/* ============================================================
 * Forex AI Trading Dashboard — Global Stylesheet
 * ============================================================
 * Dark theme · Gradients · Glassmorphism · Modern card layout
 * Mobile-first responsive design
 * ============================================================ */

/* ─── CSS Variables ─── */
:root {
  /* Primary colors */
  --primary:        #3b82f6;
  --primary-dark:   #2563eb;
  --primary-light:  #60a5fa;
  --accent:         #8b5cf6;
  --accent-dark:    #7c3aed;

  /* Semantic colors */
  --success:        #22c55e;
  --success-dark:   #16a34a;
  --danger:         #ef4444;
  --danger-dark:    #dc2626;
  --warning:        #f59e0b;
  --warning-dark:   #d97706;
  --info:           #06b6d4;

  /* Background */
  --bg-base:        #0f172a;
  --bg-surface:     #1e293b;
  --bg-card:        #1e293b;
  --bg-card-hover:  #263548;
  --bg-input:       #0f172a;
  --bg-overlay:     rgba(0, 0, 0, 0.6);

  /* Text */
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-white:     #ffffff;

  /* Border */
  --border:         #334155;
  --border-focus:   #3b82f6;

  /* Shadow */
  --shadow-sm:    0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md:    0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg:    0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow:  0 0 20px rgba(59, 130, 246, 0.15);

  /* Gradient */
  --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --gradient-success: linear-gradient(135deg, #22c55e, #06b6d4);
  --gradient-danger:  linear-gradient(135deg, #ef4444, #f97316);
  --gradient-card:    linear-gradient(145deg, #1e293b 0%, #0f172a 100%);

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transition */
  --transition: all 0.25s ease;
}

/* ─── Global Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
               'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary); }

img { max-width: 100%; display: block; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }


/* ============================================================
 * Layout Container
 * ============================================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


/* ============================================================
 * Login / Register Page
 * ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}

/* Dynamic Background Particles */
.auth-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(59,130,246,0.12) 0%, transparent 70%);
  top: -200px; right: -200px;
  border-radius: 50%;
  animation: float-glow 8s ease-in-out infinite;
}
.auth-page::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, transparent 70%);
  bottom: -150px; left: -150px;
  border-radius: 50%;
  animation: float-glow 10s ease-in-out infinite reverse;
}

@keyframes float-glow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(30px, -30px) scale(1.05); }
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo h1 {
  font-size: 1.75rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}
.auth-logo p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Form Toggle Tabs */
.auth-tabs {
  display: flex;
  border-radius: var(--radius-md);
  background: var(--bg-base);
  padding: 4px;
  margin-bottom: 28px;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  cursor: pointer;
  font-weight: 500;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: var(--transition);
  border: none;
  background: none;
  font-size: 0.95rem;
}
.auth-tab.active {
  background: var(--primary);
  color: var(--text-white);
  box-shadow: var(--shadow-sm);
}

/* Form */
.auth-form { display: none; }
.auth-form.active { display: block; }

.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.form-group .input-wrapper {
  position: relative;
}
.form-group .input-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
}
.form-group input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}
.form-group input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.form-group input.error {
  border-color: var(--danger);
}
.form-group .field-error {
  display: block;
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 4px;
  min-height: 18px;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  font-size: 0.85rem;
}
.form-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  cursor: pointer;
}
.form-options input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px; height: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-white);
  box-shadow: 0 4px 14px rgba(59,130,246,0.3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59,130,246,0.4);
}

.btn-success {
  background: var(--gradient-success);
  color: var(--text-white);
}

.btn-danger {
  background: var(--gradient-danger);
  color: var(--text-white);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-block { width: 100%; }
.btn-sm    { padding: 7px 14px; font-size: 0.85rem; }
.btn-lg    { padding: 14px 32px; font-size: 1.05rem; }

/* Loading Spinner */
.btn .spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: none;
}
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-text { opacity: 0.7; }

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


/* ============================================================
 * Top Navigation Bar
 * ============================================================ */
.navbar {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}
.navbar-brand span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: none;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary-light);
  background: rgba(59,130,246,0.1);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ws-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.ws-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  transition: var(--transition);
}
.ws-dot.connected { background: var(--success); box-shadow: 0 0 6px var(--success); }

.user-menu {
  position: relative;
}
.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.85rem;
}
.user-btn:hover { border-color: var(--primary); }
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
  z-index: 200;
}
.user-dropdown.show { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.dropdown-item:hover { background: rgba(59,130,246,0.1); color: var(--primary-light); }
.dropdown-divider { border-top: 1px solid var(--border); margin: 4px 0; }

/* Mobile Hamburger Menu */
.navbar-toggle {
  display: none;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
}


/* ============================================================
 * Dashboard Content Area
 * ============================================================ */
.dashboard-content {
  flex: 1;
  padding: 24px;
}

/* Page Sections (for SPA page switching) */
.page-section {
  display: none;
  animation: fadeIn 0.3s ease;
}
.page-section.active { display: block; }

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

/* Section Title */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-title {
  font-size: 1.35rem;
  font-weight: 700;
}
.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}


