/* =========================================================
   GEO-RESCUE — ULTRA VVIP / OBSIDIAN SNOW LUXURY DESIGN SYSTEM
   Edition: Obsidian Snow Signature
   Snow White · Pure White surfaces · Obsidian Midnight · Champagne Gold · Glacier Blue
   ========================================================= */

:root {
  color-scheme: light;

  /* --- Design Tokens from design.md Section 01 & 14 --- */
  --snow: #FFFAFA;
  --pure-white: #FFFFFF;
  --frost: #F4F7FA;
  --silver-mist: #E6EDF2;
  --line-light: #D7E1E8;
  --obsidian: #0B1117;
  --midnight: #101820;
  --deep-navy: #172A35;
  --slate: #334155;
  --steel: #526477;
  --muted: #64748B;
  --line-dark: #2A3944;
  --champagne: #F1D89A;
  --signature-gold: #C69214;
  --gold-hover: #A87508;
  --gold-wash: #F7EBCB;
  --glacier-blue: #0284C7;
  --glacier-wash: #E0F2FE;
  --deep-teal: #0F766E;
  --success: #166534;
  --success-wash: #DCFCE7;
  --warning: #92400E;
  --warning-wash: #FEF3C7;
  --danger: #991B1B;
  --danger-wash: #FEE2E2;

  --radius-card: 16px;
  --radius-control: 10px;
  --shadow-card: 0 8px 24px rgba(11, 17, 23, 0.07);

  /* Semantic surface aliases */
  --color-snow: var(--snow);
  --color-surface: var(--pure-white);
  --color-surface-soft: var(--frost);
  --color-navy: var(--deep-navy);
  --color-text-primary: var(--deep-navy);
  --color-text-secondary: var(--slate);
  --color-gold: var(--signature-gold);
  --color-gold-soft: var(--gold-wash);
  --color-blue: var(--glacier-blue);
  --color-blue-soft: var(--glacier-wash);
  --color-border: var(--line-light);
  --color-success: var(--success);
  --color-warning: var(--warning);
  --color-danger: var(--danger);
}

/* ---------- OBSIDIAN SNOW (Primary Signature System) ---------- */
:root,
[data-theme="light"] {
  --bg-primary: var(--snow);
  --bg-secondary: var(--pure-white);
  --bg-tertiary: var(--frost);
  --bg-card: var(--pure-white);
  --bg-panel: var(--pure-white);
  --bg-elevated: var(--pure-white);

  --accent-cyan: var(--glacier-blue);
  --accent-cyan-strong: #0369A1;
  --accent-blue: var(--glacier-blue);
  --accent-gold: var(--signature-gold);
  --accent-amber: var(--signature-gold);
  --accent-orange: var(--warning);
  --accent-red: var(--danger);
  --accent-green: var(--success);
  --accent-yellow: var(--signature-gold);
  --accent-purple: #6366F1;

  --text-primary: var(--deep-navy);
  --text-secondary: var(--slate);
  --text-muted: var(--steel);
  --text-dim: var(--muted);

  --border: var(--line-light);
  --border-strong: #CBD5E1;
  --border-gold: rgba(198, 146, 20, 0.35);

  --cyan-soft: var(--glacier-wash);
  --blue-soft: var(--glacier-wash);
  --orange-soft: var(--warning-wash);
  --green-soft: var(--success-wash);
  --red-soft: var(--danger-wash);
  --gold-soft: var(--gold-wash);

  --shadow-sm: 0 1px 3px rgba(11, 17, 23, 0.04);
  --shadow: 0 8px 24px rgba(11, 17, 23, 0.07);
  --shadow-lg: 0 16px 36px rgba(11, 17, 23, 0.10);
  --glow-cyan: none;
  --glow-gold: none;
  --glow-blue: none;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 20px;

  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;

  --sidebar-width: 260px;
  --topbar-height: 64px;

  /* MIDNIGHT OBSIDIAN SIDEBAR — Core Luxury Frame */
  --sidebar-bg: var(--midnight);
  --sidebar-text: #D5E0E8;
  --sidebar-text-active: var(--midnight);
  --sidebar-active-bg: var(--gold-wash);
  --sidebar-hover: var(--deep-navy);
  --sidebar-border: var(--line-dark);

  color-scheme: light;
}

/* ---------- DARK (Obsidian Command Theme) ---------- */
[data-theme="dark"] {
  --bg-primary: #0B1117;
  --bg-secondary: #101820;
  --bg-tertiary: #172A35;
  --bg-card: #101820;
  --bg-panel: #101820;
  --bg-elevated: #172A35;

  --accent-cyan: #38BDF8;
  --accent-cyan-strong: #0284C7;
  --accent-blue: #38BDF8;
  --accent-gold: var(--signature-gold);
  --accent-amber: var(--signature-gold);
  --accent-orange: #F59E0B;
  --accent-red: #F87171;
  --accent-green: #22C55E;
  --accent-yellow: var(--signature-gold);
  --accent-purple: #94A3B8;

  --text-primary: #FFFFFF;
  --text-secondary: #D5E0E8;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  --border: var(--line-dark);
  --border-strong: rgba(226, 232, 240, 0.20);
  --border-gold: rgba(241, 216, 154, 0.35);

  --cyan-soft: rgba(56, 189, 248, 0.12);
  --blue-soft: rgba(56, 189, 248, 0.12);
  --orange-soft: rgba(245, 158, 11, 0.12);
  --green-soft: rgba(34, 197, 94, 0.12);
  --red-soft: rgba(248, 113, 113, 0.12);
  --gold-soft: rgba(241, 216, 154, 0.14);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.40);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.50);
  --glow-cyan: none;
  --glow-gold: none;
  --glow-blue: none;

  --sidebar-bg: var(--obsidian);
  --sidebar-text: #D5E0E8;
  --sidebar-text-active: var(--midnight);
  --sidebar-active-bg: var(--gold-wash);
  --sidebar-hover: var(--deep-navy);
  --sidebar-border: var(--line-dark);

  color-scheme: dark;
}




/* =========================================================
   SVG ICONS — premium stroke set
   ========================================================= */

.geo-ico {
  display: inline-block;
  vertical-align: -0.2em;
  flex-shrink: 0;
}

.nav-item .icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: inherit;
  opacity: 0.9;
  transition: opacity .15s ease;
}

