/* ==============================================================================
   IRYAX ENTERPRISE SOCIAL AUTOMATION HUB - DESIGN SYSTEM
   Ultra-modern, polished B2B SaaS interface inspired by Stripe, Linear, and Vercel.
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Slate & Enterprise Neutral Tokens */
  --bg-app: #f8fafc;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-sidebar-active: #334155;
  --bg-card: #ffffff;
  --bg-surface: #f8fafc;
  --bg-surface-elevated: #ffffff;
  --bg-hover: #f1f5f9;
  
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --border-dark: #cbd5e1;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  /* Brand Gradients & Accents */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-border: #c7d2fe;
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  --brand-gradient: linear-gradient(135deg, #0ea5e9 0%, #6366f1 50%, #a855f7 100%);
  
  /* Social Media Platform Colors */
  --instagram-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  --instagram-bg: #fdf2f8;
  --instagram-text: #be185d;
  --instagram-border: #fbcfe8;
  
  --facebook-color: #1877f2;
  --facebook-bg: #eff6ff;
  --facebook-border: #bfdbfe;
  
  --whatsapp-color: #128c7e;
  --whatsapp-bg: #f0fdf4;
  --whatsapp-border: #bbf7d0;
  --whatsapp-text: #166534;
  
  /* Semantic Status Colors */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;
  
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;
  
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;
  
  --info: #0284c7;
  --info-bg: #f0f9ff;
  --info-border: #bae6fd;
  --info-text: #0369a1;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* App Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ==============================================================================
   Sidebar Navigation (Enterprise Dark Slate)
   ============================================================================== */
.sidebar {
  width: 270px;
  background-color: var(--bg-sidebar);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 24px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 20px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  flex-shrink: 0;
}

.brand-icon svg {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
}

.brand-title {
  font-size: 15.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-badge {
  display: inline-block;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748b;
  padding: 12px 14px 4px 14px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  position: relative;
}

.nav-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.nav-btn:hover {
  background-color: var(--bg-sidebar-hover);
  color: #f8fafc;
  transform: translateX(2px);
}

.nav-btn:hover svg {
  transform: scale(1.08);
}

.nav-btn.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.3) 0%, rgba(59, 130, 246, 0.2) 100%);
  color: #ffffff;
  font-weight: 700;
  border-left: 3px solid #6366f1;
}

.nav-btn.active svg {
  color: #818cf8;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.system-status-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: #cbd5e1;
  font-weight: 600;
}

.status-beacon {
  width: 9px;
  height: 9px;
  background-color: #10b981;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: pulse-beacon 2s infinite;
}

@keyframes pulse-beacon {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==============================================================================
   Main Content Layout
   ============================================================================== */
.main-content {
  flex: 1;
  padding: 30px 40px;
  overflow-y: auto;
  max-width: 100%;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  gap: 16px;
}

.top-bar-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.6px;
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ==============================================================================
   Button Components
   ============================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  font-family: inherit;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca 0%, #2563eb 100%);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #ffffff;
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-dark);
  box-shadow: var(--shadow-md);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

.btn-outline-primary {
  background-color: #ffffff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  font-weight: 600;
}

.btn-outline-primary:hover {
  background-color: #eef2ff;
  border-color: #818cf8;
  color: #3730a3;
}

.btn-outline-danger {
  background-color: #ffffff;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-weight: 600;
}

.btn-outline-danger:hover {
  background-color: #fef2f2;
  border-color: #f87171;
  color: #991b1b;
}

.btn-block {
  width: 100%;
}

/* ==============================================================================
   Metric Cards Overview
   ============================================================================== */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.metric-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.metric-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-box:hover::before {
  opacity: 1;
}

.metric-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.metric-header {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.metric-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  color: var(--primary);
}

.metric-val {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 6px;
  font-feature-settings: "tnum";
}

.metric-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==============================================================================
   Cards & Toolbar
   ============================================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
}

.card-toolbar {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background-color: #ffffff;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 280px;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--text-primary);
  font-family: inherit;
  transition: all 0.15s ease;
}

.search-input:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.client-count-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==============================================================================
   Data Table Styling (Clean & High Contrast)
   ============================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 13.5px;
}

.data-table th {
  padding: 12px 14px;
  background-color: #f8fafc;
  color: #475569;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: middle;
  background-color: #ffffff;
  transition: background-color 0.12s ease;
}

.data-table tbody tr:hover td {
  background-color: #f8fafc;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Table Specific Cell Components */
.company-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.company-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #3730a3;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #c7d2fe;
}

.company-name {
  font-weight: 700;
  color: #0f172a;
  font-size: 14px;
  letter-spacing: -0.2px;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}

.social-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.social-badge-instagram {
  background-color: var(--instagram-bg);
  color: var(--instagram-text);
  border: 1px solid var(--instagram-border);
}

