/* Polish layer on top of DaisyUI 5 — elevation, glass, and shell chrome.
   Uses the DaisyUI 5 CSS custom properties (`--color-*`, which hold full
   color values), not the removed v4 `--p`/`--b1` HSL-channel aliases. */

/* ── Base ── */

html {
    scroll-behavior: smooth;
}

*:focus {
    outline: none;
}

a,
button {
    transition: all 0.15s ease;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Admin shell ──
   Flat paper: a plain base fill, with the sidebar set one step darker. */

.admin-shell {
    min-height: 100vh;
    background: var(--color-base-100);
}

.admin-shell .drawer-content {
    background: transparent;
}

/* Glass sidebar + mobile navbar */
.glass-panel {
    background: color-mix(in srgb, var(--color-base-100) 85%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.admin-shell .drawer-side > aside {
    background: color-mix(in srgb, var(--color-base-200) 95%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ── Nav links ── */

.nav-link {
    border-radius: 0.75rem;
    padding: 0.6rem 0.75rem;
    gap: 0.6rem;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.nav-link:hover {
    background: color-mix(in srgb, var(--color-base-300) 60%, transparent);
}

.nav-link.active {
    background: var(--color-base-300);
    color: var(--color-base-content);
}

/* ── Cards ──
   `.card-elevated` is the resting surface (border + soft shadow). The lift on
   hover is handled by `.card-hover` in tailwind.css so the two never fight. */

.card-elevated {
    border-radius: 0.875rem;
    border: 1px solid var(--color-base-300);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* ── Buttons ── */

.btn-strong {
    border: 1px solid var(--color-primary);
    font-weight: 500;
}

.btn-strong:hover {
    opacity: 0.86;
}

/* ── Docs cards: feature-card style ── */

.docs-shell .not-prose > div[class*="bg-base-300"] {
    background: color-mix(in srgb, var(--color-base-200) 96%, transparent);
    border: 1px solid
        color-mix(in srgb, var(--color-base-300) 70%, transparent);
    border-radius: 14px;
    padding: 0;
    transition:
        border-color 0.25s,
        transform 0.25s,
        box-shadow 0.25s;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.03),
        0 8px 22px rgba(0, 0, 0, 0.12);
}

.docs-shell .not-prose > div[class*="bg-base-300"]:hover {
    border-color: color-mix(
        in srgb,
        var(--color-base-content) 20%,
        var(--color-base-300) 80%
    );
    transform: translateY(-2px);
    box-shadow:
        0 2px 0 rgba(255, 255, 255, 0.04),
        0 14px 30px rgba(0, 0, 0, 0.2);
}

/* ── Modals ── */

.modal .modal-box.modal-polished {
    border-radius: 1rem;
    border: 1px solid
        color-mix(in srgb, var(--color-base-300) 70%, transparent);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.modal-backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ── Tables ── */

.table-wrap {
    border-radius: 1rem;
    border: 1px solid
        color-mix(in srgb, var(--color-base-300) 70%, transparent);
    background: color-mix(in srgb, var(--color-base-200) 96%, transparent);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.table-polished thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: color-mix(in srgb, var(--color-base-200) 96%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.table-polished tbody tr {
    transition:
        background 160ms ease,
        box-shadow 160ms ease;
}

.table-polished tbody tr:hover {
    background: var(--color-base-200);
}

/* ── Empty state ── */

.empty-state {
    border-radius: 1.5rem;
    border: 1px dashed
        color-mix(in srgb, var(--color-base-300) 70%, transparent);
    background: var(--color-base-200);
}

/* ── oxidt-auth LocalLoginPage hooks (AUTH_MODE=local) ── */
/* The crate's page renders fine without these; they give it the same
   gradient backdrop and glass card as the rest of the template. */

.auth-bg {
    background:
        radial-gradient(color-mix(in oklab, var(--color-base-content) 14%, transparent) 1px, transparent 1.2px) 0 0 / 22px 22px,
        var(--color-base-100);
}

.auth-card {
    background: color-mix(in oklab, var(--color-base-200) 60%, transparent);
    backdrop-filter: blur(24px);
    border: 1px solid color-mix(in oklab, var(--color-base-300) 50%, transparent);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* ==========================================================================
   Charts (web/charts.rs)
   ==========================================================================

   Color is not chosen by eye. Every slot was run through the dataviz
   validator against this app's own surfaces (light base-100 #ffffff, dark
   #0a0a0a), each mode its own steps from the same blue ramp, never a flip:

     series-1 / series-2   light: CVD ΔE 24.7, normal 33.6 · dark: 26.8 / 31.8 — pass
     tier-1 … tier-4       ordinal: one hue, monotone L, ΔL ≥ 0.06, end ≥ 2:1 — pass
     status good/warn/crit CVD 11.3, normal-vision 27.6

   Two documented exceptions, both in the reserved status palette (which the
   categorical band rule does not govern): --status-warning #fab219 sits above
   the dark band (L 0.811), because every in-band yellow collapses against
   --status-good under protanopia (#c98500 measures ΔE 3.0); and on light it
   is 1.83:1, relieved by the legend and every chart's table view.

   Escalation reads toward the extreme: darker on light, brighter on dark.
   Re-run the validator before changing any slot. */

:root,
[data-theme="light"] {
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-critical: #d03b3b;
  --tier-1: #86b6ef;
  --tier-2: #3987e5;
  --tier-3: #1c5cab;
  --tier-4: #0d366b;
}

[data-theme="dark"] {
  --series-1: #3987e5;
  --series-2: #d95926;
  --tier-1: #184f95;
  --tier-2: #256abf;
  --tier-3: #3987e5;
  --tier-4: #86b6ef;
}

.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline {
  stroke: color-mix(in oklab, var(--color-base-content) 10%, transparent);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.chart .tick {
  fill: color-mix(in oklab, var(--color-base-content) 55%, transparent);
  font-size: 10px;
}
.chart .threshold line {
  stroke: color-mix(in oklab, var(--color-base-content) 30%, transparent);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.chart rect[fill="transparent"] { cursor: crosshair; }
.chart rect[fill="transparent"]:hover {
  fill: color-mix(in oklab, var(--color-base-content) 5%, transparent);
}
/* Tone marks the tile's edge; the number keeps its text token. */
.stat-good { border-left: 4px solid var(--status-good); }
.stat-critical { border-left: 4px solid var(--status-critical); }

/* On a phone every chart is heavily downscaled with its viewBox, text included. */
@media (max-width: 760px) {
  .chart .tick { font-size: 20px; }
}
