/* ═══════════════════════════════════════════════════
   Ultimate Setups — License Management Dashboard
   Dark Theme Design System
   ═══════════════════════════════════════════════════ */

:root {
  --bg-primary: #070a12;
  --bg-card: #0f1422;
  --bg-sidebar: #090d17;
  --bg-input: #0c111d;
  --bg-hover: #161d2e;
  --bg-topbar: #0a0e18;
  --bg-nav-active: #141d33;
  --border: #1c2436;
  --border-light: #2a3650;
  --text-primary: #eef2ff;
  --text-secondary: #9aa7c2;
  --text-muted: #5f6c87;
  --accent: #5b6cff;
  --accent-hover: #7080ff;
  --accent-glow: rgba(91,108,255,0.18);
  --accent-2: #8b5cf6;
  --accent-3: #ec4899;
  --accent-grad: linear-gradient(135deg, #5b6cff 0%, #8b5cf6 52%, #ec4899 118%);
  --success: #22c55e;
  --success-bg: rgba(34,197,94,0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239,68,68,0.12);
  --warning: #f97316;
  --warning-bg: rgba(249,115,22,0.12);
  --info: #3b82f6;
  --info-bg: rgba(59,130,246,0.12);
  --purple: #a78bfa;
  --pink: #ec4899;
  --trial: #a78bfa;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 10px 30px -10px rgba(0,0,0,0.55);
  --shadow-lg: 0 24px 60px -18px rgba(0,0,0,0.65);
  --shadow-glow: 0 10px 34px -8px rgba(91,108,255,0.30);
  --ring: 0 0 0 3px rgba(91,108,255,0.22);
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --sidebar-w: 260px;
  --topbar-h: 62px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

[data-theme="light"] {
  --bg-primary: #eef1f7;
  --bg-card: #ffffff;
  --bg-sidebar: #f7f9fc;
  --bg-input: #eef1f7;
  --bg-hover: #e7ebf3;
  --bg-topbar: #ffffff;
  --bg-nav-active: #e7ecff;
  --border: #dce3ee;
  --border-light: #e7ebf3;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #4f5dff;
  --accent-hover: #3f4ce0;
  --accent-glow: rgba(79,93,255,0.10);
  --success-bg: rgba(34,197,94,0.08);
  --danger-bg: rgba(239,68,68,0.08);
  --warning-bg: rgba(249,115,22,0.08);
  --info-bg: rgba(59,130,246,0.08);
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.06);
  --shadow-md: 0 10px 30px -12px rgba(15,23,42,0.14);
  --shadow-lg: 0 24px 60px -20px rgba(15,23,42,0.18);
  --shadow-glow: 0 10px 30px -10px rgba(79,93,255,0.22);
  --ring: 0 0 0 3px rgba(79,93,255,0.16);
}

[data-theme="light"] .auth-card { background: rgba(255,255,255,0.9); box-shadow: 0 0 80px rgba(91,108,255,0.06); }
[data-theme="light"] #topbar { background: rgba(255,255,255,0.85); border-bottom-color: var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
[data-theme="light"] #sidebar { background: rgba(248,250,252,0.92); border-right-color: var(--border); }
[data-theme="light"] .sidebar-item { color: var(--text-secondary); }
[data-theme="light"] .sidebar-item:hover { background: var(--bg-hover); color: var(--text-primary); }
[data-theme="light"] .sidebar-item.active { background: var(--bg-nav-active); color: var(--accent); }
[data-theme="light"] .sidebar-search input { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border); }
[data-theme="light"] .sidebar-search svg { color: var(--text-muted); }
[data-theme="light"] .card { background: var(--bg-card); border-color: var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
[data-theme="light"] .card:hover { border-color: var(--accent); box-shadow: 0 4px 20px rgba(91,108,255,0.08); }
[data-theme="light"] .stat-card { background: var(--bg-card); border-color: var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
[data-theme="light"] .stat-card:hover { border-color: var(--accent); box-shadow: 0 8px 24px rgba(91,108,255,0.08); }
[data-theme="light"] .form-input, [data-theme="light"] .form-select { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border); }
[data-theme="light"] .form-input::placeholder, [data-theme="light"] .form-select { color: var(--text-muted); }
[data-theme="light"] .form-input:focus, [data-theme="light"] .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
[data-theme="light"] .form-label { color: var(--text-primary); }
[data-theme="light"] .world-map-box { background: #e8ecf1; }
[data-theme="light"] .map-tooltip { background: var(--bg-card); border-color: var(--border); color: var(--text-primary); box-shadow: 0 10px 30px rgba(0,0,0,0.12); }
[data-theme="light"] .map-tooltip-country { color: var(--text-primary); }
[data-theme="light"] .badge { border: 1px solid transparent; }
[data-theme="light"] .dropdown-menu { box-shadow: 0 8px 32px rgba(0,0,0,0.1); }
[data-theme="light"] .modal-overlay { background: rgba(0,0,0,0.3); }
[data-theme="light"] .modal-box { background: var(--bg-card); color: var(--text-primary); box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
[data-theme="light"] .modal-title { color: var(--text-primary); }
[data-theme="light"] .empty-state { color: var(--text-secondary); }
[data-theme="light"] .empty-state svg { stroke: var(--text-muted); background: var(--bg-hover); }
[data-theme="light"] .page-title { color: var(--text-primary); }
[data-theme="light"] .filter-bar { border-bottom-color: var(--border); }
[data-theme="light"] .tab-btn { color: var(--text-secondary); border-bottom-color: transparent; }
[data-theme="light"] .tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
[data-theme="light"] #command-palette-overlay { background: rgba(0,0,0,0.2); }
[data-theme="light"] #command-palette { background: var(--bg-card); color: var(--text-primary); box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
[data-theme="light"] #command-palette input { background: var(--bg-input); color: var(--text-primary); }
[data-theme="light"] #command-palette input::placeholder { color: var(--text-muted); }
[data-theme="light"] .cmd-item { color: var(--text-secondary); }
[data-theme="light"] .cmd-item:hover, [data-theme="light"] .cmd-item.active { background: var(--bg-hover); color: var(--text-primary); }
[data-theme="light"] .heatmap-cell { background: var(--bg-input); }
[data-theme="light"] .heatmap-cell.l1 { background: rgba(91,108,255,0.2); }
[data-theme="light"] .heatmap-cell.l2 { background: rgba(91,108,255,0.35); }
[data-theme="light"] .heatmap-cell.l3 { background: rgba(91,108,255,0.5); }
[data-theme="light"] .heatmap-cell.l4 { background: rgba(91,108,255,0.75); }
[data-theme="light"] .skeleton { background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border-light) 50%, var(--bg-hover) 75%); background-size: 200% 100%; }
[data-theme="light"] .toast { box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
[data-theme="light"] .auth-input { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border); }
[data-theme="light"] .auth-input:focus { border-color: var(--accent); }
[data-theme="light"] .auth-input::placeholder { color: var(--text-muted); }
[data-theme="light"] .auth-sub, [data-theme="light"] .auth-toggle { color: var(--text-muted); }
[data-theme="light"] .auth-error { color: var(--danger); }
[data-theme="light"] .docs-hero { background: linear-gradient(135deg, rgba(91,108,255,0.08) 0%, rgba(139,92,246,0.04) 50%, rgba(236,72,153,0.02) 100%); border-color: rgba(91,108,255,0.12); }
[data-theme="light"] .docs-hero h2 { background: linear-gradient(135deg, #1e293b, var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
[data-theme="light"] .docs-hero-badge { background: rgba(91,108,255,0.06); border-color: rgba(91,108,255,0.1); }
[data-theme="light"] .docs-feat:hover { border-color: var(--accent); }
[data-theme="light"] .docs-callout-info { border-color: rgba(59,130,246,0.25); }
[data-theme="light"] .docs-callout-warn { border-color: rgba(245,158,11,0.25); }
[data-theme="light"] .docs-callout-tip { border-color: rgba(34,197,94,0.25); }
[data-theme="light"] .topbar-logo-text { background: linear-gradient(135deg, var(--accent), #7c3aed); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
[data-theme="light"] .table-mono { color: var(--text-muted) !important; }

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body { font-family: var(--font); background: var(--bg-primary); color: var(--text-primary); line-height: 1.5; overflow-x: hidden; position: relative; font-feature-settings: 'cv02','cv03','cv04','cv11'; letter-spacing: -0.01em; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button { font-family: var(--font); cursor: pointer; border: none; outline: none; }
input, select, textarea { font-family: var(--font); outline: none; }
table { border-collapse: collapse; width: 100%; }
::selection { background: rgba(91,108,255,0.32); color: #fff; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: padding-box; border: 2px solid transparent; }

/* ═══ ANIMATED 3D BACKGROUND ═══ */
#bg-canvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
/* Ambient mesh gradient wash behind the canvas for depth */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60rem 60rem at 12% -8%, rgba(91,108,255,0.14), transparent 60%),
    radial-gradient(50rem 50rem at 100% 0%, rgba(139,92,246,0.12), transparent 55%),
    radial-gradient(46rem 46rem at 85% 100%, rgba(236,72,153,0.08), transparent 55%);
}

#app { position: relative; z-index: 1; background: transparent; }
.auth-screen { position: relative; z-index: 1; background: transparent; }

/* ═══ AUTH ═══ */
.auth-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.auth-card { position: relative; background: linear-gradient(180deg, rgba(20,26,42,0.86), rgba(13,17,29,0.86)); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 42px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.05); overflow: hidden; }
.auth-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, rgba(91,108,255,0.5), transparent 40%, transparent 60%, rgba(236,72,153,0.35)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.auth-card::after { content: ''; position: absolute; inset: -1px; background: radial-gradient(circle at 20% 0%, rgba(91,108,255,0.18), transparent 36%), radial-gradient(circle at 80% 100%, rgba(236,72,153,0.12), transparent 38%); pointer-events: none; }
.auth-card > * { position: relative; z-index: 1; }
.auth-card h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; text-align: center; letter-spacing: -0.02em; }
.auth-card .auth-sub { color: var(--text-muted); text-align: center; font-size: 13px; margin-bottom: 28px; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 28px; }
.auth-logo-icon { width: 38px; height: 38px; background: var(--accent-grad); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: var(--shadow-glow); }
.auth-logo-text { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; background: linear-gradient(135deg, #fff, #c7d2fe); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--text-secondary); margin-bottom: 7px; }
.auth-input { width: 100%; padding: 11px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 14px; transition: border-color .2s, box-shadow .2s, background .2s; }
.auth-input:focus { border-color: var(--accent); box-shadow: var(--ring); background: var(--bg-card); }
.auth-btn { width: 100%; padding: 12px; background: var(--accent-grad); color: #fff; font-size: 14px; font-weight: 600; border-radius: var(--radius-sm); transition: all .2s; box-shadow: var(--shadow-glow); position: relative; overflow: hidden; }
.auth-btn::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent); transform: translateX(-100%); transition: transform .45s ease; }
.auth-btn:hover::before { transform: translateX(100%); }
.auth-btn:hover { filter: brightness(1.08); box-shadow: 0 14px 36px -8px rgba(91,108,255,0.5); transform: translateY(-1px); }
.auth-btn:active { transform: translateY(0); }
.auth-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.auth-toggle { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.auth-toggle a { color: var(--accent); font-weight: 600; cursor: pointer; }
.auth-error { color: var(--danger); font-size: 12px; text-align: center; margin-top: 12px; display: none; }

/* ═══ TOPBAR ═══ */
#topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h); background: rgba(9,13,22,0.72); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; z-index: 100; box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset; }
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-logo { display: flex; align-items: center; gap: 11px; }
.topbar-logo-icon { width: 34px; height: 34px; background: var(--accent-grad); border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 16px; box-shadow: var(--shadow-glow); }
.topbar-logo-text { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; background: linear-gradient(135deg, #fff, #c7d2fe); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.topbar-center { display: flex; align-items: center; gap: 12px; }
.topbar-status-chip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.16); color: var(--success); font-size: 12px; font-weight: 700; box-shadow: 0 0 24px rgba(34,197,94,0.08); }
.topbar-status-chip .status-dot { box-shadow: 0 0 0 0 rgba(34,197,94,0.35); animation: statusPulse 1.8s infinite; }
@keyframes statusPulse { 0%{box-shadow:0 0 0 0 rgba(34,197,94,0.35)}70%{box-shadow:0 0 0 8px rgba(34,197,94,0)}100%{box-shadow:0 0 0 0 rgba(34,197,94,0)} }
.topbar-team { display: flex; align-items: center; gap: 6px; padding: 7px 13px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer; transition: background .2s, border-color .2s; }
.topbar-team:hover { background: var(--bg-hover); border-color: var(--border-light); }
.topbar-avatar { width: 30px; height: 30px; background: linear-gradient(135deg, var(--accent), var(--accent-3)); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; box-shadow: var(--shadow-glow), 0 0 0 4px rgba(91,108,255,0.08); }
.topbar-right { display: flex; align-items: center; gap: 6px; margin-right: 8px; }
.topbar-icon-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--text-secondary); background: transparent; transition: background .2s, color .2s, transform .15s, box-shadow .15s; font-size: 16px; }
.topbar-icon-btn:hover { background: rgba(91,108,255,0.10); color: var(--text-primary); transform: translateY(-1px); box-shadow: 0 0 0 4px rgba(91,108,255,0.06); }
.topbar-lang { display: flex; align-items: center; gap: 6px; padding: 6px 11px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: background .2s, border-color .2s; }
.topbar-lang:hover { background: var(--bg-hover); border-color: var(--border-light); color: var(--text-primary); }
.topbar-profile { display: flex; align-items: center; cursor: pointer; position: relative; order: -1; margin-right: auto; gap: 9px; }
.dropdown-menu-wide { min-width: 180px; }
.lang-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 14px; background: none; border: none; color: var(--text-secondary); font-size: 13px; cursor: pointer; text-align: left; transition: background .15s, color .15s; }
.lang-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.lang-item span { font-size: 16px; line-height: 1; }

/* ═══ SIDEBAR ═══ */
#sidebar { position: fixed; top: var(--topbar-h); left: 0; bottom: 0; width: var(--sidebar-w); background: rgba(8,11,20,0.72); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); border-right: 1px solid var(--border); padding: 20px 12px; overflow-y: auto; z-index: 90; display: flex; flex-direction: column; }

.sidebar-search { margin-bottom: 16px; position: relative; }
.sidebar-search input { width: 100%; padding: 9px 12px 9px 36px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 13px; transition: border-color .2s, box-shadow .2s; }
.sidebar-search input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.sidebar-search input::placeholder { color: var(--text-muted); }
.sidebar-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.sidebar-nav { flex: 1; }
.sidebar-item { display: flex; align-items: center; gap: 12px; padding: 9px 13px; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 13px; font-weight: 500; cursor: pointer; transition: background .18s, color .18s, transform .15s, box-shadow .18s; margin-bottom: 2px; position: relative; text-decoration: none; }
.sidebar-item:hover { background: var(--bg-hover); color: var(--text-primary); transform: translateX(2px); }
.sidebar-item.active { background: linear-gradient(135deg, rgba(91,108,255,0.18), rgba(139,92,246,0.08)); color: var(--text-primary); box-shadow: inset 0 0 0 1px rgba(91,108,255,0.22), 0 8px 24px rgba(91,108,255,0.08); }
.sidebar-item.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--accent-grad); }
.sidebar-item.active svg { color: var(--accent); }
.sidebar-item svg { width: 18px; height: 18px; flex-shrink: 0; transition: color .18s; }
.sidebar-item .item-arrow { margin-left: auto; opacity: .4; }
.sidebar-section-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-muted); padding: 20px 14px 8px; }
.sidebar-footer { padding-top: 16px; border-top: 1px solid var(--border); margin-top: 12px; }
.sidebar-plan { display: flex; align-items: center; gap: 11px; padding: 12px 13px; font-size: 12px; color: var(--text-secondary); cursor: default; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 4px; }
.sidebar-plan-badge { background: rgba(34,197,94,0.15); color: var(--success); font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .5px; }

