:root {
  --bg:        #080808;
  --surface:   #101014;
  --surface2:  #18181e;
  --surface3:  #202028;
  --line:      #252530;
  --text:      #f0f0f5;
  --muted:     #88889a;
  --dim:       #50505e;
  --accent:    #7c5cbf;
  --accent2:   #9b7de8;
  --accent-bg: rgba(124,92,191,.12);
  --accent-glow: 0 0 20px rgba(124,92,191,.35);
  --green:     #3ecf8e;
  --yellow:    #f5c842;
  --red:       #e05a5a;
  --blue:      #5b9cf6;
  --radius:    14px;
  --shadow:    0 16px 48px rgba(0,0,0,.7);
  --ease:      cubic-bezier(.22,1,.36,1);
  --sans:      "Manrope", -apple-system, "SF Pro Display", Roboto, system-ui, sans-serif;
  --nav-h:     62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-feature-settings: "ss01","cv01";
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
svg { display: block; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ═══ ANIMATIONS ═══ */
@keyframes fadeUp  { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes popIn   { from { opacity:0; transform:scale(.93); } to { opacity:1; transform:scale(1); } }
@keyframes sheetUp { from { transform:translateY(50px); opacity:.2; } to { transform:none; opacity:1; } }
@keyframes spin    { to { transform:rotate(360deg); } }
@keyframes scanLine { 0%,100% { top:0; } 50% { top:calc(100% - 3px); } }
@keyframes glowPulse {
  0%,100% { box-shadow: 0 0 12px rgba(124,92,191,.2); }
  50%      { box-shadow: 0 0 28px rgba(124,92,191,.55); }
}
@keyframes battPulse { 0%,100% { opacity:.35; } 50% { opacity:.9; } }

/* ═══ SPLASH ═══ */
.splash {
  position: fixed; inset: 0; z-index: 999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: var(--bg);
}
.splash-logo {
  width: 72px; height: 72px; border-radius: 22px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff; font-weight: 900; font-size: 36px;
  display: grid; place-items: center;
  animation: glowPulse 2s ease-in-out infinite;
}
.splash-label { font-size: 22px; font-weight: 800; letter-spacing: .4px; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent2);
  animation: spin .8s linear infinite;
}

/* ═══ APP LAYOUT ═══ */
.app {
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  max-width: 600px; margin: 0 auto;
  position: relative; overflow: hidden;
}

/* ═══ TAB PAGES ═══ */
.tab-page {
  display: none; flex-direction: column;
  flex: 1; overflow: hidden;
}
.tab-page.active { display: flex; }

/* ═══ BOTTOM NAV ═══ */
.bottom-nav {
  height: var(--nav-h);
  background: rgba(8,8,8,.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: flex; align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom);
  flex-shrink: 0; z-index: 50;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--dim); transition: color .2s;
  font-size: 10px; font-weight: 600; letter-spacing: .3px;
  padding-top: 6px;
}
.nav-btn.active { color: var(--accent2); }
.nav-btn:active { opacity: .7; }
.nav-btn svg { transition: stroke .2s; }

/* ═══ PAGE HEADER ═══ */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  flex-shrink: 0;
}
.page-title { font-size: 20px; font-weight: 800; }

/* ═══ ICON BTN ═══ */
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  display: grid; place-items: center;
  transition: color .2s, border-color .2s, transform .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--dim); }
.icon-btn:active { transform: scale(.9); }

/* ═══ MAP TAB ═══ */
.map-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 8px; flex-shrink: 0;
  background: rgba(8,8,8,.9); backdrop-filter: blur(14px);
  position: relative; z-index: 10;
}
.map-brand { display: flex; align-items: center; gap: 11px; }
.logo {
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff; font-weight: 900; font-size: 18px;
  display: grid; place-items: center;
  animation: glowPulse 3s ease-in-out infinite;
}
.brand-title { font-weight: 800; font-size: 17px; letter-spacing: .3px; }
.brand-sub { font-size: 11.5px; color: var(--muted); }

.filter-scroll {
  display: flex; gap: 7px; padding: 6px 16px 8px;
  overflow-x: auto; flex-shrink: 0;
  scrollbar-width: none; z-index: 10; position: relative;
}
.filter-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 6px 13px; border-radius: 20px;
  background: var(--surface2); border: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px; font-weight: 600;
  transition: all .2s; white-space: nowrap;
}
.chip.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent2); }
.chip:active { transform: scale(.94); }

