/* zeugenschutz / panel/web/style.css */

:root {
    --bg:          #0a0e14;
    --bg-soft:     #0d1219;
    --panel:       #111823;
    --panel-2:     #18202d;
    --line:        #1e2733;
    --line-soft:   #182029;

    --text:        #e8edf4;
    --text-dim:    #8b96a8;
    --text-faint:  #5d6878;

    --accent:      #f2a33c;
    --accent-hi:   #ffb857;
    --accent-dim:  rgba(242, 163, 60, .12);

    --good:        #3ecf8e;
    --warn:        #f5a524;
    --bad:         #f2545b;
    --info:        #4c8dff;

    --radius:      14px;
    --radius-sm:   10px;
    --shadow:      0 18px 44px rgba(0, 0, 0, .5);

    --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

    --sidebar-w: 264px;
}

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

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
code { font-family: var(--mono); font-size: .92em; color: var(--accent); }

/* --------------------------------------------------------------------------
   Brand mark
   -------------------------------------------------------------------------- */
/* The server's own logo, straight from the loading screen. It ships with a
   proper alpha channel, so no plate or tile behind it. */
.brand-logo {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    object-fit: contain;
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, .55));
}
.brand-logo.lg { width: 54px; height: 54px; flex-basis: 54px; }

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */
.login {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(820px 460px at 50% -6%, rgba(242, 163, 60, .12), transparent 62%),
        var(--bg);
}

.login-box {
    width: 100%;
    max-width: 390px;
    padding: 34px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.login-brand h1 { font-size: 21px; font-weight: 800; letter-spacing: -.03em; }
.login-brand p  { font-size: 12.5px; color: var(--text-dim); }

.login-box label { display: block; margin-bottom: 8px; font-size: 12.5px; color: var(--text-dim); }
.login-box input { margin-bottom: 20px; }
.login-error { margin-top: 14px; color: var(--bad); font-size: 13px; text-align: center; }

/* --------------------------------------------------------------------------
   Base layout
   -------------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.app.collapsed { grid-template-columns: 0 1fr; }
.app.collapsed .sidebar { transform: translateX(-100%); }

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding: 24px 16px;
    background: var(--bg-soft);
    border-right: 1px solid var(--line);
    position: sticky;
    top: 0;
    height: 100vh;
    transition: transform .2s ease;
}

.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.sidebar-word strong {
    display: block;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.03em;
}
.sidebar-word small { color: var(--text-faint); font-size: 11px; font-family: var(--mono); }

.nav { display: flex; flex-direction: column; gap: 10px; flex: 1; overflow-y: auto; }
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

/* --------------------------------------------------------------------------
   Nav groups (foldable)
   -------------------------------------------------------------------------- */
.nav-group { display: flex; flex-direction: column; }

.nav-group-head {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--text-faint);
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    text-align: left;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.nav-group-head:hover { background: var(--panel); color: var(--text-dim); }

.nav-group-head .grp-ic { width: 15px; height: 15px; flex: none; }
.nav-group-title { flex: 1; }

.nav-group-meta {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: none;
    color: var(--text-faint);
    font-family: var(--mono);
}

.nav-group-head .chev {
    width: 15px;
    height: 15px;
    flex: none;
    transition: transform .2s ease;
}
.nav-group.open .nav-group-head .chev { transform: rotate(180deg); }

/* Folded away completely - no reserved space, no tab stops inside. */
.nav-group-body {
    display: none;
    flex-direction: column;
    gap: 3px;
    padding-top: 4px;
}
.nav-group.open .nav-group-body { display: flex; }

/* Live indicator on the "Live server" group */
.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bad);
    flex: none;
    transition: background .2s, box-shadow .2s;
}
.live-dot.on {
    background: var(--good);
    box-shadow: 0 0 0 3px rgba(62, 207, 142, .16);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.nav-item svg { width: 20px; height: 20px; flex: 0 0 20px; }
.nav-item span { flex: 1; }
.nav-item:hover { background: var(--panel); color: var(--text); }

.nav-item.active {
    background: var(--accent-dim);
    color: var(--accent);
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav-item em {
    font-style: normal;
    font-size: 11px;
    font-family: var(--mono);
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--panel-2);
    color: var(--text-faint);
}
.nav-item.active em { background: var(--accent); color: #14100a; font-weight: 700; }

.dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--good);
    flex: 0 0 7px;
    box-shadow: 0 0 0 3px rgba(62, 207, 142, .16);
}
.dot.off { background: var(--bad); box-shadow: 0 0 0 3px rgba(242, 84, 91, .16); }