/* ═══ MAIN ═══ */
#main-content { margin-left: var(--sidebar-w); margin-top: var(--topbar-h); padding: 34px 40px 56px; min-height: calc(100vh - var(--topbar-h)); }
.page { display: none; }
.page.active { display: block; animation: pageIn .24s cubic-bezier(.2,.9,.2,1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } to { opacity: 1; transform: translateY(0); filter: blur(0); } }
.page-title { font-size: 30px; font-weight: 700; margin-bottom: 24px; letter-spacing: -0.025em; background: linear-gradient(135deg, #fff 0%, #9aa7c2 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.page-subtitle { color: var(--text-secondary); font-size: 14px; margin-top: -16px; margin-bottom: 24px; }

/* ═══ CARDS ═══ */
.card { position: relative; overflow: hidden; background: linear-gradient(180deg, rgba(18,24,40,0.66), rgba(12,17,29,0.66)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; transition: border-color .25s, box-shadow .25s, transform .25s; box-shadow: var(--shadow-md); }
.card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 0%, rgba(91,108,255,0.10), transparent 34%), radial-gradient(circle at 100% 100%, rgba(236,72,153,0.06), transparent 36%); pointer-events: none; }
.card::after { content: ''; position: absolute; top: -60%; left: -50%; width: 40%; height: 220%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent); transform: rotate(18deg) translateX(-140%); transition: transform .75s ease; pointer-events: none; }
.card:hover { border-color: rgba(91,108,255,0.32); transform: translateY(-2px); box-shadow: var(--shadow-lg), 0 0 0 1px rgba(91,108,255,0.06); }
.card:hover::after { transform: rotate(18deg) translateX(420%); }
.card > * { position: relative; z-index: 1; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.card-title { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.card-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ═══ STAT CARDS ═══ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }
.stat-card { position: relative; overflow: hidden; background: linear-gradient(180deg, rgba(20,27,46,0.72), rgba(12,17,29,0.72)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px; display: flex; justify-content: space-between; align-items: flex-start; transition: border-color .25s, box-shadow .25s, transform .25s; box-shadow: var(--shadow-md); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--accent-grad); opacity: .7; }
.stat-card::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 10%, rgba(91,108,255,0.13), transparent 34%), radial-gradient(circle at 90% 100%, rgba(236,72,153,0.08), transparent 38%); pointer-events: none; }
.stat-card:hover { border-color: rgba(91,108,255,0.32); transform: translateY(-3px); box-shadow: var(--shadow-lg), 0 0 0 1px rgba(91,108,255,0.06); }
.stat-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); letter-spacing: 0.01em; }
.stat-value { font-size: 34px; font-weight: 700; margin: 6px 0 2px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.stat-sub { font-size: 12px; color: var(--text-muted); }
.stat-icon { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--accent-grad-soft); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(91,108,255,0.18); }
.stat-card > div, .stat-icon { position: relative; z-index: 1; }
.stat-icon.green { background: linear-gradient(135deg, rgba(34,197,94,0.18), rgba(34,197,94,0.06)); color: var(--success); box-shadow: inset 0 0 0 1px rgba(34,197,94,0.2); }
.stat-icon.orange { background: linear-gradient(135deg, rgba(249,115,22,0.18), rgba(249,115,22,0.06)); color: var(--warning); box-shadow: inset 0 0 0 1px rgba(249,115,22,0.2); }
.stat-icon.blue { background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(59,130,246,0.06)); color: var(--info); box-shadow: inset 0 0 0 1px rgba(59,130,246,0.2); }

