/* ═══════════════════════════════════════
   WhatsApp Bot Dashboard — Design System
   ═══════════════════════════════════════ */

:root {
  /* WhatsApp-inspired palette */
  --wa-green: #25D366;
  --wa-green-dark: #128C7E;
  --wa-teal: #075E54;
  --wa-light-green: #DCF8C6;

  /* Dark theme */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(31, 41, 55, 0.8);
  --bg-sidebar: rgba(11, 15, 25, 0.95);
  --bg-input: rgba(31, 41, 55, 0.6);
  --bg-modal: rgba(0, 0, 0, 0.7);

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --border: rgba(55, 65, 81, 0.5);
  --border-focus: var(--wa-green);

  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
}

/* ─── Light Theme ─── */

body.light-theme {
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(245, 247, 250, 1);
  --bg-sidebar: rgba(255, 255, 255, 0.98);
  --bg-input: rgba(245, 247, 250, 0.8);
  --bg-modal: rgba(0, 0, 0, 0.5);

  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;

  --border: rgba(209, 213, 219, 0.7);
  --border-focus: var(--wa-green);

  --glass: rgba(0, 0, 0, 0.03);
  --glass-border: rgba(0, 0, 0, 0.08);

  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
}

body.light-theme::before {
  background:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(37, 211, 102, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 60% 60% at 80% 20%, rgba(18, 140, 126, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 80% at 50% 80%, rgba(7, 94, 84, 0.05) 0%, transparent 70%);
}

/* ─── Reset & Base ─── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
}

/* Subtle animated gradient background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(37, 211, 102, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 60% 60% at 80% 20%, rgba(18, 140, 126, 0.05) 0%, transparent 70%),
    radial-gradient(ellipse 50% 80% at 50% 80%, rgba(7, 94, 84, 0.04) 0%, transparent 70%);
  z-index: -1;
  animation: bgShift 20s ease-in-out infinite alternate;
}

@keyframes bgShift {
  0% {
    opacity: 0.8;
  }

  100% {
    opacity: 1;
  }
}

/* ─── Layout ─── */

.app {
  display: flex;
  height: 100vh;
}

/* ─── Sidebar ─── */

.sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 28px;
  filter: drop-shadow(0 2px 8px rgba(37, 211, 102, 0.3));
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--wa-green), var(--wa-teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.15), rgba(18, 140, 126, 0.1));
  color: var(--wa-green);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  border-radius: 0 3px 3px 0;
  background: var(--wa-green);
}

.nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition);
}

/* Status States */
.status-dot.status-offline {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.status-dot.status-disconnected {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.status-dot.status-connected {
  background: var(--wa-green);
  box-shadow: 0 0 8px rgba(37, 211, 102, 0.5);
}

.status-dot.status-active {
  background: var(--wa-green);
  box-shadow: 0 0 8px rgba(37, 211, 102, 0.5);
  animation: pulse-slow 2s ease-in-out infinite;
}

.status-dot.status-running {
  background: var(--wa-green);
  box-shadow: 0 0 12px rgba(37, 211, 102, 0.8);
  animation: pulse-fast 0.8s ease-in-out infinite;
}

/* Pulse Animations */
@keyframes pulse-slow {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

@keyframes pulse-fast {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 12px rgba(37, 211, 102, 0.8);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.15);
    box-shadow: 0 0 16px rgba(37, 211, 102, 1);
  }
}

.designer-credit {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.designer-credit a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 700;
  transition: var(--transition);
  position: relative;
  letter-spacing: 0.5px;
}

.designer-credit a .tech-blue {
  color: #3b82f6;
  font-weight: 700;
}

.designer-credit a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--text-primary), #3b82f6);
  transition: var(--transition);
}

.designer-credit a:hover {
  text-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.designer-credit a:hover .tech-blue {
  color: #60a5fa;
}

.designer-credit a:hover::after {
  width: 100%;
}

/* ─── Main Content ─── */

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

/* ─── Pages ─── */

.page {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Dashboard ─── */

.dashboard-date-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-date-filter .select-input {
  min-width: 150px;
  cursor: pointer;
}

/* Toggle Switch */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--text-secondary);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--wa-green);
  border-color: var(--wa-green);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: white;
}

.toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Dashboard Mid Row - AI Analytics & Sessions */
.dashboard-mid-row {
  display: grid;
  grid-template-columns: 500px 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

@media (max-width: 1200px) {
  .dashboard-mid-row {
    grid-template-columns: 1fr;
  }
}

.analytics-cards-left,
.analytics-cards-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ai-analytics-compact,
.quick-reply-analytics-compact,
.sessions-compact,
.campaigns-compact {
  min-height: auto;
}

.sessions-compact .chart-header h3,
.campaigns-compact .chart-header h3 {
  cursor: default;
}

.ai-stats-compact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}

.ai-stat-item {
  text-align: center;
  padding: 16px 12px;
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.05), rgba(18, 140, 126, 0.03));
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  transition: var(--transition);
}

.ai-stat-item:hover {
  border-color: var(--wa-green);
  transform: translateY(-2px);
}

.ai-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--wa-green);
  margin-bottom: 6px;
}

.ai-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 22px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.1), rgba(18, 140, 126, 0.08));
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.stat-content {
  flex: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 2px;
  font-weight: 500;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-change {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.positive {
  color: var(--wa-green);
}

.stat-change.positive::before {
  content: '↗';
  font-size: 14px;
}

.stat-change.negative {
  color: #ef4444;
}

.stat-change.negative::before {
  content: '↘';
  font-size: 14px;
}

.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
}

.chart-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.chart-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.chart-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.success {
  background: var(--wa-green);
}

.legend-dot.danger {
  background: #ef4444;
}

.chart-container {
  position: relative;
  height: 250px;
}

.dashboard-bottom {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.top-campaigns-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding: 12px;
}

.campaigns-compact .top-campaigns-list {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.campaign-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  background: rgba(37, 211, 102, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: var(--transition);
  text-align: center;
  cursor: pointer;
}

.campaigns-compact .campaign-item {
  padding: 12px 8px;
  border-radius: var(--radius-sm);
}

.campaign-item:hover {
  background: rgba(37, 211, 102, 0.1);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.campaign-info {
  width: 100%;
}

.campaign-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.campaign-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.campaign-stats {
  text-align: center;
}

.campaign-count {
  font-size: 24px;
  font-weight: 700;
  color: var(--wa-green);
  margin-bottom: 2px;
}

.campaign-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sessions-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  padding: 12px;
}

.session-summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 12px 8px;
  background: rgba(37, 211, 102, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
}

.session-summary-item:hover {
  background: rgba(37, 211, 102, 0.1);
  border-color: var(--wa-green);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.session-summary-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.2), rgba(18, 140, 126, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.session-summary-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.session-summary-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-summary-phone {
  font-size: 10px;
  color: var(--text-secondary);
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

.session-summary-status {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.session-summary-status.connected {
  color: var(--wa-green);
}

.empty-dashboard {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-dashboard-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-dashboard p {
  margin-bottom: 20px;
  font-size: 16px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ─── Buttons ─── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--wa-green), var(--wa-green-dark));
  color: white;
  box-shadow: 0 2px 12px rgba(37, 211, 102, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.35);
}

.btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  box-shadow: 0 2px 12px rgba(34, 197, 94, 0.25);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.35);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
  background: rgba(245, 158, 11, 0.25);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  width: 100%;
  padding: 14px 24px;
  font-size: 15px;
  justify-content: center;
  margin-top: 8px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── Cards ─── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border);
}

.card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}

/* ─── Session Cards ─── */

.sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.session-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(12px);
  transition: var(--transition);
}

.session-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.session-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.session-name {
  font-weight: 600;
  font-size: 16px;
}

.session-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.session-status.ready {
  background: rgba(37, 211, 102, 0.15);
  color: var(--wa-green);
}

