/* ============================================================
   Inspector Mobile — Design System
   Mobile-first, tablet-aware, light + dark
   ============================================================ */

:root {
    /* Brand — one deep, official teal-green */
    --brand: #0f7061;
    --brand-600: #0c5d50;
    --brand-700: #094a40;
    --brand-050: #e7f2ef;
    --brand-ink: #0b5748;      /* readable brand text */
    --accent: #2b6cb0;         /* calm action blue (used sparingly) */
    /* semantic status — harmonised, restrained */
    --success: #2e9e63;
    --warning: #cf861f;
    --danger:  #d24a50;
    --info:    #3b7ea6;        /* slate-blue, sits well with teal */

    /* Surfaces (light) — cool, clean neutrals */
    --bg: #f4f6f7;
    --surface: #ffffff;
    --surface-2: #f7f9fa;
    --surface-3: #eceff2;
    --border: #e3e7eb;
    --border-strong: #ccd3d9;

    /* Text */
    --text: #16232e;
    --text-2: #566574;
    --text-3: #8994a0;
    --on-brand: #ffffff;

    /* Shape */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-pill: 999px;
    --shadow-1: 0 1px 2px rgba(20,32,43,.06), 0 1px 3px rgba(20,32,43,.08);
    --shadow-2: 0 4px 14px rgba(20,32,43,.10);
    --shadow-up: 0 -2px 12px rgba(20,32,43,.06);

    /* Layout */
    --header-h: 75px;
    --tabbar-h: 62px;
    --sidebar-w: 240px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light dark;
}

/* Dark palette — applied via data-theme (set synchronously before paint by the
   inline head script, which resolves the "auto" preference to a concrete value). */
:root[data-theme="dark"] {
    --brand: #16a888;
    --brand-600: #12957a;
    --brand-700: #0e7d66;
    --brand-050: rgba(22,168,136,.16);
    --brand-ink: #48d1b2;

    /* status tones tuned for dark surfaces (not neon) */
    --success: #33c97e;
    --warning: #e0a13c;
    --danger:  #e56b70;
    --info:    #58a0cf;
    --accent:  #5a8fdd;

    --bg: #0b1216;
    --surface: #16212a;
    --surface-2: #1c2933;
    --surface-3: #263440;
    --border: #2b3a46;
    --border-strong: #3b4d59;
    --text: #eef4f7;
    --text-2: #a9b7c1;
    --text-3: #74828d;
    --shadow-1: 0 1px 3px rgba(0,0,0,.5);
    --shadow-2: 0 10px 26px rgba(0,0,0,.6);
    --shadow-up: 0 -2px 16px rgba(0,0,0,.5);
    color-scheme: dark;
}
/* keep the app bar a solid readable teal, not the neon accent */
:root[data-theme="dark"] .appbar { background: linear-gradient(135deg, #0e846e, #0a6355); }
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html, body { height: 100%; max-width: 100%; overflow-x: hidden; }
body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
    font-size: 15px;
    line-height: 1.4;
}
/* readable, consistent placeholders */
::placeholder { color: var(--text-3); opacity: 1; }
input, select, textarea { color: var(--text); }
[v-cloak] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }

/* ---------- App layout ---------- */
.app {
    display: flex;
    min-height: 100%;
}
.app__main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

/* ---------- Header ---------- */
.appbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: calc(var(--header-h) + var(--safe-top));
    padding-top: var(--safe-top);
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 12px;
    padding-right: 12px;
    background: var(--brand);
    color: var(--on-brand);
    box-shadow: var(--shadow-1);
}
.appbar__logo {
    width: 45px; 
    height: 45px;
}
.appbar__logo img { width: 100%; height: 100%; object-fit: contain; }
.appbar__title { font-weight: 600; font-size: 16px; letter-spacing: .2px; min-width: 0; }
.appbar__sub { font-size: 11px; opacity: .8; font-weight: 400; }
.appbar__spacer { flex: 1 1 auto; }
.appbar__btn {
    width: 38px; height: 38px; border-radius: 10px; border: 0;
    background: rgba(255,255,255,.14); color: var(--on-brand);
    display: grid; place-items: center; font-size: 16px; cursor: pointer;
}
.appbar__btn:active { background: rgba(255,255,255,.28); }

