* {
    box-sizing: border-box;
}

:root {
    /* Tells the browser how to render its OWN native form controls â€”
       scrollbars, the un-stylable "no file chosen" text portion of a
       file input, native date-picker popups, etc. â€” so they match the
       app's actual theme instead of falling back to the browser's own
       default assumptions. Without this, a native control can end up
       combining a dark background with dark (browser-default) text,
       or similar illegible mismatches, even though every CSS-driven
       part of the same page is themed correctly. */
    color-scheme: light;
    --charcoal: #1A1A1A;
    --primary: #5F8F35; /* green — renamed from --orange/--amber (both were this exact color; merged into one variable) */
    --accent: #29B6F6; /* cyan — renamed from --green; primary structural accent (borders, links) */
    --card: #FFFFFF;
    --stripe: #F0F4FA; /* faint blue-tinted stripe instead of neutral gray */
    --error: #C0392B;
    --border: #A3B4C7; /* faint blue-tinted border instead of neutral gray */
    --indigo: #5C4EE5;
    --rose: #E0607A; /* warm accent, distinct from every tier-pill color — used for the avatar edit badge */
    --muted: #8a8a8a; /* Basic-tier pill color and other deliberately-neutral spots */
    --success: #2e8b57;
    /* Used for the create/add-new row on every curation-style
       page. Same color-mix expression as before in light mode
       -- this is purely a refactor there -- but dark mode gets a
       distinctly stronger mix below, since 8% green against a
       near-black card reads as too dark/muddy to notice as a
       distinct row. */
    --create-row-bg: color-mix(in srgb, var(--primary) 8%, var(--card));
    /* Section-group header backgrounds (My Collection's detail page) -
       same reasoning as --create-row-bg just above: a light green mix
       that reads fine against the white light-mode card would go too
       dark/muddy against dark mode's near-black one, so dark mode gets
       a distinctly stronger mix below, not the same percentage. */
    --group-header-bg: color-mix(in srgb, var(--primary) 15%, var(--card));
    --activity-blue: #0033CC; /* kept on purpose, unlike --primary elsewhere — see dark-mode override below for why it needs one here specifically */
}

/* Dark mode — mechanism-first pass. Toggled via the [data-theme]
   attribute on <html>, set synchronously before paint by a boot-time
   script (see theme.js) to avoid a flash of the wrong theme. Accent
   colors (primary/accent/indigo/rose/error) are left unchanged for now
   — a deliberate choice, not an oversight — saturated colors tuned for
   a white background often look muddy on dark ones, and that tuning is
   exactly the page-by-page styling pass planned as a separate follow-up,
   not part of this mechanism-first pass. Only background/text/border/
   stripe are inverted here, since those are what's needed for the site
   to be legible and functional in dark mode at all.
*/
[data-theme="dark"] {
    color-scheme: dark;
    --create-row-bg: color-mix(in srgb, var(--primary) 20%, var(--card));
    --group-header-bg: color-mix(in srgb, var(--primary) 35%, var(--card));
    --charcoal: #E8E8E8;
    --card: #1A1A1A;
    --stripe: #262626;
    --border: #3A3A3A;
    --muted: #A8A8A8; /* lighter than the light-mode value — mid-gray reads too dim against a near-black background */
    --activity-blue: #5B9BFF; /* the light-mode blue (#0033CC) is too dark to read against a dark card background — lightened here, same hue */
}

.theme-toggle-pill {
    width: 52px;
    height: 26px;
    border-radius: 999px;
    background: #E4E7EC;
    border: 1px solid #C4CAD4;
    position: relative;
    cursor: pointer;
    padding: 2px;
    display: inline-flex;
    align-items: center;
}

.theme-toggle-pill.is-dark {
    background: #2B2D33;
    border-color: #40434B;
}

.theme-toggle-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2B2D33;
    transition: transform 0.2s ease;
}

