/* site css */
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    overflow-anchor: none; /* prevent browser scroll-anchoring jumps during chart SVG updates */
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100vw - 2rem);
    min-width: 300px;
    z-index: 99999;
    display: none;
    background: #3e2a0e;
    color: #fff;
    border-radius: 10px;
    border-left: 4px solid #f37d36;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45), 0 2px 8px rgba(0,0,0,0.25);
    animation: pf-toast-in 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes pf-toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(0.97); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0)     scale(1);    }
}

.blazor-error-content {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 0.875rem 0.875rem 1.25rem;
}

.blazor-error-icon {
    width: 1.35rem;
    height: 1.35rem;
    flex-shrink: 0;
    color: #f5ae45;
}

.blazor-error-msg {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-family: Arial, 'Helvetica Neue', sans-serif;
}

.blazor-error-msg strong {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.blazor-error-msg span {
    font-size: 0.8rem;
    opacity: 0.75;
    line-height: 1.3;
}

.blazor-error-reload {
    background: #f37d36;
    color: #fff;
    font-weight: 600;
    padding: 0.375rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.82rem;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: Arial, 'Helvetica Neue', sans-serif;
    transition: background 0.15s;
}

.blazor-error-reload:hover { background: #be4d06; color: #fff; }

.blazor-error-dismiss {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem;
    flex-shrink: 0;
    color: #fff;
    opacity: 0.55;
    text-decoration: none;
    border-radius: 5px;
    transition: opacity 0.15s, background 0.15s;
}

.blazor-error-dismiss svg { width: 1.1rem; height: 1.1rem; }

.blazor-error-dismiss:hover { opacity: 1; background: rgba(255,255,255,0.12); }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1.25rem;
    color: white;
    border-radius: 4px;
}

.blazor-error-boundary::after {
    content: "An error has occurred in this section."
}

/* ====================================================================
   Planting Forward — Earth & Forest Theme
   ==================================================================== */

:root {
    --mud-palette-primary-hover: rgba(var(--mud-palette-primary-rgb), 0.15);
}

/* Forest background scene */
body {
    background-color: #1e6fa8;
    background-image: url('/images/forest-bg.svg');
    background-size: cover;
    background-position: bottom center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* Layout and main content transparent so forest shows through */
.mud-layout,
.mud-main-content {
    background: transparent !important;
}

/* Authenticated page card — wraps @Body only when logged in, keeping login page clean */
.pf-page-card {
    background-color: rgba(255, 255, 255, 0.90);
    border-radius: 12px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.16);
    padding: 1.5rem 1.75rem;
    margin-top: 0.25rem;
    margin-bottom: 2rem;
}

/* Cards and surfaces: slightly transparent white */
.mud-paper:not(.mud-appbar):not(.mud-drawer):not(.mud-menu-list) {
    background-color: rgba(255, 255, 255, 0.90) !important;
}

/* Drawer: warm cream, matching earth tone */
.mud-drawer {
    background-color: rgba(247, 240, 228, 0.98) !important;
    border-right: 1px solid rgba(100, 65, 20, 0.18) !important;
}
.mud-drawer-header {
    border-bottom: 1px solid rgba(100, 65, 20, 0.12);
}
.pf-nav-section {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(100, 65, 20, 0.5);
    padding: 14px 16px 3px;
    margin-top: 2px;
}
.pf-nav-section:first-child {
    padding-top: 8px;
}

/* Season / filter selects — white bg for visibility over forest */
.pf-season-select .mud-input { background-color: white !important; border-radius: 4px; }

/* AppBar season selector — white text to match AppBar theme */
/* min-width is set via inline Style computed from longest season name */
.pf-appbar-season { max-width: 240px; min-width: 200px!important; margin: 0 !important; color: white !important; }
/* White text on all internal text/input elements at all breakpoints.
   The top-level color:white cascades to most children; the explicit selectors
   below add !important to beat any MudBlazor breakpoint-specific overrides. */
.pf-appbar-season .mud-select-input,
.pf-appbar-season .mud-input-root,
.pf-appbar-season .mud-input-slot,
.pf-appbar-season .mud-input-slot *,
.pf-appbar-season input {
    color: white !important;
    -webkit-text-fill-color: white !important; /* Safari iOS overrides color on inputs; this wins */
}
/* Arrow and adornment button white */
.pf-appbar-season .mud-svg-icon { color: white !important; }
.pf-appbar-season .mud-input-adornment button { color: white !important; }
/* Outlined variant border and label in AppBar */
.pf-appbar-season .mud-input-outlined-border { border-color: rgba(255,255,255,0.55) !important; }
.pf-appbar-season:hover .mud-input-outlined-border { border-color: rgba(255,255,255,0.85) !important; }
.pf-appbar-season .mud-input-label { color: rgba(255,255,255,0.7) !important; }
.pf-appbar-season .mud-input-label-outlined { background: transparent; }
/* Prevent overflow on the text display but do NOT apply to input-root (would clip arrow sibling) */
.pf-appbar-season .mud-input-slot > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* AppBar user name — white text */
.pf-appbar-user { color: white; font-size: 0.875rem; white-space: nowrap; }

/* Page-level season selector — used in page headers (not AppBar). Normal color scheme. */
/* min-width is set via inline Style computed from longest season name; no max-width cap so it never truncates. */
.pf-page-season { margin: 0 !important; }
.pf-page-season .mud-input-slot > * { white-space: nowrap; }

/* Mobile compact season trigger button (xs only) */
.pf-season-mobile-btn { text-transform: none !important; font-size: 0.8rem !important; min-width: 0 !important; max-width: 148px; height: 32px !important; }
.pf-season-mobile-btn .mud-button-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Archived season ───────────────────────────────────────────── */

/* Chip used in page headers and dropdowns */
.pf-chip-archived {
    background: #78909c !important;
    color: white !important;
    font-size: 0.68rem !important;
    height: 20px !important;
}
.pf-chip-archived .mud-chip-content { padding: 0 8px !important; }

/* Chip used inside the AppBar (matches AppBar tone) */
.pf-chip-archived-appbar {
    background: rgba(255,255,255,0.18) !important;
    color: rgba(255,255,255,0.9) !important;
    border: 1px solid rgba(255,255,255,0.35) !important;
    font-size: 0.68rem !important;
    height: 20px !important;
}
.pf-chip-archived-appbar .mud-chip-content { padding: 0 8px !important; }

/* Page card — desaturated warm grey when archived */
.pf-page-card.pf-archived {
    background-color: rgba(210, 210, 206, 0.94) !important;
}
.pf-page-card.pf-archived .mud-paper:not(.mud-appbar):not(.mud-drawer):not(.mud-menu-list) {
    background-color: rgba(215, 215, 212, 0.92) !important;
}

/* Data grid muted colors when archived */
.pf-page-card.pf-archived .mud-table-root {
    background: rgba(212, 212, 209, 0.95) !important;
}
.pf-page-card.pf-archived .mud-table-head .mud-table-cell {
    background: rgba(255, 255, 255, 0.95) !important;
    color: rgba(60, 60, 58, 0.9) !important;
}
.pf-page-card.pf-archived .mud-table-body .mud-table-row:hover td {
    background: rgba(204, 204, 201, 0.9) !important;
}
.pf-page-card.pf-archived .mud-table-body .mud-table-cell {
    color: rgba(70, 70, 68, 0.9) !important;
}
.pf-page-card.pf-archived .mud-chip:not(.pf-chip-archived):not(.pf-chip-archived-appbar) {
    filter: saturate(0.35) brightness(1.05) !important;
}
.pf-page-card.pf-archived .mud-table-pagination {
    background: rgba(208, 208, 205, 0.97) !important;
    color: rgba(70, 70, 68, 0.85) !important;
}
.pf-page-card.pf-archived .mud-tabs-tabbar {
    background: rgba(255, 255, 255, 0.97) !important;
}
.pf-page-card.pf-archived .mud-tab-active {
    color: rgba(50, 50, 48, 1) !important;
}
/* Selects/inputs inside tab panels should look normal, not muted */
.pf-page-card.pf-archived .mud-tabs-panels .mud-input-root,
.pf-page-card.pf-archived .mud-tabs-panels .mud-select-input { color: inherit !important; }
.pf-page-card.pf-archived .mud-tabs-panels .mud-input-outlined-border { border-color: rgba(0,0,0,0.23) !important; }
.pf-page-card.pf-archived .mud-tabs-panels .mud-input-label { color: rgba(0,0,0,0.6) !important; }

/* Vertical divider between title and season selector */
.pf-appbar-divider {
    display: inline-block;
    width: 1px;
    height: 22px;
    background: rgba(255,255,255,0.3);
    margin: 0 10px;
    flex-shrink: 0;
    align-self: center;
}

/* Breathing room between start adornment icon and input text */
.mud-input-adornment-start { padding-right: 8px; }
.mud-input > input.mud-input-root-outlined.mud-input-root-adorned-start { padding-left: 10px; }

/* Align the input slot to the end (bottom) so header search fields sit flush with
   adjacent icon buttons. Scoped to .pf-header-search to avoid touching login/form fields. */
.mud-input-control.pf-header-search > .mud-input-control-input-container { align-items: end; }

/* Outlined input labels: prevent wrapping. Background is intentionally none so
   the label blends with its container rather than showing a white rectangle. */
.mud-input-label-outlined {
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 24px);
    background: none;
    padding: 0 4px;
    margin-left: -4px;
}

