/* ==========================================================================
   O'so Distributor Portal — taproom-dark theme
   Palette: roasted malt blacks, pour-gold amber, copper, cream, hop green
   Type: Bebas Neue (display) + Inter (body)
   ========================================================================== */

:root {
    --malt-black: #1a1512;
    --malt-deep: #211a15;
    --malt-card: #2a221b;
    --malt-line: #3b3128;
    --pour-gold: #e9a126;
    --pour-gold-hi: #f5b942;
    --copper: #c0703a;
    --cream: #f4ebd9;
    --cream-dim: #c9bda6;
    --hop-green: #8a9256;
    --danger: #d96a4a;
    --font-display: "Bebas Neue", "Oswald", sans-serif;
    --font-body: "Inter", "Segoe UI", sans-serif;
    --radius: 10px;
}

html, body {
    background: var(--malt-black);
    color: var(--cream);
    font-family: var(--font-body);
    min-height: 100vh;
}

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
    width: min(1180px, 100% - 3rem);
    margin-inline: auto;
    padding: 2.25rem 0 3.5rem;
}

h1, h2, h3, .display {
    font-family: var(--font-display);
    letter-spacing: 0.03em;
    color: var(--cream);
}

a {
    color: var(--pour-gold-hi);
}

    a:hover {
        color: var(--pour-gold);
    }

::selection {
    background: var(--pour-gold);
    color: var(--malt-black);
}

h1:focus {
    outline: none;
}

/* --------------------------------------------------------------------------
   Top bar + signature "pour line"
   -------------------------------------------------------------------------- */
.topbar {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0.85rem 2rem;
    background: linear-gradient(180deg, #14100d 0%, var(--malt-deep) 100%);
    position: sticky;
    top: 0;
    z-index: 100;
}

.pour-line {
    height: 4px;
    background: linear-gradient(90deg, var(--copper) 0%, var(--pour-gold) 30%, var(--pour-gold-hi) 50%, var(--pour-gold) 70%, var(--copper) 100%);
    box-shadow: 0 1px 12px rgba(233, 161, 38, 0.45);
    position: sticky;
    top: 64px;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-logo {
    display: block;
    height: 36px;
    width: auto;
    /* subtle glow so the cream ink sits comfortably on the malt background */
    filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.4));
}

.brand-mark {
    font-family: var(--font-display);
    font-size: 2rem;
    line-height: 1;
    color: var(--pour-gold);
    letter-spacing: 0.05em;
}

.brand-sub {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    color: var(--cream-dim);
    border-left: 1px solid var(--malt-line);
    padding-left: 0.85rem;
    white-space: nowrap;
}

.main-nav {
    display: flex;
    gap: 0.25rem;
    flex: 1;
}

.nav-item {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--cream-dim);
    text-decoration: none;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    transition: color 0.15s ease, background 0.15s ease;
}

    .nav-item:hover {
        color: var(--cream);
        background: rgba(244, 235, 217, 0.06);
    }

    .nav-item.active {
        color: var(--malt-black);
        background: var(--pour-gold);
    }