.theme-toggle-pill.is-dark .theme-toggle-thumb {
    background: #3A3D45;
    color: #FFFFFF;
    transform: translateX(26px);
}

body {
    background: var(--card);
    font-family: 'IBM Plex Sans', sans-serif;
    color: var(--charcoal);
    margin: 0;
}

h1, h2, h3 {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 700;
    color: var(--charcoal);
}

/* StatusMessage.razor's error state â€” used on Login and other Identity
   pages (Register, Forgot Password, etc.) */
.alert-danger {
    color: var(--error);
    font-weight: 700;
    margin-bottom: 1.25rem;
}

/* FocusOnNavigate (see Routes.razor) moves keyboard focus to the page's
   h1 after every navigation, for accessibility â€” this softens the
   browser's default stark black outline into something less jarring,
   without removing the underlying focus behavior itself. */
h1:focus {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 40%, transparent);
    border-radius: 4px;
}

/* Top nav */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    background: var(--card);
}

.site-title {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--charcoal);
}

.site-browse-and-search {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.site-browse-links {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.site-global-search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 14px;
}

    .site-nav a {
        color: var(--charcoal);
        text-decoration: none;
        font-weight: 500;
    }

        .site-nav a:hover {
            color: var(--accent);
        }

/* Pill buttons — replaces the old sharp-edged btn-specimen entirely */
.btn-pill {
    display: inline-block;
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1.6rem;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn-pill-accent {
    background: var(--accent);
    color: white;
}

    .btn-pill-accent:hover {
        background: #1a9fd8; /* darker cyan, same shade already used for .nav-link-button:hover */
    }

.btn-pill-outline {
    background: transparent;
    color: var(--charcoal);
    border: 1px solid var(--border);
}

/* A disabled pill button has to LOOK disabled. The outline pill sets its own text colour, which hides the browser's
   usual greyed-out look, so a disabled button (Clear, Up/Down at the end of a list, Previous/Next) looked exactly
   like a working one. */
.btn-pill:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

    .btn-pill-outline:hover {
        border-color: var(--accent);
        color: var(--accent);
    }

.nav-link-button {
    display: inline-block;
    background: var(--accent);
    border: none;
    border-radius: 999px;
    padding: 0.5rem 1.3rem;
    color: white !important;
    text-decoration: none;
    font-weight: 700 !important;
    font-size: 13px;
    cursor: pointer;
}

    .nav-link-button:hover {
        background: #1a9fd8;
        color: white !important;
    }

/* Form fields, restyled to match — rounded, quiet border */
.field-group {
    margin-bottom: 1.1rem;
    text-align: left;
}

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 0.35rem;
}

/* Overrides the browser's default visited-link purple, which reads
   fine in light mode but is nearly illegible against a dark
   background â€” uses the theme-aware accent color instead of a literal
   color, since a literal fix for one theme would break the other. */
.data-link,
.data-link:visited {
    color: var(--accent);
}

.field-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    padding: 0.6rem 0.9rem;
    font-family: 'IBM Plex Sans', sans-serif;
    color: var(--charcoal);
}

/* Plain element selector, not scoped to a class â€” every <select> across
   the whole app picks this up automatically (Page Assignments' group
   picker, the Grant dropdowns on Users, this one, anywhere else one
   gets added later) without needing a class added to each one
   individually. No width:100% here unlike .field-input above â€” selects
   mostly sit inline inside table cells, where auto-sizing to content
   fits better than stretching to fill the cell. */
select {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 35%, white);
    padding: 0.4rem 1rem;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 13px;
    color: #1A1A1A; /* fixed, not var(--charcoal) â€” same reasoning as .pill-picker-trigger above */
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Styles the browser-native "Choose File" button portion of a file
   input to match .btn-pill.btn-pill-accent.btn-pill-sm exactly. The
   rest of a file input (the "no file chosen" text, its own border) is
   still browser-controlled and can't be restyled the same way â€” this
   pseudo-element is the only part CSS can actually reach. Apply the
   "file-input-styled" class directly on an <InputFile> (or a plain
   <input type="file">) to opt in. */