.main { position: relative; min-width: 0; }

/* Top bar ------------------------------------------------------------------ */
.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 30px;
    border-bottom: 1px solid var(--line);
    background: var(--bg-soft);
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar-title { font-size: 20px; font-weight: 800; letter-spacing: -.03em; flex: 1; }

.icon-btn {
    display: grid; place-items: center;
    width: 38px; height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--text-dim);
    cursor: pointer;
    transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }

/* Real numbers instead of a decorative user card */
.topbar-meta { display: flex; align-items: center; gap: 8px; }

.tstat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-faint);
}
.tstat svg { width: 16px; height: 16px; }
.tstat b { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--text); }
.tstat.off { border-color: rgba(242, 84, 91, .3); }
.tstat.off svg, .tstat.off b { color: var(--bad); }

@media (max-width: 860px) { .topbar-meta { display: none; } }

.content { padding: 28px 30px 64px; max-width: 1400px; }

.view { display: none; animation: fade .2s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.view-note { color: var(--text-dim); font-size: 13.5px; margin-bottom: 20px; max-width: 78ch; }

/* --------------------------------------------------------------------------
   Section header on a config view
   -------------------------------------------------------------------------- */
.view-head {
    padding-bottom: 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--line);
}
.view-head h3 {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.01em;
    margin-bottom: 6px;
}
.view-head p {
    color: var(--text-dim);
    font-size: 13.5px;
    line-height: 1.6;
    max-width: 82ch;
}
.view-head code {
    font-family: var(--mono);
    font-size: 12px;
    padding: 1px 5px;
    border-radius: 5px;
    background: var(--panel-2);
    color: var(--accent);
}

/* Config views get a little more air between their panels */
.config-view .panel + .panel { margin-top: 18px; }

/* --------------------------------------------------------------------------
   Screenshot modal
   -------------------------------------------------------------------------- */
.shot-wait {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 260px;
    text-align: center;
    padding: 20px;
}
.shot-wait p { font-size: 14px; font-weight: 600; }
.shot-wait small { font-size: 12px; color: var(--text-faint); max-width: 46ch; line-height: 1.6; }
.shot-wait.failed p { color: var(--bad); }

.spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid var(--line);
    border-top-color: var(--accent);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.shot-img {
    display: block;
    width: 100%;
    max-height: 74vh;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #000;
}

.shot-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 11.5px;
    color: var(--text-faint);
    font-family: var(--mono);
}

/* --------------------------------------------------------------------------
   Live watch
   -------------------------------------------------------------------------- */
.watch-stage {
    position: relative;
    background: #000;
    border-radius: 10px;
    border: 1px solid var(--line);
    overflow: hidden;
    min-height: 300px;
    display: grid;
    place-items: center;
}

.watch-img {
    display: block;
    width: 100%;
    max-height: 76vh;
    object-fit: contain;
}

.watch-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 11px;
    font-size: 11.5px;
    font-family: var(--mono);
    color: var(--text-faint);
}

.watch-live {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    letter-spacing: .1em;
    color: var(--bad);
}
.watch-live i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bad);
    animation: livePulse 1.4s ease-in-out infinite;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(242, 84, 91, .5); }
    50%      { opacity: .55; box-shadow: 0 0 0 5px rgba(242, 84, 91, 0); }
}

.btn-watch {
    background: rgba(242, 84, 91, .13);
    border-color: rgba(242, 84, 91, .32);
    color: var(--bad);
}
.btn-watch:hover { background: rgba(242, 84, 91, .22); }