/* Tools dropdown — CSS-only, opens on hover, keyboard focus, or tap-focus. */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-toggle {
    font-family: inherit;
    background: transparent;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-caret {
    font-size: 0.7em;
    line-height: 1;
    transition: transform 0.15s ease;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 12rem;
    display: flex;
    flex-direction: column;
    padding: 0.35rem;
    background: linear-gradient(180deg, #1c1712 0%, var(--malt-deep) 100%);
    border: 1px solid var(--malt-line);
    border-radius: 0.6rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown:hover .nav-caret,
.nav-dropdown:focus-within .nav-caret {
    transform: rotate(180deg);
}

.nav-dropdown-item {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--cream-dim);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.4rem;
    white-space: nowrap;
    transition: color 0.15s ease, background 0.15s ease;
}

    .nav-dropdown-item:hover {
        color: var(--cream);
        background: rgba(244, 235, 217, 0.06);
    }

    .nav-dropdown-item.active {
        color: var(--malt-black);
        background: var(--pour-gold);
    }

.auth-area {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.auth-user {
    font-size: 0.8rem;
    color: var(--cream-dim);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.btn-amber {
    background: var(--pour-gold);
    border: 1px solid var(--pour-gold);
    color: var(--malt-black);
}

    .btn-amber:hover, .btn-amber:focus {
        background: var(--pour-gold-hi);
        border-color: var(--pour-gold-hi);
        color: var(--malt-black);
    }

.btn-ghost {
    background: transparent;
    border: 1px solid var(--malt-line);
    color: var(--cream);
}

    .btn-ghost:hover {
        border-color: var(--pour-gold);
        color: var(--pour-gold-hi);
    }

.btn-outline-danger {
    border-radius: 999px;
}

/* --------------------------------------------------------------------------
   Hero (dashboard)
   -------------------------------------------------------------------------- */
.hero {
    padding: 3rem 2.5rem;
    border-radius: var(--radius);
    background: radial-gradient(1200px 400px at 15% -20%, rgba(233, 161, 38, 0.18), transparent 60%), linear-gradient(160deg, var(--malt-deep), var(--malt-card));
    border: 1px solid var(--malt-line);
    margin-bottom: 2rem;
}

.hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.72rem;
    color: var(--pour-gold);
    margin-bottom: 0.75rem;
}

.hero h1 {
    font-size: clamp(2.6rem, 6vw, 4.2rem);
    margin-bottom: 0.5rem;
}

.hero p {
    color: var(--cream-dim);
    max-width: 56ch;
    margin-bottom: 1.5rem;
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--malt-card);
    border: 1px solid var(--malt-line);
    border-radius: var(--radius);
    padding: 1.1rem 1.3rem;
}

    .stat-card .stat-value {
        font-family: var(--font-display);
        font-size: 2.4rem;
        color: var(--pour-gold-hi);
        line-height: 1;
    }

    .stat-card .stat-label {
        text-transform: uppercase;
        letter-spacing: 0.14em;
        font-size: 0.7rem;
        color: var(--cream-dim);
        margin-top: 0.35rem;
    }

/* --------------------------------------------------------------------------
   Page headers, cards, panels
   -------------------------------------------------------------------------- */
.page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

    .page-head h1 {
        font-size: 2.6rem;
        margin: 0;
    }

    .page-head .page-sub {
        color: var(--cream-dim);
        font-size: 0.9rem;
    }

.panel {
    background: var(--malt-card);
    border: 1px solid var(--malt-line);
    border-radius: var(--radius);
    padding: 1.5rem;
}

/* Dashboard announcement, edited under Tools > Maintenance */
.announcement-banner {
    background: var(--malt-card);
    border: 1px solid var(--malt-line);
    border-left: 4px solid var(--pour-gold);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--cream);
}

    .announcement-banner p,
    .announcement-banner ul {
        margin-bottom: 0.5rem;
    }

    .announcement-banner > :last-child {
        margin-bottom: 0;
    }

    .announcement-banner a {
        color: var(--pour-gold-hi);
    }

/* ABV chip — little beer-label lozenge */
.abv-chip {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    color: var(--malt-black);
    background: var(--pour-gold);
    border-radius: 4px;
    padding: 0.05rem 0.5rem;
}

.badge-status {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--malt-line);
    color: var(--cream-dim);
}

    .badge-status.draft {
        color: var(--cream-dim);
    }

    .badge-status.submitted {
        color: var(--pour-gold-hi);
        border-color: var(--pour-gold);
    }

    .badge-status.confirmed {
        color: var(--hop-green);
        border-color: var(--hop-green);
    }

    .badge-status.shipped {
        color: var(--copper);
        border-color: var(--copper);
    }

    .badge-status.delivered {
        color: var(--malt-black);
        background: var(--hop-green);
        border-color: var(--hop-green);
    }

    .badge-status.cancelled {
        color: var(--danger);
        border-color: var(--danger);
    }