.file-input-styled::file-selector-button {
    display: inline-block;
    border: none;
    border-radius: 999px;
    padding: 0.35rem 1rem;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    background: var(--accent);
    color: white;
    margin-right: 0.75rem;
}

.file-input-styled::file-selector-button:hover {
    background: #1a9fd8; /* darker cyan, same shade already used for .btn-pill-accent:hover */
}

/* Click-outside-to-close via a full-screen invisible overlay rendered
   behind the popover â€” a plain Blazor @onclick handler on the overlay,
   no JS interop needed. */
.group-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: transparent;
}

/* Same light-accent tint already used for history-table headers â€”
   reused here so both read as part of the same visual language rather
   than introducing a new color. Applied only to pickers showing an
   EXISTING row's current value, not the create-row's own trigger,
   which stays plain/outline like every other create-row control. */
.pill-picker-trigger {
    background: color-mix(in srgb, var(--accent) 35%, white);
    border-color: var(--accent);
    color: #1A1A1A; /* fixed, not var(--charcoal) â€” background stays a constant light blue regardless of theme, so text must too, same fix as history-table's header */
}

/* Background for the Formats/Sites expansion panel (Collectible
   Categories / Pricing Sources) -- same light-accent tint as above,
   deliberately fixed-light regardless of theme. The nested table
   inside these panels keeps its own normal theme-aware styling (it
   sits on a real --card background of its own, not this tint
   directly) -- these descendant rules are scoped only to the specific
   elements that sit DIRECTLY on the tinted background itself
   (headings, notes, pagination), not a blanket override of everything
   inside, which would incorrectly darken the nested table's own text
   too since color inherits down through descendants by default. */
.expansion-panel-tint {
    background: color-mix(in srgb, var(--accent) 15%, white);
}

    /* Plain descendant selectors, not depth-counted child combinators
       -- the "Recently Deleted" heading nests two levels deeper than
       the panel's own main heading, and neither h3 nor .admin-note
       ever appears inside the panel's own nested <table> in this
       markup, so matching at any depth is both safe and correct here. */
    .expansion-panel-tint h3,
    .expansion-panel-tint .admin-note,
    .expansion-panel-tint .activity-pagination {
        color: #1A1A1A;
    }

.group-picker-popover {
    position: fixed;
    z-index: 101;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    width: max-content;
    max-width: 320px;
}

/* SearchPicker's results dropdown â€” same visual language as
   .activity-jump-results (vertical list, rounded card) but
   position:fixed instead of absolute, matching .group-picker-popover's
   own reasoning: escapes any ancestor's overflow:hidden clipping,
   which matters here since this renders inside table cells. */
.search-picker-results {
    position: fixed;
    z-index: 101;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    overflow: hidden;
    max-height: 280px;
    overflow-y: auto;
}

    .field-input:focus {
        outline: none;
        border-color: var(--accent);
    }

.admin-error {
    border: 1px solid var(--error);
    background: rgba(192, 57, 43, 0.06);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    color: var(--error);
    font-size: 14px;
    margin-bottom: 1.5rem;
}

/* Specimen-style cards (Login, Register, Profile, ConsignorDashboard) —
   same structure as before, restyled: rounded corners, cyan label bar
   instead of the old sharp dark-ink one, no corner ticks (dropped, not
   part of this look). */
.specimen-wrapper {
    max-width: 420px;
    margin: 4rem auto;
    position: relative;
}

.specimen-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
    overflow: hidden;
}

.specimen-label-bar {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    background: var(--accent);
    padding: 0.7rem 1.25rem;
}

    .specimen-label-bar span {
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.05em;
        color: white;
        text-transform: uppercase;
    }

    .specimen-label-bar .reference {
        color: rgba(255, 255, 255, 0.8);
    }