.leaflet-map { flex: 1; z-index: 1; }
/* Override leaflet ui for dark */
.leaflet-control-zoom a { background: var(--surface2) !important; color: var(--text) !important; border-color: var(--line) !important; }
.leaflet-popup-content-wrapper { background: var(--surface2) !important; color: var(--text) !important; box-shadow: var(--shadow) !important; border: 1px solid var(--line) !important; border-radius: 12px !important; }
.leaflet-popup-tip { background: var(--surface2) !important; }

.map-stats {
  padding: 8px 16px 6px; background: rgba(8,8,8,.88);
  backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap;
  flex-shrink: 0; z-index: 10;
}
.map-stats span { display: flex; align-items: center; gap: 4px; }
.map-stat-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ═══ SCOOTERS TAB ═══ */
.sc-search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
  padding: 0 12px; margin: 0 16px 8px;
  transition: border-color .2s;
}
.sc-search-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,191,.15); }
.sc-search-ico { color: var(--dim); flex-shrink: 0; }
.sc-search-wrap input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 15px; padding: 11px 0; }
.sc-search-wrap input::placeholder { color: var(--dim); }
.scan-mini {
  color: var(--muted); padding: 6px; margin-right: -4px; border-radius: 8px;
  display: grid; place-items: center; transition: color .2s, transform .15s;
}
.scan-mini:active { transform: scale(.88); color: var(--accent2); }

.sort-row {
  display: flex; gap: 6px; padding: 0 16px 8px; overflow-x: auto; flex-shrink: 0;
  scrollbar-width: none;
}
.sort-row::-webkit-scrollbar { display: none; }
.sort-btn {
  flex-shrink: 0; padding: 5px 12px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); font-size: 12px; font-weight: 600;
  transition: all .2s; white-space: nowrap;
}
.sort-btn.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent2); }

.sc-list { flex: 1; overflow-y: auto; padding: 0 16px 12px; }
.sc-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 8px; cursor: pointer; transition: border-color .2s, transform .15s;
  animation: fadeUp .35s var(--ease) both;
}
.sc-item:active { transform: scale(.98); border-color: var(--dim); }
.sc-pin {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
}
.pin-available { background: rgba(62,207,142,.12); color: var(--green); }
.pin-active    { background: rgba(91,156,246,.12); color: var(--blue); }
.pin-error     { background: rgba(224,90,90,.12);  color: var(--red); }
.pin-offline   { background: rgba(80,80,94,.12);   color: var(--dim); }
.pin-low       { background: rgba(245,200,66,.12); color: var(--yellow); }
.sc-info { flex: 1; min-width: 0; }
.sc-id { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-line { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.batt-wrap { display: flex; align-items: center; gap: 5px; }
.batt { width: 26px; height: 13px; border-radius: 3px; border: 1.5px solid var(--dim); position: relative; }
.batt::after { content:''; position:absolute; right:-5px; top:50%; transform:translateY(-50%); width:3px; height:6px; background:var(--dim); border-radius:0 1px 1px 0; }
.batt-fill { height: 100%; border-radius: 1.5px; background: var(--green); transition: width .3s; }
.batt-fill.mid { background: var(--yellow); }
.batt-fill.low { background: var(--red); animation: battPulse 1.4s ease-in-out infinite; }
.batt-pct { font-size: 11.5px; color: var(--muted); font-weight: 600; }

/* ═══ RENTALS TAB ═══ */
.rental-search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
  padding: 0 12px; margin: 0 16px 14px;
  transition: border-color .2s;
}
.rental-search-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,191,.15); }
.rental-search-wrap input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 15px; padding: 12px 0; }
.rental-search-wrap input::placeholder { color: var(--dim); }
.btn-primary-sm {
  padding: 7px 14px; border-radius: 9px; flex-shrink: 0;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700;
  transition: opacity .2s, transform .15s;
}
.btn-primary-sm:active { opacity: .8; transform: scale(.95); }

.rental-result { flex: 1; overflow-y: auto; padding: 0 16px; }
.rental-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; animation: fadeUp .3s var(--ease);
}
.rental-card-title {
  font-size: 13px; font-weight: 600; color: var(--accent2); text-transform: uppercase;
  letter-spacing: .8px; margin-bottom: 14px;
}
.rental-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rental-row:last-child { border-bottom: none; }
.rental-key { font-size: 13px; color: var(--muted); }
.rental-val { font-size: 13.5px; font-weight: 600; text-align: right; max-width: 55%; word-break: break-all; }
.rental-empty {
  text-align: center; padding: 50px 20px; color: var(--muted); font-size: 14px;
}