/* ====================================================================
   End Forest Theme
   ==================================================================== */

/* HR divider blot — styled in both the editor and on the rendered form */
.ql-editor hr, .pf-rich-text hr {
    border: none;
    border-top: 2px solid #c8d8c8;
    margin: 0.75rem 0;
    display: block;
}

/* Quill editor — remove double border when wrapped in our own bordered div */
.ql-container.ql-snow {
    border: none;
}
.ql-toolbar.ql-snow {
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 1px solid rgba(0,0,0,0.12);
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Shared Quill HTML output — bullets indented past surrounding text */
.pf-rich-text p { margin: 0 0 0.4rem; padding: 0; }
.pf-rich-text ul, .pf-rich-text ol { margin: 0.25rem 0 0.4rem; padding-left: 2.25rem; }
.pf-rich-text li { margin-bottom: 0.2rem; }
.pf-rich-text li::marker { color: #333; }

/* Order form — kept for specificity, inherits from pf-rich-text */
.pf-order-details { margin: 0.5rem 0 1rem; color: #333; line-height: 1.7; }

/* ====================================================================
   Dashboard Stat Cards
   ==================================================================== */

.pf-stat-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pf-stat-value {
    font-weight: 700;
    line-height: 1.1;
}

.pf-stat-label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Dashboard tabs — shrink text on mobile so all 4 fit */
.pf-dash-tabs .mud-tab {
    min-width: 0;
    padding: 8px 10px;
}

@media (max-width: 600px) {
    /* Hide tab label text, keep icons only */
    .pf-dash-tabs .mud-tab-text {
        display: none;
    }

    /* Tighter stat cards on phone */
    .pf-stat-card {
        padding: 0.6rem 0.75rem !important;
    }

    .pf-stat-value {
        font-size: 1.4rem !important;
    }
}

/* ====================================================================
   Mobile Responsive Fixes
   ==================================================================== */

/* ── Prevent text selection from bleeding behind open KPI decks and modals ── */

/* Mobile backdrop wrapper is non-selectable while a KPI deck is open.
   The class is only added dynamically when _openKpiCard != null. */
.pf-kpi-mobile-backdrop {
    -webkit-user-select: none;
    user-select: none;
}

/* Desktop: suppress text selection across the entire KPI grid while any
   drop or overlay panel is rendered (they're @if-rendered, not hidden). */
@media (min-width: 960px) {
    .pf-kpi-grid:has(.pf-kpi-drop),
    .pf-kpi-grid:has(.pf-kpi-overlay) {
        -webkit-user-select: none;
        user-select: none;
    }
}

/* Page content behind any open MudDialog should not be text-selectable.
   MudBlazor portals dialogs to body level, so .pf-page-card is not an
   ancestor of .mud-dialog — this rule safely targets only the content behind. */
body:has(.mud-dialog) .pf-page-card {
    -webkit-user-select: none;
    user-select: none;
}

/* Prevent page-level horizontal scroll — only tables scroll */
body {
    overflow-x: hidden;
}

/* Page card: do NOT clip overflow here.
   - body { overflow-x: hidden } already prevents horizontal scrolling.
   - Clipping here breaks position:fixed children (quick-actions bar) on iOS Safari
     and clips absolutely-positioned KPI drops on all browsers. */
.pf-page-card {
    overflow-x: visible;
}

/* Data tables scroll horizontally inside their container */
.mud-table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    /* negative margin trick so the scrollable area reaches the card edge */
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.mud-table-cell {
    min-width: 0;
}

/* ── Icon-only Add buttons (text hidden via d-none on mobile) ──── */
/* On desktop these are normal filled buttons. On mobile (d-none hides the
   label span) we collapse them to a square to remove the excess padding. */
@media (max-width: 600px) {
    .pf-add-btn {
        min-width: 36px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    .pf-add-btn .mud-button-icon-start {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
}

/* ── Icon-only MudButton (no text, all screen sizes) ─────────── */
.pf-btn-icon-only {
    min-width: 36px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
}
.pf-btn-icon-only .mud-button-icon-start {
    margin-right: 0 !important;
    margin-left: 0 !important;
}

/* ── Virtual scroll sortable column header ────────────────────── */
.pf-th-sort {
    cursor: pointer;
    user-select: none;
}
.pf-th-sort:hover {
    color: var(--mud-palette-primary);
}

/* ── Programs expansion panel title ───────────────────────────── */
.pf-prog-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 4px;
    flex-wrap: wrap;
    min-width: 0;
}

.pf-prog-info {
    display: flex;
    align-items: center;
    gap: 4px 6px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.pf-prog-name {
    font-size: 0.925rem;
    font-weight: 500;
    flex-shrink: 1;
    min-width: 0;
}

.pf-prog-count {
    font-size: 0.75rem;
    color: var(--mud-palette-success);
    white-space: nowrap;
}

.pf-prog-actions {
    display: inline-flex;
    gap: 0;
    flex-shrink: 0;
}

/* ── Icon-only button clusters (table actions, form link, etc.) ── */
.pf-icon-cluster {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

/* ── Raw HTML editor (email shell template, etc.) ─────────────────── */
.pf-raw-html-editor {
    font-family: "Courier New", Courier, monospace;
    font-size: 0.82rem;
}

/* Force icon buttons inside table cells to be square with tight padding */
.mud-table td .mud-icon-button {
    padding: 4px !important;
    min-width: unset !important;
    width: 32px !important;
    height: 32px !important;
}

/* ── Tab header touch scrolling ───────────────────────────────── */
/* JS in site.js handles snap-to-tab after scroll settles */
.mud-tabs-scroll-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.mud-tabs-scroll-container::-webkit-scrollbar {
    display: none;
}

/* ── App bar title ─────────────────────────────────────────────── */
.pf-app-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

/* ── Orders cancelled row tint ────────────────────────────────── */
.pf-row-cancelled {
    background-color: rgba(211, 47, 47, 0.05) !important;
}

/* ── Orders filter bar ─────────────────────────────────────────── */
.pf-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
}

.pf-filter-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
}

@media (max-width: 600px) {
    /* Tighter page card on phones */
    .pf-page-card {
        padding: 0.75rem 0.75rem;
        margin-bottom: 1rem;
    }

    /* Shrink app title font so it fits beside icon + account button */
    .pf-app-title {
        font-size: 1rem !important;
    }

    /* Keep icon button groups on a single line inside table action cells */
    .mud-table-cell > span {
        display: inline-flex;
    }

    /* Reduce input field min-width so they don't force overflow */
    .mud-input-control {
        min-width: 0;
    }

    /* Order form submit button: full width on phone */
    .pf-submit-btn {
        width: 100%;
    }

    /* Filter chip groups can each wrap to the next line as a unit */
    .pf-filter-bar {
        gap: 4px 8px;
    }
}

/* ── Drawer navigation padding ─────────────────────────────────────────────── */
/* On iOS Safari the temporary drawer's content wrapper resets padding more
   aggressively than Chrome does. Target every likely ancestor/variant so at
   least one rule wins regardless of how MudBlazor nests the elements at runtime. */
.mud-drawer          .mud-nav-link,
.mud-drawer-content  .mud-nav-link,
.mud-drawer-container .mud-nav-link { padding-left: 16px !important; }

/* Belt-and-suspenders: push the icon and text children left directly,
   in case the <a> padding is still being zeroed on Safari. */
.mud-drawer .mud-nav-link-icon-wrapper { padding-left: 0 !important; margin-left: 0 !important; }
.mud-drawer .mud-nav-link-text         { padding-left: 0 !important; }

/* Negative inventory rows — force white text on all cells and their descendants.
   Needs specificity above 0,4,0 to beat the pf-archived rule that uses !important at the same level. */
.pf-page-card .mud-table-body tr.pf-inventory-negative td.mud-table-cell,
.pf-page-card .mud-table-body tr.pf-inventory-negative td.mud-table-cell * {
    color: white !important;
    font-weight: bold !important;
}

/* Notification badge — pull tight to the bell icon corner */
.pf-notification-badge {
    top: 4px !important;
    left: 22px !important;
}

/* ── Floating admin quick-actions bar (Clients page) ────────────────── */
/* Centered pill anchored to the bottom of the viewport so it never
   overlaps table content; menus open upward (AnchorOrigin TopCenter). */
.pf-quick-actions-bar {
    position:        fixed;
    bottom:          16px;
    left:            50%;
    transform:       translateX(-50%);
    z-index:         1200;
    display:         flex;
    align-items:     center;
    gap:             8px;
    padding:         8px 16px;
    background:      rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-radius:   28px;
    box-shadow:      0 4px 24px rgba(0,0,0,0.14), 0 1px 4px rgba(0,0,0,0.08);
    white-space:     nowrap;
    border:          1px solid rgba(0,0,0,0.07);
    max-width:       calc(100vw - 24px);
}

.pf-quick-actions-label {
    font-size:      0.68rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color:          var(--mud-palette-text-secondary);
    margin-right:   4px;
    flex-shrink:    0;
}

.pf-btn-text {
    display: inline;
}

@media (max-width: 680px) {
    .pf-quick-actions-bar {
        gap:     4px;
        padding: 6px 10px;
    }
    .pf-btn-text,
    .pf-quick-actions-label {
        display: none;
    }
    .pf-quick-actions-bar .mud-button {
        min-width: 0;
        padding:   4px 5px;
    }
    .pf-quick-actions-bar .mud-button-label {
        gap: 0;
    }
    .pf-quick-actions-bar .mud-button-icon-start {
        margin-right: 0 !important;
    }
    .pf-quick-actions-bar .mud-button-icon-end {
        margin-left: 0 !important;
    }
    .pf-admin-menu-popover {
        left:      50% !important;
        transform: translateX(-50%) !important;
    }
}

/* ── Popularity score flyout (MudMenu popover) ──────────────────────── */
/* In MudBlazor 8 the popover renders as a single element that carries
   mud-popover, mud-paper, mud-elevation-X AND the PopoverClass all at once
   (not as parent/child). Use a combined selector, not a descendant selector. */
.mud-popover.pf-score-flyout {
    border-radius:    16px !important;
    background-color: #ffffff !important;
    opacity:          1     !important;
    box-shadow:       0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08) !important;
    overflow:         hidden !important;   /* clips child content to rounded corners */
}

/* Form Link column: visible on desktop, hidden on mobile */
.pf-col-formlink {
    display: table-cell !important;
}

@media (max-width: 599.98px) {
    .pf-col-formlink {
        display: none !important;
    }
}

/* ── Print ──────────────────────────────────────────────────────────────────── */
@media print {
    .mud-appbar,
    .mud-drawer,
    .mud-snackbar-location-container,
    .pf-no-print { display: none !important; }
    .mud-main-content { margin-left: 0 !important; }
    .mud-paper { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ====================================================================
   Dashboard — Card-Based Layout
   ==================================================================== */

/* ── Base card: hover lift ─────────────────────────────────────────── */
.pf-dash-card {
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.pf-dash-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.13) !important;
    transform: translateY(-2px);
}

/* ── Card header: title left, controls right ───────────────────────── */
.pf-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}

/* ── Order Trends: neutral segmented control (Day/Week/Month) ─────── */
/* Lighter, gray treatment so the grouping selector reads as a secondary
   axis control while the blue Orders/Trees/Cumulative group draws the eye
   as the primary metric selector. */
.pf-seg-neutral .mud-button-outlined {
    border-color: rgba(0, 0, 0, 0.18);
    color: var(--mud-palette-text-secondary);
}
.pf-seg-neutral .mud-button-filled-default {
    background-color: rgba(0, 0, 0, 0.11);
    color: var(--mud-palette-text-primary);
    box-shadow: none;
}
.pf-seg-neutral .mud-button-filled-default:hover {
    background-color: rgba(0, 0, 0, 0.17);
    box-shadow: none;
}

/* ── KPI entrance animation ────────────────────────────────────────── */
@keyframes pf-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── KPI card ──────────────────────────────────────────────────────── */
.pf-kpi-card {
    background-color: rgba(255,255,255,0.92);
    border-radius: 8px;
    border-left: 4px solid var(--kpi-border, #2196F3);
    padding: 14px 16px 13px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    animation: pf-fade-up 0.35s ease both;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.pf-kpi-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.13);
    transform: translateY(-2px);
}

.pf-kpi-icon { margin-bottom: 2px; }

.pf-kpi-value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--mud-palette-text-primary);
}

.pf-kpi-label {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--mud-palette-text-secondary);
}

