/* Workbench App Styles - V16 Inspired */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f9fa;
  color: #171717;
  font-size: 13px;
  line-height: 1.5;
}

iframe {
  all: initial;
  width: 100%;
  height: 100%;
  border: none;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.35);
  z-index: 998;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.overlay.active {
  display: block;
  opacity: 1;
}

/* Iframe container */
.iframe-container {
  width: 100%;
  height: 100%;
  position: relative;
  background: #ffffff;
}

.iframe-container iframe {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 48px);
  border: none;
}

/* Loading states */
.loading-state {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  z-index: 1;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid #e5e5e5;
  border-top-color: #171717;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  margin-top: 10px;
  color: #737373;
  font-size: 13px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Dashboard cards */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.dashboard-card {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.dashboard-card:hover {
  border-color: #d4d4d4;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #f5f5f5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #525252;
  flex-shrink: 0;
}

.card-icon svg {
  fill: currentColor;
}

.card-content {
  flex-grow: 1;
}

.card-content h3 {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 500;
  color: #737373;
}

.card-content p {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #171717;
}

/* Dashboard actions */
.dashboard-actions {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.dashboard-actions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.dashboard-actions-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #171717;
}

.config-actions-btn {
  background: none;
  border: none;
  color: #737373;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.config-actions-btn:hover {
  background: #f5f5f5;
  color: #171717;
}

.config-actions-btn svg {
  fill: currentColor;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.action-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  text-decoration: none;
  color: #525252;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}

.action-button:hover {
  background: #fafafa;
  border-color: #d4d4d4;
}

/* Dashboard sections */
.dashboard-section {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.dashboard-section h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #171717;
}

/* Activity list */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #fafafa;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.activity-item:hover {
  background: #f5f5f5;
}

.activity-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e5e5e5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #525252;
  flex-shrink: 0;
}

.activity-icon svg {
  fill: currentColor;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-content p {
  margin: 0;
  font-size: 13px;
  color: #171717;
}

.activity-time {
  font-size: 11px;
  color: #a3a3a3;
}

/* Status grid */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fafafa;
  border-radius: 6px;
}

.status-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #dcfce7;
  color: #166534;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.status-icon svg {
  fill: currentColor;
}

.status-content h4 {
  margin: 0 0 1px;
  font-size: 12px;
  font-weight: 500;
  color: #171717;
}

.status-content p {
  margin: 0;
  font-size: 11px;
  color: #737373;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: #ffffff;
  border-radius: 10px;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e5e5;
}

.modal-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #171717;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #737373;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.modal-close:hover {
  background: #f5f5f5;
  color: #171717;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
}

.action-config-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-config-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  font-size: 13px;
  color: #171717;
  background: #ffffff;
}

.action-input:focus {
  outline: none;
  border-color: #a3a3a3;
}

.icon-input {
  max-width: 120px;
}

.remove-action-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.remove-action-btn:hover {
  background: #fef2f2;
}

.add-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 12px;
  background: #f5f5f5;
  border: 1px dashed #d4d4d4;
  border-radius: 6px;
  color: #525252;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.add-action-btn:hover {
  background: #fafafa;
  border-color: #a3a3a3;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e5e5e5;
}

.btn-secondary {
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  color: #525252;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover {
  background: #f5f5f5;
}

.btn-primary {
  padding: 8px 14px;
  background: #171717;
  border: 1px solid #171717;
  border-radius: 6px;
  color: #ffffff;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: #404040;
}

/* Responsive */
@media (max-width: 768px) {
  .dashboard-container {
    padding: 12px;
  }
  .dashboard-cards {
    grid-template-columns: 1fr 1fr;
  }
  .action-buttons {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .dashboard-cards {
    grid-template-columns: 1fr;
  }
}