/* ═══ CONTROL TAB ═══ */
.ctrl-search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
  padding: 0 12px; margin: 0 16px 10px;
  transition: border-color .2s;
}
.ctrl-search-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,191,.15); }
.ctrl-search-wrap input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 15px; padding: 12px 0; }
.ctrl-search-wrap input::placeholder { color: var(--dim); }

.ctrl-vehicle-info { padding: 0 16px 8px; min-height: 60px; }
.ctrl-veh-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; align-items: center; gap: 12px;
  animation: fadeUp .25s var(--ease);
}
.ctrl-veh-icon {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--accent-bg); color: var(--accent2);
}
.ctrl-veh-name { font-size: 16px; font-weight: 800; }
.ctrl-veh-status { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.ctrl-actions {
  padding: 0 16px 10px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.ctrl-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 14px 10px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  transition: all .2s;
}
.ctrl-btn svg { color: var(--muted); transition: color .2s; }
.ctrl-btn:active { transform: scale(.96); opacity: .8; }
.ctrl-btn.hero { grid-column: span 2; flex-direction: row; gap: 10px; font-size: 14px; padding: 16px; }
.ctrl-btn.accent { background: var(--accent-bg); border-color: var(--accent); color: var(--accent2); }
.ctrl-btn.accent svg { color: var(--accent2); }
.ctrl-btn.green-btn { background: rgba(62,207,142,.1); border-color: rgba(62,207,142,.4); color: var(--green); }
.ctrl-btn.green-btn svg { color: var(--green); }
.ctrl-btn.red-btn { background: rgba(224,90,90,.1); border-color: rgba(224,90,90,.35); color: var(--red); }
.ctrl-btn.red-btn svg { color: var(--red); }
.ctrl-btn:disabled { opacity: .45; pointer-events: none; }

.ctrl-inventory-section { flex: 1; overflow-y: auto; padding: 0 16px 12px; }
.section-label { font-size: 12px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; }
.ctrl-inv-list { display: flex; flex-direction: column; gap: 8px; }
.inv-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; animation: fadeUp .3s var(--ease);
}
.inv-item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.inv-sc-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-bg); color: var(--accent2); display: grid; place-items: center; flex-shrink: 0; }
.inv-sc-info { flex: 1; }
.inv-sc-num { font-size: 14px; font-weight: 700; }
.inv-sc-ago { font-size: 12px; color: var(--muted); margin-top: 1px; }
.inv-release-btn {
  width: 100%; padding: 10px; border-radius: 10px;
  background: rgba(62,207,142,.1); border: 1px solid rgba(62,207,142,.35); color: var(--green);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: opacity .2s, transform .15s;
}
.inv-release-btn:active { opacity: .75; transform: scale(.97); }
.inv-release-btn:disabled { opacity: .45; pointer-events: none; }

/* ═══ PROFILE TAB ═══ */
.profile-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  margin: 0 16px 14px; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.profile-av {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--accent-bg); border: 2px solid var(--accent);
  color: var(--accent2); font-size: 28px; font-weight: 800;
  display: grid; place-items: center;
}
.profile-name { font-size: 18px; font-weight: 800; }
.profile-phone { font-size: 13px; color: var(--muted); }
.profile-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.profile-section { margin: 0 16px 12px; }
.profile-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 14px; color: var(--muted);
}

/* ═══ SHEET OVERLAY ═══ */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .2s;
}
.sheet {
  background: var(--surface); width: 100%; max-width: 600px;
  border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom);
  max-height: 88vh; display: flex; flex-direction: column;
  animation: sheetUp .3s var(--ease);
}
.sheet-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--dim); margin: 10px auto 4px; flex-shrink: 0;
}
.sheet-head {
  display: flex; align-items: center; padding: 12px 16px 10px;
  border-bottom: 1px solid var(--line); flex-shrink: 0; gap: 10px;
}
.sheet-title { font-size: 16px; font-weight: 800; flex: 1; }
.sheet-close {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--surface2); color: var(--muted);
  display: grid; place-items: center; transition: color .2s, transform .15s;
}
.sheet-close:active { transform: scale(.88); }
.sheet-body { flex: 1; overflow-y: auto; padding: 14px 16px 18px; }