.pf-kpi-subtitle {
    font-size: 0.70rem;
    color: var(--mud-palette-text-disabled);
    margin-top: 0;
    white-space: nowrap;
}

/* ── Delta badges ──────────────────────────────────────────────────── */
/* Shared base — use .pf-delta alone or combined with a variant */
.pf-delta,
.pf-delta-up,
.pf-delta-down {
    font-size: 0.74rem;
    font-weight: 600;
    border-radius: 4px;
    padding: 1px 5px;
    display: inline-block;
    width: fit-content;
}

.pf-delta-up {
    color: #2e7d32;
    background: rgba(46,125,50,0.10);
}

.pf-delta-down {
    color: #c62828;
    background: rgba(198,40,40,0.10);
}

/* ── Inline spark/progress bar ─────────────────────────────────────── */
.pf-spark-bar-track {
    height: 6px;
    background: rgba(0,0,0,0.08);
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}

.pf-spark-bar-fill {
    height: 100%;
    background: #4CAF50;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.pf-spark-bar-fill.pf-spark-bar-neg {
    background: #c62828;
}

/* ── Mobile KPI adjustments ────────────────────────────────────────── */
@media (max-width: 600px) {
    .pf-kpi-value  { font-size: 1.4rem; }
    .pf-kpi-card   { padding: 12px 14px 11px; }
    .pf-kpi-label  { font-size: 0.72rem; }
    .pf-chip-value { font-size: 1.25rem; }
    .pf-chip-label { font-size: 0.68rem; }
    .pf-kpi-chip   { min-width: 88px; padding: 9px 11px 8px; }
    /* Prevent text-selection on tap for KPI cards and chips */
    .pf-kpi-card, .pf-kpi-chip {
        -webkit-user-select: none;
        user-select: none;
    }
}
/* ── KPI Tier 1 — primary cards ────────────────────────────────────── */

/* Grid row: stretch so all 4 cards fill the tallest one's height */
.pf-kpi-grid.mud-grid { align-items: stretch !important; }
.pf-kpi-grid .mud-grid-item { display: flex; flex-direction: column; }

.pf-kpi-primary {
    min-height: 150px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
}

/* SVG sparkline strip */
.pf-kpi-sparksvg {
    display: block;
    width: 100%;
    height: 36px;
    overflow: visible;
}

/* Status breakdown bar (3-segment: submitted / pending / cancelled) */
.pf-kpi-status-bar {
    display: flex;
    height: 5px;
    border-radius: 3px;
    overflow: hidden;
    gap: 1px;
    margin-top: 4px;
}
.pf-kpi-status-bar > span {
    border-radius: 3px;
}

/* Legend row below the status bar */
.pf-kpi-status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    font-size: 0.68rem;
    color: var(--mud-palette-text-secondary);
}
.pf-kpi-status-legend > span {
    display: flex;
    align-items: center;
    gap: 3px;
}
.pf-kpi-status-legend > span::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--legend-color, #ccc);
    flex-shrink: 0;
}

/* Small pill badge (avg trees/client, zero-order warnings) */
.pf-kpi-badge-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.70rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

/* ── KPI Tier 2 — metric chips ──────────────────────────────────────── */
.pf-kpi-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pf-kpi-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 11px 14px 10px;
    border-radius: 8px;
    border-top: 3px solid var(--chip-accent, #bbb);
    background: rgba(255,255,255,0.88);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    text-decoration: none;
    color: inherit;
    min-width: 100px;
    flex: 1 1 100px;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    -webkit-user-select: none;
    user-select: none;
}
.pf-kpi-chip:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.14);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.pf-chip-value {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--mud-palette-text-primary);
}