/* Maintenance page state badges */
.badge-custom,
.badge-default {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-custom {
    color: var(--pour-gold);
    border-color: var(--pour-gold);
    background: rgba(233, 161, 38, 0.1);
}

.badge-default {
    color: var(--cream-dim);
    border-color: var(--malt-line);
}

.text-muted-brand {
    color: var(--cream-dim);
}

/* "Recently packaged" list on the packaging page — plain rows with malt dividers
   instead of Bootstrap's white list-group, which fights the dark panel. */
.recent-item {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--malt-line);
    font-size: 0.9rem;
}

    .recent-list .recent-item:last-child {
        border-bottom: none;
    }

/* --------------------------------------------------------------------------
   QuickGrid + tables

   NOTE: ::deep is a Blazor CSS-isolation construct. It is only rewritten by
   the build inside a .razor.css file. In a plain global stylesheet like this
   one the browser treats it as an invalid selector, and because an invalid
   selector poisons the ENTIRE comma-separated rule, the whole block was being
   dropped. Removed below.
   -------------------------------------------------------------------------- */
table, table.quickgrid {
    color: var(--cream);
}

.grid-wrap {
    overflow-x: auto;
}

    .grid-wrap table {
        width: 100%;
        border-collapse: collapse;
        background: var(--malt-card);
        border: 1px solid var(--malt-line);
        border-radius: var(--radius);
        overflow: hidden;
    }

    .grid-wrap thead th {
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.14em;
        color: var(--pour-gold);
        background: var(--malt-deep);
        padding: 0.8rem 1rem;
        border-bottom: 2px solid var(--pour-gold);
        white-space: nowrap;
    }

    .grid-wrap tbody td {
        padding: 0.7rem 1rem;
        border-bottom: 1px solid var(--malt-line);
        font-size: 0.9rem;
        vertical-align: middle;
    }

    /* For wide tables, like Inventory, that need every column on screen. */
    .grid-wrap table.grid-compact thead th {
        padding: 0.7rem 0.55rem;
        letter-spacing: 0.08em;
    }

    .grid-wrap table.grid-compact tbody td {
        padding: 0.6rem 0.55rem;
    }

    .grid-wrap table.grid-compact .badge-status {
        margin-top: 0.25rem;
    }

    /* QuickGrid pads a short last page with empty placeholder rows to keep the height
       steady. They have no aria-rowindex (its real rows always do), so hide them rather
       than show a stack of empty bordered lines. Only QuickGrid tables: plain tables'
       rows never carry aria-rowindex. */
    .grid-wrap table.quickgrid tbody tr:not([aria-rowindex]) {
        display: none;
    }

    .grid-wrap tbody tr:hover {
        background: rgba(233, 161, 38, 0.06);
    }

    /* The options ("hamburger") button draws with stroke="currentColor",
   so plain color inheritance is enough for that one. */
    .grid-wrap .col-options-button,
    .grid-wrap button.col-title {
        color: inherit;
    }

        /* Header hover / active feedback, amber-tinted instead of the default gray */
        .grid-wrap button.col-title:hover,
        .grid-wrap .col-options-button:hover {
            background-color: rgba(233, 161, 38, 0.14);
        }

        .grid-wrap button.col-title:active,
        .grid-wrap .col-options-button:active {
            background-color: rgba(233, 161, 38, 0.28);
        }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-control, .form-select {
    background: var(--malt-deep);
    border: 1px solid var(--malt-line);
    color: var(--cream);
    border-radius: 8px;
    /* Opt native widget internals into a dark scheme. <input type="date/time/
       number"> draws its calendar-picker button, spin buttons, and the
       mm/dd/yyyy placeholder itself — by default in the OS "light" scheme,
       which paints a near-black icon and a faint placeholder that disappear on
       our dark fields. color-scheme: dark makes the browser draw those internals
       in light tones so they're readable. It only affects browser-drawn parts;
       the explicit colors on the disabled/readonly rule below still win, so the
       auto-filled Package field is unaffected. */
    color-scheme: dark;
}

    .form-control:focus, .form-select:focus {
        background: var(--malt-deep);
        color: var(--cream);
        border-color: var(--pour-gold);
        box-shadow: 0 0 0 0.2rem rgba(233, 161, 38, 0.2);
    }

    /* Disabled / read-only fields (e.g. the auto-filled Package box on the order
       forms). Bootstrap's .form-control:disabled outspecifies our base rule and
       repaints the background light gray, but our cream color stays put — cream
       on light gray = invisible text. Restore a dark background and a muted-but-
       readable color here. -webkit-text-fill-color forces the color to stick in
       WebKit, which otherwise recolors disabled input text; opacity: 1 undoes
       Bootstrap's disabled dimming. Only targets :disabled, so the (enabled)
       date pickers and every other field are untouched. */
    .form-control:disabled, .form-select:disabled,
    .form-control[readonly] {
        background: var(--malt-black);
        color: var(--cream-dim);
        -webkit-text-fill-color: var(--cream-dim);
        border-color: var(--malt-line);
        opacity: 1;
    }

    .form-control::placeholder {
        color: #7a6f5c;
    }

    /* With color-scheme: dark above, WebKit/Chromium already draws a light
       calendar glyph; this just makes it read as clearly clickable and full
       strength rather than the browser's default faded state. */
    .form-control::-webkit-calendar-picker-indicator {
        cursor: pointer;
        opacity: 0.9;
    }

        .form-control::-webkit-calendar-picker-indicator:hover {
            opacity: 1;
        }