.session-status.qr_pending,
.session-status.initializing {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.session-status.disconnected,
.session-status.error,
.session-status.auth_failure {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.session-phone {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 16px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.session-broken-hint {
  font-size: 12px;
  color: var(--danger);
  margin-bottom: 12px;
  padding: 6px 10px;
  background: rgba(239, 68, 68, 0.08);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--danger);
}

.session-toggles {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  margin: 12px 0;
  background: rgba(37, 211, 102, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.master-toggle {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
}

.session-toggles .toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.session-toggles .toggle-label.master {
  font-size: 13px;
  align-items: flex-start;
  display: flex;
}

.session-toggles .toggle-label.master > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 1px;
}

.session-toggles .toggle-label.master strong {
  color: var(--text-primary);
  font-weight: 600;
  display: block;
  line-height: 1.4;
}

.toggle-hint {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.3;
}

.sub-toggles {
  display: flex;
  gap: 24px;
  padding-left: 0;
  flex-wrap: wrap;
  transition: var(--transition);
}

.sub-toggles .toggle-label {
  font-size: 12px;
  white-space: nowrap;
  font-weight: 500;
}

.session-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.session-actions label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* ─── Forms ─── */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.text-input,
.select-input,
.textarea-input,
.search-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}

.text-input:focus,
.select-input:focus,
.textarea-input:focus,
.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.search-input {
  width: 260px;
  padding-left: 14px;
}

.textarea-input {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.select-input {
  cursor: pointer;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-group.half {
  flex: 1;
}

.template-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.template-hint code {
  background: rgba(37, 211, 102, 0.1);
  color: var(--wa-green);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  margin: 0 2px;
}

/* ─── Table ─── */

.table-container {
  overflow-x: auto;
}

.table-scroll {
  max-height: 400px;
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.data-table tbody td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid rgba(55, 65, 81, 0.3);
  color: var(--text-primary);
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

/* ─── Contacts ─── */

.contacts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.contacts-toolbar .select-input {
  width: 200px;
}

.contact-count {
  font-size: 13px;
  color: var(--text-muted);
}

/* ─── Messaging Layout ─── */

.messaging-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.preview-bubble {
  background: var(--bg-input);
  border-radius: var(--radius);
  padding: 20px;
  min-height: 120px;
  line-height: 1.7;
  font-size: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.preview-placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.preview-bubble .wa-message {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.1), rgba(18, 140, 126, 0.05));
  border-left: 3px solid var(--wa-green);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ─── Progress ─── */

.progress-section {
  margin-top: 24px;
}

.progress-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--wa-green), var(--wa-green-dark));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-stats {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.progress-log {
  max-height: 200px;
  overflow-y: auto;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text-muted);
  line-height: 1.8;
}

.progress-log .log-sent {
  color: var(--success);
}

.progress-log .log-failed {
  color: var(--danger);
}

/* ─── Settings ─── */

.settings-grid {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 24px;
  max-width: 1400px;
}

.settings-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-right {
  display: flex;
  flex-direction: column;
}

.settings-section-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  transition: var(--transition);
}

.settings-section-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.settings-prompt-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.settings-section-header {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.08), rgba(18, 140, 126, 0.05));
  border-bottom: 1px solid var(--glass-border);
  padding: 20px 24px;
}

.settings-section-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-section-header p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.settings-subsection {
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-border);
}

.settings-subsection:last-child {
  border-bottom: none;
}

.settings-subsection h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--glass-border);
}

.settings-prompt-card .settings-subsection {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.settings-prompt-card .form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.settings-prompt-textarea {
  flex: 1;
  min-height: 400px;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

.settings-left .btn-lg {
  margin-top: 8px;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.2);
}

.settings-left .btn-lg:hover {
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.3);
  transform: translateY(-1px);
}

/* Responsive: Stack on smaller screens */
@media (max-width: 1024px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-prompt-textarea {
    min-height: 300px;
  }
}