.pf-chip-label {
    font-size: 0.70rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--mud-palette-text-secondary);
    margin-top: 3px;
    line-height: 1.3;
}

/* Medium screens: switch to CSS Grid so every cell is exactly 1/N of the row.
   A lone chip on the last row is automatically the same width as chips in the
   row above — flex-grow cannot achieve this because it doesn't know N.
   auto-fill + minmax(200px, 1fr) picks the column count from available width:
   ~670px → 3 cols (3+3+1), ~900px → 4 cols (4+3). */
@media (min-width: 601px) and (max-width: 959px) {
    .pf-kpi-chips {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 600px) {
    .pf-kpi-chip  { min-width: 80px; padding: 6px 10px; }
    .pf-chip-value { font-size: 1.1rem; }
    .pf-kpi-chips { gap: 6px; }
}

/* Non-navigating chip (stat display only) */
.pf-kpi-chip.pf-chip-static {
    cursor: default;
}
.pf-kpi-chip.pf-chip-static:hover {
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transform: none;
}
.pf-kpi-chip.pf-chip-popup {
    cursor: pointer;
    position: relative;
}

/* Oak donut popup */
.pf-oak-popup {
    position: fixed;
    bottom: 80px;
    left: 16px;
    z-index: 500;
    background: rgba(255,255,255,0.98);
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.16);
    padding: 12px 16px;
    min-width: 180px;
    white-space: nowrap;
}
.pf-oak-popup-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    margin-top: 6px;
}
.pf-oak-popup-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}

/* ── Org Type breakdown cards ───────────────────────────────────────── */
.pf-orgtype-card {
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    background: rgba(255,255,255,0.95);
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    height: 100%;
    position: relative;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.pf-orgtype-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.13);
    transform: translateY(-2px);
}

.pf-orgtype-overlay {
    position: absolute;
    top: calc(100% + 8px);
    /* left/right set by inline style based on card index */
    min-width: 320px;
    max-width: min(1100px, calc(var(--vw, 1vw) * 92));
    max-height: calc(var(--vh, 1vh) * 72);
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
    padding: 14px 16px;
    z-index: 300;
    animation: pf-fade-up 0.18s ease both;
}

/* Enrollment sub-cards inside the overlay */
.pf-enr-subcards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pf-enr-subcard {
    background: rgba(246,248,250,0.9);
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 8px;
    padding: 10px 12px;
    min-width: 240px;
    flex: 1 1 240px;
    max-width: calc(50% - 5px);
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .pf-enr-subcard { min-width: 0; max-width: 100%; flex: 1 1 100%; }
}

/* KPI card flyout overlay — used by Clients, Oak %, Avg Trees/Order cards */
.pf-kpi-overlay {
    position: absolute;
    top: calc(100% + 6px);
    min-width: 300px;
    max-width: min(1100px, calc(var(--vw, 1vw) * 92));
    max-height: calc(var(--vh, 1vh) * 75);
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
    padding: 14px 16px;
    z-index: 400;
    animation: pf-fade-up 0.18s ease both;
}

/* ── KPI deck inner panel (Trees / Clients / Enrollments) ─────────── */
.pf-kpi-deck-panel {
    width: min(420px, calc(100vw - 32px));
}

/* ── Naked KPI drop — Orders / Trees (no backing card) ────────────── */
/* Positions the org-type list + enrollment deck as a flex row below the KPI card. */
.pf-kpi-drop {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 400;
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: flex-start;
    animation: pf-fade-up 0.18s ease both;
    max-width: calc(100vw - 16px);
}

/* Right-anchored variant — deck opens to the LEFT of the org-type list (for center/right KPI cards) */
.pf-kpi-drop.pf-drop-right {
    left: auto;
    right: 0;
    flex-direction: row-reverse;
}

/* ── Slide-open utility (CSS grid trick: 0fr → 1fr, no JS needed) ─── */
/* Wrap toggle content in:  <div class="pf-slide [pf-slide-open]"><div>…</div></div>
   The inner div gets overflow:hidden so it clips at 0fr during the transition.
   Do NOT put overflow-y:auto directly on the inner div — add it on a grandchild.  */
.pf-slide {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.pf-slide.pf-slide-open {
    grid-template-rows: 1fr;
}
.pf-slide > * {
    overflow: hidden;
    min-height: 0;
}

/* ── Deck panel title header (shared by all 4 KPI drop panels) ───────── */
.pf-kpi-deck-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--mud-palette-text-secondary);
    padding-bottom: 9px;
    margin-bottom: 10px;
    border-bottom: 2px solid color-mix(in srgb, var(--deck-accent, #9e9e9e) 20%, transparent);
}

/* Accordion has no side padding of its own — give the header some breathing room */
.pf-orgtype-accordion .pf-kpi-deck-header {
    padding-left: 14px;
    padding-top: 12px;
}

/* ── Orders KPI org-type accordion ──────────────────────────────────── */
.pf-orgtype-accordion {
    background: rgba(255,255,255,0.97);
    border-radius: 12px;
    box-shadow: 0 6px 28px rgba(0,0,0,0.15), 0 1px 6px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.06);
    width: 430px;
    max-width: calc(100vw - 16px);
    overflow: hidden;
    animation: pf-fade-up 0.18s ease both;
}

.pf-orgtype-row {
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.pf-orgtype-row:last-child {
    border-bottom: none;
}

.pf-orgtype-row-hdr {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.12s ease;
    user-select: none;
}

.pf-orgtype-row-hdr:hover {
    background: rgba(0,0,0,0.025);
}

.pf-orgtype-row-open > .pf-orgtype-row-hdr {
    background: rgba(0,0,0,0.02);
}

/* ── Scroll-fade wrapper — shows bottom gradient hint when list overflows ── */
.pf-deck-scroll-wrap {
    position: relative;
}
.pf-deck-scroll-wrap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 44px;
    background: linear-gradient(transparent 0%, rgba(255,255,255,0.7) 40%, white 85%);
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.2s ease;
}
/* Hide the fade once the user has scrolled to the bottom */
.pf-deck-scroll-wrap.pf-at-bottom::after {
    opacity: 0;
}
/* Accordion variant: slightly transparent white background */
.pf-orgtype-accordion .pf-deck-scroll-wrap::after {
    background: linear-gradient(transparent 0%, rgba(255,255,255,0.65) 40%, rgba(255,255,255,0.97) 85%);
}

.pf-orgtype-enr-list {
    max-height: 270px;
    overflow-y: auto;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding: 4px 0 20px;   /* bottom pad keeps last item above the fade */
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.15) transparent;
}

.pf-orgtype-enr-list::-webkit-scrollbar { width: 4px; }
.pf-orgtype-enr-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 2px; }

.pf-orgtype-enr-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 14px;
    transition: background 0.1s ease;
}

.pf-orgtype-enr-item:hover {
    background: rgba(0,0,0,0.025);
}

/* ── Enrollment deck panel (right column) ─────────────────────────── */
.pf-enr-deck-panel {
    background: rgba(255,255,255,0.97);
    border-radius: 12px;
    box-shadow: 0 6px 28px rgba(0,0,0,0.15), 0 1px 6px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.06);
    width: 520px;
    max-width: calc(100vw - 196px); /* viewport − org list min-width − gap − margins */
    overflow: hidden;
    animation: pf-fade-up 0.18s ease both;
}

.pf-enr-deck-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px 8px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    gap: 8px;
    min-width: 0;
}

/* Viewport clips the off-page slides horizontally; height = slide content height */
.pf-enr-deck-viewport {
    overflow: hidden;
}

