:root {
  /* =========================================
     LIGHT THEME (DEFAULT)
     ========================================= */
  --bg-app: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  
  /* Primary & Accents */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --secondary: #0ea5e9;
  --accent: #10b981;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  
  --gradient-main: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
  
  /* Text */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-darker: #94a3b8;
  --text-inverse: #ffffff;
  
  /* Borders */
  --border: #e2e8f0;
  --border-sidebar: #e2e8f0;
  --border-input: #cbd5e1;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  
  /* Radii */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  /* Inputs */
  --input-bg: #ffffff;
  --input-bg-focus: #f8fafc;
  
  /* Nav */
  --nav-hover-bg: #f1f5f9;
  --nav-active-bg: rgba(79, 70, 229, 0.1);
  --nav-active-text: #4f46e5;
  
  /* Table */
  --table-header-bg: #f1f5f9;
  --table-row-hover: #f8fafc;
  
  /* Orbs */
  --orb-opacity: 0.15;
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  /* =========================================
     DARK THEME (GLASSMORPHISM)
     ========================================= */
  --bg-app: #05050a;
  --bg-sidebar: rgba(10, 10, 15, 0.4);
  --bg-card: rgba(255, 255, 255, 0.02);
  
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --secondary: #06b6d4;
  --gradient-main: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-darker: #64748b;
  --text-inverse: #ffffff;
  
  --border: rgba(255, 255, 255, 0.08);
  --border-sidebar: rgba(255, 255, 255, 0.08);
  --border-input: rgba(255, 255, 255, 0.15);
  
  --shadow-sm: 0 4px 20px rgba(0,0,0,0.2);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  
  --input-bg: rgba(0, 0, 0, 0.2);
  --input-bg-focus: rgba(0, 0, 0, 0.4);
  
  --nav-hover-bg: rgba(25, 25, 35, 0.5);
  --nav-active-bg: rgba(139, 92, 246, 0.1);
  --nav-active-text: #ffffff;
  
  --table-header-bg: rgba(0,0,0,0.4);
  --table-row-hover: rgba(255,255,255,0.03);
  
  --orb-opacity: 0.5;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Tajawal', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  transition: background-color 0.3s, color 0.3s;
}

/* --- Ambient Glowing Orbs --- */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  opacity: var(--orb-opacity);
  animation: float 20s infinite ease-in-out alternate;
  pointer-events: none;
  transition: opacity 0.5s;
}

.glow-1 {
  width: 600px; height: 600px;
  background: rgba(139, 92, 246, 0.4);
  top: -100px; left: -100px;
}
.glow-2 {
  width: 500px; height: 500px;
  background: rgba(6, 182, 212, 0.3);
  bottom: -100px; right: -50px;
  animation-delay: -5s;
}
.glow-3 {
  width: 400px; height: 400px;
  background: rgba(236, 72, 153, 0.2);
  top: 40%; left: 40%;
  animation-delay: -10s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 50px) scale(1.1); }
}

/* --- App Layout --- */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100%;
  background: transparent;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  overflow: hidden;
}

/* --- Sidebar --- */
.app-sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-sidebar);
  flex-shrink: 0;
  z-index: 50;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s, border-color 0.3s;
  overflow: hidden;
}

.app-sidebar.sidebar-collapsed {
  width: 80px;
}

/* RTL Support for sidebar border */
html[dir="rtl"] .app-sidebar { border-right: none; border-left: 1px solid var(--border-sidebar); }

.app-brand {
  padding: 24px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: padding 0.3s;
}

.sidebar-collapsed .app-brand {
  justify-content: center;
  padding: 24px 0;
}

.brand-info {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  transition: opacity 0.3s;
  min-width: 0;
}

.sidebar-collapsed .brand-info {
  display: none;
}