.nav-item .icon .geo-ico {
  width: 18px;
  height: 18px;
}

.nav-item.active .icon {
  opacity: 1;
}

.nav-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--accent-orange);
  color: #fff;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
  line-height: 1.3;
}

.user-role .geo-ico {
  vertical-align: -2px;
  opacity: 0.8;
}

/* =========================================================
   RESET
   ========================================================= */

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

html {
  scroll-behavior: smooth;
  background: var(--bg-primary);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: rgba(196, 165, 116, 0.25);
  color: var(--text-primary);
}

img { max-width: 100%; }

button, input, select, textarea { font: inherit; }
button { border: 0; }

a {
  color: #0284C7;
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--accent-cyan-strong); }

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-family: var(--font-display);
}

/* =========================================================
   BACKGROUND — subtle, no cyber grid
   ========================================================= */

.grid-bg {
  position: relative;
  background: var(--bg-primary);
}

.grid-bg::after,
body::before {
  display: none;
}

/* =========================================================
   SCROLLBAR
   ========================================================= */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--text-dim);
  border-radius: 99px;
  opacity: 0.5;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* =========================================================
   BUTTONS — solid, quiet, no shine
   ========================================================= */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease, color .15s ease;
}

.btn::after { display: none !important; content: none !important; }

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: var(--accent-gold);
}

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

.btn-primary {
  color: var(--midnight) !important;
  background: var(--signature-gold) !important;
  border: 1px solid var(--signature-gold) !important;
  box-shadow: 0 2px 8px rgba(198, 146, 20, 0.25);
  font-weight: 700 !important;
}
.btn-primary:hover {
  background: var(--gold-hover) !important;
  border-color: var(--gold-hover) !important;
  color: var(--midnight) !important;
  box-shadow: 0 4px 14px rgba(198, 146, 20, 0.35);
}

.btn-blue {
  color: #FFFFFF !important;
  background: var(--glacier-blue) !important;
  border: 1px solid var(--glacier-blue) !important;
  font-weight: 600 !important;
  border-radius: var(--radius-control);
}
.btn-blue:hover {
  background: #0369A1 !important;
  border-color: #0369A1 !important;
}

.btn-secondary {
  color: var(--deep-navy) !important;
  background: var(--pure-white) !important;
  border: 1px solid #CBD5E1 !important;
  font-weight: 600 !important;
}
.btn-secondary:hover {
  background: var(--frost) !important;
  border-color: var(--deep-navy) !important;
}

.btn-success {
  color: #fff !important;
  background: var(--success) !important;
  border-color: transparent !important;
}

.btn-danger {
  color: #fff !important;
  background: var(--danger) !important;
  border-color: transparent !important;
}

.btn-ghost {
  color: var(--slate) !important;
  background: transparent !important;
  border-color: var(--line-light) !important;
  box-shadow: none !important;
}
.btn-ghost:hover {
  color: var(--deep-navy) !important;
  background: var(--frost) !important;
}

.btn-lg { min-height: 48px; padding: 12px 24px; font-size: 0.95rem; }
.btn-sm { min-height: 32px; padding: 6px 12px; font-size: 0.78rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* =========================================================
   CARDS
   ========================================================= */

.card,
.zone-box,
.auth-card,
.profile-header {
  position: relative;
  background: var(--pure-white) !important;
  border: 1px solid var(--line-light) !important;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  color: var(--slate);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.card { padding: 24px; }

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

.card-glow {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-gold);
}

.card::before { display: none !important; content: none !important; }

/* =========================================================
   FORMS
   ========================================================= */

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

.form-label {
  display: block;
  margin-bottom: 7px;
  color: var(--deep-navy);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input,
.form-select,
textarea {
  width: 100%;
  padding: 12px 14px;
  color: var(--deep-navy) !important;
  background: var(--pure-white) !important;
  border: 1px solid #CBD5E1 !important;
  border-radius: var(--radius-control);
  box-shadow: none;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.form-input:hover,
.form-select:hover {
  border-color: var(--accent-gold);
}

.form-input:focus,
.form-select:focus,
textarea:focus {
  border-color: #0284C7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.form-input::placeholder { color: var(--text-dim); }

.form-select {
  appearance: none;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.checkbox-group input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-gold);
}

/* =========================================================
   BADGES / STATUS / PROGRESS
   ========================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-success {
  color: var(--success);
  background: var(--success-wash);
  border: 1px solid rgba(22, 101, 52, 0.2);
}
.badge-warning {
  color: var(--warning);
  background: var(--warning-wash);
  border: 1px solid rgba(146, 64, 14, 0.25);
}
.badge-danger {
  color: var(--danger);
  background: var(--danger-wash);
  border: 1px solid rgba(153, 27, 27, 0.2);
}
.badge-info {
  color: #075985;
  background: var(--glacier-wash);
  border: 1px solid rgba(7, 89, 133, 0.2);
}
.badge-locked {
  color: var(--steel);
  background: var(--silver-mist);
  border: 1px solid var(--line-light);
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  display: inline-block;
  border-radius: 50%;
}
.status-ready { background: var(--accent-green); box-shadow: none; }
.status-locked { background: var(--text-muted); }
.status-active { background: var(--accent-gold); box-shadow: none; animation: none; }

.progress-bar,
.xp-bar {
  width: 100%;
  height: 6px;
  overflow: hidden;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 999px;
}

.progress-fill {
  height: 100%;
  background: var(--accent-cyan);
  border-radius: inherit;
  box-shadow: none;
  transition: width .4s ease;
}

.xp-bar > div {
  height: 100%;
  background: var(--accent-gold);
  border-radius: inherit;
  box-shadow: none;
}

/* =========================================================
   ANIMATIONS — minimal
   ========================================================= */

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

.fade-in { animation: fadeIn .35s ease forwards; }
.slide-in { animation: slideIn .3s ease forwards; }

/* kill neon pulse */
@keyframes statusPulse { 0%,100% { opacity: 1; } }
@keyframes pulse-cyan { 0%,100% { box-shadow: none; } }
@keyframes countUp { from { opacity: 0; } to { opacity: 1; } }



.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg) !important;
  border-right: 1px solid var(--sidebar-border) !important;
  box-shadow: 4px 0 24px rgba(11, 17, 23, 0.18);
  transition: transform .28s ease;
}

.sidebar-header {
  min-height: 64px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--sidebar-border);
  background: var(--obsidian);
}