.pf-enr-deck-track {
    display: flex;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Each slide: 2-column grid of enrollment sub-cards */
.pf-enr-deck-slide {
    flex: 0 0 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 12px;
    align-content: start;
    align-items: start;       /* sub-cards only as tall as their content */
    box-sizing: border-box;
}

/* Sub-cards inside the grid slide: full-column, no flex sizing */
.pf-enr-deck-slide .pf-enr-subcard {
    min-width: 0;
    max-width: none;
    flex: none;
    width: 100%;
}

/* ── Mobile / tablet (< MudBlazor md breakpoint): KPI drop = bottom sheet ── */
/* On narrow screens the absolute-positioned drop can't fit beside the narrow
   KPI card, so we switch to a viewport-anchored bottom sheet instead.         */

@keyframes pf-slide-up-sheet {
    from { transform: translateY(100%); opacity: 0.6; }
    to   { transform: translateY(0);    opacity: 1; }
}

@media (max-width: 959px) {
    /* Prevent text-selection on tap across all KPI interactive surfaces */
    .pf-kpi-card, .pf-kpi-chip,
    .pf-kpi-drop, .pf-kpi-overlay,
    .pf-orgtype-accordion {
        -webkit-user-select: none;
        user-select: none;
    }

    /* Dim backdrop — applied via .pf-kpi-mobile-backdrop class on the wrapper div */
    .pf-kpi-mobile-backdrop::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.38);
        z-index: 499;
        pointer-events: auto;
    }

    /* Override absolute positioning — become a fixed bottom sheet */
    .pf-kpi-drop,
    .pf-kpi-drop.pf-drop-right,
    .pf-kpi-overlay {
        position: fixed;
        bottom: 0;
        left: 0 !important;
        right: 0 !important;
        top: auto;
        z-index: 500;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        max-height: calc(var(--vh, 1vh) * 72);
        overflow-y: auto;
        overflow-x: hidden;
        border-radius: 20px 20px 0 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.22);
        padding: 20px 16px 32px;
        gap: 12px;
        animation: pf-slide-up-sheet 0.28s cubic-bezier(0.32, 0.72, 0, 1) both;
    }

    /* Drag-handle pill */
    .pf-kpi-drop::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: rgba(0, 0, 0, 0.18);
        border-radius: 2px;
        margin: -8px auto 6px;
        flex-shrink: 0;
    }

    /* Org-type accordion: full width inside the bottom sheet */
    .pf-orgtype-accordion {
        width: 100%;
        max-width: 100%;
        border-radius: 10px;
    }

    /* Deck panels (Trees / Clients / Enrollments): full width in the bottom sheet */
    .pf-kpi-deck-panel {
        width: 100%;
    }

    .pf-orgtype-row-hdr {
        gap: 5px;
        padding: 9px 12px;
    }

    .pf-orgtype-enr-list {
        max-height: 220px;
    }

    /* Overlay (Oak% / Avg): reset inline-style positioning */
    .pf-kpi-overlay {
        right: 0 !important;
        left: 0 !important;
        min-width: 0;
        max-width: 100%;
        max-height: calc(var(--vh, 1vh) * 72);
        overflow-y: auto;
        padding: 20px 16px 32px;
    }

    /* Enrollment / client deck panel: full width */
    .pf-enr-deck-panel {
        width: 100%;
        max-width: none;
        border-radius: 12px;
    }

    /* 2 columns on tablet */
    .pf-enr-deck-slide {
        grid-template-columns: 1fr 1fr;
    }
}

/* Single column on phone */
@media (max-width: 599px) {
    .pf-enr-deck-slide {
        grid-template-columns: 1fr;
    }
}

/* ── Inventory sparkline CSS-hover tooltip ───────────────────────────────────
   Pure CSS approach: tooltip content is rendered in the DOM but hidden until
   the host is hovered. No JS hover events → no flicker possible.           */
.pf-spark-host {
    position: relative;
    flex: 1;
    min-width: 0;
}
.pf-spark-htip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(33,33,33,0.95);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-size: 0.78rem;
    line-height: 1.7;
}
.pf-spark-htip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(33,33,33,0.95);
}
.pf-spark-host:hover .pf-spark-htip {
    display: block;
}

/* ── GrapesJS host container ──────────────────────────────────────── */
/* Ensure the editor fills its host div and doesn't overflow the dialog */
.pf-grapes-host {
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 4px;
    overflow: hidden;
}
.pf-grapes-host .gjs-editor {
    height: 100% !important;
}
/* Keep GrapesJS floating panels (color picker, etc.) inside the dialog */
.pf-grapes-host .gjs-pn-panel,
.pf-grapes-host .gjs-toolbar {
    z-index: 10 !important;
}
/* Slightly tighter block-manager labels */
.pf-grapes-host .gjs-block__media svg {
    width: 28px;
    height: 28px;
}

/* ── Email template shell editor ──────────────────────────────────── */
.pf-raw-html-editor textarea {
    font-family: "Consolas", "Cascadia Code", "Fira Mono", monospace !important;
    font-size: 0.82rem !important;
    line-height: 1.5 !important;
}

/* ── Email template edit dialog — allow Quill link tooltip to overflow ─
   mud-paper clips overflow to achieve rounded corners, which clips the
   absolutely-positioned Quill link-edit flyout. Override just this dialog. */
.pf-template-edit-dialog.mud-dialog,
.pf-template-edit-dialog .mud-dialog-content {
    overflow: visible !important;
}

/* ====================================================================
   End Dashboard Card Layout
   ==================================================================== */

/* ====================================================================
   Client Card List  (mobile Clients page)
   ==================================================================== */

/* Mobile column-filter row above the cards */
.pf-mobile-col-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.pf-mobile-col-filters > * { flex: 1 1 140px; min-width: 0; }

/* Card container */
.pf-client-card-list { display: flex; flex-direction: column; }

/* Individual client card */
.pf-client-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.15s;
}
.pf-client-card.pf-client-card-open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
    margin-bottom: 0;
}
.pf-client-card:active { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }

.pf-client-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}
.pf-client-card-name { font-weight: 600; font-size: 0.95rem; line-height: 1.3; }
.pf-client-card-org {
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 4px;
}
.pf-client-card-contact { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.pf-client-card-contact-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    word-break: break-all;
}
.pf-client-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
}
.pf-client-card-actions { display: flex; justify-content: flex-end; margin-top: 4px; }

/* Expanded detail panel below a card */
.pf-client-card-detail {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    overflow-x: auto;
}

/* Mobile pagination row */
.pf-client-card-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 8px;
}

/* ====================================================================
   End Client Card List
   ==================================================================== */

/* ====================================================================
   Order History Cards  (inside ClientDetailPanel — both mobile & desktop)
   ==================================================================== */

/* Season group */
.pf-season-group { margin-bottom: 12px; }
.pf-season-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 2px;
    cursor: pointer;
    user-select: none;
    border-bottom: 2px solid rgba(0, 0, 0, 0.07);
    margin-bottom: 7px;
}
.pf-season-header:hover { opacity: 0.8; }
.pf-season-name {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--mud-palette-text-primary);
    opacity: 0.65;
}
.pf-season-summary {
    font-size: 0.73rem;
    color: var(--mud-palette-text-secondary);
}

/* Order card stack */
.pf-season-orders { display: flex; flex-direction: column; gap: 5px; }

/* Individual order card */
.pf-order-card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.pf-order-card.pf-order-card-open {
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.pf-order-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    transition: background 0.12s;
}
.pf-order-card-header:hover { background: rgba(0, 0, 0, 0.025); }
.pf-order-card-title { flex: 1 1 auto; min-width: 0; }
.pf-order-card-org { font-size: 0.85rem; font-weight: 500; line-height: 1.3; }
.pf-order-card-meta {
    font-size: 0.74rem;
    color: var(--mud-palette-text-secondary);
    margin-top: 1px;
    line-height: 1.4;
}
.pf-order-card-badges {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Expanded detail inside an order card */
.pf-order-card-detail {
    background: rgba(0, 0, 0, 0.025);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 10px 14px 12px;
}
.pf-order-detail-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    margin-bottom: 10px;
}
.pf-order-detail-field { display: flex; flex-direction: column; }
.pf-order-detail-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 1px;
}
.pf-order-detail-value { font-size: 0.82rem; line-height: 1.4; }

/* ── Client order history season accordion ──────────────────────────────── */
.pf-order-history-panels .mud-expand-panel {
    border: 1px solid var(--mud-palette-divider) !important;
    border-radius: 6px !important;
    margin-bottom: 6px !important;
    box-shadow: none !important;
}
.pf-order-history-panels .mud-expand-panel-header {
    padding: 8px 12px !important;
    min-height: 40px !important;
}
.pf-order-history-panels .mud-expand-panel-content {
    padding: 0 10px 8px !important;
}

/* Line-item chips */
.pf-line-items { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.pf-line-item-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.78rem;
    line-height: 1.3;
}
.pf-line-item-qty {
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
}

/* ====================================================================
   End Order History Cards
   ==================================================================== */

/* ====================================================================
   Order Row Cards  (mobile Orders page)
   ==================================================================== */