.form-floating > label {
    color: #9a8f7b;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--pour-gold);
}

    .form-floating > .form-control:focus ~ label::after,
    .form-floating > .form-control:not(:placeholder-shown) ~ label::after {
        background: transparent;
    }

.form-label {
    color: var(--cream-dim);
    font-size: 0.85rem;
}

.form-check-input:checked {
    background-color: var(--pour-gold);
    border-color: var(--pour-gold);
}

.validation-message, .text-danger {
    color: var(--danger) !important;
}

/* --------------------------------------------------------------------------
   Auth pages
   -------------------------------------------------------------------------- */
.auth-shell {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.auth-card {
    width: min(440px, 100%);
    background: var(--malt-card);
    border: 1px solid var(--malt-line);
    border-top: 4px solid var(--pour-gold);
    border-radius: var(--radius);
    padding: 2.25rem 2rem;
}

.auth-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.68rem;
    color: var(--pour-gold);
    margin-bottom: 0.5rem;
}

.auth-title {
    font-size: 2.4rem;
    margin-bottom: 0.25rem;
}

.auth-sub {
    color: var(--cream-dim);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.auth-alt {
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--cream-dim);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--malt-line);
    color: var(--cream-dim);
    font-size: 0.82rem;
}

.footer-tag {
    font-family: var(--font-display);
    letter-spacing: 0.12em;
    font-size: 1.05rem;
    color: var(--pour-gold);
}

/* --------------------------------------------------------------------------
   Blazor error UI
   -------------------------------------------------------------------------- */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    color: #333;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* --------------------------------------------------------------------------
   Small screens / reduced motion
   -------------------------------------------------------------------------- */

/* The full brewery menu only fits on one line with the logo and account on wide screens.
   Below that it gets its own row, so Sign out stays on screen. It wraps rather than
   scrolls, because a scrolling row would clip the Tools dropdown. */
@media (max-width: 1600px) {
    .topbar {
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }

    .auth-area {
        margin-left: auto;
    }

    /* A 100% basis, not width: the base flex: 1 has a 0 basis, which would squeeze
       the menu in beside the account area instead of giving it its own row. */
    .main-nav {
        order: 3;
        flex: 1 1 100%;
        flex-wrap: wrap;
    }
}

