/* ============================================================
   Nevian — dark skin

   A styling layer, not a redesign. Loaded after theme.css, ui.css and
   tailwind.css, it re-points the design tokens and repairs the handful
   of places where a light value was baked in. No markup changes, no
   layout changes, no component changes.

   To go back to light: remove the single <link> to this file.

   Reference vibe: near-black layered surfaces, generous corner radii,
   hairline borders, white headings against muted secondary text, and
   colour reserved for status and people.
   ============================================================ */

:root {
  /* ── Surfaces ────────────────────────────────────────────────
     The marketing site's surface ladder, verbatim. Near-black, then
     very small lifts: #050505 page, #090a0a window interior, #0c0d0d
     chrome (toolbars, wells, floating panels). Keeping the steps tight
     is what stops a dark UI from looking like grey stripes. */
  --bg:         #050505;
  --surface:    #0c0d0d;
  --card:       #090a0a;
  --card-2:     #0c0d0d;
  --hover:      #161817;
  --hover-fade: rgba(255, 255, 255, .03);

  /* Hairlines. Plain white at low alpha, like the site — these do all
     the structural work, there are no heavy borders anywhere. */
  --border:     rgba(255, 255, 255, .13);
  --border-2:   rgba(255, 255, 255, .20);
  --hairline:   rgba(255, 255, 255, .07);
  --well:       rgba(255, 255, 255, .03);
  --well-hi:    rgba(255, 255, 255, .08);

  /* ── Text ────────────────────────────────────────────────────
     Pure #fff glares on near-black, so the top rank stops short. */
  --text:  #eef2f0;
  --dim:   #9aa2a0;
  --muted: #767d7b;

  /* ── Brand ───────────────────────────────────────────────────
     One green, #15a06b, matching the marketing site exactly. Reserved
     for the one primary action per screen. The lighter mints below are
     data-viz only — never for buttons. */
  --accent:        #15a06b;
  --accent-bright: #17b378;
  --accent-deep:   #0f7d53;
  --accent-soft:   rgba(21, 160, 107, .12);
  --accent-line:   rgba(21, 160, 107, .32);
  --on-accent:     #ffffff;

  /* Live-data mint. Health dots, chart strokes, presence pulses —
     anything that means "this is a reading", not "this is clickable". */
  --live:      #57e39b;
  --live-soft: rgba(87, 227, 155, .12);
  --live-glow: rgba(87, 227, 155, .6);

  /* ── Status ──────────────────────────────────────────────────
     Tints rather than full-strength hues. Enough colour to triage a
     column at a glance, not enough to turn the screen into a warning
     label. Values lifted from the site's chart palette. */
  --green:  #57e39b;
  --yellow: #e6c766;
  --orange: #dd9040;
  /* The site's danger (#d8503f) lightened for near-black. Kept clearly
     red so it never reads as the amber warning next to it. */
  --red:    #ee7566;
  --blue:   #7fb2e8;
  --violet: #c0b0e4;

  --metal-hi:  rgba(255, 255, 255, .34);
  --metal-mid: rgba(255, 255, 255, .14);

  --topbar-bg: rgba(5, 5, 5, .86);

  /* Shape is deliberately NOT re-pointed here — the radius scale in
     theme.css is shared by both skins, so corners stay identical
     whichever one is loaded. */

  /* ── Elevation ───────────────────────────────────────────────
     A drop shadow barely registers on near-black, so depth comes
     from a hairline highlight along the top edge plus a wide, very
     soft shadow underneath. */
  --shadow-xs: inset 0 1px 0 rgba(255, 255, 255, .04);
  --shadow-sm: inset 0 1px 0 rgba(255, 255, 255, .04), 0 1px 2px rgba(0, 0, 0, .5);
  --shadow:    inset 0 1px 0 rgba(255, 255, 255, .04), 0 2px 10px rgba(0, 0, 0, .5), 0 8px 28px rgba(0, 0, 0, .4);
  --shadow-lg: 0 4px 18px rgba(0, 0, 0, .58), 0 24px 64px rgba(0, 0, 0, .55);
  --shadow-panel: 0 8px 30px rgba(0, 0, 0, .65), 0 36px 90px rgba(0, 0, 0, .6);
  --ring: 0 0 #0000; /* no focus rings, see the end of ui.css */
}

/* Tell the browser and form controls this is a dark surface, so native
   scrollbars, autofill and date pickers stop rendering light. */
:root { color-scheme: dark; }

/* ════════════════════════════════════════════════════════════
   Repairs: places where a light value was hard-coded
   ════════════════════════════════════════════════════════════ */

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .12);
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, .2);
  background-clip: content-box;
}

/* Tailwind's preflight sets a light default border colour on every element,
   so any width-only utility (`border-b`, `border-t`, `border`) without an
   explicit colour would draw a pale grey line on black. This is the single
   most important repair in this file. */
*, ::before, ::after { border-color: var(--border); }

/* The panel table's borders were tuned for a white ground; on dark the
   second declaration resolves to almost nothing. */
.admin-table-panel td,
.admin-table-panel th { border-color: var(--border); }

/* The content frame carried a light drop shadow from tailwind.css. It
   gets no elevation at all now — on near-black a drop shadow only shows
   up as a grey halo, and the hairline already reads as the edge. */
.admin-content-frame {
  box-shadow: none;
  border-color: var(--border);
}