.pf-order-row-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.15s;
}
.pf-order-row-card.pf-order-row-card-open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
    margin-bottom: 0;
}
.pf-order-row-card:active { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }

.pf-order-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.pf-order-row-id {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--mud-palette-text-secondary);
}
.pf-order-row-customer {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.9rem;
    margin-bottom: 2px;
}
.pf-order-row-date {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}
.pf-order-row-contact {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 6px;
    word-break: break-all;
}
.pf-order-row-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
}
.pf-order-row-org {
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
    flex: 1 1 auto;
    min-width: 0;
}

/* Dimmed line-item chip variant */
.pf-line-item-chip-dimmed { opacity: 0.45; }

/* ====================================================================
   End Order Row Cards
   ==================================================================== */

/* ====================================================================
   Desktop card-row table  (.pf-card-table on the MudTable Class param)
   ==================================================================== */

/* ── Table chrome ───────────────────────────────────────────────────── */
.pf-card-table {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}
/* Kill MudBlazor's default container shadow / border */
.pf-card-table .mud-table-container,
.pf-card-table .mud-paper {
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
}
/* Row spacing via border-collapse:separate */
.pf-card-table table {
    border-collapse: separate !important;
    border-spacing: 0 5px !important;
    background: transparent !important;
}

/* ── Header overline style ──────────────────────────────────────────── */
.pf-card-table .mud-table-head th {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--mud-palette-text-secondary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    padding-bottom: 6px;
    background: transparent;
}

/* ── Body row card look ─────────────────────────────────────────────── */
.pf-card-table .mud-table-body tr {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.045);
    transition: box-shadow 0.15s, background 0.1s;
}
.pf-card-table .mud-table-body tr:hover {
    background: #fafbff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10), 0 0 0 1px rgba(0, 0, 0, 0.07);
}
/* First + last cell rounding */
.pf-card-table .mud-table-body tr td:first-child {
    border-radius: 8px 0 0 8px;
}
.pf-card-table .mud-table-body tr td:last-child {
    border-radius: 0 8px 8px 0;
}
/* Kill zebra striping and default hover from Dense/Striped/Hover params */
.pf-card-table .mud-table-body tr.mud-table-row-selected,
.pf-card-table .mud-table-body tr:nth-child(odd),
.pf-card-table .mud-table-body tr:nth-child(even) {
    background: #fff;
}
.pf-card-table .mud-table-body tr:nth-child(odd):hover,
.pf-card-table .mud-table-body tr:nth-child(even):hover {
    background: #fafbff;
}

/* ── Status accent — colored left border ───────────────────────────── */
.pf-card-table .pf-status-row-submitted td:first-child {
    border-left: 3px solid var(--mud-palette-success) !important;
    border-radius: 8px 0 0 8px;
}
.pf-card-table .pf-status-row-converted td:first-child {
    border-left: 3px solid var(--mud-palette-warning) !important;
    border-radius: 8px 0 0 8px;
}
.pf-card-table .pf-status-row-cancelled td:first-child {
    border-left: 3px solid var(--mud-palette-error) !important;
    border-radius: 8px 0 0 8px;
}
.pf-card-table .pf-status-row-cancelled {
    opacity: 0.62;
}