/* ═══ DASHBOARD GRID ═══ */
.dash-row { display: flex; gap: 24px; margin-bottom: 24px; }
.dash-col-main { flex: 3; min-width: 0; }
.dash-col-side { flex: 2; min-width: 0; }
.dash-col-wide { flex: 5; min-width: 0; }
.dash-col-narrow { flex: 4; min-width: 0; }

/* ═══ CHARTS ═══ */
.chart-area { height: 280px; position: relative; }
.chart-donut-wrap { height: 220px; display: flex; align-items: center; justify-content: center; position: relative; margin-top: 30px; }
.chart-donut-wrap canvas { max-width: 210px !important; max-height: 210px !important; }
.chart-donut-center { position: absolute; text-align: center; pointer-events: none; left: 50%; top: calc(50% + 15px); transform: translate(-50%, -50%); width: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.chart-donut-center .donut-value { font-size: 22px; font-weight: 700; margin-bottom: 2px; }
.chart-donut-center .donut-label { font-size: 12px; color: var(--text-muted); }
.chart-legend { display: flex; align-items: center; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.chart-legend-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.chart-legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.chart-trend { margin-top: 12px; font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.chart-trend.down { color: var(--danger); }

/* ═══ WORLD MAP ═══ */
.world-map-box {
  position: relative;
  width: 100%;
  min-height: 700px;
  height: clamp(700px, 78vw, 940px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: grab;
  background:
    radial-gradient(circle at 50% 42%, rgba(91,108,255,0.22), transparent 18%),
    radial-gradient(circle at 18% 18%, rgba(91,108,255,0.18), transparent 30%),
    radial-gradient(circle at 82% 22%, rgba(16,185,129,0.14), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(236,72,153,0.10), transparent 34%),
    linear-gradient(135deg, rgba(15,23,42,0.96), rgba(2,6,23,0.99));
  border: 1px solid rgba(148,163,184,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 28px 80px -36px rgba(0,0,0,0.82);
}
.world-map-box.globe-box {
  border-radius: var(--radius-lg);
}
#world-map-canvas {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
#world-map-canvas:active { cursor: grabbing; }
.world-map-box::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.30;
  background-image:
    linear-gradient(rgba(148,163,184,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.55), transparent 74%);
}
.world-map-box::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 36%, rgba(2,6,23,0.34) 100%), linear-gradient(180deg, transparent 0%, rgba(91,108,255,0.04) 50%, transparent 100%);
  animation: globeScan 7s linear infinite;
}
@keyframes globeScan {
  0% { transform: translateY(-18%); opacity: .45; }
  50% { transform: translateY(18%); opacity: .85; }
  100% { transform: translateY(-18%); opacity: .45; }
}
.globe-box {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 34px 100px -40px rgba(0,0,0,0.92);
}
.globe-overlay {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 6;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  pointer-events: none;
}
.globe-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(15,23,42,0.72);
  border: 1px solid rgba(255,255,255,0.10);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
}
.globe-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px rgba(91,108,255,0.6); }
#world-map-canvas:active { cursor: grabbing; }
.map-hint { position: absolute; right: 14px; top: 14px; z-index: 6; display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 999px; background: rgba(15,23,42,0.70); border: 1px solid rgba(255,255,255,0.10); color: #cbd5e1; font-size: 11px; font-weight: 700; backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); box-shadow: 0 12px 32px rgba(0,0,0,0.22); pointer-events: none; }
.map-hint::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px rgba(91,108,255,0.6); }
[data-theme="light"] .map-hint,
[data-theme="light"] .globe-chip { background: rgba(255,255,255,0.84); border-color: rgba(15,23,42,0.08); color: #475569; }
.map-tooltip {
  position: absolute;
  background: rgba(15,23,42,0.94);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(148,163,184,0.22);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 18px 42px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.04), 0 0 30px rgba(91,108,255,0.14);
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-5px) scale(0.98);
  transition: opacity .16s ease, transform .16s ease;
  max-width: 320px;
}
.map-tooltip.visible { opacity: 1; transform: translateY(0) scale(1); }
.map-tooltip-country { font-weight: 750; font-size: 15px; color: #fff; margin-bottom: 5px; letter-spacing: -0.01em; }
.map-tooltip-requests { font-weight: 650; font-size: 13px; color: #dbeafe; }
.map-total-badge { font-size: 12px; font-weight: 700; color: #c7d2fe; background: rgba(59,130,246,0.14); border: 1px solid rgba(59,130,246,0.28); padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.map-legend {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  background: rgba(15,23,42,0.72);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  padding: 10px 12px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 12px 32px rgba(0,0,0,0.24);
}
.map-legend-label { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.map-legend-bar { width: 140px; height: 9px; border-radius: 999px; background: linear-gradient(90deg, rgba(37,99,235,0.85), rgba(124,58,237,0.9), rgba(217,70,239,0.95), rgba(244,63,94,1)); transition: background .3s ease; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08); }
[data-theme="light"] .world-map-box { background: radial-gradient(circle at 50% 42%, rgba(91,108,255,0.14), transparent 18%), radial-gradient(circle at 18% 18%, rgba(91,108,255,0.12), transparent 30%), radial-gradient(circle at 82% 22%, rgba(16,185,129,0.10), transparent 28%), linear-gradient(135deg, #f8fbff, #eef2ff); border-color: rgba(15,23,42,0.08); }
[data-theme="light"] .world-map-box::before { opacity: 0.22; background-image: linear-gradient(rgba(15,23,42,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(15,23,42,0.06) 1px, transparent 1px); }
[data-theme="light"] .map-legend { background: rgba(255,255,255,0.82); border-color: rgba(15,23,42,0.08); }
[data-theme="light"] .map-legend-label { color: #64748b; }
@media (max-width: 900px) {
  .world-map-box { min-height: 560px; height: 72vw; }
  .globe-overlay { left: 12px; bottom: 12px; }
}
@media (max-width: 640px) {
  .world-map-box { min-height: 480px; height: 92vw; }
  .map-legend { top: 12px; left: 12px; }
  .map-hint { top: auto; bottom: 12px; right: 12px; }
}

/* map header controls */
.map-summary-panel { margin-bottom: 16px; padding: 12px; border-radius: var(--radius-lg); background: linear-gradient(180deg, rgba(15,23,42,0.72), rgba(15,23,42,0.38)); border: 1px solid rgba(148,163,184,0.16); box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 14px 34px -24px rgba(0,0,0,0.7); }
.map-summary-panel.hidden { display: none; }
.map-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.map-summary-card { position: relative; overflow: hidden; padding: 14px 16px; border-radius: var(--radius); background: linear-gradient(180deg, rgba(15,23,42,0.9), rgba(15,23,42,0.64)); border: 1px solid rgba(148,163,184,0.14); box-shadow: inset 0 1px 0 rgba(255,255,255,0.04); }
.map-summary-card::before { content: ''; position: absolute; inset: 0; transform: translateX(-120%); background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.10) 45%, transparent 70%); transition: transform .8s ease; pointer-events: none; }
.map-summary-card:hover::before { transform: translateX(120%); }
.map-summary-card::after { content: ''; position: absolute; inset: auto -20% -55% 35%; height: 80%; background: radial-gradient(circle, rgba(91,108,255,0.18), transparent 65%); pointer-events: none; }
.map-summary-label { position: relative; display: block; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 5px; }
.map-summary-value { position: relative; display: block; font-size: 22px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.03em; }
.map-summary-sub { position: relative; display: block; margin-top: 3px; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="light"] .map-summary-panel { background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(248,250,252,0.56)); border-color: var(--border); }
[data-theme="light"] .map-summary-card { background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,250,252,0.78)); border-color: var(--border); }
.map-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.map-live-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; font-size: 12px; font-weight: 750; color: #a7f3d0; background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.28); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 0 24px rgba(16,185,129,0.08); }
.map-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,0.7); animation: livePulse 1.8s infinite; }
@keyframes livePulse { 0%{box-shadow:0 0 0 0 rgba(52,211,153,0.6)}70%{box-shadow:0 0 0 8px rgba(52,211,153,0)}100%{box-shadow:0 0 0 0 rgba(52,211,153,0)} }
.seg { display: inline-flex; background: var(--bg-input); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.04); }
.seg-btn { padding: 7px 14px; font-size: 12px; font-weight: 700; color: var(--text-secondary); background: transparent; border: none; border-radius: 999px; cursor: pointer; transition: color .18s, background .18s, box-shadow .18s; white-space: nowrap; }
.seg-btn:hover { color: var(--text-primary); }
.seg-btn.active { color: #fff; background: var(--accent-grad); box-shadow: 0 8px 20px rgba(91,108,255,0.28); }
.seg-btn.disabled { opacity: 0.42; cursor: not-allowed; filter: grayscale(0.65); }
.seg-btn.disabled:hover { color: var(--text-secondary); }
.map-tooltip-breakdown { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 11.5px; color: #9ca3af; display: flex; flex-direction: column; gap: 4px; }
.map-tooltip-breakdown b { font-weight: 750; color: #e5e7eb; font-variant-numeric: tabular-nums; }
.map-tooltip-breakdown .br-verify { color: #93c5fd; font-weight: 700; }
.map-tooltip-breakdown .br-heart { color: #6ee7b7; font-weight: 700; }
.map-tooltip-breakdown .br-plugins { color: #c4b5fd; font-weight: 700; }
.map-tooltip-breakdown .br-users { color: #fbbf24; font-weight: 700; }
.map-tooltip-breakdown .br-worlds { color: #67e8f9; font-weight: 700; }
[data-theme="light"] .map-tooltip { background: rgba(255,255,255,0.94); color: var(--text-primary); }
[data-theme="light"] .map-tooltip-country { color: var(--text-primary); }
[data-theme="light"] .map-tooltip-requests { color: var(--text-primary); }
[data-theme="light"] .map-tooltip-breakdown { border-top-color: var(--border); color: var(--text-secondary); }
[data-theme="light"] .map-tooltip-breakdown b { color: var(--text-primary); }

/* top countries leaderboard */
.map-topcountries { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 16px; }
.map-topcountries-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.map-topcountries-head > span:first-child { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
.map-topcountries-sub { font-size: 12px; color: var(--text-muted); }
.map-topcountries-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.map-tc-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); background: rgba(15,23,42,0.48); border: 1px solid rgba(148,163,184,0.12); transition: background .15s, border-color .15s, transform .15s; position: relative; overflow: hidden; }
.map-tc-row::before { content: ''; position: absolute; inset: 0; transform: translateX(-120%); background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.08) 45%, transparent 70%); transition: transform .65s ease; pointer-events: none; }
.map-tc-row:hover { background: rgba(30,41,59,0.52); border-color: rgba(91,108,255,0.22); transform: translateY(-1px); }
.map-tc-row:hover::before { transform: translateX(120%); }
.map-tc-row > * { position: relative; }
.map-tc-rank { font-size: 11px; font-weight: 800; color: var(--text-muted); width: 22px; height: 22px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: rgba(148,163,184,0.10); flex-shrink: 0; }
.map-tc-flag { font-size: 18px; line-height: 1; flex-shrink: 0; width: 24px; text-align: center; filter: saturate(1.08); }
.map-tc-info { flex: 1; min-width: 0; }
.map-tc-name { font-size: 13.5px; font-weight: 750; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-tc-meta { margin-top: 2px; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-tc-bar { height: 5px; border-radius: 999px; background: rgba(148,163,184,0.14); margin-top: 5px; overflow: hidden; }
.map-tc-bar-fill { height: 100%; border-radius: 999px; background: var(--accent-grad); transition: width .4s cubic-bezier(.22,1,.36,1); box-shadow: 0 0 16px rgba(91,108,255,0.18); }
.map-tc-bar-fill.heartbeat { background: linear-gradient(90deg, #10b981, #34d399, #a3e635); }
.map-tc-count { font-size: 13px; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.map-tc-count .hb { color: #34d399; font-size: 10px; margin-left: 4px; }
.map-topcountries-empty { grid-column: 1 / -1; text-align: center; color: var(--text-muted); font-size: 13px; padding: 20px; border: 1px dashed var(--border); border-radius: var(--radius); background: rgba(148,163,184,0.04); animation: fadeIn .25s ease both; }
@keyframes mapPulse { 0%,100%{transform:scale(1);opacity:0.9}50%{transform:scale(1.15);opacity:1} }

/* ═══ TABLES ═══ */
.data-table { width: 100%; }
.data-table thead th { text-align: left; padding: 11px 14px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table tbody td { padding: 12px 14px; font-size: 13px; color: var(--text-secondary); border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover td { background: rgba(91,108,255,0.05); }
.data-table tbody tr:last-child td { border-bottom: none; }
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: rgba(91,108,255,0.05) !important; }
.table-wrap { overflow-x: auto; }
.table-mono { font-family: var(--font-mono); font-size: 12px; color: var(--text-primary); }

/* ═══ BADGES ═══ */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; letter-spacing: .01em; }
.badge-success { background: var(--success-bg); color: var(--success); box-shadow: inset 0 0 0 1px rgba(34,197,94,0.18); }
.badge-danger { background: var(--danger-bg); color: var(--danger); box-shadow: inset 0 0 0 1px rgba(239,68,68,0.18); }
.badge-warning { background: var(--warning-bg); color: var(--warning); box-shadow: inset 0 0 0 1px rgba(249,115,22,0.18); }
.badge-info { background: var(--info-bg); color: var(--info); box-shadow: inset 0 0 0 1px rgba(59,130,246,0.18); }
.badge-muted { background: rgba(100,116,139,0.12); color: var(--text-muted); box-shadow: inset 0 0 0 1px rgba(100,116,139,0.14); }
.badge-purple { background: rgba(167,139,250,0.12); color: var(--purple); box-shadow: inset 0 0 0 1px rgba(167,139,250,0.2); }
.badge-pink { background: rgba(236,72,153,0.12); color: var(--pink); box-shadow: inset 0 0 0 1px rgba(236,72,153,0.2); }
.badge-accent { background: var(--accent-glow); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(91,108,255,0.22); }
.badge-orange { background: var(--warning-bg); color: var(--warning); box-shadow: inset 0 0 0 1px rgba(249,115,22,0.18); }
.badge-login { background: rgba(59,130,246,0.12); color: var(--info); box-shadow: inset 0 0 0 1px rgba(59,130,246,0.18); }
.badge-register { background: var(--success-bg); color: var(--success); box-shadow: inset 0 0 0 1px rgba(34,197,94,0.18); }

/* ═══ BUTTONS ═══ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 550; transition: all .2s; border: 1px solid transparent; white-space: nowrap; position: relative; overflow: hidden; }
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.20), transparent); transform: translateX(-100%); transition: transform .45s ease; }
.btn-primary:hover::before { transform: translateX(100%); }
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 14px 34px -8px rgba(91,108,255,0.5); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: var(--bg-input); color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-light); }
.btn-danger { background: var(--danger-bg); color: var(--danger); box-shadow: inset 0 0 0 1px rgba(239,68,68,0.18); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 11px; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); transition: all .2s; }
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ═══ FORMS ═══ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 7px; }
.form-input, .form-select { width: 100%; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 13px; transition: border-color .2s, box-shadow .2s, background .2s; }
.form-input:focus, .form-select:focus { border-color: var(--accent); box-shadow: var(--ring); background: var(--bg-card); }
.form-select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }

/* ═══ DROPDOWNS ═══ */
.dropdown { position: relative; display: inline-flex; }
.dropdown-trigger { display: flex; align-items: center; gap: 6px; padding: 7px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary); cursor: pointer; transition: background .2s, border-color .2s; }
.dropdown-trigger:hover { background: var(--bg-hover); border-color: var(--border-light); }
.dropdown-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 168px; background: rgba(15,20,34,0.96); backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius); padding: 5px; z-index: 200; display: none; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(91,108,255,0.04); }
.dropdown-menu.open { display: block; animation: dropIn .16s ease; transform-origin: top left; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.dropdown-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; background: none; color: var(--text-secondary); font-size: 13px; text-align: left; border-radius: var(--radius-sm); cursor: pointer; transition: background .15s, color .15s; }
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ═══ MODAL ═══ */
.modal-overlay { position: fixed; inset: 0; background: rgba(4,7,14,0.66); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 24px; animation: fadeIn .15s ease; }
.modal-box { background: linear-gradient(180deg, rgba(20,26,42,0.96), rgba(13,17,29,0.96)); backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 28px; width: 100%; max-width: 520px; max-height: 85vh; overflow-y: auto; animation: modalIn .24s cubic-bezier(.22,1,.36,1); box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.05); }
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h2 { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.modal-close { background: none; color: var(--text-muted); font-size: 20px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); transition: background .15s, color .15s; }
.modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }

/* ═══ EMPTY STATE ═══ */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; text-align: center; border: 1px dashed rgba(91,108,255,0.16); border-radius: var(--radius-lg); background: linear-gradient(135deg, rgba(91,108,255,0.04), rgba(236,72,153,0.02)); }
.empty-state svg { color: var(--text-muted); margin-bottom: 16px; opacity: .7; width: 48px; height: 48px; background: rgba(91,108,255,0.08); border-radius: 14px; padding: 14px; }
.empty-state h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--text-muted); max-width: 360px; line-height: 1.6; }

/* ═══ PAGINATION ═══ */
.pagination { display: flex; align-items: center; gap: 8px; margin-top: 16px; justify-content: flex-end; }
.page-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--bg-input); border: 1px solid var(--border); color: var(--text-secondary); font-size: 13px; transition: all .15s; }
.page-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ═══ TOASTS ═══ */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 600; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 12px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 550; animation: toastIn .22s ease; min-width: 240px; display: flex; align-items: center; gap: 8px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow-md); }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
.toast-success { background: rgba(20,30,24,0.92); color: var(--success); border: 1px solid rgba(34,197,94,0.25); }
.toast-error { background: rgba(30,20,22,0.92); color: var(--danger); border: 1px solid rgba(239,68,68,0.25); }