.specimen-perforation {
    display: none;
}
/* not part of this visual language */

.specimen-body {
    padding: 1.25rem 1.5rem;
}

.btn-specimen {
    width: 100%;
    border: none;
    border-radius: 999px;
    background: var(--primary);
    color: white;
    padding: 0.7rem;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

    .btn-specimen:hover {
        background: #4C722A;
    }

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 13px;
}

.helper-links {
    margin-top: 1rem;
    font-size: 13px;
}

    .helper-links a {
        color: var(--accent);
        text-decoration: none;
        font-weight: 500;
    }

        .helper-links a:hover {
            text-decoration: underline;
        }

.loading-text {
    text-align: center;
    margin-top: 4rem;
    color: var(--charcoal);
}

/* Profile page */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent);
    font-weight: 700;
    font-size: 22px;
    color: white;
}

.profile-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--charcoal);
    margin: 0;
}

.profile-username {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}

/* Admin panel + Brands */
.admin-page {
    max-width: 1600px;
    margin: 2.5rem auto;
    padding: 0 1rem;
}

/* ===================== Public catalog pages ===================== */
/* Shares .admin-page's width/margin philosophy but its own class,
   since these pages are for anonymous visitors, not admin/curation
   work -- built entirely from the same theme variables as everything
   else (--card, --charcoal, --border, --primary, --accent, --muted),
   so dark mode is handled automatically, no separate dark-mode rules
   needed here. */
.public-page {
    max-width: 1200px;
    margin: 2.5rem auto;
    padding: 0 1rem;
}

.public-not-found {
    text-align: center;
    padding: 4rem 1rem;
}

.public-back-link {
    display: inline-block;
    margin-bottom: 1.25rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
}

    .public-back-link:hover {
        text-decoration: underline;
    }

/* ---- Filter bar (catalog/browse page) ---- */
.public-filter-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1rem 0 1.5rem;
}

.public-filter-multiselect {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 0 0 1rem;
}

    .public-filter-multiselect .field-group {
        min-width: 260px;
        flex: 1;
    }

/* ---- Card grid (catalog/browse page) ---- */
.public-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

.public-catalog-card {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: var(--charcoal);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .public-catalog-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    }

.public-catalog-card-image {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--stripe);
    overflow: hidden;
}

    .public-catalog-card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.public-catalog-card-body {
    padding: 0.75rem;
}

.public-catalog-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.public-catalog-card-brand {
    font-size: 0.8rem;
    color: var(--muted);
}

/* ---- Item detail page ---- */
.public-detail-layout {
    display: grid;
    grid-template-columns: minmax(280px, 420px) 1fr;
    gap: 2.5rem;
    align-items: start;
}

    @media (max-width: 800px) {
        .public-detail-layout {
            grid-template-columns: 1fr;
        }
    }

.public-detail-main-image {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--stripe);
    border-radius: 10px;
    overflow: hidden;
}

    .public-detail-main-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.public-detail-no-image {
    border: 1px dashed var(--border);
}

.public-detail-thumbnails {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}

.public-detail-thumbnail {
    width: 56px;
    height: 56px;
    padding: 0;
    border: 2px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: var(--stripe);
}

    .public-detail-thumbnail img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .public-detail-thumbnail-active {
        border-color: var(--accent);
    }

.public-detail-breadcrumb {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.3rem;
}

.public-detail-brand-table {
    display: flex;
    gap: 2.5rem;
    margin-bottom: 1.25rem;
    color: var(--muted);
}

    .public-detail-brand-cell {
        text-align: center;
    }

    .public-detail-brand-cell-left {
        text-align: left;
    }

.public-detail-brand-logo {
    display: inline-block;
    max-width: 140px;
    max-height: 70px;
    object-fit: contain;
    margin-top: 0.3rem;
}

.public-detail-fact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.public-detail-fact-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    margin-bottom: 0.15rem;
}