.sidebar-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(241, 216, 154, 0.35);
  border-radius: 9px;
  overflow: hidden;
  background: rgba(241, 216, 154, 0.1);
  box-shadow: 0 0 12px rgba(198, 146, 20, 0.15);
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 7px;
}

.sidebar-brand {
  color: #FFFFFF !important;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.sidebar-brand span {
  display: block;
  margin-top: 2px;
  color: var(--champagne) !important;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  margin: 3px 0 !important;
  padding: 9px 14px !important;
  color: #D5E0E8 !important;
  border-radius: 9px !important;
  font-size: 0.86rem;
  font-weight: 500;
  transition: all .15s ease !important;
  border-left: none !important;
}

.nav-item::after { display: none !important; content: none !important; }

.nav-item:hover {
  color: #FFFFFF !important;
  background: var(--deep-navy) !important;
}

.nav-item:hover .icon { transform: none; opacity: 1; color: var(--champagne); }

.nav-item.active {
  color: var(--midnight) !important;
  background: var(--gold-wash) !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  border-left: none !important;
}

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

.nav-item .icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  opacity: 0.85;
  transition: opacity .15s ease;
}

.nav-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--signature-gold);
  color: var(--midnight);
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: auto;
  line-height: 1.2;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--sidebar-border);
  background: var(--obsidian);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #172A35;
  border: 1px solid var(--line-dark);
}

.user-avatar,
.user-initial {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--midnight);
  background: var(--signature-gold);
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: none;
}

.user-details { min-width: 0; }

.user-details .user-name {
  overflow: hidden;
  color: #FFFFFF !important;
  font-size: 0.84rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-details .user-role {
  color: #D5E0E8 !important;
  font-size: 0.72rem;
  font-weight: 500;
}

.sidebar-footer .btn-ghost {
  color: #D5E0E8 !important;
  border: 1px solid var(--line-dark) !important;
  background: transparent !important;
  margin-top: 10px;
}
.sidebar-footer .btn-ghost:hover {
  color: #FFFFFF !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.main-content {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  background: var(--bg-primary);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: #FFFFFF !important;
  border-bottom: 1px solid #E2E8F0 !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: none;
}

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

.topbar-left h2,
.topbar-title {
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: -0.015em;
}

.topbar-title::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--accent-gold);
  vertical-align: middle;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-right .user-chip,
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}

.content-area {
  padding: 24px;
}


/* =========================================================
   MOBILE MENU
   ========================================================= */

.mobile-menu-btn {
  display: none;

  width: 38px;
  height: 38px;

  color: var(--text-primary);
  background: rgba(74,155,140,.05);

  border: 1px solid var(--border);
  border-radius: 9px;

  cursor: pointer;
}

.sidebar-overlay {
  display: none;

  position: fixed;
  inset: 0;

  z-index: 99;

  background: rgba(0,0,0,.62);

  backdrop-filter: blur(2px);
}

/* =========================================================
   PROFILE / STATS
   ========================================================= */

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;

  margin-bottom: 28px;
  padding: 22px;
}

.profile-avatar-lg {
  width: 72px;
  height: 72px;

  flex: 0 0 72px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 18px;

  background:
    linear-gradient(
      135deg,
      rgba(74,155,140,.95),
      rgba(91,124,141,.95)
    );

  color: #041017;

  font-size: 1.8rem;
  font-weight: 800;

  box-shadow:
    0 0 30px rgba(74,155,140,.15);
}

.profile-info h1 {
  margin-bottom: 3px;
  font-size: 1.5rem;
}

.profile-info .role {
  color: var(--accent-cyan);
  font-size: .76rem;
  font-weight: 600;
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;

  margin-top: 13px;
}

.stat-item {
  text-align: left;
}

.stat-value {
  color: var(--accent-cyan);

  font-family: var(--font-mono);

  font-size: 1.25rem;
  font-weight: 800;
}

.stat-label {
  color: var(--text-muted);

  font-size: .62rem;

  text-transform: uppercase;
  letter-spacing: .07em;
}

.stat-pill {
  display: inline-flex;
  align-items: center;

  padding: 5px 11px !important;

  color: var(--accent-cyan);

  background: rgba(74,155,140,.055) !important;

  border: 1px solid rgba(74,155,140,.17) !important;
  border-radius: 999px !important;

  font-size: .7rem !important;
  font-weight: 650;
}

.level-bar {
  max-width: 330px;
  margin-top: 15px;
}

.level-bar .label {
  display: flex;
  justify-content: space-between;

  margin-bottom: 6px;

  color: var(--text-secondary);

  font-family: var(--font-mono);

  font-size: .66rem;
}

/* =========================================================
   MISSION CARDS
   ========================================================= */

.mission-grid {
  display: grid;

  grid-template-columns:
    repeat(auto-fill,minmax(270px,1fr));

  gap: 17px;
}

.mission-card {
  position: relative;
  overflow: hidden;
  background: var(--pure-white) !important;
  border: 1px solid var(--line-light) !important;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  color: var(--slate);
  transition: all .25s ease;
}

.mission-card:hover:not(.locked) {
  transform: translateY(-4px);
  border-color: var(--glacier-blue) !important;
  box-shadow: 0 16px 36px rgba(11, 17, 23, 0.1);
}

.mission-card.locked {
  background: var(--frost) !important;
  border-color: var(--line-light) !important;
  color: var(--steel) !important;
  opacity: 1 !important;
  filter: none !important;
}

.mission-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px;
  background: var(--frost);
  border-bottom: 1px solid var(--line-light);
}

.mission-card-header .icon {
  font-size: 2rem;
  color: var(--deep-navy);
}

.mission-card-body {
  padding: 20px;
  background: var(--pure-white);
}

.mission-card-body h3 {
  color: var(--deep-navy) !important;
  margin-bottom: 6px;
  font-size: 1.05rem;
  font-weight: 700;
}

.mission-card-body p {
  color: var(--slate) !important;
  font-size: 0.86rem;
  line-height: 1.6;
  margin-bottom: 14px;
}

.mission-card-footer {
  padding: 0 20px 20px;
  background: var(--pure-white);
}

/* =========================================================
   FEATURED MISSION / COMMAND HERO
   ========================================================= */