.brand-logo {
  min-width: 36px;
  height: 36px;
  background: var(--gradient-main);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.brand-text {
  min-width: 0;
}

.brand-text h2 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 2px;
  letter-spacing: -0.02em;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle-btn:hover {
  background: var(--nav-hover-bg);
  color: var(--primary);
}

.badge-status {
  display: inline-block;
  font-size: 0.7rem;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  padding: 0 12px;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 12px 0;
}

.sidebar-collapsed .nav-item span:not(.nav-icon) {
  display: none;
}

.nav-icon {
  font-size: 1.2rem;
  opacity: 0.8;
  transition: var(--transition);
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  margin: 0;
}

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

.nav-item.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
  border-color: rgba(79, 70, 229, 0.2);
}
[data-theme="dark"] .nav-item.active {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: inset 0 0 20px rgba(139, 92, 246, 0.05);
}

.nav-item.active .nav-icon {
  opacity: 1;
  color: var(--nav-active-text);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 60%;
  width: 4px;
  background: var(--gradient-main);
  border-radius: 0 4px 4px 0;
}
html[dir="rtl"] .nav-item.active::before {
  left: auto;
  right: 0;
  border-radius: 4px 0 0 4px;
}

.nav-spacer { flex-grow: 1; }
.bottom-menu { margin-bottom: 24px; }

/* --- Main Area --- */
.app-main {
  flex-grow: 1;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}

/* View Sections */
.view-section {
  display: none;
  height: 100%;
  animation: fadeScale 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}
.view-section.active { display: block; }

@keyframes fadeScale {
  0% { opacity: 0; transform: scale(0.98) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* --- Home View --- */
.welcome-banner {
  padding: 80px 50px;
  max-width: 800px;
  margin: 80px auto;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  transition: all 0.3s;
}

.welcome-banner h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 20px;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}

.welcome-banner p {
  font-size: 1.2rem;
  color: var(--text-muted);
}

/* --- Dashboard Container --- */
.dashboard-container {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 32px;
  padding: 32px;
  height: 100%;
  max-width: 1800px;
  margin: 0 auto;
}

.feature-sidebar {
  overflow-y: auto;
  padding-right: 12px;
  padding-left: 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.feature-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

/* Settings View */
.settings-container {
  padding: 60px;
  max-width: 700px;
  margin: 0 auto;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}

.card h3::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--secondary);
  margin-right: 10px;
  margin-left: 10px;
}