.public-detail-section {
    margin-bottom: 1.5rem;
}

    .public-detail-section h2 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

.public-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.public-detail-tag {
    display: inline-block;
    background: var(--stripe);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
}

.public-taxonomy-link {
    color: inherit;
    text-decoration: none;
}

    .public-taxonomy-link:hover {
        color: var(--accent);
        text-decoration: underline;
    }

.public-detail-tag-link {
    text-decoration: none;
    color: var(--charcoal);
    cursor: pointer;
}

    .public-detail-tag-link:hover {
        background: color-mix(in srgb, var(--accent) 15%, var(--stripe));
        border-color: var(--accent);
    }



.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.admin-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-section {
    margin-bottom: 2.5rem;
}

.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.admin-section-header-left {
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
    flex-wrap: wrap;
}

    .admin-section-header span {
        font-size: 13px;
        color: var(--muted);
    }

/* Applied to columns that should never wrap (Name, Slug, Actions) so
   they size tightly to their content, leaving whatever's left for a
   free-text column (Description, etc.) to wrap within â€” rather than
   long free text pushing action buttons onto their own line. */
.nowrap-cell {
    white-space: nowrap;
}

.admin-table {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    overflow: hidden;
}

    .admin-table th {
        text-align: left;
        padding: 0.75rem 1rem;
        font-weight: 700;
        color: var(--charcoal);
        background: var(--stripe);
    }

    .admin-table td {
        padding: 0.75rem 1rem;
        border-top: 1px solid var(--border);
        vertical-align: top;
    }

    .admin-table select {
        border: 1px solid var(--border);
        border-radius: 999px;
        padding: 0.3rem 0.9rem;
        font-size: 13px;
    }

.radio-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.9rem;
    font-size: 13px;
    white-space: nowrap;
}

.activity-jump-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    overflow: hidden;
}

.activity-jump-result {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--charcoal);
    font-size: 13px;
    cursor: pointer;
}

.activity-jump-result:last-child {
    border-bottom: none;
}

.activity-jump-result:hover {
    background: var(--stripe);
}

/* Site Maintenance â€” see MainLayout.razor's own comments for the
   enforcement logic. These replace the ENTIRE app (no header/sidebar
   at all) when blocked, so deliberately don't reuse .admin-page or
   similar page-scoped classes. */
.maintenance-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: var(--charcoal);
}

.maintenance-screen-card {
    max-width: 420px;
    text-align: center;
    background: var(--card);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

    .maintenance-screen-card h1 {
        font-size: 1.4rem;
        margin: 0 0 0.75rem;
    }

    .maintenance-screen-card p {
        margin: 0 0 0.5rem;
        color: var(--charcoal);
    }

.maintenance-warning-banner {
    background: color-mix(in srgb, var(--rose) 15%, white);
    color: #7a2e42; /* fixed, not var(--charcoal) â€” background is a constant light tint regardless of theme, same reasoning as history-table's own header fix */
    text-align: center;
    padding: 0.6rem 1rem;
    font-size: 13px;
    font-weight: 600;
}

/* SuperUser-only persistent indicator, shown in the header on every
   page while a window is active â€” see MainLayout.razor. More urgent
   than .maintenance-warning-banner (that one's an advance heads-up to
   everyone; this one means the site is actually blocked for everyone
   else right now), but still small and out of the way rather than a
   full banner, since the SuperUser viewing it isn't themselves
   affected. */
.maintenance-active-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #c0392b;
    color: white;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

    .maintenance-active-badge:hover {
        background: #a93226;
    }

.admin-toggle {
    border: 1px solid var(--accent);
    border-radius: 999px;
    background: none;
    padding: 0.3rem 0.8rem;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--accent);
}

    .admin-toggle.inactive {
        border-color: var(--error);
        color: var(--error);
    }

    .admin-toggle:hover {
        background: var(--accent);
        color: white;
    }

    .admin-toggle.inactive:hover {
        background: var(--error);
        color: white;
    }