/* Icon-only screenshot button in the map popover */
.btn-shot {
    flex: 0 0 34px !important;
    display: grid;
    place-items: center;
    padding: 0;
    background: var(--accent-dim);
    border-color: rgba(242, 163, 60, .3);
    color: var(--accent);
}
.btn-shot:hover { background: rgba(242, 163, 60, .22); }
.btn-shot svg { width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   Detection code cards
   A raw code like NO_SESSION means nothing to whoever has to decide whether it
   should ban, so each one carries a title, what happened, and how far to trust
   it. Same wording as the in-game menu - both render from ZS.Codes.
   -------------------------------------------------------------------------- */
.ac-block { margin-bottom: 28px; }
.ac-block > h3 {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 8px;
}
.ac-note { font-size: 12.5px; color: var(--text-faint); line-height: 1.65; margin-bottom: 14px; max-width: 82ch; }

.dcards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
}

.dcard {
    display: flex;
    flex-direction: column;
    padding: 17px 18px 15px;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    transition: border-color .18s, transform .18s;
}
.dcard:hover { transform: translateY(-2px); }

/* The left edge carries the consequence, so a wall of cards reads at a glance */
.dcard.act-log  { border-left-color: #4a5566; }
.dcard.act-kick { border-left-color: var(--warn); }
.dcard.act-ban  { border-left-color: var(--bad); }

.dcard-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 9px; }
.dcard-title { flex: 1; min-width: 0; }
.dcard-title strong { display: block; font-size: 14.5px; font-weight: 700; margin-bottom: 3px; }
.dcard-title code { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); }

.trust {
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: help;
}
.trust.high   { background: rgba(62, 207, 142, .15); color: var(--good); }
.trust.medium { background: rgba(245, 165, 36, .15); color: var(--warn); }
.trust.low    { background: rgba(139, 150, 168, .15); color: var(--text-dim); }

.dcard-text { font-size: 12.5px; line-height: 1.65; color: var(--text-dim); }
.dcard-note {
    font-size: 11.5px;
    line-height: 1.55;
    color: var(--text-faint);
    margin-top: 10px;
    padding-left: 11px;
    border-left: 2px solid var(--line);
}

.dcard-foot {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line-soft);
}
.dcard-label { font-size: 11px; color: var(--text-faint); flex: 1; }

.seg { display: flex; gap: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg button {
    padding: 6px 11px;
    border: 0;
    border-radius: 7px;
    background: none;
    color: var(--text-faint);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all .14s;
}
.seg button:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.seg button.on[data-action="log"]  { background: rgba(139, 150, 168, .22); color: var(--text-dim); }
.seg button.on[data-action="kick"] { background: rgba(245, 165, 36, .22);  color: var(--warn); }
.seg button.on[data-action="ban"]  { background: rgba(242, 84, 91, .22);   color: var(--bad); }

/* --------------------------------------------------------------------------
   Detection tuning cards
   -------------------------------------------------------------------------- */
.detect {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .2s;
}
.detect + .detect, .detect + .save-bar { margin-top: 18px; }
.detect.on { border-color: rgba(242, 163, 60, .3); }

.detect-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 22px;
}

.detect-ic {
    width: 40px;
    height: 40px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--panel-2);
    color: var(--text-faint);
    transition: background .2s, color .2s;
}
.detect-ic svg { width: 21px; height: 21px; }
.detect.on .detect-ic { background: var(--accent-dim); color: var(--accent); }

.detect-title { flex: 1; min-width: 0; }
.detect-title h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15.5px;
    font-weight: 700;
    margin-bottom: 5px;
}
.detect-title p {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.6;
    max-width: 74ch;
}

.pill {
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: rgba(139, 150, 168, .14);
    color: var(--text-faint);
}
.detect.on .pill { background: rgba(62, 207, 142, .16); color: var(--good); }

.detect-body {
    border-top: 1px solid var(--line);
    transition: opacity .2s;
}
.detect-body.dim { opacity: .42; }

