/* ---------------------------------------------------------------------------
   All.css — self-hosted fonts, design tokens, base layer, utilities.

   Visual language: a LIGHT analyst workspace with a DARK navigation rail.
   The rail anchors the app and keeps the eye out of the chrome; everything
   that holds data is light, high-contrast and dense.

   Two token families deliberately coexist:
     --bg / --surface / --fg ...   light application surfaces
     --side-*                      the dark rail (and the login brand panel)

   One mint-emerald accent is used only for action and signal. The
   red/amber/yellow/slate ramp is reserved exclusively for severity, so a
   colour always means the same thing. Every discovered VALUE is monospace;
   all UI chrome is Inter — that split is what makes the data read as
   forensic evidence rather than table filler.
--------------------------------------------------------------------------- */

/* --- fonts (served locally; these servers are usually isolated) ---------- */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../../assets/fonts/inter-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../../assets/fonts/inter-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../../assets/fonts/inter-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../../assets/fonts/inter-700.woff2') format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../../assets/fonts/jetbrains-400.woff2') format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../../assets/fonts/jetbrains-700.woff2') format('woff2');
}

/* --- tokens -------------------------------------------------------------- */
:root {
    /* light application surfaces */
    --bg:         #f6f8fb;
    --surface:    #ffffff;
    --surface-2:  #f3f6f9;
    --surface-3:  #e9edf3;
    --line:       #dde3ec;
    --line-soft:  #eaeef4;

    --fg:         #101828;
    --fg-muted:   #5b6676;
    --fg-dim:     #8b96a6;

    /* dark navigation rail (and login brand panel) */
    --side-bg:      #0f1620;
    --side-surface: #17212d;
    --side-line:    #243242;
    --side-fg:      #e9eff7;
    /* Nav labels sit on --side-link. It is deliberately close to --side-fg:
       the rail is the primary way around the app, so its text should read as
       readable-at-a-glance rather than as de-emphasised chrome. --side-muted
       and --side-dim stay for the genuinely secondary bits (icons, captions,
       the pipeline readout). */
    --side-link:    #d5dee9;
    --side-muted:   #a9b6c6;
    --side-dim:     #7c8b9c;
    --side-accent:  #2ee6a8;

    /* one accent — action and focus only, never decoration */
    --brand:      #0e9f6e;
    --brand-hover:#0b845b;
    --brand-ink:  #ffffff;
    --brand-bg:   #e7f7f0;
    --brand-line: #a4e2cb;
    --brand-glow: rgba(14, 159, 110, .15);

    /* severity ramp — reserved for severity, nothing else */
    --crit:       #c81e3c;
    --crit-bg:    #fdecef;
    --crit-line:  #f3c1cb;
    --high:       #b45c07;
    --high-bg:    #fdf3e5;
    --high-line:  #f2d6ac;
    --med:        #8a6d0b;
    --med-bg:     #fbf7e1;
    --med-line:   #ebdca2;
    --low:        #5b6676;
    --low-bg:     #f1f4f8;
    --low-line:   #dde3ec;

    --info:       #0b6fa4;
    --info-bg:    #e8f4fc;
    --info-line:  #b4dbf2;

    /* saturated fills for heatmap cells and bars */
    --fill-crit:  #e11d48;
    --fill-high:  #f59e0b;
    --fill-med:   #fcd34d;
    --fill-low:   #94a3b8;

    --ui:   'Inter', 'Segoe UI', Roboto, system-ui, sans-serif;
    --mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;

    /* sharp, not pill-shaped — instrumentation, not consumer app */
    --r:    7px;
    --r-sm: 5px;

    --sidebar-w: 236px;
    /* Collapsed rail: wide enough for the icon plus its hit area, so the nav
       stays usable rather than becoming a thin strip. */
    --sidebar-w-mini: 62px;
    --topbar-h:  56px;

    --shadow:    0 1px 2px rgba(16, 24, 40, .05), 0 10px 26px rgba(16, 24, 40, .06);
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow-lg: 0 18px 50px rgba(16, 24, 40, .16);
}

/* --- base ---------------------------------------------------------------- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--ui);
    font-size: 13.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }

h1, h2, h3, h4, h5, h6 {
    font-weight: 650;
    letter-spacing: -.011em;
    color: var(--fg);
}

::selection { background: rgba(14, 159, 110, .18); }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* --- scrollbars ---------------------------------------------------------- */
* { scrollbar-width: thin; scrollbar-color: #c4ccd8 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #c8d0dc;
    border: 2px solid var(--bg);
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover { background: #aeb9c8; }

/* The rail keeps its own dark scrollbar. */
.app-sidebar { scrollbar-color: #33445a transparent; }
.app-sidebar ::-webkit-scrollbar-thumb {
    background: #2c3b4d;
    border-color: var(--side-bg);
}

/* --- typography utilities ------------------------------------------------ */
.mono, code, pre, .text-mono {
    font-family: var(--mono);
    font-size: .92em;
    font-variant-ligatures: none;
}

code {
    color: #0b6b4c;
    background: var(--brand-bg);
    border: 1px solid var(--brand-line);
    border-radius: var(--r-sm);
    padding: .5px 5px;
}

/* Micro caps label — the recurring signature of this UI. */
.eyebrow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--fg-dim);
    font-family: var(--ui);
}

.num {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}

.muted { color: var(--fg-muted); }
.dim   { color: var(--fg-dim); }

.cursorPointer { cursor: pointer; }

/* Long values (URLs, query strings, paths) must never widen the page. */
.text-clip {
    display: inline-block;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

/* --- severity + state chips ---------------------------------------------- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1.5px 8px;
    border-radius: var(--r-sm);
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: .045em;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid transparent;
    font-family: var(--ui);
}

/* Leading dot makes each chip legible without relying on colour alone. */
.pill::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 5px;
}

.pill-danger    { color: var(--crit);  background: var(--crit-bg);  border-color: var(--crit-line); }
.pill-warning   { color: var(--high);  background: var(--high-bg);  border-color: var(--high-line); }
.pill-med       { color: var(--med);   background: var(--med-bg);   border-color: var(--med-line); }
.pill-info      { color: var(--info);  background: var(--info-bg);  border-color: var(--info-line); }
.pill-primary   { color: var(--info);  background: var(--info-bg);  border-color: var(--info-line); }
.pill-success   { color: var(--brand); background: var(--brand-bg); border-color: var(--brand-line); }
.pill-secondary { color: var(--fg-muted); background: var(--low-bg); border-color: var(--line); }

.pill.no-dot::before { display: none; }

/* --- loader -------------------------------------------------------------- */
.custom-loader-wrapper {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(246, 248, 251, .68);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-loader {
    width: 34px;
    height: 34px;
    border: 2px solid var(--surface-3);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .68s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .35; transform: scale(.86); }
}

@media (prefers-reduced-motion: reduce) {
    .custom-loader { animation-duration: 2.4s; }
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
