/* ==========================================================================
   Transport Tycoon — dark UI
   Hand-written styles so the game remains fully usable without Tailwind CDN.
   ========================================================================== */
.render-pending { position: relative; min-height: 240px; isolation: isolate; }
.render-pending::after { content: ''; position: absolute; inset: 0; z-index: 80; border-radius: 12px; background: rgba(15,23,42,.94); }
.render-pending::before { content: attr(data-loading-label); position: absolute; top: 52px; left: 50%; transform: translateX(-50%); z-index: 81; color: #22d3ee; font-weight: 600; padding: 20px; border-top: 3px solid #22d3ee; border-radius: 12px; background: #1f2937; }
.staff-layout > *, .staff-panel { min-width: 0; }
.staff-scroll { max-height: min(560px, 65vh); overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #475569 #111827; }
.staff-scroll:focus-visible { outline: 2px solid #22d3ee; outline-offset: -2px; }
.staff-scroll thead th { position: sticky; top: 0; background: #1f2937; z-index: 1; }
.staff-scroll .list-row { flex-wrap: wrap; gap: 8px; }
.staff-scroll .list-main { min-width: 140px; }
.staff-scroll .list-main b, .staff-scroll .list-main small { white-space: normal; overflow-wrap: anywhere; }
.staff-scroll td:last-child { white-space: normal; min-width: 150px; }
@media (max-width: 640px) { .staff-scroll { max-height: 60vh; } .staff-scroll .list-val { margin-left: auto; } }
:root {
  --bg: #070d19;
  --bg-soft: #0b1324;
  --panel: #0f172a;
  --panel-2: #131e33;
  --line: rgba(148, 163, 184, 0.13);
  --line-strong: rgba(148, 163, 184, 0.24);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --cyan: #22d3ee;
  --mint: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --violet: #a78bfa;
  --radius: 16px;
  --shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(34, 211, 238, 0.09), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(167, 139, 250, 0.07), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.font-display { font-family: "Space Grotesk", Inter, system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(34, 211, 238, 0.35); }
.hidden { display: none !important; }
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { scrollbar-width: none; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: #26344b transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #26344b; border-radius: 20px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- layout */
.glass, .panel {
  background: linear-gradient(180deg, rgba(19, 30, 51, 0.92), rgba(11, 19, 36, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.panel { box-shadow: none; }
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.panel-head h3 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.panel-head p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted-2); }
.panel-body { padding: 16px 18px; }
.panel-body.tight { padding: 10px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 0 0 16px; flex-wrap: wrap; }
.section-head h1 { margin: 0; font-family: "Space Grotesk", Inter, sans-serif; font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.section-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.section-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.text-muted { color: var(--muted); } .text-dim { color: var(--muted-2); }
.text-cyan { color: var(--cyan); } .text-mint { color: var(--mint); } .text-rose { color: var(--rose); } .text-amber { color: var(--amber); }
.text-xs { font-size: 11px; } .text-sm { font-size: 12.5px; } .text-lg { font-size: 18px; }
.font-semibold { font-weight: 600; } .font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; letter-spacing: .08em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 900;
  background: rgba(7, 13, 25, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.logo-mark {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  font-size: 23px; background: linear-gradient(145deg, rgba(34, 211, 238, .18), rgba(167, 139, 250, .12));
  border: 1px solid rgba(34, 211, 238, .28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 8px 24px -12px rgba(34, 211, 238, .5);
}
.logo-sm { width: 36px; height: 36px; border-radius: 11px; font-size: 19px; }

.status-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px; }
.stat-pill {
  display: flex; align-items: center; gap: 7px; padding: 5px 9px;
  background: rgba(15, 23, 42, .75); border: 1px solid var(--line); border-radius: 10px;
  min-width: max-content;
}
.stat-pill small { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted-2); line-height: 1.1; }
.stat-pill b { display: block; font-size: 12px; font-weight: 650; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat-ico { font-size: 14px; opacity: .9; }
.stat-pill.danger { border-color: rgba(251, 113, 133, .4); background: rgba(251, 113, 133, .08); }

.main-nav { border-top: 1px solid rgba(148, 163, 184, .07); }
.nav-item {
  display: inline-flex; align-items: center; gap: 7px; padding: 11px 12px 10px;
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); font-size: 12.5px; font-weight: 500; white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.nav-item span { font-size: 14px; filter: grayscale(.35); }
.nav-item em { font-style: normal; }
.nav-item:hover { color: var(--text); background: rgba(148, 163, 184, .05); }
.nav-item.active { color: var(--cyan); border-bottom-color: var(--cyan); background: linear-gradient(180deg, transparent, rgba(34, 211, 238, .07)); }
.nav-item.active span { filter: none; }
.nav-admin { color: var(--amber); }

.lang-switch { display: inline-flex; background: rgba(15, 23, 42, .8); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.lang-switch button {
  border: 0; background: none; color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  padding: 4px 7px; border-radius: 6px; letter-spacing: .04em;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.active { background: rgba(34, 211, 238, .14); color: var(--cyan); }

.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(15, 23, 42, .75); color: var(--muted);
  font-size: 15px; position: relative; transition: .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: rgba(30, 41, 59, .8); }
.badge-dot {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 20px; background: var(--rose); color: #1a0710; font-size: 9.5px; font-weight: 800;
  display: grid; place-items: center; border: 2px solid var(--bg);
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: rgba(30, 41, 59, .65); color: var(--text); font-size: 12.5px; font-weight: 600;
  transition: transform .1s, background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: rgba(51, 65, 85, .8); border-color: rgba(148, 163, 184, .35); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, #06b6d4, #0891b2); border-color: rgba(34, 211, 238, .5);
  color: #03242b; box-shadow: 0 8px 22px -12px rgba(34, 211, 238, .8);
}
.btn-primary:hover { background: linear-gradient(135deg, #22d3ee, #06b6d4); }
.btn-mint { background: linear-gradient(135deg, #34d399, #059669); border-color: rgba(52, 211, 153, .5); color: #022c22; }
.btn-mint:hover { background: linear-gradient(135deg, #6ee7b7, #10b981); }
.btn-danger { background: rgba(251, 113, 133, .13); border-color: rgba(251, 113, 133, .34); color: #fda4af; }
.btn-danger:hover { background: rgba(251, 113, 133, .22); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: rgba(148, 163, 184, .08); }
.btn-sm { padding: 6px 10px; font-size: 11.5px; border-radius: 8px; }
.btn-xs { padding: 4px 8px; font-size: 10.5px; border-radius: 7px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }

/* ---------------------------------------------------------------- forms */
.label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 6px; letter-spacing: .02em; }
.input {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: rgba(7, 13, 25, .65); color: var(--text); font-size: 13px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #475569; }
.input:focus { border-color: rgba(34, 211, 238, .6); box-shadow: 0 0 0 3px rgba(34, 211, 238, .11); }
.input:disabled { opacity: .55; }
select.input { 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='%2394a3b8' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }
textarea.input { min-height: 96px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 11px; color: var(--muted-2); margin-top: 5px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.check input { accent-color: var(--cyan); width: 15px; height: 15px; }
.range { width: 100%; accent-color: var(--cyan); }

/* ---------------------------------------------------------------- chips / badges */
.chip {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  padding: 4px 10px; font-size: 11px; font-weight: 500; color: var(--muted);
  background: rgba(148, 163, 184, .07); border: 1px solid var(--line);
}
.chip .dot, .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--mint); display: inline-block;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .13);
}
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  background: rgba(148, 163, 184, .1); color: var(--muted); border: 1px solid transparent;
}
.badge-active, .badge-ok, .badge-mint { background: rgba(52, 211, 153, .12); color: #6ee7b7; }
.badge-confirmed, .badge-info { background: rgba(34, 211, 238, .11); color: #67e8f9; }
.badge-paused, .badge-warn { background: rgba(251, 191, 36, .12); color: #fcd34d; }
.badge-grounded, .badge-danger, .badge-banned { background: rgba(251, 113, 133, .12); color: #fda4af; }
.badge-draft, .badge-idle { background: rgba(148, 163, 184, .1); color: #cbd5e1; }
.badge-premium { background: linear-gradient(135deg, rgba(167,139,250,.2), rgba(34,211,238,.16)); color: #c4b5fd; }
.badge-admin { background: rgba(251, 191, 36, .14); color: #fcd34d; }

/* ---------------------------------------------------------------- dashboard */
.hero { position: relative; overflow: hidden; border-radius: 20px; border: 1px solid var(--line); padding: 22px; background: linear-gradient(120deg, rgba(34,211,238,.12), rgba(167,139,250,.06) 50%, transparent); }
.hero h2 { margin: 0 0 4px; font-family: "Space Grotesk"; font-size: 22px; letter-spacing: -.03em; }
.hero p { margin: 0; color: var(--muted); font-size: 12.5px; }
.hero::after { content: "🌍"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 82px; opacity: .13; }

.kpi { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(160deg, rgba(19,30,51,.8), rgba(9,15,28,.8)); }
.kpi .k-label { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-2); }
.kpi .k-value { font-family: "Space Grotesk"; font-size: 20px; font-weight: 700; margin-top: 5px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.kpi.accent { border-color: rgba(34,211,238,.25); background: linear-gradient(160deg, rgba(34,211,238,.11), rgba(9,15,28,.8)); }

.list-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; }
.list-row:hover { background: rgba(148, 163, 184, .05); }
.list-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgba(148,163,184,.08); font-size: 15px; flex: none; }
.list-main { flex: 1; min-width: 0; }
.list-main b { display: block; font-size: 12px; font-weight: 600; }
.list-main small { display: block; font-size: 10.5px; color: var(--muted-2); }
.list-val { font-size: 12px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }

.chart-wrap { padding: 6px 8px 2px; }
.chart-legend { display: flex; gap: 14px; font-size: 10.5px; color: var(--muted); padding: 0 10px 4px; }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; display: inline-block; margin-right: 5px; }
svg.chart { width: 100%; height: 190px; overflow: visible; }
.chart-grid { stroke: rgba(148, 163, 184, .1); stroke-width: 1; }
.chart-line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { opacity: .14; }

.progress { height: 6px; background: rgba(148, 163, 184, .12); border-radius: 20px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, #22d3ee, #34d399); }
.progress.warn > i { background: linear-gradient(90deg, #fbbf24, #fb7185); }
.progress.thin { height: 4px; }

.milestone { display: flex; gap: 9px; align-items: center; padding: 8px 9px; border-radius: 9px; border: 1px solid transparent; }
.milestone.done { background: rgba(52, 211, 153, .06); border-color: rgba(52, 211, 153, .16); }
.milestone .m-ico { font-size: 19px; filter: grayscale(.6); opacity: .6; }
.milestone.done .m-ico { filter: none; opacity: 1; }
.milestone b { font-size: 11.5px; display: block; }
.milestone small { font-size: 10px; color: var(--muted-2); }

.event-card { border-left: 3px solid var(--amber); padding: 9px 11px; background: rgba(251, 191, 36, .05); border-radius: 0 9px 9px 0; }
.event-card.high, .event-card.critical { border-color: var(--rose); background: rgba(251, 113, 133, .05); }
.event-card.bonus { border-color: var(--mint); background: rgba(52, 211, 153, .05); }
.event-card b { font-size: 11.5px; display: block; }
.event-card small { font-size: 10px; color: var(--muted-2); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data th {
  text-align: left; font-size: 9.5px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted-2); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: rgba(7, 13, 25, .35);
}
table.data td { padding: 9px 10px; border-bottom: 1px solid rgba(148, 163, 184, .06); vertical-align: middle; }
table.data tr:hover td { background: rgba(148, 163, 184, .035); }
table.data tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .mono { font-family: "Space Grotesk", ui-monospace, monospace; font-size: 11px; }
.trend-up { color: var(--mint); } .trend-down { color: var(--rose); }

/* ---------------------------------------------------------------- fleet / routes */
.vehicle-card { border: 1px solid var(--line); border-radius: 14px; background: rgba(15, 23, 42, .6); overflow: hidden; transition: border-color .15s, transform .15s; }
.vehicle-card:hover { border-color: rgba(34, 211, 238, .3); transform: translateY(-1px); }
.vehicle-top { display: flex; gap: 11px; padding: 13px; align-items: flex-start; }
.vehicle-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: rgba(34, 211, 238, .09); border: 1px solid rgba(34, 211, 238, .14); }
.vehicle-title b { display: block; font-size: 13px; }
.vehicle-title small { color: var(--muted-2); font-size: 10.5px; }
.vehicle-meta { padding: 0 13px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px 10px; }
.meta-item small { display: block; font-size: 9.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .05em; }
.meta-item span { font-size: 11.5px; font-weight: 500; }
.vehicle-actions { display: flex; gap: 6px; padding: 9px 11px; border-top: 1px solid var(--line); flex-wrap: wrap; background: rgba(7, 13, 25, .3); }

.route-card { border: 1px solid var(--line); border-radius: 14px; padding: 13px; background: rgba(15, 23, 42, .6); display: flex; flex-direction: column; gap: 10px; }
.route-card.active { border-left: 3px solid var(--mint); }
.route-card.paused { border-left: 3px solid var(--amber); }
.route-card.confirmed { border-left: 3px solid var(--cyan); }
.route-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.route-path { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; }
.route-path .arrow { color: var(--muted-2); font-size: 11px; }
.route-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.route-stat small { display: block; font-size: 9px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .05em; }
.route-stat b { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.route-actions { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 9px; }
.select-check { accent-color: var(--cyan); width: 15px; height: 15px; }

.tabs { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; background: rgba(7, 13, 25, .6); border: 1px solid var(--line); flex-wrap: wrap; }
.tabs button { border: 0; background: none; color: var(--muted); padding: 6px 11px; border-radius: 7px; font-size: 11.5px; font-weight: 600; }
.tabs button:hover { color: var(--text); }
.tabs button.active { background: rgba(34, 211, 238, .13); color: var(--cyan); }

.empty { text-align: center; padding: 36px 18px; color: var(--muted-2); }
.empty .e-ico { font-size: 34px; opacity: .45; display: block; margin-bottom: 8px; }
.empty b { display: block; color: var(--muted); font-size: 13px; margin-bottom: 3px; }
.empty p { font-size: 11.5px; margin: 0; max-width: 340px; margin-inline: auto; }

/* ---------------------------------------------------------------- map */
.map-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; min-height: 620px; }
.map-layout > * { min-width: 0; }
.map-layer-controls { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border-bottom: 1px solid var(--line); background: #0f172a; }
.world-map-view .map-layer-controls button, .world-map-view #locFilters button { min-height: 44px; flex: 1 1 auto; }
.world-map-view .loc-row { min-height: 48px; }
.world-map-view .loc-row > span:nth-child(2) { flex: 1; min-width: 0; }
.world-map-view .loc-row small { overflow-wrap: anywhere; }
.world-map-view #locList { position: relative; overscroll-behavior: contain; }
.world-map-view button:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
[data-map-popup] .btn { min-height: 44px; white-space: normal; }
.world-map-view .leaflet-popup-close-button { min-width: 32px; min-height: 32px; }
.map-side { max-height: 700px; overflow: auto; }
#map { height: 700px; border-radius: var(--radius); overflow: hidden; background: #0a1322; border: 1px solid var(--line); }
.leaflet-container { background: #0a1322 !important; font-family: Inter, sans-serif; }
.leaflet-control-attribution { background: rgba(7,13,25,.75) !important; color: #64748b !important; font-size: 9px !important; }
.leaflet-control-attribution a { color: #94a3b8 !important; }
.leaflet-bar a { background: #101b2e !important; color: #cbd5e1 !important; border-color: #223049 !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #0f172a !important; color: #e2e8f0 !important; border: 1px solid #223049; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.leaflet-popup-content { margin: 11px 13px; font-size: 12px; line-height: 1.45; }
.leaflet-popup-content b { color: #67e8f9; }
.map-marker { display: grid; place-items: center; border-radius: 50%; font-size: 13px; background: #0f172a; border: 1.5px solid #22d3ee; box-shadow: 0 0 0 4px rgba(34,211,238,.13); }
.map-marker.hub { border-color: #34d399; box-shadow: 0 0 0 5px rgba(52,211,153,.18); }
.map-marker.port { border-color: #a78bfa; }
.map-marker.airport { border-color: #38bdf8; }
.loc-row { display: flex; gap: 9px; align-items: center; width: 100%; text-align: left; background: none; border: 0; color: inherit; padding: 7px 8px; border-radius: 9px; }
.loc-row:hover { background: rgba(148,163,184,.06); }
.loc-row.active { background: rgba(34,211,238,.09); }
.loc-ico { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: rgba(148,163,184,.08); font-size: 13px; flex: none; }
.loc-row b { display: block; font-size: 11.5px; }
.loc-row small { display: block; font-size: 9.5px; color: var(--muted-2); }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 10px; color: var(--muted-2); }

/* ---------------------------------------------------------------- modal / toast */
.modal { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 15, .78); backdrop-filter: blur(6px); }
.modal-panel {
  position: relative; width: 100%; max-width: 640px; max-height: 92vh; overflow: auto;
  background: linear-gradient(180deg, #121d31, #0b1324); border: 1px solid var(--line-strong);
  border-radius: 18px; box-shadow: 0 40px 100px -20px rgba(0,0,0,.9); padding: 20px;
  animation: modalIn .18s ease-out;
}
.modal-panel.wide { max-width: 940px; }
.modal-panel.narrow { max-width: 440px; }
.modal-close { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: rgba(7,13,25,.6); color: var(--muted); font-size: 12px; z-index: 2; }
.modal-close:hover { color: var(--text); }
.modal h3 { margin: 0 0 4px; font-family: "Space Grotesk"; font-size: 18px; letter-spacing: -.02em; padding-right: 30px; }
.modal .modal-sub { color: var(--muted-2); font-size: 11.5px; margin: 0 0 16px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

.toast-wrap { position: fixed; z-index: 3000; right: 14px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.toast {
  display: flex; gap: 9px; align-items: flex-start; padding: 11px 13px; border-radius: 11px;
  background: rgba(15, 23, 42, .97); border: 1px solid var(--line-strong); box-shadow: 0 16px 40px -12px rgba(0,0,0,.8);
  font-size: 12px; animation: toastIn .2s ease-out;
}
.toast.success { border-color: rgba(52,211,153,.35); }
.toast.error { border-color: rgba(251,113,133,.4); }
.toast { backdrop-filter: blur(12px); position: relative; overflow: hidden; }
.toast-msg { overflow-wrap: anywhere; }
.toast-close { flex: 0 0 auto; border: 0; background: transparent; color: var(--muted); padding: 2px; }
.toast-close:hover { color: var(--text); }
.toast .t-ico { font-size: 13px; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: rgba(34,211,238,.12); color: var(--cyan); font-weight: 800; flex: 0 0 auto; }
.toast.success .t-ico { background: rgba(52,211,153,.13); color: var(--mint); }
.toast.error .t-ico { background: rgba(251,113,133,.14); color: var(--rose); }
.toast.warning .t-ico { background: rgba(251,191,36,.14); color: var(--amber); }
.toast-body { flex: 1 1 auto; min-width: 0; }
.toast-caption { display: block; margin-top: 2px; font-size: 8.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted-2); }
.toast-progress { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; transform-origin: left; background: currentColor; opacity: .45; animation: toastProgress linear forwards; }
.toast.success .toast-progress { color: var(--mint); }
.toast.error .toast-progress { color: var(--rose); }
.toast.warning .toast-progress { color: var(--amber); }
@keyframes toastIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes toastProgress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------------------------------------------------------------- auth */
.auth-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.auth-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .32; }
.orb-a { width: 480px; height: 480px; background: #0891b2; top: -180px; right: -80px; }
.orb-b { width: 420px; height: 420px; background: #6d28d9; bottom: -160px; left: -120px; opacity: .22; }
.auth-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(148,163,184,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}
.auth-tab { border: 0; background: none; color: var(--muted); padding: 8px 10px; border-radius: 9px; font-size: 12.5px; font-weight: 600; }
.auth-tab.active { background: rgba(34, 211, 238, .13); color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(34,211,238,.16); }
.hero-stat { border: 1px solid var(--line); background: rgba(15, 23, 42, .55); border-radius: 13px; padding: 13px; }
.hero-stat .hero-icon { display: block; font-size: 18px; margin-bottom: 5px; }
.hero-stat b { display: block; font-family: "Space Grotesk"; font-size: 19px; line-height: 1.1; }
.hero-stat small { color: var(--muted-2); font-size: 10px; }

/* ---------------------------------------------------------------- promo / misc */
.promo-banner { background: linear-gradient(90deg, rgba(34,211,238,.16), rgba(167,139,250,.13)); border-bottom: 1px solid rgba(34,211,238,.18); }
.loading-bar { position: fixed; top: 0; left: 0; height: 2px; background: linear-gradient(90deg, #22d3ee, #a78bfa); z-index: 4000; animation: load 1s infinite ease-in-out; }
@keyframes load { 0% { width: 0; left: 0; } 50% { width: 70%; left: 15%; } 100% { width: 0; left: 100%; } }
.boot { position: fixed; inset: 0; z-index: 5000; display: grid; place-content: center; justify-items: center; gap: 10px; background: var(--bg); transition: opacity .3s; }
.boot-logo { font-size: 52px; animation: float 2.4s ease-in-out infinite; }
.boot-name { font-family: "Space Grotesk"; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.boot-name span { color: var(--cyan); }
.boot-bar { width: 180px; height: 3px; border-radius: 10px; background: rgba(148,163,184,.15); overflow: hidden; }
.boot-bar i { display: block; width: 40%; height: 100%; background: var(--cyan); border-radius: 10px; animation: boot 1.2s infinite ease-in-out; }
.boot p { font-size: 10.5px; color: var(--muted-2); }
@keyframes boot { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.mobile-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 950; display: none; background: rgba(8, 14, 27, .96); border-top: 1px solid var(--line); backdrop-filter: blur(16px); padding-bottom: env(safe-area-inset-bottom); }
.mobile-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; border: 0; background: none; color: var(--muted-2); font-size: 15px; }
.mobile-nav button span { font-size: 8.5px; font-weight: 600; }
.mobile-nav button.active { color: var(--cyan); }

.skeleton { background: linear-gradient(90deg, rgba(148,163,184,.07), rgba(148,163,184,.13), rgba(148,163,184,.07)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; height: 14px; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Notifications: one visual language for dashboard and inbox. */
.notif-card {
  display: flex; gap: 11px; padding: 12px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(15, 23, 42, .55);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.notif-card + .notif-card { margin-top: 8px; }
.notif-card:hover { border-color: rgba(148,163,184,.3); background: rgba(19,30,51,.75); }
.notif-card.unread {
  background: linear-gradient(100deg, rgba(34,211,238,.09), rgba(15,23,42,.55) 62%);
  border-color: rgba(34,211,238,.28);
}
.notif-card.compact { padding: 9px 10px; gap: 9px; }
.notif-card.compact .notif-ico { width: 28px; height: 28px; font-size: 14px; }
.notif-card.compact .notif-title { font-size: 11.5px; }
.notif-card.compact .notif-message { font-size: 10.5px; -webkit-line-clamp: 2; }
.notif-ico {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 17px;
  background: rgba(148,163,184,.08); border: 1px solid var(--line);
}
.notif-card.unread .notif-ico { background: rgba(34,211,238,.1); border-color: rgba(34,211,238,.2); }
.notif-title { font-size: 12.5px; line-height: 1.35; color: var(--text); }
.notif-message { margin: 3px 0 0; font-size: 11px; line-height: 1.5; color: var(--muted); }
.notif-card.compact .notif-meta { margin-top: 5px; }
.notif-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 8px; }
.notif-meta time { font-size: 9.5px; color: var(--muted-2); }
.notif-cat {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px;
  border-radius: 999px; border: 1px solid transparent;
  font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.notif-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; margin-top: 5px;
  background: var(--cyan); box-shadow: 0 0 0 4px rgba(34,211,238,.12);
}
.notif-filters {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.notif-filter {
  border: 1px solid var(--line); background: rgba(148,163,184,.05); color: var(--muted);
  border-radius: 999px; padding: 5px 10px; font-size: 10.5px; font-weight: 600;
  transition: color .15s, border-color .15s, background .15s;
}
.notif-filter span { opacity: .65; margin-left: 3px; }
.notif-filter:hover { color: var(--text); border-color: rgba(34,211,238,.35); }
.notif-filter.active { color: #67e8f9; background: rgba(34,211,238,.11); border-color: rgba(34,211,238,.35); }
.notif-list { padding-right: 2px; }
.notif-card.hidden { display: none; }

.faq details { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 7px; background: rgba(15,23,42,.5); }
.faq summary { cursor: pointer; padding: 10px 12px; font-size: 12px; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; color: var(--cyan); margin-right: 8px; font-weight: 700; }
.faq details[open] summary::before { content: "−"; }
.faq p { padding: 0 12px 12px 32px; margin: 0; font-size: 11.5px; color: var(--muted); }

.thread { border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; background: rgba(15,23,42,.55); cursor: pointer; transition: border-color .15s; }
.thread:hover { border-color: rgba(34,211,238,.3); }
.thread b { font-size: 12.5px; }
.thread small { color: var(--muted-2); font-size: 10px; }
.reply { border-left: 2px solid rgba(34,211,238,.25); padding: 8px 0 8px 12px; margin-top: 10px; }

.shop-card { border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(170deg, rgba(19,30,51,.8), rgba(9,15,28,.85)); padding: 15px; display: flex; flex-direction: column; gap: 9px; position: relative; overflow: hidden; }
.shop-card .sale-ribbon { position: absolute; top: 11px; right: -25px; transform: rotate(38deg); background: var(--rose); color: #2a0710; font-size: 8.5px; font-weight: 800; padding: 3px 26px; letter-spacing: .08em; }
.shop-ico { font-size: 28px; }
.shop-price { font-family: "Space Grotesk"; font-size: 17px; font-weight: 700; color: var(--cyan); }
.old-price { text-decoration: line-through; color: var(--muted-2); font-size: 11px; margin-left: 5px; font-family: Inter; font-weight: 400; }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.stat-box { background: rgba(7,13,25,.45); border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; }
.stat-box small { display: block; font-size: 9.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .06em; }
.stat-box b { font-size: 13px; font-variant-numeric: tabular-nums; }

.switch { position: relative; display: inline-block; width: 38px; height: 21px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #273449; border-radius: 20px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px; background: #94a3b8; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: rgba(34,211,238,.45); }
.switch input:checked + span::before { transform: translateX(17px); background: #e0fbff; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-layout { grid-template-columns: 260px minmax(0, 1fr); }
}
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .map-side { display: block; max-height: none; overflow: visible; }
  .world-map-view #locList { max-height: 240px !important; }
  #map { height: 560px; }
}
@media (max-width: 768px) {
  .world-map-view > .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-head h1 { font-size: 21px; }
  .section-head p { font-size: 11.5px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .kpi .k-value { font-size: 17px; }
  .stat-pill small { font-size: 8px; }
  .stat-pill b { font-size: 10.5px; }
  .stat-pill { padding: 4px 7px; }
  .main-nav { display: none; }
  .mobile-nav { display: flex; }
  main { padding-bottom: 88px !important; }
  .modal-panel { padding: 17px; max-height: 94vh; border-radius: 15px; }
  .route-stats { grid-template-columns: repeat(2, 1fr); }
  #map { height: 440px; }
  .hero { padding: 16px; }
  .hero::after { display: none; }
  .toast-wrap { left: 12px; right: 12px; max-width: none; bottom: 76px; }
  .detail-grid { grid-template-columns: 1fr; }
}
.buy-modal {
        display: flex;
        flex-direction: column;
        gap: 22px;
        color: var(--text, #e2e8f0);
      }
      .buy-header {
        display: flex;
        align-items: center;
        gap: 14px;
        padding-bottom: 18px;
        border-bottom: 1px solid var(--line, rgba(148,163,184,.15));
      }
      .buy-header-icon {
        display: grid;
        place-items: center;
        width: 52px;
        height: 52px;
        flex: 0 0 52px;
        border-radius: 15px;
        background: rgba(34,211,238,.09);
        border: 1px solid rgba(34,211,238,.2);
        font-size: 25px;
      }
      .buy-header h3 {
        margin: 0;
        font-size: 21px;
        font-weight: 750;
        letter-spacing: -.5px;
      }
      .buy-header .modal-sub {
        margin: 5px 0 0;
        font-size: 12px;
        line-height: 1.5;
      }
      .buy-section {
        display: flex;
        flex-direction: column;
        gap: 12px;
      }
      .buy-section-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
      }
      .buy-section-head > div {
        display: flex;
        align-items: center;
        gap: 9px;
      }
      .buy-step {
        display: grid;
        place-items: center;
        width: 27px;
        height: 27px;
        border-radius: 8px;
        background: rgba(34,211,238,.09);
        color: var(--cyan, #22d3ee);
        font-size: 10px;
        font-weight: 800;
      }
      .buy-section-head h4 {
        margin: 0;
        font-size: 13px;
        font-weight: 700;
      }
      .buy-section-hint {
        color: var(--text-dim, #94a3b8);
        font-size: 11px;
      }
      .buy-type-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 9px;
      }
      .buy-type {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 84px;
        padding: 12px 8px;
        border: 1px solid var(--line, rgba(148,163,184,.18));
        border-radius: 12px;
        background: rgba(148,163,184,.025);
        color: inherit;
        cursor: pointer;
        transition: border-color .15s, background .15s, transform .15s;
      }
      .buy-type:hover {
        border-color: rgba(34,211,238,.4);
        transform: translateY(-1px);
      }
      .buy-type.active {
        border-color: rgba(34,211,238,.65);
        background: rgba(34,211,238,.09);
        box-shadow: inset 0 0 0 1px rgba(34,211,238,.08);
      }
      .buy-type-icon { font-size: 24px; }
      .buy-type-label { font-size: 12px; font-weight: 650; }
      .buy-model-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        max-height: 250px;
        overflow: auto;
        padding: 1px 4px 1px 1px;
      }
      .buy-model-option {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 12px;
        border: 1px solid var(--line, rgba(148,163,184,.18));
        border-radius: 12px;
        background: rgba(148,163,184,.025);
        color: inherit;
        text-align: left;
        cursor: pointer;
        transition: border-color .15s, background .15s;
      }
      .buy-model-option:hover {
        border-color: rgba(34,211,238,.35);
      }
      .buy-model-option.selected {
        border-color: rgba(34,211,238,.65);
        background: rgba(34,211,238,.07);
        box-shadow: inset 0 0 0 1px rgba(34,211,238,.06);
      }
      .buy-model-radio {
        width: 16px;
        height: 16px;
        flex: 0 0 16px;
        accent-color: #22d3ee;
      }
      .buy-model-icon {
        display: grid;
        place-items: center;
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        border-radius: 10px;
        background: rgba(148,163,184,.08);
        font-size: 22px;
      }
      .buy-model-details {
        display: flex;
        flex: 1;
        flex-direction: column;
        gap: 5px;
        min-width: 0;
      }
      .buy-model-details b {
        font-size: 12px;
        font-weight: 700;
      }
      .buy-model-details small {
        color: var(--text-dim, #94a3b8);
        font-size: 10px;
        line-height: 1.5;
      }
      .buy-model-price {
        font-size: 12px;
        font-weight: 750;
        color: var(--cyan, #22d3ee);
        white-space: nowrap;
      }
      .buy-empty {
        padding: 24px 12px;
        border: 1px dashed var(--line, rgba(148,163,184,.2));
        border-radius: 12px;
        color: var(--text-dim, #94a3b8);
        font-size: 12px;
        text-align: center;
      }
      .buy-config-grid,
      .buy-config-fields {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
      }
      .buy-config-grid > .full,
      .buy-config-fields > .full {
        grid-column: 1 / -1;
      }
      .buy-field {
        display: flex;
        flex-direction: column;
        gap: 6px;
        min-width: 0;
      }
      .buy-config-panel {
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding: 14px;
        border: 1px solid var(--line, rgba(148,163,184,.15));
        border-radius: 12px;
        background: rgba(148,163,184,.025);
      }
      .buy-config-title {
        display: flex;
        align-items: center;
        gap: 10px;
      }
      .buy-config-title > span {
        display: grid;
        place-items: center;
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        border-radius: 9px;
        background: rgba(148,163,184,.08);
        font-size: 17px;
      }
      .buy-config-title > div {
        display: flex;
        flex-direction: column;
        gap: 3px;
      }
      .buy-config-title b { font-size: 12px; }
      .buy-config-title small {
        color: var(--text-dim, #94a3b8);
        font-size: 10px;
      }
      .buy-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding-top: 16px;
        border-top: 1px solid var(--line, rgba(148,163,184,.15));
      }
      .buy-total {
        display: flex;
        flex-direction: column;
        gap: 5px;
        min-width: 0;
      }
      .buy-total > span {
        color: var(--text-dim, #94a3b8);
        font-size: 10px;
      }
      .buy-total > b {
        max-width: 240px;
        overflow: hidden;
        font-size: 13px;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .buy-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        flex-shrink: 0;
      }
.buy-model-image-wrap {
    width: 56px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    background: #eff6ff;
}

.buy-model-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.buy-model-icon-fallback {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: #eff6ff;
    border-radius: 10px;
}
      @media (max-width: 560px) {
        .buy-modal { gap: 17px; }
        .buy-header h3 { font-size: 18px; }
        .buy-section-hint { display: none; }
        .buy-model-option { gap: 8px; padding: 9px; }
        .buy-model-icon { width: 34px; height: 34px; flex-basis: 34px; font-size: 19px; }
        .buy-model-price { font-size: 10px; }
        .buy-footer { align-items: stretch; flex-direction: column; }
        .buy-actions { width: 100%; }
        .buy-actions .btn { flex: 1; }
      }

@media (min-width: 769px) and (max-width: 1024px) {
  .status-strip { max-width: 480px; }
}
@media (hover: none) {
  .vehicle-card:hover { transform: none; }
}