@media (max-width: 860px) {
    .topbar {
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .pour-line {
        top: auto;
        position: static;
    }

    .site-main {
        width: calc(100% - 2rem);
    }

    .brand-logo {
        height: 28px;
    }

    .brand-sub {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* --------------------------------------------------------------------------
   QuickGrid Paginator
   -------------------------------------------------------------------------- */

.paginator {
    color: var(--cream-dim);
    font-size: 0.85rem;
    border-top: 1px solid var(--malt-line);
}

.rows-per-page {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: var(--cream-dim);
    font-size: 0.85rem;
}

    .rows-per-page select {
        width: auto;
    }

.page-jump {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
    color: var(--cream-dim);
    font-size: 0.85rem;
}

    .page-jump input {
        width: 5rem;
    }

.art-thumb {
    max-height: 72px;
    max-width: 96px;
    border-radius: 4px;
}

    .paginator .pagination-text,
    .paginator .paginator-summary,
    .paginator .page-count {
        color: var(--cream-dim);
    }

    .paginator nav button {
        border: 1px solid var(--malt-line) !important;
        border-radius: 6px;
        background-color: transparent;
        transition: background-color 0.15s ease, border-color 0.15s ease;
    }

        .paginator nav button:hover:not([disabled]) {
            border-color: var(--pour-gold) !important;
            background-color: rgba(233, 161, 38, 0.12);
        }

        .paginator nav button[disabled] {
            opacity: 0.3;
            cursor: not-allowed;
        }

        /* Replace the dark chevrons with pour-gold ones (%23 = # in a data URI) */
        .paginator nav button.go-first {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5b942' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='18 5 11 12 18 19'/%3E%3Cline x1='7' y1='5' x2='7' y2='19'/%3E%3C/svg%3E") !important;
        }

        .paginator nav button.go-previous {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5b942' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 5 8 12 15 19'/%3E%3C/svg%3E") !important;
        }

        .paginator nav button.go-next {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5b942' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 5 16 12 9 19'/%3E%3C/svg%3E") !important;
        }

        .paginator nav button.go-last {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5b942' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 5 13 12 6 19'/%3E%3Cline x1='17' y1='5' x2='17' y2='19'/%3E%3C/svg%3E") !important;
        }

        /* QuickGrid ships ONE chevron image and mirrors it with
           transform: scaleX(-1) for .go-next / .go-last. Our replacements are
           already drawn pointing the right way, so the mirror has to be
           cancelled or they point backwards. */
        .paginator nav button.go-next,
        .paginator nav button.go-last {
            transform: none !important;
        }

/* --------------------------------------------------------------------------
   QuickGrid column sort indicators

   The element is .sort-indicator (a plain div inside button.col-title) —
   NOT .col-sort-indicator. The state class .col-sort-asc / .col-sort-desc
   lives on the parent <th>.

   QuickGrid paints the arrow as a background-image whose SVG <path> has no
   fill attribute, so it renders black and cannot be recoloured with `color`.
   The default theme also drops it to opacity: 0.5. Black at half opacity on
   a #2a221b header is what reads as "too dark".

   Fix: blank the background-image, use the same path as a mask, and paint the
   mask with background-color — which accepts a CSS variable. The ascending
   variant is the same image flipped by QuickGrid's own scaleY(-1), so one
   mask covers both directions.
   -------------------------------------------------------------------------- */

.grid-wrap th.col-sort-asc .col-title,
.grid-wrap th.col-sort-desc .col-title {
    color: var(--pour-gold-hi) !important;
}

.grid-wrap th.col-sort-asc .sort-indicator,
.grid-wrap th.col-sort-desc .sort-indicator {
    background-image: none !important;
    background-color: var(--pour-gold-hi);
    opacity: 1;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M 2 3.25 L 12 20.75 L 22 3.25 L 12 10 z'/></svg>") center / contain no-repeat;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M 2 3.25 L 12 20.75 L 22 3.25 L 12 10 z'/></svg>") center / contain no-repeat;
}

/* ==========================================================================
   Lineup / sales sheet, line overview, beer detail, preorder
   ========================================================================== */

/* --- Sales sheet (/lineup) — five stacked category rows --- */
.sheet {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--malt-card);
    border: 1px solid var(--malt-line);
    border-radius: var(--radius);
    overflow: hidden;
}

.sheet-line {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--malt-line);
}

    .sheet-line:last-child {
        border-bottom: none;
    }

.sheet-line-head {
    border-right: 1px solid var(--malt-line);
    padding-right: 1.25rem;
}

.sheet-cat {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 1.9rem;
    line-height: 1.05;
    letter-spacing: 0.03em;
    color: var(--cream);
    text-decoration: none;
}

    .sheet-cat:hover {
        color: var(--pour-gold-hi);
    }

.sheet-cat-sub {
    color: var(--cream-dim);
    font-size: 0.82rem;
    margin-top: 0.5rem;
    max-width: 40ch;
}

.beer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    column-gap: 2rem;
    columns: 2;
}