/* ═══ FILTER BAR ═══ */
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search-input-wrap { position: relative; flex: 1; min-width: 200px; }
.search-input-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-input-wrap input { width: 100%; padding: 9px 12px 9px 34px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 13px; transition: border-color .2s, box-shadow .2s, background .2s; }
.search-input-wrap input:focus { border-color: var(--accent); box-shadow: var(--ring); background: var(--bg-card); }

/* ═══ CHECKBOX GRID ═══ */
.wh-events { display: flex; flex-direction: column; gap: 6px; }
.wh-event-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.wh-event-label input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }

/* ═══ CODE BLOCKS ═══ */
.code-block { position: relative; margin: 10px 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.code-block-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 14px; background: var(--bg-card); border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.code-block-lang { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; font-weight: 600; background: var(--bg-input); padding: 1px 7px; border-radius: 3px; }
.code-block pre { background: var(--bg-input); padding: 14px 16px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65; color: var(--text-primary); overflow-x: auto; white-space: pre-wrap; word-break: break-word; margin: 0; }
.code-copy { padding: 2px 8px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 4px; color: var(--text-muted); font-size: 11px; cursor: pointer; transition: all .15s; }
.code-copy:hover { background: var(--bg-hover); color: var(--text-primary); }
.code-copy.copied { color: var(--success); border-color: var(--success); }

/* ═══ ENHANCED UI FEATURES ═══ */
.quick-action-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 180;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 112px;
  height: 54px;
  padding: 0 18px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, rgba(91,108,255,0.95), rgba(139,92,246,0.95) 55%, rgba(236,72,153,0.95));
  box-shadow: 0 18px 45px rgba(91,108,255,0.34), 0 0 0 6px rgba(91,108,255,0.08);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: -.02em;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  overflow: hidden;
}
.quick-action-fab::after {
  content: '';
  position: absolute;
  inset: -60%;
  background: conic-gradient(from 0deg, transparent, rgba(255,255,255,0.35), transparent 30%);
  animation: fabSpin 3.5s linear infinite;
  opacity: .35;
}
.quick-action-fab span, .quick-action-fab svg { position: relative; z-index: 1; }
@keyframes fabSpin { to { transform: rotate(360deg); } }
.quick-action-fab:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 24px 60px rgba(91,108,255,0.42), 0 0 0 9px rgba(91,108,255,0.12); filter: saturate(1.12); }
.quick-action-fab:active { transform: translateY(0) scale(.98); }