/* ---------- Content ---------- */
.content {
    flex: 1 1 auto;
    padding: 12px 12px calc(var(--tabbar-h) + var(--safe-bottom) + 12px);
    overflow-x: hidden;
}
.page-title { font-size: 20px; font-weight: 700; margin: 4px 2px 12px; }
.page-title small { display:block; font-size:12px; font-weight:500; color:var(--text-2); margin-top:2px;}

/* ---------- Bottom tab bar (phone) ---------- */
.tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 45;
    height: calc(var(--tabbar-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    display: flex;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: var(--shadow-up);
}
.tabbar__item {
    flex: 1 1 0;
    border: 0; background: transparent;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; color: var(--text-3); font-size: 10.5px; cursor: pointer;
    padding: 6px 2px;
}
.tabbar__item i { font-size: 19px; }
.tabbar__item.active { color: var(--brand); }
.tabbar__item.active i { transform: translateY(-1px); }

/* ---------- Sidebar (tablet/desktop) ---------- */
.sidebar { display: none; }

/* ---------- Cards / list ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-1);
}
.card + .card { margin-top: 10px; }
.card__body { padding: 14px; }

.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 12px 14px;
    box-shadow: var(--shadow-1);
    display: flex; gap: 12px; align-items: flex-start;
    cursor: pointer;
    transition: transform .08s ease, box-shadow .12s ease;
}
.list-item:active { transform: scale(.995); box-shadow: var(--shadow-2); }
.list-item__main { flex: 1 1 auto; min-width: 0; }
.list-item__title { font-weight: 600; font-size: 15px; color: var(--text); margin-bottom: 3px; }
.list-item__meta { font-size: 12.5px; color: var(--text-2); display:flex; flex-wrap:wrap; gap:5px 14px; }
.list-item__meta > span { display: inline-flex; align-items: center; }
.list-item__meta i { color: var(--text-3); margin-right: 6px; font-size: 12px; }
.list-item__meta .pill i { margin-right: 0; }
.list-item__chev { color: var(--text-3); align-self: center; }
/* robust title + status header: long titles wrap, pill pinned top-right */
.li-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 3px; }
.li-head .list-item__title { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
.li-head > .pill, .li-head > .status-pill, .li-head .pill { flex: 0 0 auto; }
.li-head--pills { flex-wrap: wrap; }
.list-item__lead {
    width: 44px; height: 44px; border-radius: 11px; flex: 0 0 auto;
    display:grid; place-items:center; font-size:18px;
    color: var(--brand-ink);
    background: color-mix(in srgb, var(--brand) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand) 26%, transparent);
}