.detect-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    padding: 22px;
}

/* Number field with a unit glued to the right edge of the input */
.field.unit { position: relative; }
.field.unit input { padding-right: 56px; }
.field.unit::after {
    content: attr(data-unit);
    position: absolute;
    right: 13px;
    /* label line (~14px) + the .field gap (7px), then centred over the input */
    top: 21px;
    height: 39px;
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-faint);
    pointer-events: none;
}
.field.unit small {
    display: block;
    margin-top: 8px;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text-faint);
}

.detect-foot {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    padding: 18px 22px 20px;
    border-top: 1px solid var(--line-soft);
    background: var(--bg-soft);
}

.detect-note {
    flex: 1;
    min-width: 280px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-faint);
    max-width: 70ch;
}

.detect-action {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    color: var(--text-dim);
    white-space: nowrap;
}
.detect-action b {
    padding: 4px 11px;
    border-radius: 7px;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.detect-action b.act-log  { background: rgba(139, 150, 168, .16); color: var(--text-dim); }
.detect-action b.act-kick { background: rgba(245, 165, 36, .16);  color: var(--warn); }
.detect-action b.act-ban  { background: rgba(242, 84, 91, .16);   color: var(--bad); }

/* --------------------------------------------------------------------------
   Tag chips (bypass groups)
   -------------------------------------------------------------------------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    background: var(--accent-dim);
    border: 1px solid rgba(242, 163, 60, .22);
    color: var(--accent);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Compact key/value grid
   -------------------------------------------------------------------------- */
.kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px 22px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.kv-grid > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}
.kv-grid span { color: var(--text-dim); }
.kv-grid b { font-weight: 600; }
.kv-grid b.ok  { color: var(--good); }
.kv-grid b.bad { color: var(--bad); }
.kv-grid b.mono { font-family: var(--mono); font-size: 12px; color: var(--accent); }

/* --------------------------------------------------------------------------
   Stat tiles
   -------------------------------------------------------------------------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat {
    padding: 18px 20px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.stat.accent { border-color: rgba(242, 163, 60, .3); background: linear-gradient(160deg, var(--accent-dim), var(--panel) 62%); }
.stat.accent strong { color: var(--accent); }

.stat-label { display: block; font-size: 11.5px; color: var(--text-dim); margin-bottom: 8px; letter-spacing: .01em; }
.stat strong { font-size: 28px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Panels
   -------------------------------------------------------------------------- */
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line-soft);
}
.panel-head h3 { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.panel-head .hint { margin-left: auto; font-size: 12px; color: var(--text-faint); }
.panel-head .search { margin-left: auto; max-width: 250px; }

.panel-body { padding: 20px; }
.panel-body.no-pad { padding: 0; }

.muted { color: var(--text-faint); font-size: 13px; }

/* --------------------------------------------------------------------------
   Live map
   -------------------------------------------------------------------------- */
.map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}
.map-panel, .map-side { margin-bottom: 0; }
.map-side { position: sticky; top: 96px; max-height: calc(100vh - 130px); display: flex; flex-direction: column; }
.map-side .panel-body { overflow-y: auto; }

.map-wrap {
    position: relative;
    background: #05080c;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
}
.map-wrap.grabbing { cursor: grabbing; }

#map-svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 220px);
    user-select: none;
}

/* Zoom controls ------------------------------------------------------------ */
.map-zoom {
    position: absolute;
    right: 14px;
    top: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 6;
}
.map-zoom button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(17, 24, 35, .92);
    color: var(--text-dim);
    font-size: 19px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
}
.map-zoom button:hover { color: var(--accent); border-color: var(--accent); }
.map-zoom button svg { width: 15px; height: 15px; }

.map-hint {
    margin-top: 4px;
    color: var(--text-faint);
    font-size: 10.5px;
    font-style: italic;
}