.system-status-panel {
  position: fixed;
  right: 24px;
  top: calc(var(--topbar-h) + 14px);
  z-index: 175;
  width: min(320px, calc(100vw - 48px));
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(15,23,42,0.88);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 0 24px 70px rgba(0,0,0,0.35);
  animation: panelIn .22s ease both;
}
.system-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 8px;
}
.system-status-row:last-child { margin-bottom: 0; }
.system-status-row b { display: block; font-size: 13px; color: var(--text-primary); }
.system-status-row small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 12px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 6px rgba(34,197,94,0.10); }
.status-dot.online { background: var(--success); animation: pulseDot 1.8s infinite; }
.status-dot.warn { background: var(--warning); box-shadow: 0 0 0 6px rgba(249,115,22,0.10); }
.status-dot.offline { background: var(--danger); box-shadow: 0 0 0 6px rgba(239,68,68,0.10); }

.activity-ticker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  animation: tickerIn .24s ease both;
}
.activity-ticker-item b { display: block; font-size: 13px; color: var(--text-primary); }
.activity-ticker-item small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 12px; }
.activity-ticker-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; font-size: 12px; font-weight: 800; }
.activity-ticker-icon.success { background: rgba(34,197,94,0.16); color: var(--success); }
.activity-ticker-icon.info { background: rgba(59,130,246,0.16); color: var(--info); }
.activity-ticker-icon.danger { background: rgba(239,68,68,0.16); color: var(--danger); }

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