/* ---------- Badges / status pills ---------- */
.pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: var(--r-pill);
    font-size: 11.5px; font-weight: 600; line-height: 1.5;
    background: var(--surface-3); color: var(--text-2);
    border: 1px solid transparent;
}
.pill i { font-size: 10px; }
/* neutral, calm number badge (avoids a second green on the card) */
.pill--num { background: var(--surface-3); color: var(--text-2); border-color: var(--border); font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.pill--num i { color: var(--text-3); }
.pill--success { color: var(--success); background: color-mix(in srgb, var(--success) 16%, transparent); border-color: color-mix(in srgb, var(--success) 32%, transparent); }
.pill--warning { color: var(--warning); background: color-mix(in srgb, var(--warning) 18%, transparent); border-color: color-mix(in srgb, var(--warning) 34%, transparent); }
.pill--danger  { color: var(--danger);  background: color-mix(in srgb, var(--danger) 16%, transparent);  border-color: color-mix(in srgb, var(--danger) 32%, transparent); }
.pill--info    { color: var(--info);    background: color-mix(in srgb, var(--info) 16%, transparent);    border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.pill--brand   { color: var(--brand-ink); background: color-mix(in srgb, var(--brand) 16%, transparent); border-color: color-mix(in srgb, var(--brand) 28%, transparent); }
.pill--dot::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border: 1px solid transparent; border-radius: var(--r-sm);
    padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
    background: var(--surface-3); color: var(--text);
}
.btn:active { filter: brightness(.96); }
.btn--brand { background: var(--brand); color: #fff; }
.btn--accent { background: var(--accent); color: #fff; }
.btn--outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--block { width: 100%; }
.btn--sm { padding: 7px 12px; font-size: 12.5px; }
.btn--lg { padding: 13px 18px; font-size: 15px; }

.fab {
    position: fixed;
    right: 16px;
    bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
    z-index: 44;
    width: 54px; height: 54px; border-radius: 50%;
    background: var(--brand); color: #fff; border: 0;
    box-shadow: var(--shadow-2); font-size: 22px; cursor: pointer;
    display: grid; place-items: center;
}

/* ---------- Search / inputs ---------- */
.searchbar {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-pill); padding: 9px 14px; box-shadow: var(--shadow-1);
}
.searchbar i { color: var(--text-3); }
.searchbar input {
    border: 0; outline: 0; background: transparent; color: var(--text);
    font-size: 14.5px; flex: 1 1 auto; min-width: 0;
}
.field { margin-bottom: 12px; }
.field > label { display:block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.input, .select, .textarea {
    width: 100%; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
    padding: 11px 12px; font-size: 14.5px; background: var(--surface); color: var(--text);
    outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-050); }
.textarea { min-height: 88px; resize: vertical; }

/* Chips (filter) */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto; padding: 7px 13px; border-radius: var(--r-pill);
    background: var(--surface); border: 1px solid var(--border);
    font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.chip .badge { background: rgba(0,0,0,.12); border-radius: var(--r-pill); padding: 0 6px; font-size: 11px; }

/* Segmented */
.segmented { display: flex; background: var(--surface-3); border-radius: var(--r-sm); padding: 3px; gap: 3px; }
.segmented button {
    flex: 1 1 0; border: 0; background: transparent; padding: 8px; border-radius: 6px;
    font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer;
}
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
    padding: 12px 14px; box-shadow: var(--shadow-1);
}
.stat__label { font-size: 11.5px; color: var(--text-2); font-weight: 600; display:flex; align-items:center; gap:7px; }
.stat__label i { color: var(--brand-ink); font-size: 13px; }
.stat__value { font-size: 22px; font-weight: 700; margin-top: 4px; }
.stat__value small { font-size: 12px; font-weight: 600; color: var(--text-3); }

/* ---------- Detail (object) ---------- */
.detail-hero {
    background: linear-gradient(135deg, var(--brand), var(--brand-700));
    color: #fff; border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-2);
    margin-bottom: 12px;
}
.detail-hero__id { font-size: 12px; opacity: .85; }
.detail-hero__name { font-size: 18px; font-weight: 700; margin: 3px 0 8px; }
.detail-hero__row { display:flex; flex-wrap:wrap; gap: 6px 14px; font-size: 12.5px; opacity: .95; }
.detail-hero__row i { opacity: .8; margin-right: 4px; }

.detail-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin: 0 -12px 12px; padding-left: 12px; padding-right: 12px; scrollbar-width:none; }
.detail-tabs::-webkit-scrollbar { display:none; }
.detail-tab {
    flex: 0 0 auto; padding: 9px 14px; border-radius: var(--r-pill);
    background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
    font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
    display:inline-flex; align-items:center; gap:6px;
}
.detail-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Key-value rows */
.kv { display: flex; flex-direction: column; }
.kv__row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.kv__row:last-child { border-bottom: 0; }
.kv__k { color: var(--text-2); font-size: 13px; flex: 0 0 auto; }
.kv__v { color: var(--text); font-size: 13.5px; font-weight: 600; text-align: right; }

/* Section heading */
.section-head { display:flex; align-items:center; justify-content:space-between; margin: 6px 2px 10px; }
.section-head h3 { font-size: 15px; font-weight: 700; margin: 0; }
.section-head .count { color: var(--text-3); font-size: 12.5px; }

/* ---------- Skeleton ---------- */
.skel { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 6px; }
.skel::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
    transform: translateX(-100%); animation: shimmer 1.3s infinite;
}
:root[data-theme="dark"] .skel::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skel-line { height: 12px; margin: 8px 0; }
.skel-item { height: 68px; margin-bottom: 10px; border-radius: var(--r-md); }

/* ---------- Empty / states ---------- */
.empty { text-align: center; color: var(--text-3); padding: 40px 20px; }
.empty i { font-size: 40px; margin-bottom: 12px; opacity: .5; }
.empty p { margin: 4px 0; font-size: 14px; }
.empty small { color: var(--text-3); }

/* ---------- Bottom sheet ---------- */
.sheet-backdrop {
    position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.4);
    opacity: 0; animation: fade .18s ease forwards;
}
@keyframes fade { to { opacity: 1; } }
.sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
    background: var(--surface); border-radius: 18px 18px 0 0;
    padding: 8px 14px calc(16px + var(--safe-bottom));
    max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-2);
    transform: translateY(100%); animation: slideup .24s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes slideup { to { transform: translateY(0); } }