/* Player popover ----------------------------------------------------------- */
.map-pop {
    position: absolute;
    z-index: 8;
    width: 250px;
    transform: translate(-50%, calc(-100% - 20px));
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 20px 46px rgba(0, 0, 0, .62);
    animation: popIn .16s cubic-bezier(.2, .9, .3, 1.3);
    cursor: default;
}
.map-pop.flip { transform: translate(-50%, 20px); }

@keyframes popIn {
    from { opacity: 0; transform: translate(-50%, calc(-100% - 8px)) scale(.94); }
}

/* Pointer towards the blip */
.map-pop::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 11px;
    height: 11px;
    margin-left: -5.5px;
    background: var(--panel-2);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    transform: rotate(45deg);
}
.map-pop.flip::after {
    bottom: auto;
    top: -6px;
    border: 0;
    border-left: 1px solid var(--line);
    border-top: 1px solid var(--line);
}

.pop-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 12px 11px 14px;
    border-bottom: 1px solid var(--line);
}
.pop-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.pop-name { flex: 1; min-width: 0; line-height: 1.3; }
.pop-name strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pop-name small { font-size: 11px; color: var(--text-faint); }

.pop-x {
    width: 22px; height: 22px;
    flex: none;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--text-faint);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
}
.pop-x:hover { background: rgba(242, 84, 91, .16); color: var(--bad); }

.pop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px 14px;
    padding: 12px 14px;
}
.pop-grid > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pop-grid span { font-size: 11px; color: var(--text-faint); }
.pop-grid b { font-family: var(--mono); font-size: 11.5px; font-weight: 700; }
.pop-grid b.badge { font-family: var(--font); }

.pop-pos {
    padding: 0 14px 12px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-faint);
}

.pop-actions {
    display: flex;
    gap: 7px;
    padding: 11px 14px;
    border-top: 1px solid var(--line);
    background: var(--bg-soft);
    border-radius: 0 0 11px 11px;
}
.pop-actions .btn { flex: 1; }

.map-tip {
    position: absolute;
    z-index: 5;
    padding: 8px 11px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 9px;
    box-shadow: var(--shadow);
    font-size: 12px;
    pointer-events: none;
    white-space: nowrap;
    transform: translate(-50%, -130%);
}
.map-tip strong { display: block; font-size: 12.5px; margin-bottom: 2px; }
.map-tip span { color: var(--text-faint); font-family: var(--mono); font-size: 11px; }

.map-legend {
    position: absolute;
    left: 14px; bottom: 12px;
    display: flex; flex-direction: column; gap: 5px;
    font-size: 11px;
    color: var(--text-dim);
}
.map-legend span { display: flex; align-items: center; gap: 7px; }
.ld { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ld.on-foot { background: var(--accent); }
.ld.in-veh  { background: var(--info); }
.ld.stale   { background: var(--bad); }

.blip { cursor: pointer; }
.blip circle.core { transition: opacity .15s; }
.blip:hover circle.core { opacity: .75; }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }

th {
    padding: 11px 20px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-faint);
    border-bottom: 1px solid var(--line-soft);
    white-space: nowrap;
}

td {
    padding: 12px 20px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 13px;
    vertical-align: middle;
}
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }

td.mono, .mono { font-family: var(--mono); font-size: 12px; }
td.right { text-align: right; white-space: nowrap; }
.empty { padding: 30px 20px; text-align: center; color: var(--text-faint); font-size: 13px; }