.permission-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
}

.permission-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: 999px;
    background: rgba(41, 182, 246, 0.12);
    padding: 0.2rem 0.7rem;
    font-size: 12px;
    color: var(--charcoal);
}

/* Bold treatment for chips representing a "this is currently assigned/
   granted" relationship â€” Users' held permissions, Page Groups'
   "Permission Access" (which permissions currently grant this group).
   NOT applied to Page Assignments' "Other pages" badges (group:/
   policy:/role: labels) â€” those describe a fixed protection mechanism
   on a non-reassignable page, closer to a static descriptive label
   than a live assignment someone can act on. */
.permission-chip-assigned {
    font-weight: 700;
}

    .permission-chip button {
        border: none;
        background: none;
        cursor: pointer;
        color: var(--error);
        font-weight: bold;
    }

.permission-add {
    display: flex;
    gap: 0.3rem;
}

    .permission-add input, .permission-add select {
        border: 1px solid var(--border);
        border-radius: 999px;
        padding: 0.3rem 0.7rem;
        font-size: 12px;
        width: 100px;
    }

    .permission-add button {
        border: 1px solid var(--accent);
        border-radius: 6px;
        background: none;
        cursor: pointer;
        font-size: 12px;
        padding: 0.3rem 0.6rem;
        color: var(--accent);
    }

.admin-note {
    margin-top: 0.75rem;
    font-size: 12px;
    color: var(--muted);
}

.admin-note-danger {
    margin-top: 0.75rem;
    font-size: 12px;
    color: var(--error);
    font-weight: 700;
}

.nav-btn-primary {
    background: var(--primary) !important;
}

    .nav-btn-primary:hover {
        background: #4C722A !important;
    }

.nav-btn-indigo {
    background: var(--indigo) !important;
}

    .nav-btn-indigo:hover {
        background: #4636c9 !important;
    }

.site-shell {
    display: flex;
    min-height: calc(100vh - 65px);
}

.site-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1.25rem;
}

.site-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

    .site-sidebar-nav a {
        color: var(--charcoal);
        text-decoration: none;
        font-weight: 500;
        font-size: 14px;
    }

        .site-sidebar-nav a:hover {
            color: var(--accent);
        }

.sidebar-break {
    height: 1px;
    background: var(--border);
    margin: 1.25rem 0;
}

.sidebar-sub-break {
    height: 1px;
    background: var(--border);
    opacity: 0.5;
    margin: 0.5rem 0.75rem;
}

.sidebar-section-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.sidebar-sub-link {
    padding-left: 0.75rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-main {
    flex-grow: 1;
    padding: 1.5rem 2rem 1.5rem 0.5rem;
}

.dashboard-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    min-width: 0;
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
}

.nav-avatar-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--indigo);
    color: white;
    font-weight: 700;
    font-size: 13px;
}


.profile-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.profile-cards .profile-header {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 0.75rem;
}

.profile-cards .profile-avatar {
    width: 64px;
    height: 64px;
    font-size: 22px;
}

.btn-pill-header {
    background: var(--card);
    color: var(--charcoal) !important;
    border-radius: 999px;
    padding: 0.3rem 0.9rem;
    font-size: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
}

    .btn-pill-header:hover {
        background: var(--stripe);
    }

.profile-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 1.5rem;
}

.profile-field-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

.profile-field-value {
    font-size: 14px;
    color: var(--charcoal);
}

.profile-card-note {
    font-size: 12px;
    color: var(--muted);
    margin-top: 0.5rem;
}

.btn-pill-sm {
    padding: 0.35rem 1rem;
    font-size: 12px;
}

.profile-meta {
    font-size: 12px;
    color: var(--muted);
    margin: 0.1rem 0 0;
}