/* ── Expanded child / detail row ────────────────────────────────────── */
.pf-card-table .mud-table-body tr.pf-child-row {
    background: rgba(0, 0, 0, 0.018);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.pf-card-table .mud-table-body tr.pf-child-row:hover {
    background: rgba(0, 0, 0, 0.018);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.pf-card-table .mud-table-body tr.pf-child-row td:first-child {
    border-radius: 0 0 0 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
}
.pf-card-table .mud-table-body tr.pf-child-row td:last-child {
    border-radius: 0 0 8px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
}
.pf-card-table .mud-table-body tr.pf-child-row td {
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* Hidden state: suppress all visual chrome so the 0-height row is invisible */
.pf-card-table .mud-table-body tr.pf-child-row.pf-child-row-hidden {
    background: transparent;
    box-shadow: none;
}
.pf-card-table .mud-table-body tr.pf-child-row.pf-child-row-hidden td,
.pf-card-table .mud-table-body tr.pf-child-row.pf-child-row-hidden td:first-child,
.pf-card-table .mud-table-body tr.pf-child-row.pf-child-row-hidden td:last-child {
    border-top: none !important;
    border-radius: 0;
    padding: 0 !important;
}

/* ====================================================================
   End Desktop card-row table
   ==================================================================== */

/* ====================================================================
   Dialog / modal polish
   ==================================================================== */

/* ── Status band (first element inside DialogContent) ───────────────── */
.pf-dialog-status-band {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 0.82rem;
    border-left: 4px solid transparent;
}
.pf-dialog-status-submitted {
    background: rgba(76, 175, 80, 0.08);
    border-left-color: var(--mud-palette-success);
}
.pf-dialog-status-cancelled {
    background: rgba(244, 67, 54, 0.07);
    border-left-color: var(--mud-palette-error);
    opacity: 0.85;
}
.pf-dialog-status-converted {
    background: rgba(255, 152, 0, 0.09);
    border-left-color: var(--mud-palette-warning);
}
.pf-dialog-status-meta {
    color: var(--mud-palette-text-secondary);
    font-size: 0.78rem;
}
.pf-dialog-status-reason {
    font-style: italic;
    color: var(--mud-palette-text-secondary);
    font-size: 0.78rem;
    flex: 1 1 auto;
}

/* ── Labeled field grid ─────────────────────────────────────────────── */
.pf-modal-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-bottom: 4px;
}
.pf-modal-field {
    flex: 1 1 140px;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pf-modal-field-wide {
    flex: 1 1 100%;
}
/* Shared base for all field/section labels inside dialogs and edit panels */
.pf-field-label,
.pf-modal-field-label,
.pf-modal-section-label,
.pf-edit-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--mud-palette-text-secondary);
}

.pf-modal-field-value {
    font-size: 0.875rem;
    line-height: 1.4;
}
.pf-modal-field-value a {
    color: inherit;
}
.pf-modal-field-sub {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

/* ── Section dividers inside dialog ─────────────────────────────────── */
.pf-modal-section {
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    padding-top: 12px;
    margin-top: 12px;
}
.pf-modal-section-label {
    margin-bottom: 8px;
}

/* ── Client section panels (EditClientDialog) ───────────────────────── */
.pf-edit-section {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px 12px 12px;
    background: rgba(0, 0, 0, 0.015);
}
.pf-edit-section-label {
    margin-bottom: 8px;
}

/* ====================================================================
   End Dialog / modal polish
   ==================================================================== */

/* ====================================================================
   Additional row-status variants
   ==================================================================== */

/* Active (e.g. current season) — green left border */
.pf-card-table .pf-status-row-active td:first-child {
    border-left: 3px solid var(--mud-palette-success) !important;
    border-radius: 8px 0 0 8px;
}

/* Archived — subtle grey left border */
.pf-card-table .pf-status-row-archived td:first-child {
    border-left: 3px solid rgba(0, 0, 0, 0.2) !important;
    border-radius: 8px 0 0 8px;
}
.pf-card-table .pf-status-row-archived {
    opacity: 0.7;
}

/* Inactive (e.g. disabled user) — dimmed */
.pf-card-table .pf-status-row-inactive {
    opacity: 0.52;
}

/* ====================================================================
   End Additional row-status variants
   ==================================================================== */

/* ====================================================================
   Mobile bottom-deck dialogs  (xs / sm — max 959 px)
   Targets Z Fold 7 closed (≈ 390 px) and open (≈ 720 px).
   On desktop (≥ 960 px) MudBlazor's default centered dialog is kept.
   ==================================================================== */
@media (max-width: 959px) {

    /* Slide-up entrance — overrides MudBlazor's default scale-in */
    @keyframes pf-deck-enter {
        from { transform: translateY(40px); opacity: 0.5; }
        to   { transform: translateY(0);    opacity: 1;   }
    }

    /* Pull the dialog container to the bottom edge */
    .mud-dialog-container {
        align-items:     flex-end  !important;
        justify-content: center    !important;
        padding:         0         !important;
    }

    /* Full-width deck: rounded top corners, flush bottom, height-capped */
    .mud-dialog {
        width:         100%    !important;
        max-width:     100vw   !important;
        margin:        0       !important;
        border-radius: 20px 20px 0 0 !important;
        /* dvh tracks the real visible area (URL bar shown/hidden) */
        max-height: 90vh;
        max-height: 90dvh;
        display:    flex;
        flex-direction: column;
        /* Slide-up entrance */
        animation: pf-deck-enter 0.24s cubic-bezier(0.34, 1.1, 0.64, 1) !important;
    }

    /* Drag-handle pill — visually cues the sheet is swipeable */
    .mud-dialog::before {
        content:       '';
        display:       block;
        width:         40px;
        height:        4px;
        background:    rgba(0, 0, 0, 0.14);
        border-radius: 2px;
        margin:        10px auto 2px;
        flex-shrink:   0;
    }

    /* Title bar fixed at top of sheet */
    .mud-dialog .mud-dialog-title {
        flex-shrink: 0;
    }

    /* Content scrolls inside the capped height */
    .mud-dialog .mud-dialog-content {
        flex:                     1 1 auto;
        overflow-y:               auto    !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Actions bar pinned at the bottom of the sheet */
    .mud-dialog .mud-dialog-actions {
        flex-shrink:  0;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

}
/* ====================================================================
   End Mobile bottom-deck dialogs
   ==================================================================== */

/* ====================================================================
   Species detail panel (Inventory expand row)
   ==================================================================== */
.pf-species-detail {
    display:     flex;
    gap:         20px;
    align-items: flex-start;
    flex-wrap:   wrap;
    padding-top: 4px;
}

.pf-species-detail-image {
    flex:        0 0 auto;
}

.pf-species-detail-image img {
    width:         200px;
    max-height:    200px;
    object-fit:    contain;
    border-radius: 8px;
    box-shadow:    0 2px 8px rgba(0,0,0,0.10);
    background:    #f8f8f8;
}

.pf-species-detail-desc {
    flex:         1 1 260px;
    font-size:    0.83rem;
    line-height:  1.55;
    color:        rgba(0,0,0,0.78);
}

/* Tighten up Quill's list rendering inside the read-only panel */
.pf-species-detail-desc .ql-editor ul,
.pf-species-detail-desc .ql-editor ol {
    padding-left: 1.2em;
}

.pf-species-detail-desc .ql-editor li {
    margin-bottom: 3px;
}

/* Card description (mobile accordion) — tighter list indent than the desktop panel */
.pf-card-desc {
    font-size:   0.81rem;
    line-height: 1.5;
    color:       rgba(0,0,0,0.76);
}

.pf-card-desc .ql-editor ul,
.pf-card-desc .ql-editor ol {
    padding-left: 0.75em;
}

.pf-card-desc .ql-editor li {
    margin-bottom: 2px;
}

/* Mobile — stack image above description */
@media (max-width: 599px) {
    .pf-species-detail-image img {
        width:      100%;
        max-height: 180px;
    }
    .pf-species-detail {
        flex-direction: column;
    }
}
/* ====================================================================
   End Species detail panel
   ==================================================================== */

/* Touch-swipe scrolling for tab bars on mobile */
.mud-tabs-toolbar {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.mud-tabs-toolbar::-webkit-scrollbar {
    display: none;
}

/* ══════════════════════════════════════════════════════════════════════════
   Mid-range responsive (tablet / small laptop: 960 px – 1399 px)

   MudBlazor switches from mobile-card layout to the desktop table at 960 px,
   but the desktop tables are designed for ≥ 1400 px and don't fit comfortably
   in the gap between those two breakpoints.  The rules below bridge that gap
   without touching the mobile (< 960 px) or full-desktop (≥ 1400 px) layouts.
   ══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 960px) and (max-width: 1399px) {

    /* ── 1. Page card: recover ~28 px on each side for tables ─────────── */
    .pf-page-card {
        padding: 1rem 0.875rem;
    }

    /* ── 2. Table cells: tighter horizontal padding (Dense is already on,
            but these shave another 4–6 px per column = 40–60 px total) ── */
    .mud-table td.mud-table-cell {
        padding-left:  8px !important;
        padding-right: 8px !important;
    }
    .mud-table th.mud-table-cell {
        padding-left:  8px !important;
        padding-right: 8px !important;
    }

    /* ── 3. Icon buttons inside table cells: 4 px smaller each ────────── */
    .mud-table td .mud-icon-button {
        width:  28px !important;
        height: 28px !important;
    }

    /* ── 4. Slightly smaller chip labels inside table rows ─────────────── */
    .mud-table td .mud-chip { font-size: 0.70rem !important; }

    /* ── 5. Column-visibility utility ─────────────────────────────────── */
    /* Tag both the <MudTh> and every <MudTd> for a column with
       class="pf-col-md-hide" to suppress that column at this breakpoint.
       HTML automatically adjusts colspan cells that exceed the visible
       column count, so child/expansion rows remain full-width.            */
    .pf-col-md-hide {
        display: none !important;
    }
}
/* ══════════════════════════════════════════════════════════════════════════
   End mid-range responsive
   ══════════════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════════════
   Modern AppBar + Drawer (Header & Navigation refresh)
   ══════════════════════════════════════════════════════════════════════════ */

/* AppBar — translucent dark surface with blur and a subtle bottom accent.
   Sits above the forest background and reads as a polished glass header. */
.pf-appbar.mud-appbar {
    background: linear-gradient(180deg, rgba(62, 42, 14, 0.92) 0%, rgba(46, 31, 10, 0.92) 100%) !important;
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid rgba(243, 125, 54, 0.35);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

/* DEV badge — dark red pill next to the app title */
.pf-dev-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 4px;
    background: #8b1a1a;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.6;
    flex-shrink: 0;
    user-select: none;
}

.pf-appbar-menu-btn { margin-right: 4px; }

/* Brand block: logo tile + title */
.pf-appbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 4px;
    margin-right: 12px;
    min-width: 0;
    flex-shrink: 1;
}

.pf-appbar-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(243, 125, 54, 0.18), rgba(63, 157, 67, 0.18));
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.pf-appbar-logo img { width: 26px; height: 26px; display: block; }

.pf-app-title {
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.1;
}

/* User chip on the right side of the AppBar */
.pf-appbar-user-chip {
    gap: 8px;
    padding: 4px 6px 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background-color 120ms ease, border-color 120ms ease;
}
.pf-appbar-user-chip:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.2);
}
.pf-appbar-avatar.mud-avatar {
    background: linear-gradient(135deg, #f37d36, #be4d06) !important;
    color: #ffffff !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    width: 28px !important;
    height: 28px !important;
}

/* ── Modern Drawer ─────────────────────────────────────────────── */

.pf-drawer.mud-drawer {
    background: linear-gradient(180deg, rgba(252, 247, 238, 0.98) 0%, rgba(244, 235, 219, 0.98) 100%) !important;
    border-right: 1px solid rgba(100, 65, 20, 0.15) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12) !important;
    overflow: hidden;
    overscroll-behavior: contain;
}
/* MudBlazor's .mud-drawer-content is already display:flex / flex-direction:column / height:100%;
   override its overflow so only pf-nav-scroll scrolls. */
.pf-drawer .mud-drawer-content {
    overflow: hidden;
}