.social-badge-instagram:hover {
  background-color: #fce7f3;
  color: #9d174d;
}

.social-badge-facebook {
  background-color: var(--facebook-bg);
  color: var(--facebook-color);
  border: 1px solid var(--facebook-border);
}

.social-badge-facebook:hover {
  background-color: #dbeafe;
}

.phone-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  background-color: var(--whatsapp-bg);
  border: 1px solid var(--whatsapp-border);
  color: var(--whatsapp-text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.phone-badge:hover {
  background-color: #dcfce7;
  border-color: #86efac;
}

.phone-badge svg {
  width: 14px;
  height: 14px;
  color: var(--whatsapp-color);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}
.badge-success .badge-dot { background-color: var(--success); }

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
}
.badge-warning .badge-dot { background-color: var(--warning); }

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}
.badge-danger .badge-dot { background-color: var(--danger); }

.badge-info {
  background: var(--info-bg);
  color: var(--info-text);
  border: 1px solid var(--info-border);
}
.badge-info .badge-dot { background-color: var(--info); }

.badge-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.actions-cell {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
}

.actions-cell .btn {
  white-space: nowrap;
}

.clients-directory-table td {
  padding: 14px;
  vertical-align: middle;
}

.company-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.company-phone-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 2px 6px;
}

.template-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.template-chip-custom {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.channels-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.recipients-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recipient-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.recipient-title-chip {
  font-weight: 700;
  font-size: 10.5px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  border-radius: 4px;
  padding: 2px 6px;
  min-width: 30px;
  text-align: center;
}

.recipient-name-text {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13px;
  min-width: 115px;
}

.phone-badge-compact {
  padding: 3px 10px;
  font-size: 12px;
}

.client-row-inactive td {
  opacity: 0.78;
}

.client-row-inactive:hover td {
  opacity: 1;
}

/* ==============================================================================
   Forms & Inputs
   ============================================================================== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 7px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
  display: block;
}

/* Tab Management */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==============================================================================
   Modals
   ============================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: modalScale 0.2s ease-out;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-head {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  flex-shrink: 0;
}

.modal-head .card-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
}

.view-details-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 600px) {
  .view-details-row {
    grid-template-columns: 1fr;
  }
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  border-radius: var(--radius-sm);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.modal-close:hover {
  color: var(--text-primary);
  background-color: #e2e8f0;
}

/* ==============================================================================
   Toast Notifications System
   ============================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  pointer-events: auto;
  animation: toastSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 300px;
  max-width: 440px;
}

@keyframes toastSlide {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.toast-success {
  border-left: 4px solid var(--success);
}

.toast.toast-danger {
  border-left: 4px solid var(--danger);
}

.toast.toast-info {
  border-left: 4px solid var(--primary);
}

/* Trust Banner */
.trust-banner {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: #166534;
}

/* Responsive */
@media (max-width: 1024px) {
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; box-shadow: none; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
  .main-content { padding: 24px 20px; }
}

@media (max-width: 640px) {
  .metrics-row { grid-template-columns: 1fr; }
  .top-bar { flex-direction: column; align-items: stretch; }
  .card-toolbar { flex-direction: column; align-items: stretch; }
}

/* Accessibility and compact screens */
:focus-visible { outline: 3px solid #6366f1; outline-offset: 3px; }
.metric-box { border-top: 3px solid #e0e7ff; }
.page-title { letter-spacing: -0.035em; }
.system-status-box { line-height: 1.6; }
@media (max-width: 640px) {
  .main-content { padding: 20px 12px; min-width: 0; }
  .sidebar { position: relative; height: auto; min-height: auto; }
  .nav-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .nav-section-title { grid-column: 1 / -1; }
  .toast { min-width: 0; max-width: calc(100vw - 32px); }
  .toast-container { right: 16px; bottom: 16px; }
  .modal-content { max-height: 90dvh; overflow-y: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.operations-form { display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:20px; }
.operations-form label { display:flex;flex-direction:column;gap:8px;font-size:13px;font-weight:600; }
.operation-feedback { margin:16px 0;line-height:1.7;overflow-wrap:anywhere; }
.operations-form label:has(input[type="checkbox"]) { flex-direction:row;align-items:center; }
.operations-form input[type="checkbox"] { width:16px;height:16px;flex:0 0 16px; }
#queue-body td { padding:14px 12px;border-top:1px solid var(--border-color);font-size:13px;overflow-wrap:anywhere; }
#tab-operations table { border-collapse:collapse;min-width:720px;table-layout:fixed; }
#tab-operations th { padding:12px;text-align:left;font-size:12px;color:var(--text-muted); }
@media(max-width:640px){.operations-form{grid-template-columns:1fr;}}