.beer-list-wide {
    columns: 1;
}

    .beer-list li {
        break-inside: avoid;
        padding: 0.3rem 0;
    }

.beer-link {
    color: var(--pour-gold-hi);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dotted transparent;
}

    .beer-link:hover {
        color: var(--pour-gold);
        border-bottom-color: var(--pour-gold);
    }

.beer-meta {
    display: block;
    color: var(--cream-dim);
    font-size: 0.78rem;
}

.sheet-empty {
    color: var(--cream-dim);
    font-style: italic;
    padding: 0.6rem 0;
}

/* --- Preorder flags / banners --- */
.preorder-flag {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.66rem;
    font-weight: 700;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    color: var(--malt-black);
    background: var(--pour-gold);
    margin-right: 0.5rem;
    vertical-align: middle;
}

.preorder-banner {
    background: linear-gradient(160deg, var(--malt-deep), var(--malt-card));
    border: 1px solid var(--pour-gold);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    color: var(--cream);
}

.preorder-banner-link {
    margin-left: 0.5rem;
    white-space: nowrap;
}

/* --- Line overview (/lineup/{slug}) --- */
.lineup-detail {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 360px);
    gap: 1.5rem;
    align-items: start;
}

.one-sheet-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
}

/* --- Beer detail (/lineup/beer/{id}) --- */
.beer-detail {
    display: grid;
    grid-template-columns: minmax(260px, 380px) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.beer-can-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
}

@media (max-width: 900px) {
    /* minmax(0, …) lets the column shrink to the screen; wide tables scroll inside it. */
    .sheet-line,
    .lineup-detail,
    .beer-detail {
        grid-template-columns: minmax(0, 1fr);
    }

    .sheet-line-head {
        border-right: none;
        border-bottom: 1px solid var(--malt-line);
        padding-right: 0;
        padding-bottom: 1rem;
    }

    .beer-list {
        columns: 1;
    }
}

/* --------------------------------------------------------------------------
   TTB tools page
   -------------------------------------------------------------------------- */
.section-title {
    font-family: var(--font-display);
    font-size: 1.7rem;
    color: var(--pour-gold-hi);
    letter-spacing: 0.04em;
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--malt-line);
}

.subsection-title {
    font-size: 1.05rem;
    color: var(--cream);
    margin: 1.25rem 0 0.6rem;
}

.text-amber {
    color: var(--pour-gold-hi);
}

/* Emphasised subtotal / grand-total rows inside the amber-on-malt tables. */
.grid-wrap tfoot .total-row td,
.grid-wrap tbody tr.total-row td {
    background: var(--malt-deep);
    border-top: 2px solid var(--pour-gold);
    color: var(--cream);
}

/* --------------------------------------------------------------------------
   Print: strip site chrome and the interactive tools so the on-hand barrels
   report prints (or "Save as PDF") clean for TTB filing.
   -------------------------------------------------------------------------- */