/* ============================================================
 * Statistics Card Grid
 * ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card:hover {
  border-color: rgba(59,130,246,0.3);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.stat-card.success::before { background: var(--gradient-success); }
.stat-card.danger::before  { background: var(--gradient-danger); }
.stat-card.warning::before { background: linear-gradient(135deg, #f59e0b, #f97316); }

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.stat-card-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-card-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: rgba(59,130,246,0.1);
  color: var(--primary-light);
}
.stat-card.success .stat-card-icon { background: rgba(34,197,94,0.1); color: var(--success); }
.stat-card.danger  .stat-card-icon { background: rgba(239,68,68,0.1); color: var(--danger); }
.stat-card.warning .stat-card-icon { background: rgba(245,158,11,0.1); color: var(--warning); }

.stat-card-value {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.stat-card-change {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.stat-card-change .positive { color: var(--success); }
.stat-card-change .negative { color: var(--danger); }


/* ============================================================
 * Card / Panel
 * ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
}
.card-body {
  padding: 20px;
}
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: rgba(15,23,42,0.5);
}


/* ============================================================
 * Chart Area
 * ============================================================ */
.chart-container {
  position: relative;
  height: 320px;
  width: 100%;
}
.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}


/* ============================================================
 * Two-Column Layout
 * ============================================================ */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}


/* ============================================================
 * Table
 * ============================================================ */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}
table th, table td {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(15,23,42,0.5);
}
table tr:hover td {
  background: rgba(59,130,246,0.04);
}

.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted   { color: var(--text-muted) !important; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-danger  { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-info    { background: rgba(6,182,212,0.15);  color: var(--info); }
.badge-primary { background: rgba(59,130,246,0.15); color: var(--primary-light); }


/* ============================================================
 * Subscription Card
 * ============================================================ */
.subscription-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.subscription-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(59,130,246,0.08);
}
.sub-plan-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.sub-plan-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
}
.sub-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(51,65,85,0.5);
  font-size: 0.9rem;
}
.sub-detail-row:last-child { border-bottom: none; }
.sub-detail-label { color: var(--text-muted); }
.sub-detail-value { font-weight: 600; }


/* ============================================================
 * Settings Form
 * ============================================================ */
.settings-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.settings-form .form-group {
  margin-bottom: 0;
}
.settings-form .form-group input,
.settings-form .form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}
.settings-form .form-group input:focus,
.settings-form .form-group select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.settings-form .form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
  padding-right: 36px;
}
.settings-form select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* Toggle Switch */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(51,65,85,0.4);
}
.switch-row:last-child { border-bottom: none; }
.switch-label {
  font-size: 0.92rem;
}
.switch-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.toggle-switch {
  position: relative;
  width: 48px; height: 26px;
}
.toggle-switch input { display: none; }
.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border);
  border-radius: 26px;
  cursor: pointer;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}


/* ============================================================
 * Activation Code Input
 * ============================================================ */
.activation-input {
  display: flex;
  gap: 10px;
}
.activation-input input {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
  outline: none;
  transition: var(--transition);
}
.activation-input input:focus {
  border-color: var(--border-focus);
}


/* ============================================================
 * Toast Notification
 * ============================================================ */
.toast-container {
  position: fixed;
  top: 76px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  min-width: 300px;
  max-width: 420px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideIn 0.3s ease;
  position: relative;
}
.toast.removing { animation: slideOut 0.3s ease forwards; }

.toast-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }
.toast-message { font-size: 0.82rem; color: var(--text-secondary); }
.toast-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1.1rem; padding: 0; line-height: 1;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.success .toast-icon { color: var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info { border-left: 3px solid var(--info); }
.toast.info .toast-icon { color: var(--info); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}


/* ============================================================
 * Modal
 * ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 95%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1.05rem; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; }
.modal-body { padding: 24px; }
.modal-footer { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }


/* ============================================================
 * Empty State
 * ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 14px;
  opacity: 0.4;
}
.empty-state-text {
  font-size: 0.95rem;
  margin-bottom: 6px;
}


/* ============================================================
 * Loading Skeleton
 * ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text { height: 16px; margin-bottom: 10px; }
.skeleton-title { height: 24px; width: 60%; margin-bottom: 14px; }
.skeleton-card { height: 120px; }


/* ============================================================
 * Responsive Design
 * ============================================================ */

/* Tablet ≤ 768px */
@media (max-width: 768px) {
  .navbar-nav { display: none; }
  .navbar-toggle { display: block; }

  .navbar-nav.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px; left: 0; right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 12px;
    box-shadow: var(--shadow-lg);
  }

  .dashboard-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid-2 { grid-template-columns: 1fr; }
  .settings-form .form-row { grid-template-columns: 1fr; }

  .auth-card { margin: 16px; padding: 28px 20px; }

  .chart-container { height: 240px; }

  .stat-card { padding: 14px; }
  .stat-card-value { font-size: 1.3rem; }
}

/* Mobile ≤ 480px */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .activation-input { flex-direction: column; }
  .section-header { flex-direction: column; align-items: flex-start; }

  table th, table td { padding: 8px 10px; font-size: 0.82rem; }
  .toast { min-width: auto; max-width: calc(100vw - 40px); }
}


/* ============================================================
 * Utilities
 * ============================================================ */
.hidden  { display: none !important; }
.flex    { display: flex; }
.gap-10  { gap: 10px; }
.gap-16  { gap: 16px; }
.mt-10   { margin-top: 10px; }
.mt-20   { margin-top: 20px; }
.mb-10   { margin-bottom: 10px; }
.mb-20   { margin-bottom: 20px; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.font-mono   { font-family: 'SF Mono', 'Fira Code', monospace; }