.profile-field-full {
    grid-column: 1 / -1;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-editable {
    position: relative;
    display: inline-block;
}

.avatar-edit-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--rose);
    color: #fff;
    border: 2px solid var(--card); /* blends with the surrounding page background instead of always being white */
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .avatar-edit-badge:hover {
        background: #C94860; /* darker rose */
    }

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 26, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    width: 400px;
    max-width: 90vw;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 1.1rem;
}

.modal-body {
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    padding: 0.75rem 1.5rem 1.25rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
}

.source-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.source-tab {
    padding: 6px 12px;
    border-radius: 999px; /* pill, matches project button style */
    border: 1px solid var(--border);
    background: var(--card);
    cursor: pointer;
}

    .source-tab.active {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

    .source-tab.disabled {
        color: var(--muted);
        cursor: not-allowed;
        pointer-events: none;
    }

.avatar-preview img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    margin-top: 8px;
}

.form-error {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 6px;
}

.btn-inline-edit {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--rose);
    margin-left: 6px;
    padding: 0;
    vertical-align: middle;
}

    .btn-inline-edit:hover {
        color: #C94860; /* darker rose */
    }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.profile-visual {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.tier-seal {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.activity-filter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

    .activity-filter label {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        font-size: 0.85rem;
        color: var(--muted);
    }

.activity-context-chips {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.3rem;
    flex-wrap: wrap;
}

.activity-chip {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 999px;
}

.activity-chip-ip {
    background: rgba(90, 78, 229, 0.12);
    color: var(--indigo);
}

.activity-chip-device {
    background: color-mix(in srgb, var(--primary) 15%, transparent);
    color: var(--primary);
}

.activity-category-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s ease;
}

.activity-category-login {
    background: rgba(90, 78, 229, 0.12);
    color: var(--indigo);
}

.activity-category-profile {
    background: rgba(76, 209, 217, 0.15);
    color: var(--accent);
}

.activity-category-account-access {
    background: color-mix(in srgb, var(--primary) 15%, transparent);
    color: var(--primary);
}

.activity-event-success {
    color: var(--success);
    font-weight: 600;
}

.activity-event-failure {
    color: var(--error);
    font-weight: 600;
}

.activity-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.activity-stat {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    min-width: 130px;
}

.activity-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--activity-blue);
}

.activity-stat-warn .activity-stat-value {
    color: var(--error);
}

.activity-stat-label {
    font-size: 0.8rem;
    color: var(--muted);
}

.page-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--primary), var(--accent)); /* green to cyan */
    color: #fff;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.page-banner-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-banner-icon svg {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    opacity: 0.9;
}

.page-banner-title h1 {
    margin: 0;
    color: #fff;
}

.page-banner-subtitle {
    margin: 2px 0 0;
    font-size: 0.85rem;
    opacity: 0.85;
}

.page-banner-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    flex-shrink: 0;
}

.activity-table thead th {
    background: var(--accent); /* matches .specimen-label-bar exactly */
    color: #fff;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    font-weight: 700;
    padding: 0.75rem 1rem;
    text-align: left;
}

    .activity-table thead th:first-child {
        border-top-left-radius: 8px;
    }

    .activity-table thead th:last-child {
        border-top-right-radius: 8px;
    }

table.history-table thead th {
    background: color-mix(in srgb, var(--accent) 35%, white); /* lighter shade of the same accent blue */
    color: #1A1A1A; /* fixed, not var(--charcoal) â€” this header's background stays a constant light blue regardless of theme (mixed with literal white above), so its text must stay a constant dark color too, not flip light in dark mode */
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    font-weight: 700;
    padding: 0.75rem 1rem;
    text-align: left;
}

    table.history-table thead th:first-child {
        border-top-left-radius: 8px;
    }

    table.history-table thead th:last-child {
        border-top-right-radius: 8px;
    }

.admin-table-primary thead th {
    background: var(--primary);
    color: #fff;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    font-weight: 700;
    padding: 0.75rem 1rem;
    text-align: left;
}

    .admin-table-primary thead th:first-child {
        border-top-left-radius: 8px;
    }

    .admin-table-primary thead th:last-child {
        border-top-right-radius: 8px;
    }

