/* NodeShield Panel — shared layout (no Tailwind dep, all vanilla) */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0a0a0a;
    color: #e5e5e5;
    min-height: 100vh;
}
a { color: #fbbf24; text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

.layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, #0d0d0d 0%, #0a0a0a 100%); border-right: 1px solid #1f1f1f; padding: 1rem .75rem; display: flex; flex-direction: column; }

.sidebar .brand { display: flex; align-items: center; gap: .65rem; padding: .25rem .5rem 1.25rem; border-bottom: 1px solid #1f1f1f; margin-bottom: 1rem; }
.sidebar .brand-logo { width: 36px; height: 36px; border-radius: .5rem; background: linear-gradient(135deg, #f97316, #fbbf24); display: grid; place-items: center; box-shadow: 0 6px 20px rgba(249,115,22,.25); }
.sidebar .brand-logo svg { width: 20px; height: 20px; color: #0a0a0a; }
.sidebar .brand-text h1 { font-size: .95rem; color: #fafafa; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.sidebar .brand-text small { display: block; color: #71717a; font-size: .7rem; margin-top: 1px; }

.sidebar .section-label { color: #52525b; font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; padding: .5rem .75rem .25rem; margin-top: .25rem; font-weight: 600; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: .65rem; padding: .5rem .75rem; border-radius: .5rem; font-size: .875rem; font-weight: 500; text-decoration: none; color: #a1a1aa; border: 1px solid transparent; transition: all .15s; }
.sidebar nav a:hover { background: #161616; color: #e5e5e5; text-decoration: none; }
.sidebar nav a.is-active { color: #fbbf24; background: linear-gradient(90deg, rgba(249,115,22,.12), rgba(249,115,22,.02)); border-color: rgba(249,115,22,.22); }
.sidebar nav a svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .8; }
.sidebar nav a.is-active svg { opacity: 1; }

.sidebar .footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid #1f1f1f; }
.sidebar .user-card { display: flex; align-items: center; gap: .65rem; padding: .55rem .65rem; border-radius: .55rem; background: #131313; border: 1px solid #1f1f1f; margin-bottom: .5rem; }
.sidebar .user-card .avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #f97316, #fbbf24); flex-shrink: 0; display: grid; place-items: center; color: #0a0a0a; font-weight: 700; font-size: .8rem; }
.sidebar .user-card .meta { min-width: 0; flex: 1; }
.sidebar .user-card .meta-line1 { font-size: .8rem; color: #e5e5e5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .user-card .meta-line2 { font-size: .65rem; color: #52525b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

.content { padding: 2rem; max-width: 1400px; }
.content h2 { font-size: 1.5rem; margin: 0 0 .5rem; color: #fff; }
.content .subtitle { color: #71717a; margin: 0 0 2rem; font-size: .875rem; }

.card { background: #161616; border: 1px solid #2a2a2a; border-radius: .75rem; padding: 1.25rem; margin-bottom: 1rem; }
.card h3 { margin: 0 0 .25rem; font-size: 1rem; color: #fff; display: flex; align-items: center; gap: .5rem; }
.card .card-desc { color: #71717a; font-size: .8rem; margin: 0 0 1rem; }

.row { display: flex; align-items: center; justify-content: space-between; padding: .5rem 0; gap: 1rem; }
.row + .row { border-top: 1px solid #1f1f1f; }
.row-label { font-family: monospace; font-size: .9rem; color: #d4d4d4; }

select { background: #0f0f0f; color: #e5e5e5; border: 1px solid #2a2a2a; border-radius: .375rem; padding: .25rem .5rem; font-size: .8rem; }
select:focus { outline: 1px solid #f97316; }

.toggle { position: relative; width: 36px; height: 20px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider { position: absolute; inset: 0; background: #3f3f46; border-radius: 999px; transition: .2s; cursor: pointer; }
.toggle .slider::before { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: .2s; }
.toggle input:checked + .slider { background: #f97316; }
.toggle input:checked + .slider::before { transform: translateX(16px); }

.btn { display: inline-flex; align-items: center; gap: .375rem; padding: .5rem .875rem; border-radius: .5rem; border: 1px solid #2a2a2a; background: #1c1c1c; color: #e5e5e5; font-size: .875rem; }
.btn:hover { background: #27272a; }
.btn-primary { background: #f97316; border-color: #f97316; color: #0a0a0a; font-weight: 600; }
.btn-primary:hover { background: #fb923c; }
.btn-danger  { background: #dc2626; border-color: #dc2626; color: #fff; }

table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { text-align: left; padding: .55rem .75rem; background: #0f0f0f; color: #71717a; font-weight: 600; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid #1f1f1f; }
td { padding: .75rem; border-top: 1px solid #1a1a1a; vertical-align: top; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #181818; }
tbody tr.is-loading td { color: #525252; text-align: center; padding: 2rem; }

/* Search-style input — compact, with optional leading icon.
   IMPORTANT: must spell the padding shorthand on the input so the
   global `input[type=text] { padding: .5rem .75rem }` rule later in
   this file (line ~204) can't shorthand-override the icon's
   reserved space — same selector specificity (11), later wins. */
.search-input { position: relative; display: block; width: 100%; }
.search-input > input[type=text] {
    padding: .5rem .75rem .5rem 2.4rem;
    width: 100%;
}
.search-input > svg {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #71717a;
    pointer-events: none;
}

/* Action row helpers */
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.toolbar .grow { flex: 1; min-width: 200px; }
.toolbar label { display: block; }
.toolbar label > span { display: block; color: #a1a1aa; font-size: .7rem; font-weight: 500; margin-bottom: .25rem; }
select.form-select {
    width: 100%; padding: .5rem 2rem .5rem .75rem;
    background: #0f0f0f url("data:image/svg+xml;charset=UTF-8,%3csvg viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") no-repeat right .65rem center / 14px;
    color: #e5e5e5; border: 1px solid #2a2a2a; border-radius: .375rem; font-size: .875rem;
    appearance: none; -webkit-appearance: none;
}
select.form-select option { background: #0f0f0f; color: #e5e5e5; }
select.form-select:focus { outline: none; border-color: #f97316; box-shadow: 0 0 0 3px rgba(249,115,22,.15); }

/* Custom dropdown — option panel only (the trigger now uses .action-pill from
 * settings.html). Removed in v4.11 audit: .dropdown-trigger, .dropdown-trigger
 * sub-classes, .cat-bar (superseded by .tabs in whitelists.html), and
 * .kind-chip — none were referenced anywhere. */
.dropdown { position: relative; display: inline-block; width: 100%; }
.dropdown-panel {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
    background: #131313; border: 1px solid #2f2f2f; border-radius: .5rem;
    box-shadow: 0 12px 32px rgba(0,0,0,.5);
    padding: .25rem; max-height: 280px; overflow-y: auto;
    display: none;
}
.dropdown.is-open .dropdown-panel { display: block; animation: ddPop .12s ease-out; }
@keyframes ddPop { from { opacity: 0; transform: translateY(-4px) } to { opacity: 1; transform: translateY(0) } }
.dropdown-panel button {
    width: 100%; padding: .5rem .65rem; background: transparent; color: #d4d4d4;
    border: none; border-radius: .35rem; text-align: left; font-size: .82rem;
    display: flex; flex-direction: column; gap: 2px; cursor: pointer; font-family: inherit;
}
.dropdown-panel button:hover { background: #1c1c1c; color: #fafafa; }
.dropdown-panel button.is-selected { background: rgba(249,115,22,.12); color: #fbbf24; }
.dropdown-panel button .opt-desc { font-family: -apple-system, sans-serif; font-size: .68rem; color: #71717a; }

/* ── Action pill — settings page per-detection trigger ─────────────────── */
.action-pill {
    display: inline-flex; align-items: center; justify-content: space-between;
    gap: .5rem; min-width: 92px;
    padding: .35rem .55rem; border-radius: .45rem;
    font-size: .68rem; font-weight: 700; letter-spacing: .06em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    cursor: pointer; border: 1px solid transparent;
    transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
    background: transparent;
}
.action-pill .ap-left    { display: inline-flex; align-items: center; gap: .4rem; }
.action-pill .ap-dot     { width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex-shrink: 0; box-shadow: 0 0 0 2px rgba(255,255,255,.04); }
.action-pill .ap-chevron { width: 11px; height: 11px; opacity: .5; transition: transform .2s, opacity .15s; flex-shrink: 0; }
.action-pill:hover .ap-chevron { opacity: .9; }
.dropdown.is-open .action-pill .ap-chevron { transform: rotate(180deg); opacity: 1; }

.action-pill.is-log {
    background: rgba(82,82,91,.12); color: #a1a1aa; border-color: rgba(82,82,91,.3);
}
.action-pill.is-log:hover { background: rgba(82,82,91,.22); border-color: rgba(82,82,91,.55); color: #d4d4d4; }

.action-pill.is-kick {
    background: linear-gradient(180deg, rgba(251,191,36,.16), rgba(251,191,36,.06));
    color: #fbbf24; border-color: rgba(251,191,36,.32);
}
.action-pill.is-kick:hover { background: linear-gradient(180deg, rgba(251,191,36,.24), rgba(251,191,36,.1)); border-color: rgba(251,191,36,.55); }

.action-pill.is-ban {
    background: linear-gradient(180deg, rgba(244,63,94,.2), rgba(244,63,94,.07));
    color: #fb7185; border-color: rgba(244,63,94,.35);
    box-shadow: inset 0 0 14px rgba(244,63,94,.06);
}
.action-pill.is-ban:hover { background: linear-gradient(180deg, rgba(244,63,94,.28), rgba(244,63,94,.13)); border-color: rgba(244,63,94,.6); box-shadow: inset 0 0 16px rgba(244,63,94,.1), 0 0 0 1px rgba(244,63,94,.08); }

.dropdown.is-open .action-pill { box-shadow: 0 0 0 3px rgba(249,115,22,.18); border-color: rgba(249,115,22,.6); }

/* ── Option rows in the action dropdown panel ─────────────────────────── */
.action-opt {
    display: flex; flex-direction: column; gap: 3px;
    padding: .55rem .65rem; border-radius: .45rem; cursor: pointer;
    background: transparent; border: 1px solid transparent;
    width: 100%; text-align: left; color: #d4d4d4; font-family: inherit;
    transition: background .12s, border-color .12s;
}
.action-opt:hover { background: #1c1c1c; border-color: #2a2a2a; }
.action-opt.is-selected { background: rgba(249,115,22,.08); border-color: rgba(249,115,22,.2); }
.action-opt .opt-head { display: flex; align-items: center; gap: .55rem; }
.action-opt .opt-dot  { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(255,255,255,.03); }
.action-opt .opt-name { font-size: .85rem; font-weight: 600; color: #fafafa; flex: 1; letter-spacing: -.01em; }
.action-opt .opt-check { color: #fbbf24; font-weight: 700; font-size: .8rem; opacity: 0; transition: opacity .12s; }
.action-opt.is-selected .opt-check { opacity: 1; }
.action-opt .opt-desc { color: #71717a; font-size: .7rem; padding-left: 19px; line-height: 1.35; }

/* Filter chip — for active filters */
.chip { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .5rem; border-radius: 999px; background: #161616; border: 1px solid #2a2a2a; color: #a1a1aa; font-size: .7rem; font-weight: 500; }
.chip.is-amber { background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.25); color: #fbbf24; }

/* Detail row code block */
pre.detail-block { background: #0a0a0a; color: #a1a1aa; padding: .65rem; font-size: .72rem; border-radius: .35rem; border: 1px solid #1f1f1f; max-height: 240px; overflow: auto; }

input[type=text], input[type=email], input[type=password],
input[type=url],  input[type=number], textarea {
    background: #0f0f0f; border: 1px solid #2a2a2a; border-radius: .375rem;
    padding: .5rem .75rem; color: #e5e5e5; font-size: .875rem; width: 100%;
    font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #3f3f46; }
input:focus, textarea:focus { outline: none; border-color: #f97316; box-shadow: 0 0 0 3px rgba(249,115,22,.15); }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { opacity: .35; }
input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; letter-spacing: -.01em; }
input.is-set { border-color: #14532d; background: linear-gradient(#0f1a13, #0f0f0f); }
input.is-invalid { border-color: #7f1d1d; box-shadow: 0 0 0 3px rgba(220,38,38,.15); }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: #3f3f46; flex-shrink: 0; }
.status-dot.is-on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18); }

.field-stack { display: flex; flex-direction: column; gap: .35rem; padding: .75rem 0; }
.field-stack + .field-stack { border-top: 1px solid #1f1f1f; }
.field-stack .field-head { display: flex; align-items: center; gap: .5rem; }
.field-stack .field-label { font-weight: 600; color: #e5e5e5; font-size: .875rem; }
.field-stack .field-desc  { color: #71717a; font-size: .72rem; margin-left: auto; }

.actions-bar { position: sticky; top: 0; z-index: 5; background: linear-gradient(#0a0a0a, rgba(10,10,10,.85)); backdrop-filter: blur(6px); padding: 1rem 0; margin: -1rem 0 .5rem; display: flex; justify-content: space-between; align-items: center; }
.actions-bar .dirty-pill { color: #fbbf24; font-size: .75rem; opacity: 0; transition: opacity .2s; }
.actions-bar.is-dirty .dirty-pill { opacity: 1; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }

.stat-card { position: relative; background: #131313; border: 1px solid #232323; border-radius: .75rem; padding: 1.1rem 1.25rem 1.25rem; overflow: hidden; transition: border-color .15s, transform .15s; }
.stat-card:hover { border-color: #2f2f2f; transform: translateY(-1px); }
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent, #f97316); }
.stat-card .stat-head { display: flex; align-items: center; gap: .5rem; color: #71717a; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.stat-card .stat-head svg { width: 14px; height: 14px; color: var(--accent, #f97316); }
.stat-num  { font-size: 1.85rem; font-weight: 700; color: #fafafa; line-height: 1.1; margin-top: .55rem; letter-spacing: -.02em; }
.stat-num .stat-num-unit { font-size: .9rem; color: #71717a; font-weight: 500; margin-left: .25rem; }
.stat-sub  { color: #52525b; font-size: .7rem; margin-top: .35rem; }
.stat-accent-amber  { --accent: #fbbf24; }
.stat-accent-cyan   { --accent: #06b6d4; }
.stat-accent-violet { --accent: #a855f7; }
.stat-accent-rose   { --accent: #f43f5e; }
.stat-accent-emerald{ --accent: #10b981; }

.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .55rem; border-radius: 999px; font-size: .7rem; font-weight: 600; border: 1px solid transparent; }
.pill-online { background: rgba(34,197,94,.12); color: #4ade80; border-color: rgba(34,197,94,.25); }
.pill-amber  { background: rgba(251,191,36,.12); color: #fbbf24; border-color: rgba(251,191,36,.25); }
.pill-muted  { background: #161616; color: #a1a1aa; border-color: #2a2a2a; }

.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-header h2 { font-size: 1.4rem; margin: 0; color: #fafafa; letter-spacing: -.01em; }
.page-header .crumbs { color: #52525b; font-size: .8rem; margin-bottom: .4rem; }
.page-header .crumbs strong { color: #a1a1aa; font-weight: 600; }

.range-tabs { display: inline-flex; padding: 3px; background: #0f0f0f; border: 1px solid #1f1f1f; border-radius: .5rem; gap: 2px; }
.range-tabs button { background: transparent; color: #71717a; border: none; padding: .35rem .75rem; font-size: .75rem; font-weight: 500; border-radius: .35rem; }
.range-tabs button.is-active { background: #1c1c1c; color: #fbbf24; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.range-tabs button:hover:not(.is-active) { color: #d4d4d4; }

.chart-card {
    background: linear-gradient(180deg, #161616 0%, #111111 100%);
    border: 1px solid #1f1f1f;
    border-radius: .85rem;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.02);
    transition: border-color .2s ease;
}
.chart-card:hover { border-color: #2a2a2a; }
.chart-card .chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .75rem; }
.chart-card .chart-head h3 { margin: 0; font-size: 1rem; color: #fafafa; font-weight: 600; letter-spacing: -.01em; }
.chart-card .chart-head .chart-sub { color: #525252; font-size: .72rem; margin-top: 2px; }
.chart-card .chart-meta { display: flex; gap: 1.25rem; }
.chart-card .chart-meta .m { text-align: right; }
.chart-card .chart-meta .m-lbl { font-size: .65rem; color: #525252; text-transform: uppercase; letter-spacing: .08em; }
.chart-card .chart-meta .m-val { font-size: 1.05rem; color: #fafafa; font-weight: 700; font-variant-numeric: tabular-nums; }

.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; padding-top: .25rem; }

/* SVG donut — viewBox is 200×200; displayed at 172px for crisp 1.16× downsampling.
   shape-rendering=geometricPrecision smooths the arc edges on all browsers. */
.donut-svg-wrap {
    position: relative;
    width: 172px;
    height: 172px;
}
.donut-svg-wrap svg {
    width: 100%;
    height: 100%;
    display: block;
    shape-rendering: geometricPrecision;
    filter: drop-shadow(0 6px 20px rgba(0,0,0,.35));
}
.donut-svg-wrap .donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    line-height: 1;
}
.donut-svg-wrap .donut-num {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -.025em;
    font-variant-numeric: tabular-nums;
    color: #fafafa;
    background: linear-gradient(180deg, #ffffff 0%, #b4b4b4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: .35rem;
}
.donut-svg-wrap .donut-lbl {
    font-size: .58rem;
    color: #525252;
    text-transform: uppercase;
    letter-spacing: .18em;
    font-weight: 600;
}

.legend { width: 100%; display: flex; flex-direction: column; gap: .15rem; }
.legend .legend-row {
    display: grid;
    grid-template-columns: 10px 1fr auto auto;
    align-items: center;
    gap: .6rem;
    font-size: .78rem;
    padding: .4rem .55rem;
    border-radius: .4rem;
    transition: background-color .15s ease;
}
.legend .legend-row:hover { background-color: rgba(255,255,255,.025); }
.legend .legend-row .dot {
    width: 10px; height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}
.legend .legend-row .name {
    color: #d4d4d4;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.legend .legend-row .pct {
    color: #525252;
    font-size: .7rem;
    font-variant-numeric: tabular-nums;
    min-width: 2.5rem;
    text-align: right;
}
.legend .legend-row .val {
    color: #a3a3a3;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    min-width: 1.5rem;
    text-align: right;
}

.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: #525252;
    font-size: .8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
}
.empty-state svg { color: #404040; }

@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { border-right: none; border-bottom: 1px solid #1f1f1f; }
    .content { padding: 1rem; }
}