.full-height-card {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

/* --- Forms & Inputs --- */
.help-text {
  font-size: 0.85rem;
  color: var(--text-darker);
  margin-bottom: 16px;
}

.form-group { margin-bottom: 16px; flex: 1; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

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

input[type="text"], input[type="password"], input[type="number"], input[type="email"], textarea, select {
  width: 100%;
  padding: 12px 16px;
  background: var(--input-bg);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text-main);
  transition: var(--transition);
  font-family: inherit;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  background: var(--input-bg-focus);
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

input::placeholder, textarea::placeholder { color: var(--text-darker); }

input[type="file"] {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px dashed var(--border-input);
  padding: 16px;
  text-align: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--nav-hover-bg);
  border: 1px solid var(--border);
  color: var(--text-main);
  cursor: pointer;
  margin-right: 16px;
  transition: var(--transition);
  font-weight: 500;
}

/* --- Buttons --- */
.btn {
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-block { width: 100%; }

.btn-primary {
  background: var(--gradient-main);
  color: #fff;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

/* Variables Toolbar - Premium Tags */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.toolbar button {
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-sidebar);
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 20px; /* Pill shape */
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
}

/* Removed brackets pseudo-element to save space */
.toolbar button:hover {
  transform: translateY(-2px);
  background: var(--nav-hover-bg);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

/* Custom File Upload */
.custom-file-upload {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.custom-file-upload input[type="file"] {
  display: none;
}

.btn-file {
  margin: 0;
  padding: 8px 16px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.file-name {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* --- Analytics Dashboard --- */
.analytics-dashboard {
  padding: 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.dashboard-header {
  margin-bottom: 40px;
}

.dashboard-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 10px;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dashboard-header p {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-details h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.stat-details h2 {
  font-size: 1.8rem;
  color: var(--text-main);
  font-weight: 800;
}

.charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.chart-card h3 {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 20px;
  font-weight: 700;
}

.chart-card canvas {
  width: 100% !important;
  max-height: 300px;
}

@media (max-width: 1024px) {
  .charts-row {
    grid-template-columns: 1fr;
  }
}

/* Status Colors globally */
.status-success-text { color: var(--success); font-weight: 600; }
.status-danger-text { color: var(--danger); font-weight: 600; }

/* Attachments Preview */
.attachment-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.attachment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--nav-hover-bg);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  border: 1px solid var(--border);
}

.attachment-item button {
  background: none;
  border: none;
  color: var(--text-darker);
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}

.attachment-item button:hover { color: var(--danger); transform: scale(1.2); }

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

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--nav-hover-bg);
}

/* --- Table --- */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: calc(100vh - 250px);
}

/* Campaign Stats Pills */
.stat-pill {
  background: var(--nav-hover-bg);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 4px;
}
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: #f59e0b; }

/* Delay Progress Bar */
.delay-progress-container {
  height: 4px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  margin-bottom: 12px;
  overflow: hidden;
  position: relative;
}
[data-theme="dark"] .delay-progress-container {
  background: rgba(255, 255, 255, 0.05);
}
.delay-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--primary);
}

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
html[dir="rtl"] th, html[dir="rtl"] td { text-align: right; }

th {
  background: var(--table-header-bg);
  color: var(--text-muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  backdrop-filter: blur(10px);
}

tbody tr:hover { background: var(--table-row-hover); }

.status-success { color: var(--accent); font-size: 0.85rem; font-weight: 500; margin-top: 8px;}
.status-success-text { color: var(--accent); font-weight: 600; }
.status-danger-text { color: var(--danger); font-weight: 600; }
.empty-state { color: var(--text-darker); padding: 60px !important; font-style: italic; text-align: center;}

/* --- Popup Specific --- */
.popup-body {
  width: 350px;
  height: auto;
  padding: 24px;
  background: var(--bg-app);
}

.logo {
  text-align: center;
  margin-bottom: 24px;
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.popup-body input {
  margin-bottom: 12px;
}

.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mb-2 { margin-bottom: 20px; }
/* --- Action Buttons Layout --- */
.action-btn-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.action-row {
  display: flex;
  gap: 12px;
}
.action-row .btn {
  flex: 1;
}

/* Premium Button Gradients */
.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-warning {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}
.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3) !important;
}
.btn-danger:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4) !important;
}
/* --- WA Connect Button --- */
.sidebar-global-action {
  padding: 0 16px 16px 16px;
  transition: all 0.3s ease;
}

.btn-wa-connect {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
}

.btn-wa-connect:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

.btn-wa-connect .wa-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Collapsed State Handling */
.sidebar-collapsed .sidebar-global-action {
  padding: 0 12px 16px 12px;
}

.sidebar-collapsed .btn-wa-connect {
  padding: 12px 0;
  border-radius: 12px;
}

.sidebar-collapsed .btn-wa-connect span:not(.wa-icon) {
  display: none;
}
/* --- Auth Modal --- */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-main);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.auth-overlay.hidden {
  display: none;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  text-align: center;
}

.auth-header {
  margin-bottom: 24px;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 8px;
}
/* Metric Cards */
.metric-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(0,0,0,0.04);
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.06);
}

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

.metric-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: #64748b;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.metric-value {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
}
/* Action Menu Dropdown */
.action-dropdown {
  position: absolute;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  top: 100%;
  margin-top: 8px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-dropdown:not(.hidden) {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.action-dropdown.hidden {
  display: flex; /* Override default hidden so animation works */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  pointer-events: none;
}

[dir="ltr"] .action-dropdown { right: 0; }
[dir="rtl"] .action-dropdown { left: 0; }

.action-dropdown button {
  background: transparent;
  border: none;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  width: 100%;
  transition: background 0.2s, color 0.2s;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.action-dropdown button:last-child {
  border-bottom: none;
}

[dir="rtl"] .action-dropdown button { text-align: right; }

.action-dropdown button:hover {
  background: #f8fafc;
  color: var(--primary);
}

.icon-btn {
  padding: 0;
  width: 36px;
  height: 36px;
  font-size: 1.4rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  color: #64748b;
  border: 1px solid transparent !important;
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: none !important;
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  color: var(--primary);
}
