/*
 * Noir — a monochrome skin for the Attendance HRM.
 *
 * This is layered ON TOP of Filament's own stylesheet, registered through
 * FilamentAsset::register() in AppServiceProvider. It is deliberately not a
 * Filament "theme": Panel::theme() REPLACES the framework stylesheet, and a
 * replacement has to be compiled from Filament's Tailwind sources. This
 * deployment has no Vite build and no node toolchain, so a compiled theme is
 * not buildable here. Everything below is plain CSS against Filament's own
 * class names and custom properties, which needs no build step.
 *
 * The palette itself comes from AdminPanelProvider::colors(); this file only
 * does the things a palette cannot: surface treatment, borders, density of
 * shadow, and the monochrome sidebar.
 *
 * Both themes are supported. Filament puts `.dark` on <html>, so every rule
 * here has a light form and, where it differs, a `.dark` counterpart. Spacing
 * is left entirely alone — Filament's defaults.
 */

:root {
    /* One radius for the whole panel. Filament mixes several by default,
       which reads as busy once the colour is taken away. */
    --hrm-radius: 0.625rem;
    --hrm-border: rgb(228 228 231);          /* zinc-200 */
    --hrm-border-strong: rgb(212 212 216);   /* zinc-300 */
    --hrm-surface: rgb(255 255 255);
    --hrm-canvas: rgb(250 250 250);          /* zinc-50  */
}

.dark {
    --hrm-border: rgb(39 39 42);             /* zinc-800 */
    --hrm-border-strong: rgb(63 63 70);      /* zinc-700 */
    --hrm-surface: rgb(24 24 27);            /* zinc-900 */
    --hrm-canvas: rgb(9 9 11);               /* zinc-950 */
}

/* ---- Canvas -------------------------------------------------------------
   A flat, slightly recessed page so raised surfaces read without shadow. */

.fi-body {
    background-color: var(--hrm-canvas);
}

/* ---- Surfaces -----------------------------------------------------------
   Noir trades drop shadows for hairlines. Shadows on a monochrome panel turn
   into grey mush; a single crisp border separates things far better. */

.fi-section,
.fi-wi-stats-overview-stat,
.fi-ta-ctn,
.fi-fo-component-ctn,
.fi-modal-window,
.fi-dropdown-panel {
    border: 1px solid var(--hrm-border);
    border-radius: var(--hrm-radius);
    box-shadow: none;
    background-color: var(--hrm-surface);
}

.fi-modal-window,
.fi-dropdown-panel {
    /* The two things that genuinely float keep a shadow, or they look pasted
       onto the page rather than above it. */
    box-shadow: 0 16px 40px -12px rgb(0 0 0 / 0.18);
}

.dark .fi-modal-window,
.dark .fi-dropdown-panel {
    box-shadow: 0 16px 40px -12px rgb(0 0 0 / 0.6);
}

/* ---- Sidebar ------------------------------------------------------------
   Kept monochrome. The active item is marked by weight and a solid rail
   rather than a block of primary colour. */

.fi-sidebar,
.fi-topbar > nav {
    background-color: var(--hrm-surface);
    border-color: var(--hrm-border);
}

.fi-sidebar-item-button {
    border-radius: calc(var(--hrm-radius) - 0.125rem);
}

.fi-sidebar-item-active .fi-sidebar-item-button {
    background-color: rgb(244 244 245); /* zinc-100 */
    font-weight: 600;
}

.dark .fi-sidebar-item-active .fi-sidebar-item-button {
    background-color: rgb(39 39 42); /* zinc-800 */
}

.fi-sidebar-group-label {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.6875rem;
    opacity: 0.55;
}

/* ---- Tables -------------------------------------------------------------
   Headers become quiet labels; rows are separated by hairlines only. */

.fi-ta-header-cell {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.6875rem;
    font-weight: 600;
    opacity: 0.6;
}

.fi-ta-row:not(:last-child) {
    border-bottom: 1px solid var(--hrm-border);
}

.fi-ta-row:hover {
    background-color: rgb(250 250 250);
}

.dark .fi-ta-row:hover {
    background-color: rgb(39 39 42 / 0.5);
}

/* Numbers line up when they share a width. */
.fi-ta-text-item-label {
    font-variant-numeric: tabular-nums;
}

/* ---- Badges -------------------------------------------------------------
   Flat, bordered, no gradient — so a coloured badge is a signal. */

.fi-badge {
    border-radius: 9999px;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.06);
}

.dark .fi-badge {
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08);
}

/* ---- Buttons & inputs ---------------------------------------------------
   Primary is near-black, so it needs no gradient to carry weight. */

.fi-btn {
    border-radius: calc(var(--hrm-radius) - 0.125rem);
    box-shadow: none;
    font-weight: 600;
}

.fi-input-wrp {
    border-radius: calc(var(--hrm-radius) - 0.125rem);
    box-shadow: none;
    border: 1px solid var(--hrm-border-strong);
}

.fi-input-wrp:focus-within {
    border-color: rgb(113 113 122); /* zinc-500 */
    box-shadow: 0 0 0 1px rgb(113 113 122);
}

/* ---- Headings -----------------------------------------------------------
   Slightly tighter, which reads as deliberate rather than default. */

.fi-header-heading {
    letter-spacing: -0.015em;
}

.fi-section-header-heading {
    letter-spacing: -0.01em;
}
