/* krios-theme.css
   Global overrides layered on top of MudBlazor to reproduce the old DashCode / Tailwind look.
   Loaded AFTER MudBlazor's stylesheet in App.razor so these win.

   Everything keys off MudBlazor's own --mud-palette-* variables (set by KriosTheme.cs) so it
   tracks light and dark mode automatically. Tokens were pulled from the original build in
   assets/css/app.css (line references in comments). No Tailwind, no app.css, no jQuery. */

/* ---------------------------------------------------------------------------
   App bar — the old header was a light/white bar (~80px) with a soft shadow,
   not MudBlazor's flat coloured bar. (app.css: .logo-segment bg = white)
   --------------------------------------------------------------------------- */
.krios-appbar.mud-appbar {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.06);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

/* ---------------------------------------------------------------------------
   Drawer / sidebar (old width 248px, set in the theme)
   --------------------------------------------------------------------------- */
.krios-drawer.mud-drawer {
    border-right: 1px solid var(--mud-palette-lines-default);
}

.krios-drawer-header {
    height: var(--mud-appbar-height, 72px);
    align-items: center;
}

.krios-drawer-logo {
    border-radius: 4px;
}

/* Section labels — small muted uppercase, like the old .sidebar-menu-title (app.css:12966).
   The Overline typo already uppercases; this adds the muted colour and spacing. */
.krios-nav-label.mud-typography {
    display: block;
    padding: 1.15rem 1.5rem 0.4rem;
    color: var(--mud-palette-text-secondary);
    font-weight: 600;
    letter-spacing: 0.07em;
}

/* Nav links — DashCode .navItem: 0.875rem / weight 500, rounded, comfortable spacing.
   (app.css:12983) Active state uses the brand primary as a solid pill. NOTE: the original
   compiled CSS actually filled the active item with slate-800/white; primary was chosen here
   per the theming spec — see the report note. */
.krios-nav .mud-nav-link {
    margin: 2px 8px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mud-palette-drawer-text);
}

.krios-nav .mud-nav-link:hover {
    background-color: rgba(100, 116, 139, 0.12); /* slate tint */
}

.krios-nav .mud-nav-link.active {
    background-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text, #fff);
    font-weight: 600;
}

.krios-nav .mud-nav-link.active .mud-nav-link-icon {
    color: var(--mud-palette-primary-text, #fff);
}

/* ---------------------------------------------------------------------------
   Cards / MudPaper — soft DashCode card shadow (app.css .shadow-base / .shadow-base2),
   not MudBlazor's heavier Material elevation. The 6px radius comes from the theme's
   DefaultBorderRadius (.card { border-radius: 0.375rem }, app.css:11252).
   Only cards (elevation 1-2) are softened; popovers/menus (higher elevation) keep theirs.
   --------------------------------------------------------------------------- */
.mud-paper.mud-elevation-1,
.mud-paper.mud-elevation-2 {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 10px rgba(96, 97, 112, 0.10);
}

/* ---------------------------------------------------------------------------
   DataGrid / Table header — slate-200 fill (dark: slate-700) with muted uppercase
   header text, matching the old .table-th (app.css:10771: 0.75rem / 600 / uppercase,
   colour slate-600 light, slate-300 dark). --mud-palette-lines-default is exactly
   slate-200 in light and slate-700 in dark, so the header shading tracks the mode.
   --------------------------------------------------------------------------- */
.mud-table-root .mud-table-head {
    background-color: var(--mud-palette-lines-default);
}

.mud-table-root .mud-table-head .mud-table-cell {
    background-color: transparent;
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Sort-header buttons inherit the muted header colour instead of MudBlazor's default. */
.mud-table-root .mud-table-head .mud-table-cell .mud-button-root,
.mud-table-root .mud-table-head .mud-table-cell .mud-typography {
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Body cells echo .table-td (0.875rem, slate text) — sizing only; colours come from the theme. */
.mud-table-root .mud-table-body .mud-table-cell {
    font-size: 0.875rem;
}

/* ---------------------------------------------------------------------------
   Pills / badges — replaces the old Tailwind `bg-{c}-500 bg-opacity-25 text-{c}-500`
   rounded-full pills (app.css .badge.pill, radius 999px). Tinted background, brand-
   coloured text; the translucent tint reads correctly on white and on dark cards.
   --------------------------------------------------------------------------- */
.krios-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
}

.krios-pill-wide {
    min-width: 90px;
}

.krios-pill-success {
    color: var(--mud-palette-success);
    background-color: rgba(80, 199, 147, 0.18);
}

.krios-pill-warning {
    color: var(--mud-palette-warning);
    background-color: rgba(250, 145, 107, 0.20);
}

.krios-pill-danger {
    color: var(--mud-palette-error);
    background-color: rgba(241, 89, 92, 0.18);
}

.krios-pill-neutral {
    color: var(--mud-palette-text-secondary);
    background-color: rgba(100, 116, 139, 0.18);
}

/* ---------------------------------------------------------------------------
   Buttons — DashCode .btn was capitalize / weight 600 (app.css:8731); the theme's
   Button typography already sets that. Keep MudBlazor's filled buttons from SHOUTING.
   --------------------------------------------------------------------------- */
.mud-button-root {
    text-transform: none;
    letter-spacing: normal;
}

/* Plain anchor links in grids — use the brand primary instead of raw browser blue. */
a.krios-link {
    color: var(--mud-palette-primary);
    text-decoration: none;
}

a.krios-link:hover {
    text-decoration: underline;
}