.shortcuts-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2,6,23,0.62);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeIn .18s ease both;
}
.shortcuts-card {
  width: min(560px, 100%);
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(15,23,42,0.96), rgba(15,23,42,0.86));
  box-shadow: 0 30px 90px rgba(0,0,0,0.42);
  animation: modalIn .22s cubic-bezier(.2,.9,.2,1) both;
}
.shortcuts-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.shortcuts-header h3 { margin: 0 0 4px; font-size: 20px; }
.shortcuts-header p { margin: 0; color: var(--text-muted); font-size: 13px; }
.shortcuts-grid { display: grid; gap: 10px; }
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-secondary);
  font-size: 13px;
}
.shortcut-row span { font-weight: 600; color: var(--text-primary); }
.shortcut-row kbd {
  min-width: 30px;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.18);
}

.confetti-piece {
  position: fixed;
  top: -10px;
  z-index: 2000;
  width: 8px;
  height: 14px;
  border-radius: 3px;
  pointer-events: none;
  animation: confettiFall 900ms ease-out forwards;
}

@keyframes panelIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes pulseDot { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .65; } }
@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translateY(calc(100vh + 60px)) rotate(720deg) scale(.8); }
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-row { flex-direction: column; }
  .dash-col-main, .dash-col-side, .dash-col-wide, .dash-col-narrow { flex: none; }
  .map-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  #sidebar { display: none; }
  #sidebar.open { display: flex; position: fixed; z-index: 200; left: 0; top: var(--topbar-h); bottom: 0; }
  #main-content { margin-left: 0; padding: 20px; }
  .stat-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar-center { display: none; }
  .mobile-menu-btn { display: flex !important; }
  .map-summary-grid { grid-template-columns: 1fr; }
  .map-topcountries-list { grid-template-columns: 1fr; }
  .map-controls { justify-content: flex-start; }
  .world-map-box { min-height: 520px; height: 620px; }
}
.mobile-menu-btn { display: none !important; }