@media print {
    .topbar,
    .pour-line,
    .site-footer,
    .main-nav,
    .auth-area,
    #blazor-error-ui,
    .no-print {
        display: none !important;
    }

    html, body {
        background: #fff !important;
        color: #000 !important;
    }

    .site-main {
        width: 100% !important;
        margin: 0 !important;
    }

    .stat-card,
    .grid-wrap table {
        background: #fff !important;
        border-color: #999 !important;
    }

    .stat-card .stat-value,
    .section-title,
    .subsection-title,
    .grid-wrap thead th {
        color: #000 !important;
    }

    .grid-wrap thead th {
        background: #eee !important;
        border-bottom: 2px solid #000 !important;
    }

    .grid-wrap tfoot .total-row td,
    .grid-wrap tbody tr.total-row td {
        background: #eee !important;
        border-top: 2px solid #000 !important;
        color: #000 !important;
    }

    .grid-wrap tbody td {
        color: #000 !important;
    }
}

/* --- Category filter buttons --- */
.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.filter-title {
    min-width: 4.5rem;
    color: var(--cream-dim);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.filter-chip {
    padding: 0.2rem 0.7rem;
    border: 1px solid var(--malt-line);
    border-radius: 999px;
    background: transparent;
    color: var(--cream-dim);
    font-size: 0.8rem;
}

    .filter-chip.on {
        border-color: var(--pour-gold);
        background: var(--pour-gold);
        color: var(--malt-black);
        font-weight: 600;
    }

    .filter-chip:focus-visible {
        outline: 2px solid var(--pour-gold-hi);
        outline-offset: 2px;
    }

.filter-reset {
    align-self: flex-start;
}

/* --- Order cutoff / preorder deadline countdown --- */
.deadline-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border: 1px solid var(--hop-green);
    border-radius: 4px;
    color: var(--cream);
    font-size: 0.75rem;
    white-space: nowrap;
}

    .deadline-badge.closing {
        border-color: var(--pour-gold);
        color: var(--pour-gold-hi);
        font-weight: 600;
    }

    .deadline-badge.passed {
        border-color: var(--danger);
        color: var(--danger);
    }

/* --------------------------------------------------------------------------
   Insights
   -------------------------------------------------------------------------- */
.insights-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

    .insights-controls .form-select {
        width: auto;
    }

.insights-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

    .insights-section-head h2 {
        margin: 0;
    }

.insights-legend {
    color: var(--cream-dim);
    font-size: 0.85rem;
}

    .insights-legend .key {
        display: inline-block;
        width: 0.8rem;
        height: 0.8rem;
        border-radius: 2px;
        margin: 0 0.3rem 0 0.8rem;
        vertical-align: -1px;
    }

.key-current, .bar-current { background: var(--pour-gold); }
.key-previous, .bar-previous { background: var(--malt-line); }

.month-chart {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.5rem;
}

.month-col {
    text-align: center;
    min-width: 0;
}

.month-bars {
    height: 180px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    border-bottom: 1px solid var(--malt-line);
}

    .month-bars .bar {
        width: 42%;
        max-width: 22px;
        border-radius: 3px 3px 0 0;
        min-height: 1px;
    }

.month-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cream-dim);
    margin-top: 0.35rem;
}

.month-value {
    font-size: 0.8rem;
    color: var(--cream);
    min-height: 1.2em;
}

.stat-change {
    font-size: 0.8rem;
    color: var(--cream-dim);
    margin-top: 0.4rem;
}

.change { font-weight: 600; white-space: nowrap; }
.change-up { color: var(--hop-green); }
.change-down { color: var(--danger); }
.change-new { color: var(--pour-gold-hi); }

@media (max-width: 640px) {
    .month-chart { gap: 0.2rem; }
    .month-label { font-size: 0.6rem; letter-spacing: 0; }
    .month-value { font-size: 0.65rem; }
    .month-bars { height: 130px; }
}