.featured-mission {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
  padding: 32px 34px;
  overflow: hidden;
  background: linear-gradient(135deg, #0B1117 0%, #101820 50%, #15222E 100%) !important;
  border: 1px solid #233544 !important;
  border-radius: 18px;
  box-shadow: 0 16px 36px rgba(11, 17, 23, 0.22);
}

.featured-mission::after {
  content: 'ACTIVE MISSION';
  position: absolute;
  top: 14px;
  right: 20px;
  color: var(--champagne);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.featured-mission h2 {
  margin-bottom: 8px;
  font-size: 1.55rem;
  color: #FFFFFF !important;
  font-weight: 800;
}

.featured-mission .scenario {
  max-width: 650px;
  margin-bottom: 16px;
  color: #D5E0E8 !important;
  font-size: 0.92rem;
  line-height: 1.65;

  color: var(--text-secondary);

  font-size: .82rem;
}

/* =========================================================
   MAP PAGE
   ========================================================= */

.map-layout {
  display: grid;

  grid-template-columns: 270px minmax(0,1fr) 250px;

  width: 100%;
  height: calc(100vh - var(--topbar-height));

  gap: 0;
}

.map-panel {
  overflow-y: auto;

  padding: 18px;

  background:
    linear-gradient(
      180deg,
      rgba(10,23,34,.98),
      rgba(6,15,23,.98)
    );

  border-right: 1px solid var(--border);
}

.map-panel.right {
  border-right: 0;
  border-left: 1px solid var(--border);
}

.map-panel h3 {
  margin-bottom: 14px;

  color: var(--text-muted);

  font-family: var(--font-mono);

  font-size: .66rem;

  text-transform: uppercase;
  letter-spacing: .1em;
}

.map-canvas {
  position: relative;

  min-width: 0;

  background: #071019;

  overflow: hidden;
}

.map-container {
  position: relative;

  width: 100%;
  height: 100%;
}

.map-svg {
  width: 100%;
  height: 100%;
}

.layer-item {
  display: flex;
  align-items: center;
  gap: 9px;

  margin-bottom: 3px;
  padding: 9px 10px;

  border-radius: 8px;

  color: var(--text-secondary);

  font-size: .77rem;

  cursor: pointer;

  transition: .2s ease;
}

.layer-item:hover {
  color: var(--text-primary);
  background: rgba(74,155,140,.045);
}

.layer-item input {
  width: 15px;
  height: 15px;

  accent-color: var(--accent-cyan);
}

.layer-item label {
  flex: 1;
  cursor: pointer;
}

/* map controls */

.map-controls {
  position: absolute;

  left: 16px;
  bottom: 16px;

  z-index: 10;

  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-ctrl-btn {
  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--text-primary);

  background:
    rgba(8,19,29,.9);

  border: 1px solid var(--border);
  border-radius: 9px;

  cursor: pointer;

  backdrop-filter: blur(8px);

  transition: .2s ease;
}

.map-ctrl-btn:hover {
  color: var(--accent-cyan);

  border-color: rgba(74,155,140,.4);

  background: rgba(74,155,140,.08);
}

/* legend */

.legend {
  position: absolute;

  right: 16px;
  bottom: 16px;

  z-index: 10;

  padding: 12px 14px;

  background:
    rgba(8,19,29,.9);

  border: 1px solid var(--border);
  border-radius: 9px;

  backdrop-filter: blur(10px);
}

.legend h4 {
  margin-bottom: 8px;

  color: var(--text-muted);

  font-size: .62rem;

  text-transform: uppercase;
  letter-spacing: .08em;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;

  margin-bottom: 5px;

  color: var(--text-secondary);

  font-size: .7rem;
}

.legend-color {
  width: 12px;
  height: 12px;

  border-radius: 3px;
}

/* info */

.info-stat {
  margin-bottom: 9px;
  padding: 12px;

  background:
    rgba(255,255,255,.018);

  border: 1px solid var(--border);
  border-radius: 9px;
}

.info-stat .label {
  display: block;

  margin-bottom: 3px;

  color: var(--text-muted);

  font-size: .6rem;

  text-transform: uppercase;
  letter-spacing: .07em;
}

.info-stat .value {
  color: var(--accent-cyan);

  font-family: var(--font-mono);

  font-size: 1.15rem;
  font-weight: 800;
}

.info-stat .value.danger {
  color: var(--accent-red);
}

.info-stat .value.warning {
  color: var(--accent-orange);
}

/* =========================================================
   GEO MAP WRAPPER
   ========================================================= */

.geo-map-wrap {
  position: relative;

  width: 100%;

  margin-bottom: 18px;

  overflow: hidden;

  background:
    linear-gradient(
      180deg,
      #091522,
      #050c14
    );

  border: 1px solid rgba(74,155,140,.15) !important;
  border-radius: 15px !important;

  box-shadow:
    0 12px 40px rgba(0,0,0,.38),
    inset 0 0 60px rgba(74,155,140,.025);
}

.geo-map-wrap svg {
  display: block;

  width: 100%;
  height: auto;

  min-height: 260px;
}

.geo-map-zone {
  cursor: pointer;

  transition:
    filter .25s ease,
    stroke-width .25s ease;
}

.geo-map-zone:hover {
  filter: brightness(1.22);
  stroke: var(--accent-cyan);
  stroke-width: 2.5 !important;
}

.geo-map-zone.selected {
  filter: brightness(1.35);

  stroke: var(--accent-cyan) !important;
  stroke-width: 3 !important;

  animation: pulse-cyan 2s infinite;
}

.geo-map-label {
  color: #fff;

  fill: var(--text-primary);

  font-family: var(--font);

  font-size: 20px;
  font-weight: 800;

  letter-spacing: .015em;

  pointer-events: none;

  text-shadow:
    0 2px 8px rgba(0,0,0,.8);
}

.geo-map-hud {
  position: absolute;

  top: 11px;
  left: 11px;
  right: 11px;

  z-index: 5;

  padding: 8px 13px;

  color: var(--text-secondary);

  background:
    rgba(5,13,21,.84);

  border: 1px solid rgba(74,155,140,.16);
  border-radius: 9px;

  font-family: var(--font-mono);

  font-size: .68rem;

  backdrop-filter: blur(9px);

  pointer-events: none;
}

.geo-map-hud strong {
  color: var(--accent-cyan);
}

.geo-map-scanline {
  position: absolute;

  top: 0;
  left: 0;
  right: 0;

  height: 2px;

  z-index: 4;

  pointer-events: none;

  opacity: .55;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(74,155,140,.6),
      transparent
    );

  animation: scanMove 4s linear infinite;
}

@keyframes scanMove {
  0% {
    top: 0;
  }

  100% {
    top: 100%;
  }
}

.geo-map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;

  gap: 8px 15px;

  padding: 9px 13px;

  color: var(--text-secondary);

  background: rgba(5,13,21,.88);

  border-top: 1px solid rgba(74,155,140,.1);

  font-size: .65rem;
}

