/* App-level overrides on top of tokens.css.
   Colors must come from CSS variables defined in tokens.css — no hex values here. */

body {
    margin: 0;
    /* Font family is set by tokens.css via --ms-font-ui. */
    background: var(--ms-bg);
    color: var(--ms-text);
}

/* Side-nav links — colors via tokens. */
.nav-link {
    color: var(--ms-text-dim);
    padding: .5rem .75rem;
    border-radius: 6px;
}
.nav-link:hover {
    background: var(--ms-panel);
    color: var(--ms-text);
}
.nav-link.active {
    background: var(--ms-panel-header);
    color: var(--ms-text);
}

/* Bootstrap dark-table overrides for the existing list pages. */
.table-dark {
    --bs-table-bg: var(--ms-panel);
    --bs-table-striped-bg: var(--ms-panel-header);
    --bs-table-color: var(--ms-text);
}

/* ──────────────────────────────────────────────────────────────────────────
   Dark-mode consistency pass (UI polish).

   tokens.css already declares `color-scheme` per theme (dark on dark /
   hicontrast / auto-dark, light on the light theme), so native widgets
   (the <select> dropdown chrome, date pickers, default scrollbars) already
   match the theme. The rules below close the remaining gaps: form controls
   that weren't pulling the panel tokens, a single consistent accent focus
   ring, themed custom scrollbars everywhere (not just inside panels), and
   Bootstrap surfaces (paired with data-bs-theme on <html> in App.razor).
   ────────────────────────────────────────────────────────────────────── */

/* Form controls — adopt the panel surface, border + text tokens so an
   <input> / <select> / <textarea> on any screen (Replay window picker,
   dispatch modal selects, admin forms) reads as part of the dark chrome
   instead of a bright OS default. The purpose-built .ms-sel / .ms-audit-text
   styles set the same tokens, so this is a safety net, not a conflict. */
input[type="text"],
input[type="search"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="datetime-local"],
input[type="date"],
input[type="time"],
select,
textarea {
    background-color: var(--ms-panel);
    color: var(--ms-text);
    border: 1px solid var(--ms-panel-border);
}

/* Native option list of a <select> — color-scheme handles the chrome, but
   pin the surface explicitly for engines that ignore it. */
select option {
    background-color: var(--ms-panel);
    color: var(--ms-text);
}

/* Accent focus ring — one consistent affordance across every control. */
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
    outline: 2px solid var(--ms-accent);
    outline-offset: 1px;
}

/* Placeholder text leans on the mute token so it stays legible but recedes. */
input::placeholder,
textarea::placeholder {
    color: var(--ms-text-mute);
    opacity: 1; /* Firefox dims placeholders by default — undo it */
}

/* Themed custom scrollbars everywhere (panels already had their own; this
   covers page-level scroll regions like .ms-shell-main and modal bodies).
   Firefox via scrollbar-color; WebKit/Blink via the pseudo-elements. */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--ms-panel-border) transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--ms-panel-border);
    border-radius: 0;
}
::-webkit-scrollbar-thumb:hover { background: var(--ms-text-mute); }

/* Bootstrap surfaces — when a Bootstrap component IS used, make its panels
   follow the MariSight tokens instead of Bootstrap's own greys. data-bs-theme
   on <html> (set in App.razor) already flips Bootstrap to its dark variant;
   these overrides align the exact surface/border to ours. */
.dropdown-menu,
.modal-content,
.offcanvas,
.popover,
.card {
    background-color: var(--ms-panel);
    color: var(--ms-text);
    border-color: var(--ms-panel-border);
}
.dropdown-item { color: var(--ms-text); }
.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--ms-panel-header);
    color: var(--ms-text);
}