.sheet__grip { width: 40px; height: 4px; border-radius: 3px; background: var(--border-strong); margin: 6px auto 12px; }
.sheet__head { display:flex; align-items:center; justify-content:space-between; margin-bottom: 12px; }
.sheet__head h3 { margin: 0; font-size: 16px; font-weight: 700; }

/* Menu grid (More) */
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.menu-grid__item {
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
    padding: 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px;
    cursor: pointer; text-align: center;
}
.menu-grid__item i { font-size: 22px; color: var(--brand); }
.menu-grid__item span { font-size: 11.5px; font-weight: 600; color: var(--text); line-height: 1.2; }

/* map placeholder */
.map-frame {
    width: 100%; height: 100%; min-height: 260px; border: 0; border-radius: var(--r-md);
    background:
        repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 12px, var(--surface-3) 12px, var(--surface-3) 24px);
    display: grid; place-items: center; color: var(--text-3);
}
.map-canvas { position: relative; width: 100%; height: calc(100vh - var(--header-h) - var(--tabbar-h) - var(--safe-top) - var(--safe-bottom) - 100px); min-height: 320px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); }

/* pull-to-refresh indicator */
.ptr {
    position: fixed; top: calc(var(--header-h) + var(--safe-top) - 4px); left: 50%;
    transform: translateX(-50%) translateY(-46px); z-index: 55;
    width: 38px; height: 38px; border-radius: 50%; background: var(--surface);
    box-shadow: var(--shadow-2); display: grid; place-items: center;
    color: var(--brand-ink); font-size: 15px; opacity: 0;
    transition: transform .18s ease, opacity .18s ease;
}
.ptr.ready { color: var(--brand); }

/* infinite loader */
.infinite { display: flex; justify-content: center; padding: 14px 0 4px; min-height: 30px; }
.infinite__spin, .infinite__end { color: var(--text-3); font-size: 12.5px; }

/* media uploader + gallery + lightbox */
.u-hide { display: none !important; }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 620px) { .media-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .media-grid { grid-template-columns: repeat(6, 1fr); } }
.media-tile {
    position: relative; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden;
    background: var(--surface-3); border: 1px solid var(--border); cursor: pointer;
}
.media-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-tile__file { width: 100%; height: 100%; display: grid; place-items: center; font-size: 30px; color: var(--brand-ink); }
.media-tile__del {
    position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%;
    border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; cursor: pointer; display: grid; place-items: center;
}
.media-tile__cap {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 6px 5px;
    background: linear-gradient(transparent, rgba(0,0,0,.72)); color: #fff;
    font-size: 10px; display: flex; flex-direction: column;
}
.media-tile__cap span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.media-tile__cap small { opacity: .8; font-size: 9px; }

.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.92); display: grid; place-items: center; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 86vh; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.lightbox__close { position: absolute; top: calc(14px + var(--safe-top)); right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 18px; cursor: pointer; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 18px; cursor: pointer; }
.lightbox__nav--prev { left: 12px; } .lightbox__nav--next { right: 12px; }
.lightbox__cap { position: absolute; bottom: calc(18px + var(--safe-bottom)); left: 0; right: 0; text-align: center; color: #fff; font-size: 13px; opacity: .9; }

/* Map view (Google Maps container) */
.map-view { display: flex; flex-direction: column; }
.map-view__wrap { position: relative; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-1); background: var(--surface-2); }
.map-box { width: 100%; height: calc(100vh - var(--header-h) - var(--tabbar-h) - var(--safe-top) - var(--safe-bottom) - 108px); min-height: 340px; background: var(--surface-2); }
@media (min-width: 768px) { .map-box { height: calc(100vh - var(--header-h) - 150px); } }
.map-box--mini { min-height: 300px; height: 44vh; }
.map-coord-card { display: flex; justify-content: space-between; align-items: center; }
.map-fallback {
    position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px;
    align-items: center; justify-content: center; text-align: center;
    color: var(--text-2); font-size: 13.5px; padding: 20px;
}
.map-fallback i { font-size: 26px; color: var(--text-3); }
.map-fallback small { color: var(--text-3); font-size: 11.5px; }