/* ─── Modals ─── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-modal);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-lg {
  width: 700px;
}

.modal-xl {
  width: 900px;
}

.modal-sm {
  width: 380px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  transition: var(--transition);
  padding: 0 4px;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

/* ─── QR Code ─── */

.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.qr-container img {
  border-radius: var(--radius);
  border: 4px solid white;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.qr-loading {
  text-align: center;
  color: var(--text-secondary);
}

.qr-loading p {
  margin-top: 16px;
  font-size: 14px;
}

.qr-hint {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  margin-top: 8px !important;
}

/* ─── Spinner ─── */

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--wa-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

/* ─── Toggle Switch ─── */

.toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  vertical-align: middle;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-input);
  border-radius: 11px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: var(--transition);
}

.toggle input:checked+.toggle-slider {
  background: rgba(37, 211, 102, 0.3);
  border-color: var(--wa-green);
}

.toggle input:checked+.toggle-slider::before {
  transform: translateX(18px);
  background: var(--wa-green);
}

.toggle input:disabled+.toggle-slider {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ─── Import Stats ─── */

.import-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.import-stats .stat {
  background: var(--bg-input);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.import-stats .stat strong {
  color: var(--wa-green);
}

/* ─── Empty State ─── */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 20px;
}

/* ─── Toast / Notifications ─── */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 3.7s;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

.toast.info {
  border-left: 3px solid var(--info);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

/* ─── Scrollbar ─── */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ─── Campaign Analytics ─── */

.campaign-summary {
  background: var(--bg-input);
  border-radius: var(--radius);
  padding: 20px;
}

.campaign-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.campaign-stat {
  text-align: center;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
}

.campaign-stat .stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.campaign-stat .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mini-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}

.mini-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ─── Responsive: smaller screens ─── */

@media (max-width: 768px) {
  .messaging-layout {
    grid-template-columns: 1fr;
  }

  .campaign-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .header-actions {
    flex-wrap: wrap;
  }

  .search-input {
    width: 100%;
  }

  .campaign-action-buttons {
    flex-direction: column;
  }
}

/* ─── Placeholder Tags (compact) ─── */

.placeholder-tags-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.placeholder-tag {
  background: rgba(37, 211, 102, 0.15);
  color: var(--wa-green);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid rgba(37, 211, 102, 0.25);
  font-weight: 600;
}

.placeholder-tag:hover {
  background: rgba(37, 211, 102, 0.25);
  transform: scale(1.05);
}

/* ─── Template Selector ─── */

.template-selector-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.template-selector-row .select-input {
  flex: 1;
}

/* ─── Multi-File List ─── */

.media-file-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.media-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
}

.media-file-item .media-file-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.media-file-item .media-file-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-file-item .media-file-size {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.media-add-more {
  padding: 8px 12px;
  text-align: center;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
}

/* ─── Campaign Action Buttons ─── */

.campaign-action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.btn-half {
  flex: 1;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
}

/* ─── Progress Modal ─── */

.progress-bar-container {
  width: 100%;
  height: 12px;
  background: var(--bg-input);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
  transition: width 0.3s ease;
}

.progress-stats {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-align: center;
}

.progress-log {
  max-height: 300px;
  overflow-y: auto;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.progress-log .log-sent {
  color: var(--success);
  padding: 3px 0;
}

.progress-log .log-failed {
  color: var(--danger);
  padding: 3px 0;
}

/* ─── Media Upload Area ─── */

.media-upload-area {
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.media-upload-area:hover {
  border-color: var(--accent);
}

.media-upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px;
  cursor: pointer;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  transition: background 0.15s ease;
}

.media-upload-prompt:hover {
  background: var(--bg-input);
}

.media-upload-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-input);
}

.media-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.media-file-icon {
  font-size: 24px;
}