.admin-table-indigo thead th {
    background: var(--indigo);
    color: #fff;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    font-weight: 700;
    padding: 0.75rem 1rem;
    text-align: left;
}

    .admin-table-indigo thead th:first-child {
        border-top-left-radius: 8px;
    }

    .admin-table-indigo thead th:last-child {
        border-top-right-radius: 8px;
    }

/* Visual separation between the Line/Brand/Global sections of
   GroupedPillPicker.razor -- each present group gets its own divider
   above it, per-group labels already handle the "which is which" part,
   this handles the "each visually separated" part. */
.grouped-pill-picker-group {
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    margin-top: 0.6rem;
}

    .grouped-pill-picker-group:first-child {
        margin-top: 0;
    }

    /* Same reused accent colors as elsewhere in this app, not new
       ones -- indigo already marks the nested/more-specific tier on
       Categories/Sources' own sub-tables, accent already marks their
       expansion panels, primary already marks "add new". Reused here
       with the same most-specific-to-broadest logic: Line (indigo) ->
       Brand (accent) -> Global (primary). Light-mode percentages stay
       low since these are small pill-container backgrounds, not a
       full page-width panel; dark-mode gets a stronger mix, same
       reasoning as --create-row-bg's own light/dark split -- a light
       tint fades to invisible against a near-black card otherwise. */
    .grouped-pill-picker-group-line {
        background: color-mix(in srgb, var(--indigo) 10%, var(--card));
    }

    .grouped-pill-picker-group-brand {
        background: color-mix(in srgb, var(--accent) 10%, var(--card));
    }

    .grouped-pill-picker-group-global {
        background: color-mix(in srgb, var(--primary) 10%, var(--card));
    }

    [data-theme="dark"] .grouped-pill-picker-group-line {
        background: color-mix(in srgb, var(--indigo) 22%, var(--card));
    }

    [data-theme="dark"] .grouped-pill-picker-group-brand {
        background: color-mix(in srgb, var(--accent) 22%, var(--card));
    }

    [data-theme="dark"] .grouped-pill-picker-group-global {
        background: color-mix(in srgb, var(--primary) 22%, var(--card));
    }

.activity-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.activity-category-filter {
    display: flex;
    gap: 0.4rem;
    margin-right: 0.5rem;
}

.activity-category-off {
    background: var(--stripe) !important;
    color: var(--muted) !important;
    opacity: 1;
}

/* A cycling palette for badge sets whose values aren't fixed and known
   ahead of time (Users page: staff role, and especially permission
   bundle names, which can be anything an admin creates) â€” unlike
   Activity's category badges, which hardcode one class per known
   category name, these are assigned by position/index instead. */
.badge-color-0 { background: color-mix(in srgb, var(--primary) 15%, white); color: var(--primary); }
.badge-color-1 { background: color-mix(in srgb, var(--indigo) 15%, white); color: var(--indigo); }
.badge-color-2 { background: color-mix(in srgb, var(--accent) 18%, white); color: var(--accent); }
.badge-color-3 { background: color-mix(in srgb, var(--rose) 18%, white); color: var(--rose); }
.badge-color-4 { background: color-mix(in srgb, var(--error) 15%, white); color: var(--error); }
.badge-color-5 { background: color-mix(in srgb, var(--muted) 22%, white); color: var(--muted); }

.activity-filter-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-right: 1.25rem;
    margin-right: 0.25rem;
    border-right: 1px solid var(--border);
}

    .activity-filter-group:last-of-type {
        border-right: none;
    }

.activity-filter-group-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-right: 0.25rem;
}

.account-level-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0.4rem 0;
}

.tier-pill {
    display: inline-block;
    background: var(--tier-color);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 14px;
    border-radius: 999px;
}