/* ═══ DOCS PAGE ═══ */
#page-docs .docs-hero { background: linear-gradient(135deg, rgba(91,108,255,0.12) 0%, rgba(139,92,246,0.06) 50%, rgba(236,72,153,0.04) 100%); border: 1px solid rgba(91,108,255,0.15); border-radius: 16px; padding: 40px 32px; margin-bottom: 28px; text-align: center; position: relative; overflow: hidden; }
#page-docs .docs-hero::before { content: ''; position: absolute; top: -40%; left: -20%; width: 140%; height: 140%; background: radial-gradient(ellipse at 30% 20%, rgba(91,108,255,0.08) 0%, transparent 60%), radial-gradient(ellipse at 70% 80%, rgba(139,92,246,0.06) 0%, transparent 60%); pointer-events: none; }
#page-docs .docs-hero-icon { width: 56px; height: 56px; background: linear-gradient(135deg, var(--accent), #7c3aed); border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; color: #fff; margin-bottom: 16px; box-shadow: 0 4px 20px rgba(91,108,255,0.3); position: relative; }
#page-docs .docs-hero h2 { font-size: 26px; font-weight: 800; margin-bottom: 8px; position: relative; background: linear-gradient(135deg, var(--text-primary), var(--trial)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
#page-docs .docs-hero p { color: var(--text-secondary); font-size: 14px; max-width: 520px; margin: 0 auto 20px; line-height: 1.7; position: relative; }
#page-docs .docs-hero-badges { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; position: relative; }
#page-docs .docs-hero-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; background: rgba(91,108,255,0.08); border: 1px solid rgba(91,108,255,0.12); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
#page-docs .docs-hero-badge svg { opacity: .6; }
#page-docs .docs-layout { display: flex; }
#page-docs .docs-content { flex: 1; min-width: 0; padding-right: 32px; padding-bottom: 40px; }
#page-docs .docs-right-nav { width: 140px; flex-shrink: 0; margin-left: auto; border-left: 1px solid var(--border); padding-left: 14px; position: sticky; top: calc(var(--topbar-h) + 20px); align-self: flex-start; max-height: calc(100vh - 120px); overflow-y: auto; }
#page-docs .docs-nav-cat { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); padding: 18px 0 8px; cursor: default; display: inline-block; transition: color .3s ease, transform .3s ease, text-shadow .3s ease, letter-spacing .3s ease; }
#page-docs .docs-nav-cat:hover { color: var(--accent); transform: scale(1.12); text-shadow: 0 0 12px rgba(96,165,250,.5); letter-spacing: 1.8px; }
#page-docs .docs-right-nav a { display: flex; align-items: center; gap: 8px; padding: 6px 0 6px 14px; font-size: 14px; color: var(--text-secondary); text-decoration: none; transition: color .25s ease, transform .25s ease, padding-left .25s ease; border-radius: 4px; }
#page-docs .docs-right-nav a svg { opacity: .5; flex-shrink: 0; transition: opacity .2s; }
#page-docs .docs-right-nav a:hover { color: var(--text-primary); transform: translateX(4px); padding-left: 18px; }
#page-docs .docs-right-nav a:hover svg { opacity: .8; }
#page-docs .docs-right-nav a.active { color: var(--accent); font-weight: 600; background: rgba(91,108,255,0.06); padding-left: 18px; }
#page-docs .docs-right-nav a.active svg { opacity: 1; color: var(--accent); }
#page-docs .docs-section { margin-bottom: 36px; scroll-margin-top: calc(var(--topbar-h) + 20px); animation: docFadeIn .4s ease both; }
#page-docs .docs-section:nth-child(2) { animation-delay: .05s; }
#page-docs .docs-section:nth-child(3) { animation-delay: .1s; }
#page-docs .docs-section:nth-child(4) { animation-delay: .15s; }
#page-docs .docs-section:nth-child(5) { animation-delay: .2s; }
#page-docs .docs-section:nth-child(6) { animation-delay: .25s; }
#page-docs .docs-section:nth-child(7) { animation-delay: .3s; }
#page-docs .docs-section:nth-child(8) { animation-delay: .35s; }
#page-docs .docs-section:nth-child(9) { animation-delay: .4s; }
@keyframes docFadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
#page-docs .docs-section h3 { font-size: 17px; font-weight: 700; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
#page-docs .docs-section h3 svg { color: var(--accent); flex-shrink: 0; }
#page-docs .docs-section h4 { font-size: 14px; font-weight: 600; margin: 18px 0 8px; }
#page-docs .docs-section > p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 12px; }
#page-docs .docs-section code { background: var(--bg-input); padding: 1px 5px; border-radius: 3px; font-size: 12px; color: var(--trial); font-family: var(--font-mono); }
#page-docs .docs-ep { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); margin: 10px 0 14px; font-family: var(--font-mono); font-size: 14px; }
#page-docs .docs-method { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
#page-docs .docs-method-post { background: rgba(34,197,94,0.15); color: var(--success); }
#page-docs .docs-method-get { background: rgba(59,130,246,0.15); color: var(--info); }
#page-docs .docs-callout { padding: 12px 16px; border-radius: var(--radius); margin: 12px 0; font-size: 13px; line-height: 1.6; color: var(--text-secondary); display: flex; align-items: flex-start; gap: 0; }
#page-docs .docs-callout svg { margin-top: 1px; }
#page-docs .docs-callout b { color: var(--text-primary); }
#page-docs .docs-callout-info { background: var(--info-bg); border: 1px solid rgba(59,130,246,0.18); }
#page-docs .docs-callout-warn { background: var(--warning-bg); border: 1px solid rgba(245,158,11,0.18); }
#page-docs .docs-callout-tip { background: rgba(34,197,94,0.07); border: 1px solid rgba(34,197,94,0.18); }
#page-docs .docs-params { margin: 10px 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
#page-docs .docs-param { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
#page-docs .docs-param:last-child { border-bottom: none; }
#page-docs .docs-param code { min-width: 70px; }
#page-docs .docs-param span { color: var(--text-muted); font-size: 12px; }
#page-docs .docs-req { padding: 1px 7px; border-radius: 3px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; background: var(--danger-bg); color: var(--danger); }
#page-docs .docs-opt { padding: 1px 7px; border-radius: 3px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; background: var(--bg-input); color: var(--text-muted); }
#page-docs .docs-steps { margin: 12px 0; }
#page-docs .docs-step { display: flex; gap: 12px; padding: 10px 0 10px 24px; border-left: 2px solid var(--border); margin-left: 11px; position: relative; }
#page-docs .docs-step:last-child { border-left-color: transparent; }
#page-docs .docs-step-n { position: absolute; left: -13px; top: 8px; width: 22px; height: 22px; background: linear-gradient(135deg, var(--accent), #7c3aed); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; box-shadow: 0 2px 8px rgba(91,108,255,0.3); }
#page-docs .docs-step-n svg { stroke: #fff; }
#page-docs .docs-step b { display: block; font-size: 13px; color: var(--text-primary); }
#page-docs .docs-step span { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
#page-docs .docs-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
#page-docs .docs-feat { display: flex; gap: 14px; padding: 16px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color .2s, transform .2s; }
#page-docs .docs-feat:hover { border-color: var(--accent); transform: translateY(-1px); }
#page-docs .docs-feat-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
#page-docs .docs-feat b { display: block; font-size: 13px; color: var(--text-primary); margin-bottom: 2px; }
#page-docs .docs-feat span { display: block; font-size: 12px; color: var(--text-muted); line-height: 1.4; }
@media (max-width: 768px) {
  #page-docs .docs-layout { flex-direction: column-reverse; }
  #page-docs .docs-content { padding-right: 0; }
  #page-docs .docs-right-nav { width: 100%; margin-left: 0; border-left: none; border-top: 1px solid var(--border); padding-left: 0; display: flex; overflow-x: auto; gap: 4px 12px; padding: 6px 4px; position: static; max-height: none; }
  #page-docs .docs-nav-cat { display: none; }
  #page-docs .docs-feats { grid-template-columns: 1fr; }
}

/* ═══ ANIMATED COUNTERS ═══ */
.stat-value { display: inline-block; }

/* ═══ SKELETON LOADING ═══ */
.skeleton { background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-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: 14px; margin-bottom: 8px; }
.skeleton-text.short { width: 60%; }
.skeleton-title { height: 18px; width: 40%; margin-bottom: 12px; }
.skeleton-cell { height: 14px; padding: 10px 14px; }
.skeleton-badge { height: 22px; width: 70px; border-radius: 999px; }

/* ═══ GRADIENT SIDEBAR ACCENT ═══ */
#sidebar::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, #5b6cff, #8b5cf6, #ec4899, #5b6cff); background-size: 200% 100%; animation: gradientSlide 5s linear infinite; }
@keyframes gradientSlide { 0% { background-position: 0% 0; } 100% { background-position: 200% 0; } }

/* ═══ PAGE TRANSITIONS ═══ */
.page { display: none; }
.page.active { display: block; animation: pageSlideIn .35s cubic-bezier(.22,1,.36,1); }
@keyframes pageSlideIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ═══ COMMAND PALETTE ═══ */
#command-palette-overlay { position: fixed; inset: 0; background: rgba(2,6,23,0.62); backdrop-filter: blur(8px); z-index: 1000; display: none; align-items: flex-start; justify-content: center; padding-top: 15vh; animation: fadeIn .1s ease; }
#command-palette-overlay.open { display: flex; }
#command-palette { background: linear-gradient(180deg, rgba(17,24,39,0.98), rgba(15,23,42,0.96)); backdrop-filter: blur(24px) saturate(140%); border: 1px solid rgba(255,255,255,0.08); border-radius: 22px; width: min(620px, calc(100vw - 40px)); max-height: 460px; overflow: hidden; box-shadow: 0 30px 100px rgba(0,0,0,0.55); animation: cmdIn .18s cubic-bezier(.2,.9,.2,1); }
@keyframes cmdIn { from { opacity: 0; transform: scale(.96) translateY(-10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
#command-input { width: 100%; padding: 18px 20px; background: transparent; border: none; border-bottom: 1px solid var(--border); color: var(--text-primary); font-size: 16px; }
#command-input:focus { outline: none; }
#command-input::placeholder { color: var(--text-muted); }
#command-results { max-height: 390px; overflow-y: auto; padding: 8px; }
.command-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; color: var(--text-secondary); font-size: 13px; cursor: pointer; transition: background .15s, transform .15s; }
.command-item:hover, .command-item.active { background: rgba(91,108,255,0.12); color: var(--text-primary); transform: translateX(2px); }
.command-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .65; color: var(--accent); }
.command-item-label { flex: 1; font-weight: 600; }
.command-item-hint { font-size: 11px; color: var(--text-muted); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.06); padding: 3px 7px; border-radius: 6px; font-family: var(--font-mono); }
.command-empty { padding: 28px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ═══ ACTIVITY HEATMAP ═══ */
.heatmap-card { margin-top: 24px; }
.heatmap-container { display: flex; gap: 3px; overflow-x: auto; padding: 4px 0; }
.heatmap-week { display: flex; flex-direction: column; gap: 3px; }
.heatmap-cell { width: 13px; height: 13px; border-radius: 2px; background: var(--bg-input); transition: all .15s; cursor: pointer; }
.heatmap-cell:hover { transform: scale(1.3); z-index: 2; position: relative; }
.heatmap-cell.l1 { background: rgba(91,108,255,0.25); }
.heatmap-cell.l2 { background: rgba(91,108,255,0.45); }
.heatmap-cell.l3 { background: rgba(91,108,255,0.65); }
.heatmap-cell.l4 { background: rgba(91,108,255,0.9); }
.heatmap-labels { display: flex; flex-direction: column; gap: 3px; margin-right: 6px; justify-content: space-between; }
.heatmap-labels span { font-size: 10px; color: var(--text-muted); height: 13px; display: flex; align-items: center; }
.heatmap-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 11px; color: var(--text-muted); }
.heatmap-legend { display: flex; align-items: center; gap: 4px; }
.heatmap-legend-cell { width: 13px; height: 13px; border-radius: 2px; }