.media-file-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-file-size {
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Campaign Buttons ─── */

.buttons-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.campaign-button-item {
  display: grid;
  grid-template-columns: 24px 1fr 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 10px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
}

.campaign-button-item .btn-number {
  font-weight: 700;
  font-size: 14px;
  color: var(--wa-green);
  padding-top: 8px;
}

.campaign-button-item .btn-label-input {
  font-size: 13px;
}

.campaign-button-item .btn-reply-input {
  font-size: 12px;
  min-height: 54px;
  resize: vertical;
}

/* ─── Skeleton Loading ─── */

.skeleton-card {
  pointer-events: none;
}

.skeleton-text {
  display: inline-block;
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Campaign Analytics Detail ─── */

.campaign-meta {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}

.campaign-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 13px;
}

.meta-label {
  color: var(--text-muted);
  font-weight: 500;
}

.meta-value {
  color: var(--text-primary);
  font-weight: 500;
}

.analytics-section {
  margin-top: 20px;
}

.analytics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.analytics-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.analytics-header .analytics-title {
  margin-bottom: 0;
}

/* Filter tabs */

.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.filter-tab {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition);
}

.filter-tab:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.filter-tab.active {
  background: var(--wa-green);
  color: white;
}

/* Error breakdown */

.error-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.error-breakdown-item {
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 12px;
  border-left: 3px solid var(--danger);
}

.error-breakdown-bar {
  height: 4px;
  background: rgba(239, 68, 68, 0.15);
  border-radius: 2px;
  margin-bottom: 8px;
  overflow: hidden;
}

.error-breakdown-fill {
  height: 100%;
  background: var(--danger);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.error-breakdown-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.error-breakdown-msg {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-word;
}

.error-breakdown-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
  white-space: nowrap;
}

/* Message status badge */

.msg-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.msg-status-badge.sent {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.msg-status-badge.failed {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* Message content preview */

.msg-content-cell {
  max-width: 200px;
}

.msg-content-preview {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: help;
}

.msg-error-cell {
  max-width: 180px;
}

.msg-error-text {
  font-size: 11px;
  color: var(--danger);
  line-height: 1.3;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: help;
}

/* ─── Help Accordion ─── */

.help-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.help-item {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.help-item:hover {
  border-color: var(--border);
}

.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.help-header:hover {
  background: var(--bg-card-hover);
}

.help-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.help-toggle {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.help-item.open .help-toggle {
  transform: rotate(180deg);
}

.help-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.help-content > * {
  padding: 0 20px 20px;
}

.help-content h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  margin-top: 12px;
}

.help-content h4:first-child {
  margin-top: 0;
}

.help-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}

.help-content ul,
.help-content ol {
  font-size: 14px;
}

.help-content code {
  background: rgba(37, 211, 102, 0.1);
  color: var(--wa-green);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* ─── Mobile Responsiveness ─── */

.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  z-index: 1001; /* Above sidebar */
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hamburger-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger-btn:active {
  background: var(--bg-card-hover);
}

@media (max-width: 768px) {
  .app {
    flex-direction: column;
  }
  
  .mobile-header {
    display: flex;
  }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 60px; /* Below mobile header */
    height: calc(100vh - 60px);
    width: 280px;
    z-index: 1000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }

  .sidebar.open {
    left: 0;
  }

  /* Hide the duplicate logo inside the mobile sidebar since it's in the mobile header */
  .sidebar-header {
    display: none;
  }

  .main-content {
    margin-top: 60px;
    height: calc(100vh - 60px);
    padding: 16px;
  }

  /* Collapse Grids */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Fix data tables by letting them scroll horizontally */
  .data-table-wrapper, .card {
    overflow-x: auto;
  }
  
  table.data-table {
    min-width: 600px; /* Force minimum width to prevent columns from crushing */
  }

  /* Adjust modals to take up full screen */
  .modal-content {
    width: 95%;
    max-width: 100%;
    margin: 10px;
    max-height: 90vh;
  }

  /* Make header typography slightly smaller */
  .page-header h1 {
    font-size: 24px;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .page-header-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }

  /* Fix absolute positioning of some buttons */
  .btn {
    padding: 10px 16px;
  }
}