/* Zebra striping was tuned for a white table. */
.admin-table-panel tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, .014);
}

/* Buttons are flat controls. Elevation belongs to panels, never actions. */
.admin-btn-primary,
.btn-primary,
.admin-btn,
.admin-btn:hover:not(:disabled),
.admin-btn-primary:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
  box-shadow: none;
}

/* Autofilled inputs otherwise flip to a pale yellow block. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--card-2) inset;
  caret-color: var(--text);
}

/* ════════════════════════════════════════════════════════════
   Box elements: the parts that read as "modern" in the references
   ════════════════════════════════════════════════════════════ */

/* Cards sit on a lifted surface with a hairline, not a hard border. */
.admin-card,
.card,
.stat,
.panel,
.ring-card,
.ticket-card {
  background: var(--card);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

/* Rounded table shell, matching the card radius. */
.admin-table th { background: var(--card-2); }
.admin-table th:first-child { border-top-left-radius: var(--radius-lg); }
.admin-table th:last-child  { border-top-right-radius: var(--radius-lg); }

/* Inputs and selects: dark well, hairline, emerald focus ring. */
.admin-input,
.admin-select,
.input,
.select,
textarea,
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="number"] {
  background: var(--card-2);
  border-color: var(--border-2);
  color: var(--text);
}
.admin-input::placeholder,
.input::placeholder,
textarea::placeholder,
input::placeholder { color: var(--muted); }

.admin-input:focus,
.admin-select:focus,
.input:focus,
textarea:focus,
input:focus {
  box-shadow: none;
  background: var(--surface);
}

/* Secondary buttons stay on the dark surface without elevation. */
.admin-btn {
  background: var(--card-2);
  border-color: var(--border-2);
  box-shadow: none;
}
.admin-btn:hover:not(:disabled) {
  background: var(--hover);
  border-color: var(--border-2);
  box-shadow: none;
}

/* The search pill on the Fleet page and the topbar. */
.glass-search {
  background: var(--card-2);
  border-color: var(--border-2);
  box-shadow: var(--shadow-xs);
}

/* The pill itself draws the frame, so the input inside has to stay
   invisible. Without this the broad input rules above win on specificity
   and paint a second filled box inside the pill. */
.admin-search input,
.glass-search input {
  height: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: 0;
  color: var(--text);
}
.admin-search input:focus,
.glass-search input:focus {
  background: transparent;
  border: 0;
  box-shadow: none;
  outline: 0;
}

/* Segmented controls: dark well with a lifted active chip, which is
   how the reference tab strips read. */
.seg {
  background: var(--card-2);
  border-color: var(--border);
}
.seg-slider {
  background: var(--hover);
  border-color: var(--border-2);
  box-shadow: var(--shadow-xs);
}

/* Sidebar: pure structure, no fill change — the hairline does the work. */
#sidebar { background: var(--bg); }

/* Active nav row uses the same neutral surface and hairline as dashboard cards. */
.nav-indicator {
  background: var(--card);
  border-color: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

/* Custom dropdown panel and menus. Separated from what's behind them by a
   lifted surface and a hairline, not by elevation — a drop shadow on
   near-black just fogs the content underneath. */
.cs-panel,
.pop {
  background: var(--surface);
  border-color: var(--border-2);
  box-shadow: none;
}
.cs-option:hover,
.cs-option[aria-selected="true"] { background: var(--hover-fade); }

/* Modals and drawers. */
.modal,
.admin-modal,
.shadow-panel {
  background: var(--surface);
  border-color: var(--border-2);
  box-shadow: var(--shadow-panel);
}

/* Code and pre blocks inside articles and notes. */
code, pre, .nt-pre, .prose pre {
  background: var(--card-2);
  border-color: var(--border);
}

/* Skeletons shimmer against the dark surface instead of the light one. */
.skeleton, .skel {
  background: linear-gradient(90deg, var(--card) 25%, var(--card-2) 37%, var(--card) 63%);
  background-size: 400% 100%;
}

/* The Nevian mark is a full-bleed glyph on transparency, so it sits on
   nothing at all: a plate would show as corners around the glyph, and any
   border-radius clips the image itself and shaves the arms off the N. */
.brand-logo,
.side-brand img {
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  object-fit: contain;
}

.bar-bg { background: var(--card-2); }

/* ════════════════════════════════════════════════════════════
   Selection and focus
   ════════════════════════════════════════════════════════════ */

::selection { background: rgba(21, 160, 107, .3); color: var(--text); }

/* ════════════════════════════════════════════════════════════
   OS brand marks

   Shared with the marketing site: the source SVGs are solid black, so
   brightness(0) then invert recolors them to a light grey. No plate
   behind the glyph — the shape alone identifies the platform, and a
   tinted box would only add noise to a long list. The Apple glyph
   reads optically smaller than the Windows one, so it renders a couple
   of pixels larger to balance.
   ════════════════════════════════════════════════════════════ */

.os-mark { display: grid; place-items: center; flex-shrink: 0; }
.os-mark img { object-fit: contain; filter: brightness(0) invert(.82); opacity: .92; }
.os-mark img.is-windows { width: 18px; height: 18px; }
.os-mark img.is-apple   { width: 21px; height: 21px; }
.os-mark svg { width: 18px; height: 18px; color: #d1d6d4; opacity: .92; }