/* Google InfoWindow content */
.gm-pop { min-width: 190px; padding: 2px 2px 0; }
.gm-pop__id { font-size: 11.5px; font-weight: 700; color: var(--brand-ink); }
.gm-pop__name { font-size: 13.5px; font-weight: 700; margin: 3px 0; color: #16232e; }
.gm-pop__meta { font-size: 12px; color: #556574; margin-bottom: 8px; }
.gm-pop__btn { width: 100%; border: 0; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 600; padding: 8px; font-size: 12.5px; cursor: pointer; }

.map-locate {
    position: absolute; right: 12px; bottom: 12px; z-index: 500;
    width: 46px; height: 46px; border-radius: 50%; border: 0;
    background: var(--surface); color: var(--brand-ink); box-shadow: var(--shadow-2);
    font-size: 18px; cursor: pointer; display: grid; place-items: center;
}
.map-legend {
    position: absolute; left: 12px; bottom: 12px; z-index: 500;
    display: flex; gap: 10px; padding: 7px 11px; border-radius: var(--r-pill);
    background: var(--surface); box-shadow: var(--shadow-2); font-size: 11px; font-weight: 600; color: var(--text-2);
}
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.gis-ramp { width: 90px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #0c5d50, #0f9d7f, #e2b04a, #e5484d); }
.map-legend .dot--ok { background: #0f9d7f; }
.map-legend .dot--warn { background: var(--warning); }
.map-legend .dot--danger { background: var(--danger); }
/* misc extracted helpers */
.u-min0 { min-width: 0; }
.dl-icon { align-self: center; color: var(--brand-ink); }
.section-head.mt0 { margin-top: 0; }

/* advanced filter (accordion) */
.facc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-1); margin-bottom: 10px; overflow: hidden; }
.facc__head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 13px 14px; border: 0; background: transparent; color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer; text-align: left; }
.facc__head > i:first-child { color: var(--brand-ink); font-size: 15px; }
.facc__head span { flex: 1 1 auto; }
.facc__chev { color: var(--text-3); font-size: 13px; }
.facc__body { padding: 4px 14px 14px; border-top: 1px solid var(--border); }
.fdate { margin-bottom: 12px; }
.fdate > label, .fyn > label, .fms__label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.fyn { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.fyn:last-child { border-bottom: 0; }
.fyn > label { margin-bottom: 0; flex: 0 0 auto; }
.fyn .segmented { flex: 1 1 auto; max-width: 240px; }
.segmented--sm button { padding: 6px; font-size: 12px; }
.fms { margin-bottom: 12px; }
.fms__label { display: flex; align-items: center; gap: 7px; }
.fms__label .badge { background: var(--brand); color: #fff; border-radius: var(--r-pill); padding: 0 7px; font-size: 10px; font-weight: 700; }
.chips--wrap { flex-wrap: wrap; overflow: visible; padding: 0; }

.filter-actions {
    position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + -60px);
    display: flex; gap: 8px; padding: 8px; margin: 12px -2px 0;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
    box-shadow: var(--shadow-2);
}
@media (min-width: 768px) { .filter-actions { bottom: 12px; } }

/* object create/edit form */
.obj-form { display: flex; flex-direction: column; gap: 12px; }
.ofs {
    margin: 0; border: 1px solid var(--border); border-radius: var(--r-md);
    padding: 12px 14px 14px; background: var(--surface); box-shadow: var(--shadow-1);
}
.ofs > legend {
    float: none; width: auto; padding: 0 8px; margin-left: 4px;
    font-size: 12.5px; font-weight: 700; color: var(--brand-ink);
}
.ofs--off { opacity: .55; }
.ofs .field:last-child { margin-bottom: 0; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check {
    display: flex; align-items: center; gap: 9px; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2);
    font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text);
}
.check input { width: 18px; height: 18px; accent-color: var(--brand); flex: 0 0 auto; }
.check:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.obj-form__actions {
    position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + -60px);
    display: flex; gap: 8px; padding: 8px; margin: 6px -2px 0;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
    box-shadow: var(--shadow-2);
}
@media (min-width: 768px) {
    .check-grid { grid-template-columns: repeat(4, 1fr); }
    .obj-form__actions { bottom: 8px; }
}
input:disabled, select:disabled, .input:disabled, .select:disabled { opacity: .55; cursor: not-allowed; }