.geo-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.geo-map-legend i {
  width: 9px;
  height: 9px;

  display: inline-block;

  border-radius: 3px;

  box-shadow: 0 0 5px rgba(0,0,0,.35);
}

/* =========================================================
   TASK / MISSION SECTIONS
   ========================================================= */

.task-panel {
  margin-bottom: 22px;
  padding: 24px;
  background: var(--pure-white) !important;
  border: 1px solid var(--line-light) !important;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  color: var(--slate);
}

.task-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.task-header .num {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  color: var(--glacier-blue);
  background: var(--glacier-wash);
  border: 1px solid rgba(2, 132, 199, 0.2);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
}

.zone-options,
.shelter-options,
.route-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.option-card {
  padding: 18px;
  text-align: center;
  background: var(--frost) !important;
  border: 1px solid var(--line-light) !important;
  border-radius: 12px;
  color: var(--deep-navy);
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}

.option-card:hover {
  border-color: var(--glacier-blue) !important;
  background: var(--pure-white) !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.option-card.selected {
  color: var(--glacier-blue) !important;
  background: var(--glacier-wash) !important;
  border-color: var(--glacier-blue) !important;
}

.option-card.correct {
  border-color: var(--success) !important;
  background: var(--success-wash) !important;
  color: var(--success) !important;
}

.option-card.wrong {
  border-color: var(--danger) !important;
  background: var(--danger-wash) !important;
  color: var(--danger) !important;
}

.feedback-box {
  display: none;

  margin-top: 15px;
  padding: 13px 16px;

  border-radius: 9px;

  animation: fadeIn .35s ease;
}

.feedback-box.show {
  display: block;
}

.feedback-box.success {
  color: #4ade80;

  background: rgba(34,197,94,.07);

  border: 1px solid rgba(34,197,94,.2);
}

.feedback-box.warning {
  color: #facc15;

  background: rgba(234,179,8,.07);

  border: 1px solid rgba(234,179,8,.2);
}

.feedback-box.error {
  color: #f87171;

  background: rgba(239,68,68,.07);

  border: 1px solid rgba(239,68,68,.2);
}

/* =========================================================
   WHAT IF
   ========================================================= */

.slider-group {
  margin-bottom: 18px;
}

.slider-group label {
  display: flex;
  justify-content: space-between;

  margin-bottom: 8px;

  color: var(--text-secondary);

  font-size: .78rem;
}

.slider {
  width: 100%;
  height: 5px;

  appearance: none;

  background: #132532;

  border-radius: 999px;

  outline: none;
}

.slider::-webkit-slider-thumb {
  appearance: none;

  width: 17px;
  height: 17px;

  background: var(--accent-cyan);

  border: 2px solid #06121b;
  border-radius: 50%;

  cursor: pointer;

  box-shadow:
    0 0 12px rgba(74,155,140,.55);
}

.toggle-group {
  display: flex;
  gap: 7px;
}

.toggle-btn {
  flex: 1;

  padding: 9px;

  color: var(--text-secondary);

  background: rgba(4,13,21,.65);

  border: 1px solid var(--border);
  border-radius: 8px;

  cursor: pointer;

  font-size: .75rem;
  font-weight: 650;

  transition: .2s ease;
}

.toggle-btn.active {
  color: var(--accent-cyan);

  background: rgba(74,155,140,.07);

  border-color: rgba(74,155,140,.35);
}

.compare-box {
  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 10px;

  margin-top: 17px;
}

.compare-item {
  padding: 13px;

  text-align: center;

  background: rgba(4,13,21,.55);

  border-radius: 9px;
}

.compare-item .title {
  margin-bottom: 5px;

  color: var(--text-muted);

  font-size: .6rem;

  text-transform: uppercase;
}

/* =========================================================
   AI CHAT
   ========================================================= */

.ai-chat {
  display: flex;
  flex-direction: column;

  height: 420px;

  overflow: hidden;

  background:
    linear-gradient(
      145deg,
      rgba(13,28,41,.95),
      rgba(5,14,22,.95)
    );

  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.chat-messages {
  flex: 1;

  display: flex;
  flex-direction: column;
  gap: 10px;

  padding: 15px;

  overflow-y: auto;

  background-image:
    linear-gradient(
      rgba(74,155,140,.012) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(74,155,140,.012) 1px,
      transparent 1px
    );

  background-size: 28px 28px;
}

.chat-bubble {
  max-width: 82%;

  padding: 10px 13px;

  border-radius: 12px;

  font-size: .78rem;
  line-height: 1.55;
}

.chat-bubble.user {
  align-self: flex-end;

  color: #dffaff;

  background:
    linear-gradient(
      135deg,
      rgba(74,155,140,.13),
      rgba(91,124,141,.1)
    );

  border: 1px solid rgba(74,155,140,.14);

  border-bottom-right-radius: 4px;
}

.chat-bubble.ai {
  align-self: flex-start;

  color: var(--text-secondary);

  background: rgba(4,13,21,.75);

  border: 1px solid var(--border);

  border-bottom-left-radius: 4px;
}

.chat-input-area {
  display: flex;
  gap: 7px;

  padding: 10px;

  border-top: 1px solid var(--border);

  background: rgba(3,9,15,.75);
}

.chat-input-area input {
  flex: 1;
}

/* =========================================================
   RESULT / ASSESSMENT
   ========================================================= */

.score-display {
  text-align: center;
  margin: 30px 0;
}

.score-big {
  font-size: clamp(4rem,10vw,6rem);
  font-weight: 850;

  background:
    linear-gradient(
      135deg,
      var(--accent-cyan),
      var(--accent-blue),
      var(--accent-green)
    );

  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;

  animation: countUp .8s ease;
}

.score-breakdown {
  display: grid;

  grid-template-columns:
    repeat(auto-fit,minmax(150px,1fr));

  gap: 10px;

  margin: 22px 0;
}

.breakdown-item {
  padding: 15px;

  text-align: center;

  background: rgba(13,28,41,.8);

  border: 1px solid var(--border);
  border-radius: 10px;
}

.breakdown-item .pct {
  color: var(--accent-cyan);

  font-family: var(--font-mono);

  font-size: 1.35rem;
  font-weight: 800;
}

.breakdown-item .name {
  margin-top: 3px;

  color: var(--text-muted);

  font-size: .68rem;
}

/* =========================================================
   BADGES
   ========================================================= */

.badges-grid {
  display: grid;

  grid-template-columns:
    repeat(auto-fill,minmax(160px,1fr));

  gap: 15px;
}

.badge-card {
  position: relative;

  padding: 23px 14px;

  text-align: center;

  background:
    linear-gradient(
      145deg,
      rgba(13,28,41,.94),
      rgba(7,18,28,.94)
    );

  border: 1px solid var(--border);
  border-radius: var(--radius);

  transition: .25s ease;
}

.badge-card:hover {
  transform: translateY(-3px);

  border-color: rgba(74,155,140,.22);
}

.badge-card.unlocked {
  border-color: rgba(74,155,140,.2);

  box-shadow:
    inset 0 0 25px rgba(74,155,140,.025);
}

.badge-card.locked {
  opacity: .4;
  filter: grayscale(.8);
}

.badge-icon {
  margin-bottom: 10px;

  font-size: 2.7rem;

  filter:
    drop-shadow(0 0 10px rgba(74,155,140,.12));
}

.badge-name {
  color: var(--text-primary);

  font-size: .84rem;
  font-weight: 650;
}

/* =========================================================
   CERTIFICATE
   ========================================================= */

.certificate {
  position: relative;

  max-width: 720px;

  margin: 0 auto;

  padding: 46px;

  text-align: center;

  overflow: hidden;

  background:
    radial-gradient(
      circle at 50% 0,
      rgba(74,155,140,.08),
      transparent 40%
    ),
    linear-gradient(
      145deg,
      #102332,
      #07131e
    );

  border: 1px solid rgba(74,155,140,.5);
  border-radius: var(--radius-lg);

  box-shadow:
    0 0 60px rgba(74,155,140,.1),
    var(--shadow-lg);
}

.certificate::before {
  content: '';

  position: absolute;

  inset: 10px;

  border: 1px solid rgba(74,155,140,.12);
  border-radius: 12px;

  pointer-events: none;
}

.cert-logo {
  font-size: 3rem;
  margin-bottom: 13px;
}

.cert-title {
  margin-bottom: 6px;

  color: var(--accent-cyan);

  font-family: var(--font-mono);

  font-size: 1.25rem;

  text-transform: uppercase;
  letter-spacing: .15em;
}

.cert-subtitle {
  margin-bottom: 28px;

  color: var(--text-secondary);

  font-size: .8rem;
}

.cert-name {
  margin: 14px 0;

  color: var(--text-primary);

  font-size: 2rem;
  font-weight: 800;
}

.cert-desc {
  max-width: 430px;

  margin: 0 auto 28px;

  color: var(--text-secondary);

  font-size: .82rem;
}

.cert-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;

  gap: 35px;

  margin-top: 28px;
  padding-top: 21px;

  border-top: 1px solid var(--border);
}

.cert-meta-item {
  text-align: center;
}

.cert-meta-item .label {
  color: var(--text-muted);

  font-size: .58rem;

  text-transform: uppercase;
  letter-spacing: .08em;
}

.cert-meta-item .value {
  margin-top: 3px;

  color: var(--text-primary);

  font-size: .75rem;
  font-weight: 650;
}

/* =========================================================
   TEACHER DASHBOARD
   ========================================================= */

.stats-cards {
  display: grid;

  grid-template-columns:
    repeat(auto-fit,minmax(180px,1fr));

  gap: 13px;

  margin-bottom: 27px;
}

.stat-card {
  position: relative;

  padding: 20px;

  overflow: hidden;

  text-align: center;

  background: var(--pure-white) !important;
  border: 1px solid var(--line-light) !important;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.stat-card::after { display: none; }

.stat-card .value {
  position: relative;
  z-index: 1;
  color: var(--deep-navy) !important;
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
}

.stat-card .label {
  position: relative;
  z-index: 1;
  margin-top: 5px;
  color: var(--steel) !important;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* =========================================================
   TABLE
   ========================================================= */

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  font-size: 0.86rem;
  background: var(--pure-white);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-card);
}

.data-table th {
  padding: 13px 16px;
  color: var(--deep-navy) !important;
  background: var(--frost) !important;
  border-bottom: 2px solid var(--line-light) !important;
  font-family: var(--font-mono);
  font-size: 0.75rem !important;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.data-table td {
  padding: 13px 16px;
  color: var(--slate) !important;
  background: var(--pure-white);
  border-bottom: 1px solid var(--line-light);
  font-size: 0.86rem;
}

.data-table tbody tr {
  transition: .15s ease;
}

.data-table tbody tr:hover td {
  color: var(--deep-navy) !important;
  background: var(--frost) !important;
}

/* =========================================================
   INSIGHT
   ========================================================= */

.insight-box {
  margin-top: 20px;
  padding: 17px;

  background:
    linear-gradient(
      135deg,
      rgba(196,144,106,.07),
      rgba(196,144,106,.025)
    );

  border: 1px solid rgba(196,144,106,.18);
  border-radius: var(--radius);
}

.insight-box h4 {
  display: flex;
  align-items: center;
  gap: 7px;

  margin-bottom: 9px;

  color: var(--accent-orange);

  font-size: .85rem;
}

.insight-box ul {
  padding: 0;
  list-style: none;
}

.insight-box li {
  padding: 7px 0;

  color: var(--text-secondary);

  font-size: .75rem;

  border-bottom: 1px solid rgba(255,255,255,.035);
}

.insight-box li:last-child {
  border-bottom: 0;
}

/* =========================================================
   CHART
   ========================================================= */

.chart-placeholder {
  height: 250px;

  display: flex;
  align-items: flex-end;
  justify-content: center;

  gap: 12px;

  padding: 25px;

  background:
    linear-gradient(
      180deg,
      rgba(13,28,41,.85),
      rgba(6,15,23,.9)
    );

  border: 1px solid var(--border);
  border-radius: var(--radius);

  background-image:
    linear-gradient(
      rgba(74,155,140,.025) 1px,
      transparent 1px
    );

  background-size: 100% 40px;
}

.chart-bar {
  position: relative;

  width: 38px;

  background:
    linear-gradient(
      180deg,
      var(--accent-cyan),
      var(--accent-blue)
    );

  border-radius: 5px 5px 0 0;

  box-shadow:
    0 0 15px rgba(74,155,140,.12);

  transition: height .6s ease;
}

.chart-bar span {
  position: absolute;

  top: -22px;
  left: 50%;

  transform: translateX(-50%);

  color: var(--text-muted);

  font-family: var(--font-mono);
  font-size: .6rem;

  white-space: nowrap;
}

/* =========================================================
   TIMELINE
   ========================================================= */

.timeline {
  position: relative;

  padding-left: 27px;
}

.timeline::before {
  content: '';

  position: absolute;

  top: 0;
  bottom: 0;
  left: 7px;

  width: 1px;

  background:
    linear-gradient(
      var(--border),
      transparent
    );
}

.timeline-item {
  position: relative;

  padding-bottom: 22px;
}

.timeline-item::before {
  content: '';

  position: absolute;

  top: 4px;
  left: -24px;

  width: 10px;
  height: 10px;

  background: var(--accent-cyan);

  border: 2px solid var(--bg-primary);
  border-radius: 50%;

  box-shadow:
    0 0 8px rgba(74,155,140,.45);
}

.timeline-item.locked::before {
  background: var(--text-muted);
  box-shadow: none;
}

.timeline-item.in-progress::before {
  background: var(--accent-orange);

  box-shadow:
    0 0 10px rgba(196,144,106,.65);

  animation: statusPulse 1.5s infinite;
}

/* =========================================================
   BOTTOM NAV
   ========================================================= */

.bottom-nav {
  display: none;

  position: fixed;

  left: 0;
  right: 0;
  bottom: 0;

  z-index: 100;

  justify-content: space-around;

  padding: 7px 3px;

  background: color-mix(in srgb, var(--bg-primary) 94%, transparent);

  border-top: 1px solid var(--border);

  backdrop-filter: blur(12px);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;

  min-width: 58px;

  padding: 5px 8px;

  color: var(--text-muted);

  font-size: .58rem;
}

.bottom-nav a.active {
  color: var(--accent-cyan);
}

.bottom-nav .icon {
  font-size: 1.15rem;
}

/* =========================================================
   UTILITY
   ========================================================= */

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

.text-muted {
  color: var(--text-muted);
}

.text-cyan {
  color: var(--accent-cyan);
}

.text-orange {
  color: var(--accent-orange);
}

.mt-1 {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 16px;
}

.mt-3 {
  margin-top: 24px;
}

.mt-4 {
  margin-top: 32px;
}

.mb-2 {
  margin-bottom: 16px;
}

.mb-3 {
  margin-bottom: 24px;
}

.mb-4 {
  margin-bottom: 32px;
}

.flex {
  display: flex;
}

.gap-2 {
  gap: 12px;
}

.gap-3 {
  gap: 20px;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

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

.w-full {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* =========================================================
   RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 1100px) {

  :root {
    --sidebar-width: 235px;
  }

  .map-layout {
    grid-template-columns: 235px minmax(0,1fr);
  }

  .map-panel.right {
    display: none;
  }

  .content-area {
    padding: 23px;
  }

}

/* =========================================================
   RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 768px) {

  :root {
    --topbar-height: 60px;
  }

  body {
    font-size: 14px;
  }

  .sidebar {
    transform: translateX(-105%);
    box-shadow: 12px 0 40px rgba(0,0,0,.5);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .main-content {
    margin-left: 0;

    padding-bottom: 66px;
  }

  .mobile-menu-btn {
    display: flex;

    align-items: center;
    justify-content: center;
  }

  .topbar {
    padding: 0 14px;
  }

  .topbar-title {
    font-size: .82rem;
  }

  .topbar-title::before {
    display: none;
  }

  .topbar-right .user-chip {
    display: none;
  }

  .content-area {
    padding: 17px 13px;
  }

  .profile-header {
    align-items: flex-start;
    padding: 18px;
  }

  .profile-avatar-lg {
    width: 58px;
    height: 58px;
    flex-basis: 58px;

    font-size: 1.45rem;
    border-radius: 15px;
  }

  .profile-info h1 {
    font-size: 1.2rem;
  }

  .stats-row {
    gap: 14px;
  }

  .mission-grid {
    grid-template-columns: 1fr;
  }

  .featured-mission {
    grid-template-columns: 1fr;

    padding: 21px;

    gap: 16px;
  }

  .featured-mission::after {
    display: none;
  }

  .map-layout {
    display: flex;
    flex-direction: column;

    height: auto;
  }

  .map-panel {
    max-height: none;

    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .map-canvas {
    height: 430px;
    min-height: 430px;
  }

  .geo-map-wrap svg {
    min-height: 210px;
  }

  .geo-map-label {
    font-size: 16px;
  }

  .geo-map-legend {
    gap: 6px 10px;
    font-size: .6rem;
  }

  .auth-page {
    flex-direction: column;
  }

  .auth-left {
    padding: 20px 15px;
  }

  .auth-right {
    display: none;
  }

  .auth-card {
    padding: 27px 20px;
  }

  .hero-title,
  .landing-content h1 {
    font-size: clamp(2.5rem, 14vw, 4rem) !important;
  }

  .hero-tagline {
    font-size: .9rem;
  }

  .hero-buttons {
    width: 100%;

    flex-direction: column;

    margin-bottom: 40px;
  }

  .hero-buttons .btn {
    width: min(320px,100%);
  }

  .features {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .feature-card {
    padding: 18px 10px;
  }

  .feature-icon {
    font-size: 1.8rem;
  }

  .feature-title {
    font-size: .72rem;
  }

  .badges-grid {
    grid-template-columns: repeat(2,1fr);
    gap: 10px;
  }

  .badge-card {
    padding: 19px 10px;
  }

  .badge-icon {
    font-size: 2.25rem;
  }

  .score-big {
    font-size: 4rem;
  }

  .certificate {
    padding: 35px 20px;
  }

  .cert-name {
    font-size: 1.65rem;
  }

  .compare-box {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    display: flex;
  }

}

/* =========================================================
   RESPONSIVE — SMALL PHONE
   ========================================================= */

@media (max-width: 480px) {

  .features {
    grid-template-columns: 1fr;
  }

  .role-selector {
    grid-template-columns: 1fr;
  }

  .stats-cards {
    grid-template-columns: 1fr 1fr;
  }

  .score-breakdown {
    grid-template-columns: 1fr 1fr;
  }

  .zone-options,
  .shelter-options,
  .route-options {
    grid-template-columns: 1fr;
  }

  .task-panel {
    padding: 17px;
  }

  .geo-map-hud {
    font-size: .58rem;
  }

  .map-canvas {
    height: 360px;
    min-height: 360px;
  }

  .data-table {
    min-width: 620px;
  }

  .data-table-wrap {
    overflow-x: auto;
  }

}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

}

/* Icon containers on dashboard */
.quick-icon,
.mini-status-icon,
.active-icon,
.hero-stat .geo-ico {
  color: var(--accent-gold);
}

.quick-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--gold-soft);
  border: 1px solid var(--border-gold);
  color: var(--accent-gold);
}