.pf-drawer-header.mud-drawer-header {
    padding: 14px 16px 12px !important;
    border-bottom: 1px solid rgba(100, 65, 20, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
}

.pf-drawer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.pf-drawer-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f37d36, #be4d06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(190, 77, 6, 0.25);
}
.pf-drawer-logo img { width: 26px; height: 26px; display: block; filter: brightness(0) invert(1); }
.pf-drawer-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.pf-drawer-title { font-weight: 700 !important; color: #3e2a0e; letter-spacing: 0.01em; }
.pf-drawer-subtitle { color: rgba(100, 65, 20, 0.65) !important; font-size: 0.7rem !important; text-transform: uppercase; letter-spacing: 0.08em; }

/* Season selector wrapper inside the drawer — horizontal breathing room */
.pf-drawer-season {
    padding-left: 10px;
    padding-right: 10px;
}

/* Nav menu layout: header + footer fixed, nav items scroll.
   pf-nav-menu fills the remaining height of mud-drawer-content (flex child);
   pf-nav-scroll is the only scroll container; pf-nav-footer is pinned at bottom. */
.pf-nav-menu.mud-navmenu {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    padding: 8px 10px 0 !important;
}
.pf-nav-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Section labels */
.pf-drawer .pf-nav-section {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(100, 65, 20, 0.55);
    padding: 14px 12px 4px;
    margin-top: 2px;
}
.pf-drawer .pf-nav-section:first-child { padding-top: 6px; }

/* Pill-style nav links with left accent indicator on active */
.pf-drawer .mud-nav-link {
    position: relative;
    border-radius: 10px !important;
    margin: 1px 4px;
    padding: 4px 12px !important;
    color: #4a3418 !important;
    font-weight: 500;
    font-size: 0.85rem;
    transition: background-color 120ms ease, color 120ms ease, transform 120ms ease;
}
.pf-drawer .mud-nav-link .mud-nav-link-icon {
    color: rgba(100, 65, 20, 0.65);
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    transition: color 120ms ease;
}
.pf-drawer .mud-nav-link .mud-nav-link-icon-wrapper {
    margin-right: 8px !important;
    min-width: unset !important;
}
.pf-drawer .mud-nav-link:hover {
    background-color: rgba(243, 125, 54, 0.10) !important;
    color: #3e2a0e !important;
}
.pf-drawer .mud-nav-link:hover .mud-nav-link-icon { color: #f37d36; }

.pf-drawer .mud-nav-link.active {
    background-color: rgba(243, 125, 54, 0.16) !important;
    color: #be4d06 !important;
    font-weight: 600;
}
.pf-drawer .mud-nav-link.active .mud-nav-link-icon { color: #f37d36 !important; }
.pf-drawer .mud-nav-link.active::before {
    content: "";
    position: absolute;
    left: -4px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 2px;
    background: linear-gradient(180deg, #f37d36, #be4d06);
    box-shadow: 0 0 8px rgba(243, 125, 54, 0.45);
}

/* Drawer footer — pinned at bottom by flex layout, never scrolls */
.pf-nav-footer {
    flex: 0 0 auto;
    padding: 12px 14px;
    margin: 0 8px 5px;
    border: 1px solid rgba(100, 65, 20, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.45);
    box-shadow: 0 2px 8px rgba(100, 65, 20, 0.08);
}
.pf-nav-footer-line {
    display: block;
    line-height: 1.6;
    color: rgba(100, 65, 20, 0.7) !important;
}
.pf-nav-footer-fineprint {
    display: block;
    font-size: 0.65rem !important;
    opacity: 0.65;
    margin-top: 2px;
    color: rgba(100, 65, 20, 0.7) !important;
}

/* Tighten title further on very narrow screens (icon + title + avatar must fit) */
@media (max-width: 380px) {
    .pf-appbar-logo { width: 32px; height: 32px; }
    .pf-appbar-logo img { width: 22px; height: 22px; }
    .pf-app-title { font-size: 0.95rem !important; }
}

/* ── Mobile drawer (sm and below) ─────────────────────────────────
   Standard modern off-canvas pattern: near-full-width panel, larger
   touch targets, identity block at the top, scrim covers everything
   else, swipe/tap-outside closes. MudDrawer's Temporary variant already
   provides the overlay + outside-click-to-close behavior. */
@media (max-width: 599.98px) {
    /* NOTE: Do NOT override .pf-drawer width or transform here — MudDrawer's
       Temporary variant computes its slide-in/out translateX from the width
       value passed via the Width parameter. Overriding width in CSS leaves the
       panel partially visible and prevents it from closing. */

    /* A stronger scrim reads better on small screens */
    .mud-overlay-drawer { background: rgba(0, 0, 0, 0.45) !important; }

    /* Bigger header so the close button has comfortable thumb reach */
    .pf-drawer-header.mud-drawer-header {
        padding: 12px 14px 10px !important;
    }
    .pf-drawer-logo { width: 40px; height: 40px; }
    .pf-drawer-logo img { width: 26px; height: 26px; }

    /* Identity block sits just below the header (mobile-only) */
    .pf-drawer-user {
        align-items: center;
        gap: 10px;
        padding: 8px 14px 10px;
        border-bottom: 1px solid rgba(100, 65, 20, 0.12);
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
    }
    .pf-drawer-avatar.mud-avatar {
        background: linear-gradient(135deg, #f37d36, #be4d06) !important;
        color: #ffffff !important;
        font-weight: 700 !important;
        flex-shrink: 0;
    }
    .pf-drawer-user-text {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-width: 0;
        line-height: 1.2;
    }
    .pf-drawer-user-name {
        font-weight: 600;
        color: #3e2a0e;
        font-size: 0.92rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .pf-drawer-user-role {
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: rgba(100, 65, 20, 0.6);
    }
    .pf-drawer-signout.mud-icon-button {
        color: rgba(100, 65, 20, 0.75) !important;
        flex-shrink: 0;
    }
    .pf-drawer-signout.mud-icon-button:hover {
        color: #be4d06 !important;
        background: rgba(243, 125, 54, 0.12) !important;
    }

    .pf-drawer-close.mud-icon-button {
        color: rgba(100, 65, 20, 0.7) !important;
    }
    .pf-drawer-close.mud-icon-button:hover {
        color: #be4d06 !important;
        background: rgba(243, 125, 54, 0.12) !important;
    }

    /* Roomier season selector wrapper on mobile */
    .pf-drawer-season {
        padding: 8px 14px 10px !important;
        border-bottom: 1px solid rgba(100, 65, 20, 0.12) !important;
    }


    /* Compact, comfortable nav links on mobile */
    .pf-drawer .mud-nav-link {
        padding: 5px 12px !important;
        font-size: 0.88rem;
        margin: 1px 4px;
        line-height: 1.2;
    }
    .pf-drawer .mud-nav-link .mud-nav-link-icon-wrapper {
        margin-right: 8px !important;
    }
    .pf-drawer .pf-nav-section {
        padding: 10px 12px 2px;
        font-size: 0.62rem;
    }

    /* Footer compactness on small screens */
    .pf-nav-footer { padding: 8px 14px; margin: 0 6px 5px; }
    .pf-nav-footer-line { font-size: 0.68rem !important; line-height: 1.4; }
    .pf-nav-footer-fineprint { font-size: 0.6rem !important; margin-top: 1px; }
}

/* Desktop: hide the mobile-only close button & identity block (d-flex defaults
   they get from MudBlazor utility classes are already correct, but be defensive). */
@media (min-width: 600px) {
    .pf-drawer-user, .pf-drawer-close { display: none !important; }
}

/* ── Collapsible nav section buttons (colored banner style) ─────────────────── */
.pf-nav-section-btn {
    display: flex;
    align-items: center;
    width: 100%;
    border: none;
    cursor: pointer;
    padding: 7px 10px 7px 12px;
    margin: 6px 0 2px;
    border-radius: 10px;
    gap: 8px;
    text-align: left;
    color: #fff;
    transition: filter 120ms ease;
}
.pf-nav-section-btn:first-child { margin-top: 2px; }
.pf-nav-section-btn:hover { filter: brightness(1.1); }

/* Per-section accent colors */
.pf-nav-section-season    { background: #5b8fd6; }
.pf-nav-section-analytics { background: #4ea868; }
.pf-nav-section-contacts  { background: #7c6db8; }
.pf-nav-section-field     { background: #3b8f80; }
.pf-nav-section-admin     { background: #d95b4a; }

.pf-nav-section-btn .pf-nav-section-icon {
    font-size: 18px !important;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}
.pf-nav-section-btn .pf-nav-section-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    color: #fff;
    flex: 1;
}
.pf-nav-section-btn .pf-nav-section-chevron {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px !important;
    flex-shrink: 0;
    transition: transform 150ms ease;
}

/* Season pill on colored header */
.pf-nav-season-pill {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    color: #5b8fd6;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 10px;
    padding: 1px 7px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Mobile tweaks for section buttons */
@media (max-width: 599.98px) {
    .pf-nav-section-btn { padding: 7px 10px 7px 12px; margin: 4px 0 2px; }
    .pf-nav-section-btn:first-child { margin-top: 2px; }
}

/* Make the AppBar brand block a navigation link */
a.pf-appbar-brand {
    text-decoration: none;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 120ms ease;
    padding: 2px 6px 2px 2px;
}
a.pf-appbar-brand:hover { background: rgba(255, 255, 255, 0.10); }
a.pf-appbar-brand .pf-app-title { color: white !important; }

/* AppBar refinements on small screens — tighter padding so brand + actions fit */
@media (max-width: 599.98px) {
    .pf-appbar.mud-appbar {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }
    .pf-appbar-brand { gap: 8px; margin-left: 2px; margin-right: 4px; }
    /* A subtle background behind the hamburger so it feels like an obvious tap target */
    .pf-appbar-menu-btn.mud-icon-button {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.12);
    }
    .pf-appbar-menu-btn.mud-icon-button:hover {
        background: rgba(255, 255, 255, 0.16);
    }
}