/* ═══ CSV EXPORT BUTTON ═══ */
.export-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 12px; cursor: pointer; transition: all .2s; }
.export-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-light); }

/* ═══ UTILITIES ═══ */
.text-muted { color: var(--text-muted); font-size: 13px; }
.text-green { color: var(--success); }
.text-red { color: var(--danger); }
.text-orange { color: var(--warning); }
.mb { margin-bottom: 16px; }
.mt { margin-top: 16px; }
.hidden { display: none !important; }
.text-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══ TEAM ROLES ═══ */
.role-badge-owner { background: linear-gradient(135deg, var(--accent), #7c3aed); color: #fff; }
.role-badge-admin { background: var(--warning-bg); color: var(--warning); }
.role-badge-member { background: rgba(100,116,139,0.12); color: var(--text-muted); }

/* ═══ RTL (Arabic) ═══ */
[dir="rtl"] #sidebar { left: auto; right: 0; border-right: none; border-left: 1px solid rgba(30,41,59,0.5); }
[dir="rtl"] #main { margin-left: 0; margin-right: var(--sidebar-w); }
[dir="rtl"] .sidebar-item.active { border-left: none; border-right: 2px solid var(--accent); margin-left: 0; margin-right: -2px; }
[dir="rtl"] .sidebar-item .item-arrow { margin-left: 0; margin-right: auto; transform: scaleX(-1); }
[dir="rtl"] .sidebar-search svg { left: auto; right: 11px; }
[dir="rtl"] .sidebar-search input { padding: 9px 36px 9px 12px; }
[dir="rtl"] .search-input-wrap svg { left: auto; right: 10px; }
[dir="rtl"] .search-input-wrap input { padding: 8px 34px 8px 12px; }
[dir="rtl"] .topbar-right { margin-right: 0; margin-left: 8px; }
[dir="rtl"] .topbar-profile { margin-right: 0; margin-left: auto; }
[dir="rtl"] .dropdown-menu { left: auto; right: 0; }
[dir="rtl"] .dropdown-item { text-align: right; flex-direction: row-reverse; }
[dir="rtl"] .lang-item { text-align: right; }
[dir="rtl"] .filter-bar { flex-direction: row-reverse; }
[dir="rtl"] .filter-bar .btn-primary { order: -1; }
[dir="rtl"] .filter-bar .export-btn { order: -2; }
[dir="rtl"] .stat-label { text-align: right; }
[dir="rtl"] .table-wrap { direction: rtl; }
[dir="rtl"] .auth-card { text-align: right; }
[dir="rtl"] .form-group { text-align: right; }
[dir="rtl"] .modal-header { flex-direction: row-reverse; }
[dir="rtl"] .heatmap-legend { flex-direction: row-reverse; }
[data-theme="light"][dir="rtl"] #sidebar { border-left: 1px solid var(--border); }
[data-theme="light"][dir="rtl"] #topbar { direction: rtl; }

/* ===================================================
   MODERN DESIGN ENHANCEMENTS
   =================================================== */

/* Enhanced Stat Cards with Modern Gradients */
.stat-card {
  background: linear-gradient(145deg, var(--bg-card), var(--bg-sidebar));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

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

.stat-card:hover::before {
  transform: scaleX(1);
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Enhanced Dashboard Grid Layout */
.dash-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (min-width: 992px) {
  .dash-row {
    grid-template-columns: 2fr 1fr;
  }
}

/* Modern Card Design */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

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

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

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Modern Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-grad);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(91,108,255,0.4);
}

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

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

/* Enhanced Dropdown Menus */
.dropdown-menu {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
  padding: 8px;
  min-width: 200px;
}

.dropdown-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

/* Modern Form Elements */
.form-input, .form-select {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}

/* Enhanced Table Design */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  padding: 16px 20px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-sidebar);
}

.data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

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

/* Modern Badge Design */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary {
  background: rgba(91,108,255,0.15);
  color: var(--accent);
  border: 1px solid rgba(91,108,255,0.3);
}

.badge-success {
  background: rgba(34,197,94,0.15);
  color: var(--success);
  border: 1px solid rgba(34,197,94,0.3);
}

.badge-warning {
  background: rgba(249,115,22,0.15);
  color: var(--warning);
  border: 1px solid rgba(249,115,22,0.3);
}

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

/* Enhanced Modal Design */
.modal-overlay {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  max-width: 500px;
  width: 90%;
}

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

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Enhanced Toast Notifications */
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 400px;
}

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

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

.toast-warning {
  border-left: 4px solid var(--warning);
}

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

/* Enhanced Sidebar Design */
#sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 24px 0;
}

.sidebar-item {
  padding: 12px 24px;
  margin: 4px 16px;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}

.sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.sidebar-item.active {
  background: var(--bg-nav-active);
  color: var(--accent);
}

.sidebar-search {
  padding: 0 24px 24px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-search input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  border-radius: var(--radius);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

/* Enhanced Topbar Design */
#topbar {
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 0 24px;
  height: var(--topbar-h);
}

.topbar-logo-text {
  font-weight: 800;
  font-size: 1.25rem;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Enhanced Globe Visualization */
.world-map-box {
  background: radial-gradient(circle at 50% 42%, rgba(91,108,255,0.22), transparent 18%),
              radial-gradient(circle at 18% 18%, rgba(91,108,255,0.18), transparent 30%),
              radial-gradient(circle at 82% 22%, rgba(16,185,129,0.14), transparent 28%),
              radial-gradient(circle at 50% 100%, rgba(236,72,153,0.10), transparent 34%),
              linear-gradient(135deg, rgba(15,23,42,0.96), rgba(2,6,23,0.99));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 28px 80px -36px rgba(0,0,0,0.82);
  position: relative;
  width: 100%;
  min-height: 700px;
  height: clamp(700px, 78vw, 940px);
  overflow: hidden;
}

.map-tooltip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  padding: 16px;
  backdrop-filter: blur(10px);
  min-width: 250px;
}

/* Enhanced Performance Metrics Card */
#performance-metrics-card {
  animation: fadeInUp 0.5s ease;
}

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

/* Enhanced Auth Screen */
.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  padding: 40px;
  width: 100%;
  max-width: 450px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.auth-logo-text {
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-field {
  margin-bottom: 20px;
}

.auth-field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-primary);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--accent-grad);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-glow);
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(91,108,255,0.4);
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  
  .card-header {
    padding: 16px;
  }
  
  .data-table th,
  .data-table td {
    padding: 12px 16px;
  }
  
  .auth-card {
    padding: 30px 20px;
    margin: 20px;
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
  
  #topbar {
    padding: 0 16px;
  }
  
  .sidebar-search {
    padding: 0 16px 16px;
  }
  
  .sidebar-item {
    padding: 10px 16px;
    margin: 4px 12px;
  }
}

/* Enhanced Animations */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-fade-in {
  animation: fadeIn 0.3s ease;
}


/* Loading Animation for Stat Cards */
.stat-card.loading {
  position: relative;
  overflow: hidden;
}

.stat-card.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Enhanced Globe Loading State */
#globe-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-secondary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.globe-loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Enhanced Button Hover Effects */
.btn-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-icon:active {
  transform: translateY(0);
}