.mini-status-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--bg-tertiary);
  color: var(--accent-gold);
}

.hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 900px) {
  .mobile-menu-btn { display: inline-flex !important; align-items: center; justify-content: center; }
}

/* =========================================================
   OBSIDIAN SNOW COMMAND HERO SYSTEM
   ========================================================= */

.obsidian-hero,
.command-hero {
  position: relative;
  overflow: hidden;
  padding: 32px 34px;
  margin-bottom: 28px;
  border: 1px solid #233544 !important;
  border-radius: 18px !important;
  background: linear-gradient(135deg, #0B1117 0%, #101820 50%, #15222E 100%) !important;
  box-shadow: 0 16px 36px rgba(11, 17, 23, 0.22), inset 0 1px 0 rgba(241, 216, 154, 0.15) !important;
}

.obsidian-hero h1,
.command-hero h1,
.obsidian-hero h2,
.command-hero h2 {
  color: #FFFFFF !important;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.obsidian-hero h1 span,
.command-hero h1 span,
.obsidian-hero h2 span,
.command-hero h2 span {
  color: var(--champagne) !important;
}

.obsidian-hero p,
.command-hero p,
.obsidian-hero .hero-subtitle,
.command-hero .hero-subtitle,
.obsidian-hero .hero-role,
.command-hero .hero-role {
  color: #D5E0E8 !important;
  font-size: 0.94rem;
  line-height: 1.6;
}

.obsidian-hero .eyebrow,
.command-hero .eyebrow,
.obsidian-hero .hero-kicker,
.command-hero .hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--champagne) !important;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.obsidian-hero .hero-stat,
.command-hero .hero-stat {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 8px 14px;
  color: #D5E0E8;
  font-size: 0.8rem;
  font-weight: 600;
}

.obsidian-hero .hero-stat strong,
.command-hero .hero-stat strong {
  color: #FFFFFF;
}

/* =========================================================
   RESPONSIVE VVIP — HP / TABLET / LAPTOP / MAC
   ========================================================= */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img, svg, video {
  max-width: 100%;
  height: auto;
}

/* Touch-friendly targets */
@media (pointer: coarse) {
  .nav-item,
  .btn,
  .btn-action,
  button {
    min-height: 44px;
  }
  .nav-item {
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

/* Large phones / small tablets */
@media (max-width: 640px) {
  .content-area {
    padding: 14px 12px !important;
  }
  .materi-hero h1 {
    font-size: 1.25rem !important;
  }
  .materi-grid,
  .quiz-row {
    grid-template-columns: 1fr !important;
  }
  .profile-grid {
    grid-template-columns: 1fr !important;
  }
  .stats-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
  .main-content {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
  .sidebar-footer,
  .topbar {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
}

/* Landscape phone */
@media (max-width: 900px) and (orientation: landscape) {
  .sidebar {
    width: 220px;
  }
  .topbar {
    height: 52px;
  }
}

/* High-DPI / Retina (Mac etc.) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .sidebar-logo img,
  .user-avatar,
  .profile-avatar-lg {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Prevent horizontal scroll on mobile */
@media (max-width: 768px) {
  body, .app-layout, .main-content {
    overflow-x: hidden;
    max-width: 100vw;
  }
  .content-area > * {
    max-width: 100%;
  }
  input, select, textarea {
    font-size: 16px !important; /* prevent iOS zoom on focus */
  }
}

/* Desktop / Mac large screens */
@media (min-width: 1400px) {
  .content-area {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* =========================================================
   MOBILE / APPLE — MENU TITIK TIGA + DRAWER SEPERTI DESKTOP
   ========================================================= */

.mobile-more-btn .more-dots {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 22px;
  height: 22px;
}
.mobile-more-btn .more-dots span {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

/* Tablet + HP: tampilkan tombol menu */
@media (max-width: 900px) {
  .mobile-menu-btn,
  .mobile-more-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    margin: 0;
    color: var(--text-primary, #101820);
    background: rgba(198, 146, 20, 0.08);
    border: 1px solid rgba(198, 146, 20, 0.35);
    border-radius: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    z-index: 20;
    flex-shrink: 0;
  }
  .mobile-menu-btn:active,
  .mobile-more-btn:active {
    background: rgba(198, 146, 20, 0.2);
    transform: scale(0.96);
  }

  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 86vw) !important;
    max-width: 300px;
    z-index: 200 !important;
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.45);
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.open {
    transform: translateX(0) !important;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 190 !important;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: none;
  }
  .sidebar-overlay.open {
    display: block !important;
  }

  .main-content {
    margin-left: 0 !important;
    width: 100%;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px !important;
    min-height: 56px;
  }
  .topbar-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem !important;
  }

  /* Nav items lebih mudah di-tap (Apple HIG ~44px) */
  .sidebar .nav-item {
    min-height: 48px !important;
    padding: 12px 16px !important;
    font-size: 0.95rem !important;
  }
  .sidebar-nav {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
  .sidebar-footer {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* iPhone notch / home indicator */
@supports (padding: max(0px)) {
  @media (max-width: 900px) {
    .sidebar {
      padding-top: env(safe-area-inset-top);
    }
  }
}

body.sidebar-drawer-open {
  overflow: hidden;
  touch-action: none;
}