/* Compact list used by the map side panel */
.plist { display: flex; flex-direction: column; }
.prow {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 20px;
    border-bottom: 1px solid var(--line-soft);
    cursor: pointer;
    transition: background .14s;
}
.prow:hover { background: rgba(255, 255, 255, .025); }
.prow:last-child { border-bottom: 0; }
.prow .pd { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.prow .pinfo { flex: 1; min-width: 0; }
.prow .pinfo strong { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .pinfo small { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}
.badge.log    { background: rgba(139, 150, 168, .16); color: var(--text-dim); }
.badge.kick   { background: rgba(245, 165, 36, .16);  color: var(--warn); }
.badge.ban    { background: rgba(242, 84, 91, .16);   color: var(--bad); }
.badge.active { background: rgba(62, 207, 142, .16);  color: var(--good); }
.badge.pending{ background: rgba(245, 165, 36, .16);  color: var(--warn); }
.badge.none   { background: rgba(242, 84, 91, .16);   color: var(--bad); }
.badge.bypass {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(242, 163, 60, .28);
    margin-left: 6px;
    cursor: help;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
input[type="text"], input[type="password"], input[type="number"], input[type="search"], select, textarea {
    width: 100%;
    padding: 10px 13px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(242, 163, 60, .14);
}
textarea { resize: vertical; font-family: var(--mono); font-size: 12.5px; }
select { cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 175px; }
.field > span { font-size: 12px; color: var(--text-dim); }
.field.grow { flex: 1; min-width: 260px; }

.field-row { display: flex; gap: 14px; margin-bottom: 18px; align-items: flex-end; }
.field-row.wrap { flex-wrap: wrap; }
.field-row:last-child { margin-bottom: 0; }

.check-row { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 14px; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 38px; height: 21px; flex: 0 0 38px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
    position: absolute; inset: 0;
    background: var(--line);
    border-radius: 20px;
    cursor: pointer;
    transition: background .16s;
}
.switch .track::after {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 15px; height: 15px;
    background: #fff;
    border-radius: 50%;
    transition: transform .16s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(17px); }

.match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; margin-bottom: 20px; }
.match-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 13px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: var(--panel-2);
    color: var(--text);
    transition: background .15s, border-color .15s, opacity .15s;
    white-space: nowrap;
}
.btn:hover { background: #212b3a; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #14100a; font-weight: 700; }
.btn-primary:hover { background: var(--accent-hi); }

.btn-danger { background: rgba(242, 84, 91, .14); border-color: rgba(242, 84, 91, .3); color: var(--bad); }
.btn-danger:hover { background: rgba(242, 84, 91, .22); }

.btn-ghost { background: none; border-color: var(--line); color: var(--text-dim); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }

.save-bar { display: flex; gap: 10px; align-items: center; margin-top: 4px; }

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */
.toast {
    position: fixed;
    right: 28px; bottom: 28px;
    z-index: 60;
    padding: 13px 19px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    font-size: 13px;
    animation: slide .2s ease;
}
.toast.error { border-left-color: var(--bad); }
.toast.ok    { border-left-color: var(--good); }
@keyframes slide { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal {
    position: fixed; inset: 0; z-index: 80;
    display: grid; place-items: center;
    padding: 24px;
    background: rgba(4, 6, 10, .74);
}
.modal-box {
    width: 100%; max-width: 570px;
    max-height: 84vh;
    display: flex; flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Screenshots need room - a 1280px capture in a 570px box is pointless. */
.modal-box.wide {
    max-width: min(1600px, 95vw);
    max-height: 94vh;
}
.modal-box.wide .modal-body { padding: 16px; }
.modal-head { display: flex; align-items: center; padding: 17px 22px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { font-size: 15.5px; font-weight: 700; flex: 1; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 15px 22px; border-top: 1px solid var(--line-soft); }
.modal-foot:empty { display: none; }

.kv { display: grid; grid-template-columns: 132px 1fr; gap: 9px 16px; font-size: 13px; }
.kv dt { color: var(--text-dim); }
.kv dd { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.kv dd.nil { color: var(--text-faint); font-style: italic; font-family: var(--font); }

/* --------------------------------------------------------------------------
   Narrow screens
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
    .map-layout { grid-template-columns: 1fr; }
    .map-side { position: static; max-height: none; }
}

@media (max-width: 860px) {
    .app { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; z-index: 40;
        width: var(--sidebar-w);
        transform: translateX(-100%);
    }
    .app.nav-open .sidebar { transform: none; }
    .topbar { padding: 14px 18px; }
    .content { padding: 20px 18px 48px; }
    .panel-body { padding: 16px; }
    th, td { padding-left: 16px; padding-right: 16px; }
}