/* Vehicle sheet content */
.veh-stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px;
}
.veh-stat {
  background: var(--surface2); border: 1px solid var(--line); border-radius: 11px;
  padding: 11px 13px;
}
.veh-stat-val { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.veh-stat-key { font-size: 11.5px; color: var(--muted); }
.veh-errors {
  background: rgba(224,90,90,.08); border: 1px solid rgba(224,90,90,.25); border-radius: 11px;
  padding: 10px 13px; margin-bottom: 14px;
}
.veh-errors-title { font-size: 12px; color: var(--red); font-weight: 700; margin-bottom: 6px; }
.veh-error-tag {
  display: inline-block; padding: 3px 9px; border-radius: 6px;
  background: rgba(224,90,90,.1); color: var(--red); font-size: 12px; font-weight: 600;
  margin: 2px; border: 1px solid rgba(224,90,90,.2);
}
.sheet-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.sheet-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 13px 8px; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--muted);
  transition: all .2s;
}
.sheet-btn:active { transform: scale(.95); opacity: .8; }
.sheet-btn.hero { grid-column: span 2; flex-direction: row; justify-content: center; gap: 10px; font-size: 14px; padding: 15px; }
.sheet-btn.accent-btn { background: var(--accent-bg); border-color: var(--accent); color: var(--accent2); }
.sheet-btn.green-btn { background: rgba(62,207,142,.1); border-color: rgba(62,207,142,.4); color: var(--green); }
.sheet-btn.red-btn { background: rgba(224,90,90,.1); border-color: rgba(224,90,90,.35); color: var(--red); }
.sheet-btn:disabled { opacity: .45; pointer-events: none; }
.sheet-map-link {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px; border-radius: 10px;
  background: var(--surface2); border: 1px solid var(--line);
  color: var(--muted); font-size: 13px; font-weight: 600;
  margin-bottom: 12px; transition: color .2s, border-color .2s;
}
.sheet-map-link:active { opacity: .75; }

/* ═══ QR SCANNER ═══ */
.scan-card {
  background: var(--surface); width: 100%; max-width: 600px; border-radius: 22px 22px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  animation: sheetUp .3s var(--ease);
}
.scan-head {
  display: flex; align-items: center; padding: 14px 16px 10px; gap: 10px;
  border-bottom: 1px solid var(--line);
}
.scan-title { flex: 1; font-size: 16px; font-weight: 700; text-align: center; }
.modal-close {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--surface2); color: var(--muted);
  display: grid; place-items: center; transition: transform .15s;
}
.modal-close:active { transform: scale(.88); }
.scan-body { padding: 16px; }
.scan-viewport {
  position: relative; border-radius: 16px; overflow: hidden;
  aspect-ratio: 4/3; background: #000; max-height: 260px;
}
.scan-viewport video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 0; width: 100%; height: 100%; }
.scan-line {
  position: absolute; left: 0; right: 0; height: 2px;
  background: var(--accent2); opacity: .8;
  animation: scanLine 2.5s ease-in-out infinite;
  display: none;
}
.scan-viewport.scanning .scan-line { display: block; }
.scan-hint {
  text-align: center; padding: 14px 0 4px;
  font-size: 14px; color: var(--muted);
}
.scan-hint.error { color: var(--red); }

/* ═══ CONFIRM ═══ */
.confirm-box {
  background: var(--surface); border-radius: 18px; border: 1px solid var(--line);
  padding: 24px 20px; width: calc(100% - 48px); max-width: 360px;
  margin: auto; animation: popIn .25s var(--ease);
}
.confirm-title { font-size: 17px; font-weight: 800; margin-bottom: 10px; }
.confirm-msg { font-size: 14px; color: var(--muted); margin-bottom: 20px; line-height: 1.5; }
.confirm-btns { display: flex; flex-direction: column; gap: 8px; }
.btn-danger {
  padding: 13px; border-radius: 11px; font-size: 14px; font-weight: 700; width: 100%;
  background: var(--red); color: #fff; transition: opacity .2s, transform .15s;
}
.btn-danger:active { opacity: .8; transform: scale(.97); }
.btn-ghost {
  padding: 13px; border-radius: 11px; font-size: 14px; font-weight: 600; width: 100%;
  background: var(--surface2); border: 1px solid var(--line); color: var(--muted);
  transition: opacity .2s;
}