/* toast */
.toast-host { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
@media (min-width: 768px) { .toast-host { bottom: 20px; } }
.toast-msg { display: flex; align-items: center; gap: 10px; max-width: 480px; width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--text-3); border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--shadow-2); font-size: 13.5px; opacity: 0; transform: translateY(12px); transition: opacity .22s ease, transform .22s ease; }
.toast-msg.show { opacity: 1; transform: translateY(0); }
.toast-msg i { font-size: 17px; }
.toast-msg--success { border-left-color: var(--success); } .toast-msg--success i { color: var(--success); }
.toast-msg--info { border-left-color: var(--info); } .toast-msg--info i { color: var(--info); }
.toast-msg--warning { border-left-color: var(--warning); } .toast-msg--warning i { color: var(--warning); }
.toast-msg--error { border-left-color: var(--danger); } .toast-msg--error i { color: var(--danger); }

/* utility */
.u-mt { margin-top: 12px; }
.u-mb { margin-bottom: 12px; }
.u-muted { color: var(--text-2); }
.u-row { display: flex; gap: 10px; align-items: center; }
.u-wrap { flex-wrap: wrap; }
.u-grow { flex: 1 1 auto; }
.u-center { text-align: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hr { height: 1px; background: var(--border); margin: 12px 0; border: 0; }
/* extracted-from-inline helpers */
.u-between { justify-content: space-between; }
.u-items-start { align-items: flex-start; }
.g-5 { gap: 5px; } .g-6 { gap: 6px; } .g-8 { gap: 8px; } .g-12 { gap: 12px; }
.mt-4 { margin-top: 4px; } .mt-6 { margin-top: 6px; } .mt-8 { margin-top: 8px; }
.fs-10 { font-size: 10.5px; } .fs-11 { font-size: 11px; } .fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; } .fs-14 { font-size: 14px; } .fs-16 { font-size: 16px; }
.fw-500 { font-weight: 500; }
.t-2 { color: var(--text-2); } .t-3 { color: var(--text-3); }
.t-danger { color: var(--danger); } .t-warning { color: var(--warning); }
.cur-pointer { cursor: pointer; }
.note-hint { font-size: 12px; color: var(--text-2); margin: 8px 0 0; }
.skel-hero { height: 120px; border-radius: var(--r-lg); }
.form-loading { padding: 30px; }
/* coloured lead badges */
.list-item__lead--danger { background: color-mix(in srgb, var(--danger) 13%, transparent); border-color: color-mix(in srgb, var(--danger) 24%, transparent); color: var(--danger); }
.list-item__lead--warning { background: color-mix(in srgb, var(--warning) 15%, transparent); border-color: color-mix(in srgb, var(--warning) 26%, transparent); color: var(--warning); }
/* soft close button used in sheets/popups */
.btn-soft { background: var(--surface-3); color: var(--text); }
/* legend swatch */
.legend-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend-row { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-2); margin-top: 12px; }

/* ============================================================
   Tablet & up  (>= 768px)  → sidebar layout, grids
   ============================================================ */
@media (min-width: 768px) {
    .tabbar { display: none; }
    .fab { bottom: 24px; }
    .sidebar {
        display: flex; flex-direction: column;
        width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
        background: var(--surface); border-right: 1px solid var(--border);
        position: sticky; top: 0; height: 100vh; overflow-y: auto;
        padding-top: var(--safe-top);
    }
    .sidebar__brand {
        display: flex; align-items: center; gap: 10px; padding: 16px 16px;
        border-bottom: 1px solid var(--border);
    }
    .sidebar__brand .logo { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-050); display:grid; place-items:center; overflow:hidden;}
    .sidebar__brand .logo img { width:100%; height:100%; object-fit:contain;}
    .sidebar__brand b { font-size: 15px; }
    .sidebar__brand span { display:block; font-size: 11px; color: var(--text-2); }
    .sidebar__nav { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
    .sidebar__link {
        display: flex; align-items: center; gap: 12px; padding: 11px 12px;
        border-radius: var(--r-sm); color: var(--text-2); font-size: 14px; font-weight: 600;
        cursor: pointer; border: 0; background: transparent; text-align: left; width: 100%;
    }
    .sidebar__link i { width: 20px; text-align: center; font-size: 16px; }
    .sidebar__link:hover { background: var(--surface-3); color: var(--text); }
    .sidebar__link.active { background: var(--brand-050); color: var(--brand); }

    .content { padding: 18px 22px calc(24px); max-width: 1180px; width: 100%; margin: 0 auto; }
    .stats { grid-template-columns: repeat(4, 1fr); }
    .list--grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .page-title { font-size: 24px; }
    .appbar__btn.only-mobile { display: none; }
}

@media (min-width: 1100px) {
    .list--grid { grid-template-columns: repeat(3, 1fr); }
}
