/* Brand tokens — MUST stay in sync with Models/AdminColors.cs, which is the
   single source of truth. Blazor cannot emit a static .css file from C#
   constants, so this is a deliberate, documented mirror: change
   AdminColors.cs first, then update these values to match. */
:root {
    --brand:               #7C3AED;
    --brand-hover:         #6D28D9;
    --accent:              #F59E0B;
    --primary-bg:          #FFFFFF;
    --secondary-bg:        #F8F7FF;
    --text-primary:        #1A1033;
    --text-secondary:      #4B4668;
    --text-muted:          #9992B3;
    --border:              #E8E4F3;
    --scroll-thumb-hover:  #C4B8E8;
    --error-soft-bg:       #FEE2E2;
    --error-soft-fg:       #991B1B;
}

html, body {
    background-color: var(--secondary-bg);
    color: var(--text-primary);
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

/* ── Override MudBlazor dark-surface fallbacks ─────────────────────── */
.mud-drawer {
    background-color: var(--primary-bg) !important;
    border-right: 1px solid var(--border);
}

/* ── Sidebar nav: rounded "pill" items, inset from the drawer edge ──────
   Matches the reference dashboard's sidebar — the active item is a solid
   filled rounded rectangle (not just a text-color change), everything else
   is plain text+icon on transparent background. */
.mud-nav-item {
    padding-left: 12px;
    padding-right: 12px;
    margin-bottom: 2px;
}

.mud-nav-link {
    border-radius: 10px !important;
    margin: 0 !important;
    transition: background-color 0.15s, color 0.15s;
}

.mud-nav-link:hover {
    background-color: var(--secondary-bg) !important;
    color: var(--brand) !important;
}

.mud-nav-link.active {
    background-color: var(--brand) !important;
    color: #fff !important;
}

.mud-nav-link.active .mud-nav-link-icon {
    color: #fff !important;
}

/* Group titles ("Library", "Engagement", ...) read as small uppercase
   section labels rather than full nav items, matching the reference
   sidebar's "General" / "Applications" / "Manage" section headers. */
.mud-nav-group > .mud-nav-link {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted) !important;
    background-color: transparent !important;
}
.mud-nav-group > .mud-nav-link:hover {
    color: var(--brand) !important;
    background-color: transparent !important;
}
.mud-nav-group > .mud-nav-link .mud-nav-link-icon {
    display: none;
}
/* The reference sidebar's section labels (General/Applications/Manage) are
   plain text with no dropdown affordance at all — hide MudNavGroup's
   expand/collapse chevron too so a group header doesn't visually look like
   a toggle button. The groups stay functionally expandable (click still
   works; Expanded="true"/"false" per group in NavMenu.razor still controls
   default state) — only the chevron icon itself is hidden. */
.mud-nav-group > .mud-nav-link .mud-nav-link-expand-icon {
    display: none !important;
}

/* ── Utility ─────────────────────────────────────────────────────────── */
.fw-bold { font-weight: 700; }

.rounded-lg { border-radius: 12px !important; }

code {
    background: var(--secondary-bg);
    color: var(--brand);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

/* ── Stat card surface ────────────────────────────────────────────────── */
.mud-paper[style*="background:#F8F7FF"] {
    border: 1px solid var(--border);
}

/* ── Card polish — soft lift on hover for a less flat, more premium feel ── */
.rounded-lg.mud-paper {
    transition: box-shadow 0.2s ease;
}
.rounded-lg.mud-paper:hover {
    box-shadow: 0 4px 16px rgba(26, 16, 51, 0.08);
}

/* ── Flat, bordered cards everywhere (2026-09-01 redesign pass) ─────────
   Every page's <MudPaper Elevation="1" Class="pa-X rounded-lg"> card uses
   this same pattern — rather than hand-editing ~40 occurrences across ~21
   pages, override MudBlazor's elevation-1 drop-shadow globally so every
   existing card picks up the flat/bordered look (matches StatCard.razor
   and the reference dashboard) with one change. Scoped to `.mud-paper`
   specifically so popovers/menus/dialogs at elevation 1 keep their shadow —
   only page cards use MudPaper for this pattern. */
.mud-paper.mud-elevation-1 {
    box-shadow: none !important;
    border: 1px solid var(--border);
}

/* MudTable renders its own root element (not a MudPaper), so the shared
   AdminDataTable's Elevation="1" list tables need the same override
   separately — every list page (Books, Vendors, Users, ...) uses this one
   component, so this one rule covers all of them. */
.mud-table.mud-elevation-1 {
    box-shadow: none !important;
    border: 1px solid var(--border);
}

/* Same story for MudTabs (CampaignDetail.razor, AuthorDetail.razor both use
   <MudTabs Elevation="1">) — found while verifying the Vendors/Authors/
   Categories pass; also silently affected CampaignDetail.razor's tabs from
   the earlier Campaigns increment, fixed retroactively here. */
.mud-tabs.mud-elevation-1 {
    box-shadow: none !important;
    border: 1px solid var(--border);
}

/* ── Dashboard "Needs Attention" rows ────────────────────────────────── */
.needs-attention-row {
    transition: background-color 0.15s;
}
.needs-attention-row:hover {
    background-color: var(--secondary-bg);
}

/* ── MudTable header ─────────────────────────────────────────────────── */
.mud-table-head .mud-table-cell {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Scrollbar ───────────────────────────────────────────────────────── */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: var(--secondary-bg); }
::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }

/* ── SSR Login form ─────────────────────────────────────────────────── */
.login-field { margin-bottom: 1.25rem; }
.login-field label {
    display: block; margin-bottom: 0.35rem;
    font-size: 0.875rem; font-weight: 500; color: var(--text-secondary);
}
.login-input {
    width: 100%; padding: 0.75rem 1rem;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 1rem; color: var(--text-primary);
    background: var(--primary-bg); outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.login-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
.login-btn {
    width: 100%; padding: 0.85rem;
    background: var(--brand); color: #fff; border: none;
    border-radius: 8px; font-size: 1rem; font-weight: 600;
    cursor: pointer; transition: background 0.15s;
}
.login-btn:hover { background: var(--brand-hover); }
.login-error {
    background: var(--error-soft-bg); color: var(--error-soft-fg);
    padding: 0.75rem 1rem; border-radius: 8px;
    margin-bottom: 1rem; font-size: 0.875rem;
}

/* ── Keyboard focus ring (accessibility) ─────────────────────────────────
   Shown only for keyboard focus (:focus-visible), never on mouse click, so it
   adds a visible indicator without changing how pointer users see controls. */
.mud-button-root:focus-visible,
.mud-icon-button:focus-visible,
.mud-nav-link:focus-visible,
.mud-chip:focus-visible,
.mud-switch-base:focus-visible,
.mud-table-sort-label:focus-visible,
a:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* ── Skip link (keyboard / screen-reader shortcut past the sidebar) ───────
   Off-screen until it receives keyboard focus, then shown top-left. */
.skip-link {
    position: absolute;
    left: 8px;
    top: -48px;
    z-index: 2000;
    padding: 8px 14px;
    background: var(--brand);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus { top: 8px; }
.main-content-anchor:focus { outline: none; }