/* ═══ ADMIN ═══ */
.admin-sheet {
  background: var(--surface); width: 100%; max-width: 600px; border-radius: 22px 22px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  max-height: 92vh; display: flex; flex-direction: column;
  animation: sheetUp .3s var(--ease);
}
.admin-tabs {
  display: flex; border-bottom: 1px solid var(--line); flex-shrink: 0;
  padding: 0 16px; gap: 2px;
}
.atab {
  padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .2s, border-color .2s;
}
.atab.active { color: var(--accent2); border-bottom-color: var(--accent2); }
.admin-tab-content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.admin-search-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--surface2); border-bottom: 1px solid var(--line);
  flex-shrink: 0; color: var(--dim);
}
.admin-search-bar input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14px; }
.a-refresh { color: var(--muted); padding: 4px; transition: color .2s; }
.a-refresh:active { color: var(--accent2); }
.a-refresh-wide {
  display: flex; align-items: center; gap: 6px; padding: 10px 12px;
  color: var(--muted); font-size: 13px; font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.admin-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.admin-empty { text-align: center; padding: 30px 20px; color: var(--dim); font-size: 14px; }
.admin-user-card {
  background: var(--surface2); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; animation: fadeUp .25s var(--ease);
}
.auc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.auc-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-bg); color: var(--accent2); font-size: 16px; font-weight: 800;
  display: grid; place-items: center; position: relative; overflow: hidden;
}
.auc-av-init { position: relative; z-index: 1; }
.auc-meta { flex: 1; min-width: 0; }
.auc-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auc-phone { font-size: 12px; color: var(--muted); margin-top: 1px; }
.auc-tid { font-size: 11.5px; color: var(--dim); margin-bottom: 8px; }
.auc-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.auc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.auc-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 8px; font-size: 12px; font-weight: 600;
  transition: opacity .2s;
}
.auc-btn:active { opacity: .7; }
.auc-btn:disabled { opacity: .45; pointer-events: none; }
.auc-grant   { background: rgba(62,207,142,.1);  border: 1px solid rgba(62,207,142,.3); color: var(--green); }
.auc-revoke  { background: rgba(224,90,90,.08);  border: 1px solid rgba(224,90,90,.25); color: var(--red); }
.auc-promote { background: var(--accent-bg);     border: 1px solid var(--accent);       color: var(--accent2); }
.auc-demote  { background: rgba(245,200,66,.08); border: 1px solid rgba(245,200,66,.25); color: var(--yellow); }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
}
.badge-admin { background: var(--accent-bg); border: 1px solid var(--accent); color: var(--accent2); }
.badge-wl    { background: rgba(62,207,142,.1); border: 1px solid rgba(62,207,142,.3); color: var(--green); }
.admin-stats-body { padding: 12px; }
.stat-group { margin-bottom: 16px; }
.stat-group-title { font-size: 12px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; }
.stat-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.stat-row:last-child { border-bottom: none; }
.stat-row-k { color: var(--muted); }
.stat-row-v { font-weight: 700; }
.log-item {
  padding: 8px 10px; border-radius: 9px; background: var(--surface2);
  border: 1px solid var(--line); font-size: 12px; color: var(--muted);
  display: flex; flex-direction: column; gap: 3px;
}
.log-action { font-weight: 700; color: var(--text); }
.log-meta { color: var(--dim); font-size: 11px; }

/* ═══ TOAST ═══ */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  left: 50%; transform: translateX(-50%);
  background: var(--surface3); border: 1px solid var(--line);
  color: var(--text); padding: 10px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 600; z-index: 999;
  box-shadow: var(--shadow); white-space: nowrap; max-width: 90vw;
  animation: popIn .2s var(--ease);
}

/* ═══ LEAFLET MARKERS ═══ */
.lf-marker {
  width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.5);
}
.lf-m-available { background: var(--green); border-color: rgba(62,207,142,.5); }
.lf-m-active    { background: var(--blue);  border-color: rgba(91,156,246,.5); }
.lf-m-error     { background: var(--red);   border-color: rgba(224,90,90,.5); }
.lf-m-offline   { background: #444;         border-color: rgba(80,80,94,.5); }
.lf-m-low       { background: var(--yellow); border-color: rgba(245,200,66,.5); color: #000; }

/* ═══ LOADING STATES ═══ */
.loading-state { text-align: center; padding: 40px 20px; color: var(--dim); font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.load-spinner { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent2); animation: spin .7s linear infinite; }
