/* =============================================================================
   Supplier Catalog Design System - Subframe/Tailwind Inspired
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Brand fonts (Monotype kit) are loaded in base.html / login.html. DM Mono
   stays in the var() fallback chain so dev / unauthenticated states don't
   look broken if the kit hasn't loaded yet.
   ----------------------------------------------------------------------------- */

/* -----------------------------------------------------------------------------
   Design Tokens (from Subframe config)
   ----------------------------------------------------------------------------- */

:root {
    /* color-scheme controlled by inline style on <html>, toggled by JS */

    /* Neutral Colors (warm stone) — light/dark pairs */
    --neutral-0: light-dark(rgb(255, 255, 255), rgb(23, 20, 18));
    --neutral-50: light-dark(rgb(250, 250, 249), rgb(28, 25, 23));
    --neutral-100: light-dark(rgb(245, 245, 244), rgb(41, 37, 36));
    --neutral-200: light-dark(rgb(231, 229, 228), rgb(55, 50, 48));
    --neutral-300: light-dark(rgb(214, 211, 209), rgb(68, 64, 60));
    --neutral-400: light-dark(rgb(168, 162, 158), rgb(120, 113, 108));
    --neutral-500: light-dark(rgb(120, 113, 108), rgb(148, 142, 137));
    --neutral-600: light-dark(rgb(87, 83, 78), rgb(168, 162, 158));
    --neutral-700: light-dark(rgb(68, 64, 60), rgb(200, 196, 193));
    --neutral-800: light-dark(rgb(41, 37, 36), rgb(214, 211, 209));
    --neutral-900: light-dark(rgb(28, 25, 23), rgb(231, 229, 228));
    --neutral-950: light-dark(rgb(12, 10, 9), rgb(245, 245, 244));

    /* Brand Colors */
    --brand-50: light-dark(rgb(250, 250, 250), rgb(28, 25, 23));
    --brand-100: light-dark(rgb(245, 245, 245), rgb(41, 37, 36));
    --brand-200: light-dark(rgb(229, 229, 229), rgb(55, 50, 48));
    --brand-300: light-dark(rgb(212, 212, 212), rgb(68, 64, 60));
    --brand-400: light-dark(rgb(163, 163, 163), rgb(120, 113, 108));
    --brand-500: light-dark(rgb(115, 115, 115), rgb(148, 142, 137));
    --brand-600: light-dark(rgb(38, 38, 38), rgb(229, 229, 229));
    --brand-700: light-dark(rgb(64, 64, 64), rgb(200, 196, 193));
    --brand-800: light-dark(rgb(38, 38, 38), rgb(229, 229, 229));
    --brand-900: light-dark(rgb(23, 23, 23), rgb(245, 245, 244));

    /* SS&Co brand palette — 10 colors comprising the brand. Approximate
       hexes from the brand-guide swatches; refine as Pantone/Adobe values
       become available. Use these directly as accent colors, or rely on
       the semantic mappings below for warnings / success / danger. */
    --ssco-coral: #F58886;
    --ssco-sunset: #F4A53B;
    --ssco-sunflower: #F8E80E;
    --ssco-sunrise: #D8D14F;
    --ssco-turquoise: #1FA39A;
    --ssco-indian-brush: #E51857;
    --ssco-evening-cloud: #2C2D74;
    --ssco-night-sky: #0E0B26;
    --ssco-rock-forest: #373625;
    --ssco-sand: #F3EEEB;

    /* Brand color subtle tints (12-15% opacity) for backgrounds */
    --ssco-coral-subtle: rgba(245, 136, 134, 0.15);
    --ssco-sunset-subtle: rgba(244, 165, 59, 0.15);
    --ssco-sunflower-subtle: rgba(248, 232, 14, 0.15);
    --ssco-sunrise-subtle: rgba(216, 209, 79, 0.15);
    --ssco-turquoise-subtle: rgba(31, 163, 154, 0.15);
    --ssco-indian-brush-subtle: rgba(229, 24, 87, 0.15);
    --ssco-evening-cloud-subtle: rgba(44, 45, 116, 0.15);

    /* Semantic Colors — routed through brand palette.
       success → Turquoise, warning → Sunset, error → Indian Brush */
    --error-400: light-dark(#EE3F77, #ED4F84);
    --error-500: light-dark(var(--ssco-indian-brush), #ED4F84);
    --warning-400: light-dark(#F6B45D, #F7BD6F);
    --warning-500: light-dark(var(--ssco-sunset), #F7BD6F);
    --success-400: light-dark(#3EB6AD, #5BC6BE);
    --success-500: light-dark(var(--ssco-turquoise), #5BC6BE);

    /* Semantic status backgrounds (subtle tints) */
    --error-subtle: light-dark(#FAD9E4, var(--ssco-indian-brush-subtle));
    --warning-subtle: light-dark(#FCE5CB, var(--ssco-sunset-subtle));
    --success-subtle: light-dark(#CFEEEB, var(--ssco-turquoise-subtle));
    --info-subtle: light-dark(#D7D8EE, var(--ssco-evening-cloud-subtle));

    /* Semantic Aliases */
    --brand-primary: light-dark(rgb(38, 38, 38), rgb(229, 229, 229));
    --default-font: light-dark(rgb(28, 25, 23), rgb(231, 229, 228));
    --subtext-color: light-dark(rgb(120, 113, 108), rgb(148, 142, 137));
    --neutral-border: light-dark(rgb(231, 229, 228), rgb(55, 50, 48));
    --default-background: light-dark(rgb(255, 255, 255), rgb(18, 16, 14));

    /* Typography — Simple Supply Co brand fonts (Monotype kit).
       Guida Mono Pro Var: body + technical (mostly used).
       Ringside Compressed: condensed display heads.
       Kansas Casual: occasional flair / callouts.
       Heritage / Legend Soft Script: rare decorative use. */
    --font-mono: "Guida Mono Pro Var", "DM Mono", ui-monospace, SFMono-Regular, monospace;
    --font-display: "Ringside Compressed A", "Ringside Compressed B", "Ringside Compressed", "Helvetica Neue Condensed", "Arial Narrow", sans-serif;
    --font-flair: "Kansas Casual", "Bradley Hand", cursive;
    --font-script: "Legend Soft Script", "Brush Script MT", cursive;
    --font-heritage: "Heritage", "Tangerine", cursive;

    /* Shadows */
    --shadow-sm: light-dark(
        0px 1px 2px 0px rgba(0, 0, 0, 0.05),
        0px 1px 2px 0px rgba(0, 0, 0, 0.3)
    );
    --shadow-md: light-dark(
        0px 4px 16px -2px rgba(0, 0, 0, 0.08),
        0px 4px 16px -2px rgba(0, 0, 0, 0.4)
    );
    --shadow-lg: light-dark(
        0px 12px 32px -4px rgba(0, 0, 0, 0.08),
        0px 12px 32px -4px rgba(0, 0, 0, 0.5)
    );

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;

    /* Layout */
    --icon-sidebar-width: 56px;
    --categories-width: 280px;
}

/* -----------------------------------------------------------------------------
   Web Awesome Token Overrides
   ----------------------------------------------------------------------------- */

:root,
.wa-light {
    --wa-font-family-body: var(--font-mono);
    --wa-font-family-heading: var(--font-display);
    --wa-font-family-code: var(--font-mono);

    --wa-font-size-2xs: 11px;
    --wa-font-size-xs: 12px;
    --wa-font-size-s: 13px;
    --wa-font-size-m: 14px;
    --wa-font-size-l: 16px;
    --wa-font-size-xl: 18px;

    --wa-border-radius-s: var(--radius-sm);
    --wa-border-radius-m: var(--radius-md);
    --wa-border-radius-l: var(--radius-lg);

    /* Global form-control heights — wa-button, wa-select, wa-input all share
       these so dropdowns and buttons line up at the same height everywhere. */
    --wa-form-control-height: 32px;
    --wa-input-height-s: 28px;
    --wa-input-height-m: 32px;
    --wa-input-height-l: 40px;
}

.wa-dark {
    --wa-font-family-body: var(--font-mono);
    --wa-font-family-heading: var(--font-display);
    --wa-font-family-code: var(--font-mono);
}

wa-badge {
    font-size: 10px;
}

wa-card::part(base) {
    border-color: var(--neutral-border);
    background: var(--default-background);
}

wa-card::part(header) {
    font-weight: 500;
    font-size: 13px;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--neutral-border);
}

wa-card::part(body) {
    padding: var(--space-3) var(--space-4);
}

wa-card::part(footer) {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--neutral-border);
}

/* When .card-body is left inside a wa-card during a partial migration, drop
   its padding so we don't double-pad against wa-card's own body slot. */
wa-card .card-body {
    padding: 0;
}

/* -----------------------------------------------------------------------------
   Global vertical rhythm
   New components consistently shipped without breathing room. These rules
   give every dialog body, card body, and explicit `.wa-stack` container a
   default flex-column with gap so direct children don't jam together.
   Children that need overrides can opt out with margin/gap of their own.
   ----------------------------------------------------------------------------- */
wa-dialog::part(body),
wa-card::part(body),
.wa-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* Modal & drawer titles use the brand display font — same character
   as .page-heading but a touch smaller so they fit a dialog header. */
wa-dialog::part(title),
wa-drawer::part(title) {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Tighter rhythm variant — for dense forms / inline groups. */
.wa-stack-sm {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* Map WA's brand palette → warm stone (replaces default blue).
   The palette runs lightest (95) → darkest (05) as constants. WA's theme
   already remaps the chain for dark mode (fill-quiet picks brand-95 in
   light, brand-10 in dark, etc.) — don't double-invert with light-dark()
   here, or in dark mode tags end up with cream backgrounds. */
:root,
.wa-light,
.wa-dark,
.wa-brand-blue {
    --wa-color-brand-95: rgb(245, 245, 244);
    --wa-color-brand-90: rgb(231, 229, 228);
    --wa-color-brand-80: rgb(214, 211, 209);
    --wa-color-brand-70: rgb(168, 162, 158);
    --wa-color-brand-60: rgb(120, 113, 108);
    --wa-color-brand-50: rgb(87, 83, 78);
    --wa-color-brand-40: rgb(68, 64, 60);
    --wa-color-brand-30: rgb(41, 37, 36);
    --wa-color-brand-20: rgb(28, 25, 23);
    --wa-color-brand-10: rgb(23, 20, 18);
    --wa-color-brand-05: rgb(12, 10, 9);

    /* Loud fill stays dark stone in both modes (matches cart-btn pattern) —
       primary buttons should always read as "shade of black" with white text. */
    --wa-color-brand-fill-loud: rgb(38, 38, 38);
    --wa-color-brand-border-loud: rgb(38, 38, 38);
    --wa-color-brand-on-loud: rgb(255, 255, 255);

    /* Route WA's success / warning / danger semantic tokens through the SS&Co
       brand palette. wa-tag, wa-callout, and wa-button variant=success/warning/
       danger pick these up automatically across the app. */
    --wa-color-success-fill-loud: var(--ssco-turquoise);
    --wa-color-success-fill-normal: var(--ssco-turquoise);
    --wa-color-success-fill-quiet: var(--success-subtle);
    --wa-color-success-border-loud: var(--ssco-turquoise);
    --wa-color-success-border-normal: var(--ssco-turquoise);
    --wa-color-success-border-quiet: var(--success-subtle);
    --wa-color-success-on-loud: white;
    --wa-color-success-on-quiet: var(--ssco-turquoise);

    --wa-color-warning-fill-loud: var(--ssco-sunset);
    --wa-color-warning-fill-normal: var(--ssco-sunset);
    --wa-color-warning-fill-quiet: var(--warning-subtle);
    --wa-color-warning-border-loud: var(--ssco-sunset);
    --wa-color-warning-border-normal: var(--ssco-sunset);
    --wa-color-warning-border-quiet: var(--warning-subtle);
    --wa-color-warning-on-loud: rgb(40, 25, 5);
    --wa-color-warning-on-quiet: light-dark(#7a4a0c, var(--ssco-sunset));

    --wa-color-danger-fill-loud: var(--ssco-indian-brush);
    --wa-color-danger-fill-normal: var(--ssco-indian-brush);
    --wa-color-danger-fill-quiet: var(--error-subtle);
    --wa-color-danger-border-loud: var(--ssco-indian-brush);
    --wa-color-danger-border-normal: var(--ssco-indian-brush);
    --wa-color-danger-border-quiet: var(--error-subtle);
    --wa-color-danger-on-loud: white;
    --wa-color-danger-on-quiet: var(--ssco-indian-brush);

    /* Surface → match our card/page backgrounds and borders */
    --wa-color-surface-default: var(--default-background);
    --wa-color-surface-raised: var(--default-background);
    --wa-color-surface-lowered: var(--neutral-50);
    --wa-color-surface-border: var(--neutral-border);

    /* Focus ring matches brand */
    --wa-focus-ring-width: 2px;
    --wa-focus-ring-offset: 1px;

    /* Form controls — compact, brand mono */
    --wa-form-control-border-color: var(--neutral-border);
    --wa-form-control-border-radius: var(--radius-md);
    --wa-form-control-background-color: var(--default-background);
    --wa-form-control-value-color: var(--default-font);
    --wa-form-control-placeholder-color: var(--subtext-color);
    --wa-form-control-label-color: var(--subtext-color);
    --wa-form-control-label-font-weight: 400;
    --wa-form-control-hint-color: var(--subtext-color);
    --wa-form-control-padding-inline: var(--space-3);
}

/* -----------------------------------------------------------------------------
   Web Awesome Component Styling
   Lightweight per-component tweaks. Most styling comes from token overrides
   above. Use ::part() only when tokens can't reach the surface we need.
   ----------------------------------------------------------------------------- */

/* Buttons — flat, no shadow, matches our .btn aesthetic */
wa-button::part(base) {
    box-shadow: none;
    font-weight: 500;
    transition: all 0.15s ease;
}

wa-button[appearance~="outlined"]::part(base) {
    border-color: var(--neutral-border);
    color: var(--default-font);
    background: var(--default-background);
}

wa-button[appearance~="outlined"]:hover::part(base) {
    background: var(--neutral-100);
    border-color: var(--neutral-300);
}

wa-button[appearance~="plain"]::part(base) {
    color: var(--subtext-color);
}

wa-button[appearance~="plain"]:hover::part(base) {
    color: var(--default-font);
}

/* Inputs / textareas / selects */
wa-input,
wa-textarea,
wa-select {
    font-family: var(--font-mono);
    font-size: 14px;
}

/* WA's form-control mixin sets the host to display: flex; flex-direction:
   column to stack label / control / hint vertically. When all three slots
   are empty (just a bare select with no label), the column layout still
   adds vertical extent that makes the host visually taller than a sibling
   wa-button. Switch to inline-flex row when there's no label/hint slotted. */
wa-input:not([label]):not([hint]),
wa-textarea:not([label]):not([hint]),
wa-select:not([label]):not([hint]) {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
}

wa-input::part(base),
wa-textarea::part(base),
wa-select::part(combobox) {
    border-color: var(--neutral-border);
    background: var(--default-background);
    color: var(--default-font);
    transition: border-color 0.15s ease;
}

wa-input:focus-within::part(base),
wa-textarea:focus-within::part(base),
wa-select:focus-within::part(combobox) {
    border-color: var(--brand-primary);
}

wa-input::part(form-control-label),
wa-textarea::part(form-control-label),
wa-select::part(form-control-label) {
    font-size: 11px;
    margin-bottom: var(--space-1);
}

/* Callouts — subtle tinted background, single-character left accent */
wa-callout {
    font-size: 14px;
    line-height: 1.4;
}

wa-callout::part(base) {
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    border-width: 1px;
}

wa-callout[variant="success"]::part(base) {
    background: var(--success-subtle);
    border-color: transparent;
    color: var(--success-500);
}

wa-callout[variant="danger"]::part(base) {
    background: var(--error-subtle);
    border-color: transparent;
    color: var(--error-500);
}

wa-callout[variant="warning"]::part(base) {
    background: var(--warning-subtle);
    border-color: transparent;
    color: var(--warning-500);
}

wa-callout[variant="neutral"]::part(base),
wa-callout[variant="brand"]::part(base) {
    background: var(--neutral-50);
    border-color: var(--neutral-border);
    color: var(--default-font);
}

/* Dropdown items + select options share the same vertical rhythm.
   Both components style padding on :host, so we target the elements
   directly. One rule keeps every dropdown menu in the app consistent. */
wa-option,
wa-dropdown-item {
    padding: var(--space-3) var(--space-4);
    min-height: 38px;
    line-height: 1.4;
    font-size: 14px;
}

/* Tags — used as status badges. WA styles padding on :host (the custom
   element), not ::part(base) — so we set padding on the host directly. */
wa-tag {
    padding-block: var(--wa-space-2xs, 4px);
    padding-inline: var(--wa-space-s, 10px);
    line-height: 1.4;
}

wa-tag::part(base) {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
    border-radius: var(--radius-sm);
}

/* Avatar — matches our 64px profile circle look */
wa-avatar {
    --size: 40px;
    --background-color: var(--neutral-100);
    --color: var(--subtext-color);
}

wa-avatar::part(base) {
    border: 2px solid var(--neutral-border);
}

/* Divider — match our existing border color. Set margin directly so it
   beats the wa-card's inherited --spacing (which is what blank --spacing
   on the divider would resolve to inside a card). */
wa-divider {
    --color: var(--neutral-border);
    --width: 1px;
    margin: var(--space-5) 0 !important;
}

/* Spinner — inherit current color */
wa-spinner {
    --indicator-color: currentColor;
    --track-color: var(--neutral-200);
}

/* -----------------------------------------------------------------------------
   Reset & Base
   ----------------------------------------------------------------------------- */

/* Reset — keep box-sizing for everyone, but only zero margin/padding on
   element types that need it. Wildcard margin: 0 was breaking WA's
   slotted-icon spacing (wa-button's `slot[name='start']::slotted(*) {
   margin-inline-end: 0.75em }` lives in a layer; unlayered * wins). */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body,
h1, h2, h3, h4, h5, h6,
p, ul, ol, dl, figure, blockquote, pre,
form, fieldset {
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 24px;
    color: var(--default-font);
    background-color: var(--default-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--brand-primary);
}

img {
    display: block;
    max-width: 100%;
}

input,
button,
select {
    font: inherit;
    color: var(--default-font);
    background-color: var(--default-background);
}

/* -----------------------------------------------------------------------------
   Typography
   ----------------------------------------------------------------------------- */

.text-caption {
    font-size: 14px;
    line-height: 18px;
    font-weight: 400;
}

.text-caption-bold {
    font-size: 14px;
    line-height: 18px;
    font-weight: 500;
}

.text-body {
    font-size: 14px;
    line-height: 24px;
    font-weight: 400;
}

.text-body-bold {
    font-size: 15px;
    line-height: 22px;
    font-weight: 500;
}

.text-heading-3 {
    font-size: 18px;
    line-height: 22px;
    font-weight: 400;
}

.text-heading-2 {
    font-size: 22px;
    line-height: 26px;
    font-weight: 400;
}

.text-heading-1 {
    font-size: 32px;
    line-height: 38px;
    font-weight: 400;
}

.text-muted {
    color: var(--subtext-color);
}

/* -----------------------------------------------------------------------------
   App Shell Layout
   ----------------------------------------------------------------------------- */

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Icon Sidebar (left) */
.icon-sidebar {
    width: var(--icon-sidebar-width);
    background: var(--default-background);
    border-right: 1px solid var(--neutral-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-4) 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.icon-sidebar-logo {
    width: 32px;
    height: 32px;
    margin-bottom: var(--space-6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-sidebar-logo svg {
    width: 24px;
    height: 24px;
    color: var(--brand-primary);
}

.icon-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.icon-sidebar-bottom {
    margin-top: auto;
}

.icon-sidebar-item {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--neutral-500);
    cursor: pointer;
    transition: all 0.15s ease;
}

/* Notification inbox row styling on /notifications */
.notification-dot-cell { width: 18px; padding-left: 12px; }
.notification-unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-color, #d92020);
}
.notification-row.notification-unread { background: var(--brand-subtle, var(--neutral-50)); }
.notification-link { color: var(--default-font); text-decoration: none; }
.notification-link:hover { text-decoration: underline; }
.notification-body { color: var(--subtext-color); font-size: 12px; margin-top: 2px; }
.activity-tab-toolbar { display: flex; justify-content: flex-end; padding: 8px 0; }

/* Unread notification badge — small pill on the upper right of the
   sidebar bell icon. */
.sidebar-unread-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #d92020;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
}

.icon-sidebar-item:hover {
    background: var(--neutral-100);
    color: var(--brand-primary);
}

.icon-sidebar-item.active {
    background: var(--neutral-100);
    color: var(--brand-primary);
}

.icon-sidebar-item.active:hover {
    background: var(--neutral-100);
    color: var(--brand-primary);
}

.icon-sidebar-item svg {
    width: 20px;
    height: 20px;
}

/* Cloak icon has more internal detail than other sidebar icons (eye + $);
   bump it up slightly so the dollar sign reads cleanly. */
.icon-sidebar-item .cloak-icon-on,
.icon-sidebar-item .cloak-icon-off {
    width: 22px;
    height: 22px;
}

button.icon-sidebar-item {
    border: none;
    background: none;
    font: inherit;
}

/* Main Content Area */
.main-content {
    margin-left: var(--icon-sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--default-background);
}

.main-content.padded {
    padding: 80px;
}

/* Top Navigation Bar */
.top-nav {
    height: 56px;
    background: var(--default-background);
    border-bottom: 1px solid var(--neutral-border);
    display: flex;
    align-items: center;
    padding: 0 var(--space-4);
    gap: var(--space-4);
    position: sticky;
    top: 0;
    z-index: 50;
}

/* Supplier Dropdown */
.supplier-dropdown {
    position: relative;
}

.supplier-dropdown-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--default-background);
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.supplier-dropdown-btn:hover {
    background: var(--neutral-50);
}

.supplier-dropdown-btn svg {
    width: 16px;
    height: 16px;
    color: var(--neutral-500);
}

.supplier-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: var(--space-1);
    background: var(--default-background);
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 200px;
    display: none;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
}

.supplier-dropdown-menu.show {
    display: flex;
}

.supplier-dropdown-item {
    display: block;
    padding: var(--space-2) var(--space-3);
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    border-bottom: 1px solid var(--neutral-100);
    color: var(--default-font);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.supplier-dropdown-item:last-child {
    border-bottom: none;
}

.supplier-dropdown-item:hover {
    background: var(--neutral-50);
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
    max-width: 400px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-input-wrapper svg {
    position: absolute;
    left: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--neutral-400);
}

.search-input {
    width: 100%;
    padding: var(--space-2) var(--space-3) var(--space-2) 36px;
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--default-background);
}

.search-input::placeholder {
    color: var(--neutral-400);
}

.search-input:focus {
    outline: none;
    border-color: var(--brand-primary);
}

.search-btn {
    padding: var(--space-2) var(--space-4);
    background: var(--default-background);
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
}

.search-btn:hover {
    background: var(--neutral-50);
}

/* Nav Right Section */
.nav-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-left: auto;
}

/* Allocation Dropdown */
.allocation-dropdown {
    position: relative;
}

.allocation-dropdown-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--default-background);
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
}

.allocation-dropdown-btn:hover {
    background: var(--neutral-50);
}

.allocation-dropdown-btn svg {
    width: 16px;
    height: 16px;
    color: var(--neutral-500);
}

.allocation-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--space-1);
    background: var(--default-background);
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 160px;
    display: none;
    z-index: 100;
}

.allocation-dropdown-menu.show {
    display: block;
}

.allocation-dropdown-item {
    padding: var(--space-2) var(--space-3);
    cursor: pointer;
    font-size: 14px;
}

.allocation-dropdown-item:hover {
    background: var(--neutral-50);
}
.allocation-dropdown-item[data-allocation="BV(CO)"],
.allocation-dropdown-item[data-allocation="Salida(CO)"] {
    color: var(--info-color, #0d6efd);
}
.allocation-dropdown-item[data-allocation="Staff"] {
    color: var(--warning-color, #b45309);
}

/* Color-coded allocation button */
.allocation-dropdown-btn.alloc-co {
    border-color: var(--info-color, #0d6efd);
    background: light-dark(#eff6ff, #1e3a5f);
}
.allocation-dropdown-btn.alloc-staff {
    border-color: var(--warning-color, #b45309);
    background: light-dark(#fefce8, #3d2e0a);
}

/* CO/Staff Modal */
.co-modal-sku {
    font-size: 14px;
    color: var(--subtext-color);
    margin-bottom: var(--space-3);
}
.co-modal-field {
    margin-bottom: var(--space-3);
    width: 100%;
}
.co-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    width: 100%;
}

/* Selected customer card */
.co-selected-customer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
    background: var(--neutral-50);
    margin-bottom: var(--space-3);
}
.co-selected-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.co-selected-icon {
    font-size: 24px;
    color: var(--subtext-color);
}
.co-selected-name {
    font-size: 15px;
    font-weight: 600;
}
.co-selected-detail {
    font-size: 14px;
    color: var(--subtext-color);
}

/* New customer toggle */
.co-new-customer-toggle {
    margin-top: var(--space-2);
    margin-bottom: var(--space-2);
}

/* Customer search results in modal */
.co-search-results:empty {
    display: none;
}
.co-search-results {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-2);
}
.co-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
}
.co-search-item:hover {
    background: var(--neutral-50);
}
.co-search-item-icon {
    font-size: 18px;
    color: var(--subtext-color);
}
.co-search-name {
    font-size: 14px;
    font-weight: 500;
}
.co-search-detail {
    font-size: 13px;
    color: var(--subtext-color);
}
.co-search-empty {
    padding: 12px;
    font-size: 14px;
    color: var(--subtext-color);
    text-align: center;
}

/* Allocation customer card (in cart allocation row) */
.alloc-customer-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
    background: var(--neutral-50);
    font-size: 14px;
}
.alloc-customer-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.alloc-customer-name {
    font-weight: 600;
    font-size: 14px;
}
.alloc-customer-contact {
    font-size: 11px;
    color: var(--subtext-color);
}

/* Provenance line at the top of an expanded cart row's allocation
   panel — "Added by Scott · May 6, 03:14 PM". */
.cart-row-meta {
    font-size: 11px;
    color: var(--subtext-color);
}

/* Comment count badge on the expand caret. */
.comment-count-badge {
    margin-left: 6px;
    vertical-align: middle;
}

/* Per-cart-item comment thread (a wa-card living in the expanded
   allocation row). Width is capped — without this, the card stretches
   the full colspan of the cart row, and 60ch (per the WA pattern)
   feels too tight on wide screens. */
.comment-thread {
    margin-top: var(--space-1);
    max-width: min(720px, 100%);
}
/* Override the global inline-flex rule on label-less wa-textarea so the
   compose textarea fills the card width instead of sizing to content.
   Selector specificity must beat `wa-textarea:not([label]):not([hint])`
   above. */
.comment-thread wa-textarea.comment-input:not([label]) {
    display: block;
    width: 100%;
}
/* Comment list is a <ul>; reset native list styling. */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.comment-list p {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.comment-empty,
.comment-loading,
.comment-error {
    font-size: 12px;
    color: var(--subtext-color);
    font-style: italic;
}
.comment-error {
    color: var(--danger-color, #c00);
    font-style: normal;
}
/* Comment header: plain flex row pairing avatar + meta. We tried
   wa-flank for this (per the WA pattern) but its responsive defaults
   collapse the avatar onto its own row in our narrow card. Plain flex
   keeps it predictable. */
.comment-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: nowrap;
}

/* Meta line (SCOTT COMMENTED 14 MINUTES AGO): keep the monospace UI
   typeface in uppercase for a small technical timestamp feel. Sized
   down + muted so it's clearly subordinate to the body. */
.comment-meta {
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.3;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--subtext-color);
}
.comment-meta strong {
    font-weight: 600;
    color: var(--default-font);
}
.comment-meta .wa-caption-s {
    font-size: inherit;
}

.comment-item wa-avatar {
    --size: 28px;
    flex-shrink: 0;
}

/* Body: Kansas Casual (humanist flair) sized at 24px so the comment
   text dominates the row and is read first before the SCOTT COMMENTED
   N MINUTES AGO meta line below. Note: Kansas Casual is a caps-only
   display font, so the body always renders uppercase regardless of
   how it was typed. */
.comment-item p {
    font-family: var(--font-flair);
    font-size: 24px;
    line-height: 1.35;
    color: var(--default-font);
    text-transform: none;
}

/* Tighten the gaps inside the comment-thread card — the default
   wa-stack gap (--wa-space-m, ~16px) leaves too much air between the
   Post button, the divider, and the first comment. */
.comment-thread .wa-stack {
    gap: var(--space-2);
}
/* wa-divider has its own margin via --spacing (defaults to wa-space-m
   ~16px above + below), which double-stacks with the wa-stack gap and
   makes the band around the rule far too tall. Zero it out — the
   wa-stack gap alone is enough breathing room. */
.comment-thread wa-divider {
    --spacing: 0;
}
/* Balance the visual rhythm: add a beat below the DISCUSS heading and
   below the last comment so the top and bottom of the card breathe
   the same as the band around the divider. */
.comment-thread-heading {
    padding-bottom: var(--space-3);
}
.comment-list .comment-item:last-child {
    padding-bottom: var(--space-3);
}
/* Empty-state polish: when there are no comments, hide both the
   divider above the list and the "no comments yet" placeholder so
   the card collapses to a clean compose-only block. The CSS
   re-evaluates on data-state change, so posting the first comment
   automatically reveals the divider + list. */
.comment-thread:has(.comment-list[data-state="empty"]) wa-divider,
.comment-list[data-state="empty"] .comment-empty {
    display: none;
}

/* Cart Button — always dark pill */
.cart-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgb(38, 38, 38);
    color: rgb(255, 255, 255);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
}

.cart-btn:hover {
    background: rgb(23, 23, 23);
    color: rgb(255, 255, 255);
}

.cart-totals {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.cart-total-no {
    color: rgba(255, 255, 255, 0.8);
}

.cart-total-separator {
    color: rgba(255, 255, 255, 0.5);
}

.cart-total-vegas {
    color: rgba(255, 255, 255, 0.8);
}

.cart-total-single {
    color: rgba(255, 255, 255, 0.9);
}

/* Content Layout */
.content-layout {
    display: flex;
    flex: 1;
}

/* Categories Sidebar */
.categories-sidebar {
    width: var(--categories-width);
    background: var(--default-background);
    border-right: 1px solid var(--neutral-border);
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    /* Two-pane layout: top tabs + categories list scrolls in the middle,
       filters dock at the bottom with their own scroll if needed. */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.categories-sidebar > wa-tab-group,
.categories-sidebar > .categories-header {
    flex-shrink: 0;
}

.categories-sidebar > .categories-list {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

/* Toggle hidden state — driven by sidebar toggle button on /products */
body.collections-hidden .categories-sidebar {
    display: none;
}

.sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: transparent;
    border: none;
    color: var(--subtext-color);
    cursor: pointer;
    transition: color 0.15s;
}

.sidebar-toggle-btn:hover {
    color: var(--default-font);
}

body.collections-hidden .sidebar-toggle-btn {
    color: var(--neutral-300);
}

.categories-sidebar .sidebar-header {
    padding: var(--space-3) var(--space-4);
    font-size: 11px;
    font-weight: 500;
    color: var(--subtext-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--neutral-border);
}

.categories-sidebar .category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories-sidebar .category-list li {
    border-bottom: 1px solid var(--neutral-100);
}

.categories-sidebar .category-list li a {
    display: block;
    padding: var(--space-2) var(--space-4);
    font-size: 13px;
    color: var(--default-font);
    text-decoration: none;
    transition: background 0.15s ease;
}

.categories-sidebar .category-list li a:hover {
    background: var(--neutral-50);
}

/* View Toggle (Categories/Brands) */
/* Cloak mode — hide cost data behind a blur so the screen is safe to share.
   MSRP stays clear; NET (the .price-net half of the MSRP/NET cell), supplier
   retail, and the discount % column all blur. Hover lifts the blur briefly
   so you can spot-check a value without toggling cloak off. */
html.cloak-mode .price-net,
html.cloak-mode .cell-supplier-retail,
html.cloak-mode .cell-disc,
html.cloak-mode #lightboxNet,
html.cloak-mode #lightboxDisc {
    filter: blur(5px);
    user-select: none;
    transition: filter 0.15s ease;
}
html.cloak-mode .price-net:hover,
html.cloak-mode .cell-supplier-retail:hover,
html.cloak-mode .cell-disc:hover,
html.cloak-mode #lightboxNet:hover,
html.cloak-mode #lightboxDisc:hover {
    filter: blur(0);
}

/* Active filter tags above the products table */
.active-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-3);
    border-bottom: 1px solid var(--neutral-100);
}

/* Sidebar size/depth filters (Sunbelt for now) — docked at the bottom of
   the sidebar, scrolls internally if the filter list overflows. Section
   padding lives on the items themselves so the dividing rules extend
   edge-to-edge. */
.sidebar-filters {
    flex-shrink: 0;
    border-top: 1px solid var(--neutral-border);
    background: var(--default-background);
    padding: 0;
    max-height: 50vh;
    overflow-y: auto;
}
.sidebar-filters[hidden] { display: none; }
.sidebar-filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 500;
    color: var(--subtext-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-3) var(--space-4) var(--space-2);
}
.sidebar-filters-clear {
    background: none;
    border: none;
    color: var(--subtext-color);
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}
.sidebar-filters-clear:hover { color: var(--default-font); }
.sidebar-filters-clear[hidden] { display: none; }

.filter-group { padding-bottom: var(--space-2); }
.filter-group-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--default-font);
    padding: var(--space-2) var(--space-4);
}
/* Strip wa-details' boxed look — render as flat sections separated by
   horizontal rules that extend to the sidebar edges. */
.filter-accordion {
    --spacing: 0;
    margin: 0;
}
.filter-accordion::part(base) {
    background: transparent;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--neutral-100);
}
.filter-accordion::part(header) {
    padding: var(--space-2) var(--space-4);
    font-size: 12px;
}
.filter-accordion::part(content) {
    padding: 0 0 var(--space-2);
}
.filter-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 3px var(--space-4);
    font-size: 12px;
    color: var(--default-font);
    cursor: pointer;
}
.filter-accordion .filter-check {
    /* Indent checkboxes inside accordions so they read as nested */
    padding-left: calc(var(--space-4) + var(--space-3));
}
.filter-check input[type="checkbox"] {
    margin: 0;
    accent-color: var(--default-font);
}
.filter-check > span:first-of-type { flex: 1; }
.filter-count {
    color: var(--subtext-color);
    font-size: 11px;
}
.filter-empty {
    font-size: 12px;
    color: var(--subtext-color);
}

/* Sidebar Categories/Brands tabs — wa-tab-group with empty panels acts as
   pure navigation; the panels stay hidden because the actual sidebar list is
   rendered into the sibling .categories-list element below. */
.sidebar-view-tabs::part(body) {
    display: none;
}
.sidebar-view-tabs::part(nav) {
    border-bottom: 1px solid var(--neutral-border);
}
.sidebar-view-tabs wa-tab::part(base) {
    flex: 1;
    justify-content: center;
    font-size: 11px;
    letter-spacing: 0.05em;
}

/* App-wide wa-tab-group active-state fix: WA's default
   --wa-color-brand-on-quiet (warm stone in our palette) is too dim in dark
   mode — the inactive tab ends up looking brighter than the active one and
   the indicator line nearly disappears. Force the indicator to the body
   text color and use it for active text too, with subtext-color for
   inactive. Affects every wa-tab-group; individual groups can override
   --indicator-color or wa-tab[active] color if they want the brand tint. */
wa-tab-group {
    --indicator-color: var(--default-font);
}
wa-tab-group wa-tab {
    color: var(--subtext-color);
}
wa-tab-group wa-tab[active] {
    color: var(--default-font);
}

.categories-header {
    padding: var(--space-3) var(--space-4);
    font-size: 13px;
    font-weight: 500;
    color: var(--subtext-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--neutral-border);
    position: sticky;
    top: 0;
    background: var(--default-background);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.back-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-1);
    margin: calc(-1 * var(--space-1));
    margin-right: var(--space-1);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
}

.back-btn:hover {
    background: var(--neutral-100);
}

.categories-list {
    list-style: none;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    border-bottom: 1px solid var(--neutral-100);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: background 0.15s ease;
}

.category-item:hover {
    background: var(--neutral-50);
}

.category-item.selected {
    background: var(--brand-primary);
    color: var(--neutral-0);
}

.leaf-check {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--brand-primary);
    flex-shrink: 0;
}

.category-item .arrow {
    color: var(--neutral-400);
    font-size: 14px;
}

.category-item.selected .arrow {
    color: var(--neutral-0);
}

.category-item .count {
    background: var(--neutral-200);
    color: var(--neutral-600);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
}

.category-item.selected .count {
    background: light-dark(rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.2));
    color: var(--neutral-0);
}

.category-item.leaf-selected {
    background: light-dark(rgba(38, 38, 38, 0.08), rgba(229, 229, 229, 0.08));
    border-left: 3px solid var(--brand-primary);
    padding-left: 9px;
}

/* Products Area */
.products-area {
    flex: 1;
    padding: var(--space-4) var(--space-6);
    background: var(--default-background);
    min-width: 0;
    overflow-y: auto;
    height: calc(100vh - 49px); /* Subtract top bar height */
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-4);
}

.products-header h1 {
    font-size: 20px;
    font-weight: 400;
    margin-bottom: var(--space-1);
}

.products-header .subtitle {
    font-size: 13px;
    color: var(--subtext-color);
}

.products-header-actions {
    display: flex;
    gap: var(--space-2);
    flex-shrink: 0;
}

/* Product Table */
.product-table {
    width: 100%;
}

.product-table-header {
    display: grid;
    grid-template-columns: 1fr 120px 80px 50px 45px 40px 60px 40px 60px;
    gap: var(--space-2);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--neutral-border);
    font-size: 11px;
    font-weight: 500;
    color: var(--subtext-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.product-table-row {
    display: grid;
    grid-template-columns: 1fr 120px 80px 50px 45px 40px 60px 40px 60px;
    gap: var(--space-2);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--neutral-100);
    align-items: center;
    cursor: pointer;
    transition: background 0.15s ease;
}

.product-table-row:hover {
    background: var(--neutral-50);
    margin: 0 calc(-1 * var(--space-3));
    padding-left: var(--space-3);
    padding-right: var(--space-3);
}

.product-table-row.expanded {
    background: var(--neutral-50);
    margin: 0 calc(-1 * var(--space-3));
    padding-left: var(--space-3);
    padding-right: var(--space-3);
}

/* Selectable product table (category products view with checkboxes) */
.product-table.selectable .product-table-header,
.product-table.selectable .product-table-row {
    grid-template-columns: 28px 14px 1fr 120px 80px 50px 45px 40px 60px 40px 60px;
}

/* Extra column for suppliers that publish their own retail price (e.g., Sunbelt) */
.product-table.has-supplier-retail .product-table-header,
.product-table.has-supplier-retail .product-table-row {
    grid-template-columns: 1fr 120px 80px 70px 50px 45px 40px 60px 40px 60px;
}
.product-table.selectable.has-supplier-retail .product-table-header,
.product-table.selectable.has-supplier-retail .product-table-row {
    grid-template-columns: 28px 14px 1fr 120px 80px 70px 50px 45px 40px 60px 40px 60px;
}

/* Product Info Cell */
/* Product row checkbox */
.product-cell-check {
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-cell-check input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--brand-primary);
    width: 15px;
    height: 15px;
}

/* Shopify status dot */
.product-cell-dot {
    display: flex;
    align-items: center;
    justify-content: center;
}
.shopify-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.shopify-dot.in-stock {
    background: var(--success-500);
}
.shopify-dot.out-of-stock {
    background: var(--error-400);
}

.product-cell-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.product-thumb {
    width: 48px;
    height: 48px;
    background: #fff;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-text {
    min-width: 0;
}

.product-sku {
    font-weight: 500;
    font-size: 14px;
    color: var(--default-font);
}

.product-desc {
    font-size: 13px;
    color: var(--subtext-color);
}

/* Price Cell */
.product-cell-price {
    text-align: right;
}

.price-msrp {
    font-size: 13px;
    color: var(--neutral-400);
}

.price-net {
    font-size: 14px;
    font-weight: 500;
    color: var(--default-font);
}

/* Other Cells */
.product-cell {
    text-align: center;
    font-size: 13px;
    color: var(--default-font);
}

.product-cell-muted {
    text-align: center;
    font-size: 13px;
    color: var(--subtext-color);
}

/* Quantity Input */
.qty-input {
    width: 100%;
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 13px;
    background: var(--default-background);
}

.qty-input:focus {
    outline: none;
    border-color: var(--brand-primary);
}

.qty-input.over-stock {
    background: var(--error-subtle);
    border-color: var(--error-400);
}

.qty-input.updated,
.lightbox-qty-input.updated {
    animation: flash-green 0.5s ease-out;
}

/* Promo pricing indicator */
.promo-price {
    color: var(--success-500) !important;
}

.promo-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    background: var(--success-500);
    color: var(--neutral-0);
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
    letter-spacing: 0.5px;
}

@keyframes flash-green {
    0% {
        background-color: var(--success-subtle);
    }
    100% {
        background-color: var(--default-background);
    }
}

/* Product Details (expandable) */
.product-details {
    display: none;
    background: var(--neutral-50);
    padding: var(--space-4);
    margin: 0 calc(-1 * var(--space-3));
    border-bottom: 1px solid var(--neutral-200);
}

.product-details.show {
    display: block;
}

.product-details-inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.product-details-info table {
    font-size: 13px;
}

.product-details-info table th {
    text-align: left;
    font-weight: 500;
    color: var(--subtext-color);
    padding-right: var(--space-4);
    padding-bottom: var(--space-2);
}

.product-details-info table td {
    padding-bottom: var(--space-2);
}

/* Extended Description */
.extended-description {
    background: var(--neutral-100);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: var(--space-4);
    color: var(--neutral-700);
}

/* Assortment Contents */
.assortment-contents {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    border-left: 1px solid var(--neutral-200);
    padding-left: var(--space-4);
    margin-left: var(--space-4);
}

.assortment-contents h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--neutral-700);
}

.assortment-table {
    font-size: 11px;
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
    display: block;
}

.assortment-table thead {
    position: sticky;
    top: 0;
    background: var(--neutral-0);
}

.assortment-table th {
    text-align: left;
    font-weight: 500;
    color: var(--subtext-color);
    padding: var(--space-1) var(--space-2);
    border-bottom: 1px solid var(--neutral-200);
}

.assortment-table td {
    padding: var(--space-1) var(--space-2);
    border-bottom: 1px solid var(--neutral-100);
}

.assortment-table a {
    color: var(--brand-primary);
    text-decoration: none;
}

.assortment-table a:hover {
    text-decoration: underline;
}

/* Price Change Indicators */
.price-change-up {
    color: var(--error-500);
}

.price-change-down {
    color: var(--success-500);
}

/* -----------------------------------------------------------------------------
   Breadcrumbs
   ----------------------------------------------------------------------------- */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 13px;
    color: var(--subtext-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 var(--space-4) 0;
    padding: 0;
    padding-inline-start: 0;
    list-style: none;
}

.breadcrumb-item {
    margin-inline-start: 0;
}

.breadcrumb-item a {
    color: var(--subtext-color);
}

.breadcrumb-item a:hover {
    color: var(--brand-primary);
}

.breadcrumb-item.active {
    color: var(--default-font);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    margin-right: var(--space-2);
    color: var(--neutral-300);
}

/* -----------------------------------------------------------------------------
   Loading States
   ----------------------------------------------------------------------------- */

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--neutral-200);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
}

/* -----------------------------------------------------------------------------
   Alerts
   ----------------------------------------------------------------------------- */

.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: 13px;
}

.alert-warning {
    background: var(--warning-subtle);
    color: light-dark(rgb(146, 64, 14), rgb(251, 191, 36));
}

.alert-info {
    background: var(--info-subtle);
    color: light-dark(rgb(30, 64, 175), rgb(96, 165, 250));
}

/* -----------------------------------------------------------------------------
   Toast
   ----------------------------------------------------------------------------- */

.toast-container {
    position: fixed;
    bottom: var(--space-4);
    right: var(--space-4);
    z-index: 1000;
}

.toast {
    background: var(--brand-primary);
    color: var(--neutral-0);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
}

.toast.show {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* -----------------------------------------------------------------------------
   Utility Classes
   ----------------------------------------------------------------------------- */

.text-center {
    text-align: center;
}
.text-end {
    text-align: right;
}
.text-right {
    text-align: right;
}
.text-left {
    text-align: left;
}
.text-success {
    color: var(--success-500);
}
.text-danger {
    color: var(--error-500);
}

.flex {
    display: flex;
}
.flex-col {
    flex-direction: column;
}
.items-center {
    align-items: center;
}
.justify-center {
    justify-content: center;
}
.justify-between {
    justify-content: space-between;
}
.gap-1 {
    gap: var(--space-1);
}
.gap-2 {
    gap: var(--space-2);
}
.gap-3 {
    gap: var(--space-3);
}
.gap-4 {
    gap: var(--space-4);
}

.mt-2 {
    margin-top: var(--space-2);
}
.mt-4 {
    margin-top: var(--space-4);
}
.mb-2 {
    margin-bottom: var(--space-2);
}
.mb-4 {
    margin-bottom: var(--space-4);
}
.py-4 {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
}

.hidden {
    display: none;
}

/* Badge for counts */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: var(--radius-full);
    background: var(--neutral-200);
    color: var(--neutral-600);
}

/* Table utilities for product details */
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th,
.table td {
    padding: var(--space-2);
    text-align: left;
}
.table-sm th,
.table-sm td {
    padding: var(--space-1) var(--space-2);
}
.table-warning {
    background: var(--warning-subtle);
}
.table-info {
    background: var(--info-subtle);
}

/* Small text helper — one notch below body */
.small {
    font-size: 13px;
}

/* Background helpers */
.bg-danger-subtle {
    background: var(--error-subtle) !important;
}

/* Brand column */
.product-cell-brand {
    font-size: 13px;
    color: var(--subtext-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =============================================================================
   Cart Page Styles
   ============================================================================= */

/* Cart Tabs */
.cart-tabs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--neutral-border);
    padding-bottom: var(--space-3);
}

.cart-tab {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--default-background);
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--default-font);
    transition: all 0.15s ease;
}

.cart-tab:hover {
    background: var(--neutral-50);
}

.cart-tab.active {
    background: var(--brand-primary);
    color: var(--neutral-0);
    border-color: var(--brand-primary);
}

.cart-tab .count {
    background: var(--neutral-200);
    color: var(--neutral-600);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 13px;
}

.cart-tab.active .count {
    background: light-dark(rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.2));
    color: var(--neutral-0);
}

/* Cart Section */
.cart-section {
    margin-bottom: var(--space-6);
}

.cart-section.hidden {
    display: none;
}

/* Cart Table */
.cart-table-header,
.cart-table-row {
    display: grid;
    grid-template-columns: 24px 40px 100px 1fr 80px 50px 50px 70px 80px 60px;
    gap: var(--space-2);
    align-items: center;
    padding: var(--space-2) 0;
}

.cart-table-header {
    border-bottom: 1px solid var(--neutral-border);
    font-size: 11px;
    font-weight: 500;
    color: var(--subtext-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cart-table-row {
    border-bottom: 1px solid var(--neutral-100);
    font-size: 13px;
}

.cart-table-row:hover {
    background: var(--neutral-50);
}

.cart-col-expand {
    color: var(--neutral-400);
    cursor: pointer;
    font-size: 10px;
}

.cart-col-thumb {
    width: 40px;
    height: 40px;
    background: var(--neutral-100);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.cart-col-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-col-sku {
    font-weight: 500;
}

.cart-col-sku a {
    color: var(--default-font);
}

.cart-col-sku a:hover {
    color: var(--brand-primary);
}

.cart-col-desc {
    color: var(--subtext-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-col-price,
.cart-col-total {
    font-weight: 500;
}

.cart-col-stock {
    color: var(--subtext-color);
}

.cart-col-actions {
    display: flex;
    gap: var(--space-1);
}

.btn-inc,
.btn-remove {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--default-background);
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--neutral-500);
    transition: all 0.15s ease;
}

.btn-inc:hover {
    background: var(--neutral-100);
    color: var(--default-font);
}

.btn-remove:hover {
    background: var(--error-subtle);
    border-color: var(--error-400);
    color: var(--error-500);
}

/* Cart Footer */
.cart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) 0;
    border-top: 1px solid var(--neutral-border);
    margin-top: var(--space-2);
}

.cart-total {
    font-size: 14px;
}

.cart-total strong {
    font-size: 16px;
}

.cart-actions {
    display: flex;
    gap: var(--space-2);
}

.btn-submit {
    padding: var(--space-2) var(--space-4);
    background: var(--brand-primary);
    color: var(--neutral-0);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease;
}

.btn-submit:hover {
    background: var(--brand-900);
}

.btn-clear {
    padding: var(--space-2) var(--space-4);
    background: var(--default-background);
    color: var(--default-font);
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
}

.btn-clear:hover {
    background: var(--neutral-100);
}

/* Cart Empty State */
.cart-empty {
    padding: var(--space-8);
    text-align: center;
    color: var(--subtext-color);
    background: var(--neutral-50);
    border-radius: var(--radius-md);
}

/* =============================================================================
   Bootstrap Overrides for Cart Page
   ============================================================================= */

/* Cart Page Title */
.products-area h5 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: var(--space-4);
    color: var(--default-font);
}

/* Warehouse Tabs */
.nav-tabs,
ul.nav-tabs {
    border-bottom: none;
    display: flex !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 0;
}

/* Cart header with tabs and barcode button */
.cart-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--neutral-border);
    margin-bottom: var(--space-4);
}

.cart-header-buttons {
    display: flex;
    gap: 8px;
}

/* SKU Import Modal */
.sku-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.sku-modal {
    background: var(--default-background);
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.sku-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--neutral-border);
}

.sku-modal-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.sku-modal-body {
    padding: 20px;
}

/* SKU Processing State */
.sku-processing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.processing-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--neutral-border);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.processing-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.processing-dots {
    display: inline-block;
    width: 20px;
    text-align: left;
}

.processing-count {
    font-size: 14px;
}

.nav-tabs .nav-item,
.nav-tabs > li {
    list-style: none !important;
    margin: 0;
    padding: 0;
}

.nav-tabs .nav-link {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--subtext-color);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: var(--space-2) var(--space-4);
    margin-bottom: -1px;
    transition: all 0.15s ease;
    cursor: pointer;
}

.nav-tabs .nav-link:hover {
    color: var(--default-font);
    background: transparent;
    border-bottom-color: var(--neutral-300);
}

.nav-tabs .nav-link.active {
    color: var(--default-font);
    background: transparent;
    border-bottom-color: var(--brand-primary);
}

.nav-tabs .badge {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-left: var(--space-2);
}

.nav-tabs .badge.bg-primary {
    background: var(--brand-primary) !important;
    color: var(--neutral-0) !important;
}

.nav-tabs .badge.bg-secondary {
    background: var(--neutral-400) !important;
    color: var(--neutral-0) !important;
}

/* Tab Content Panes */
.tab-content {
    width: 100%;
}

.tab-content > .tab-pane {
    display: none;
}

.tab-content > .tab-pane.active {
    display: block;
}

.tab-content > .tab-pane.fade {
    opacity: 0;
    transition: opacity 0.15s linear;
}

.tab-content > .tab-pane.fade.show {
    opacity: 1;
}

/* Bootstrap Buttons - Flat Style */
.btn {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    box-shadow: none;
}

.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: 13px;
}

.btn-outline-primary {
    color: var(--default-font);
    border: 1px solid var(--neutral-border);
    background: var(--default-background);
}

.btn-outline-primary:hover {
    background: var(--neutral-100);
    border-color: var(--neutral-300);
    color: var(--default-font);
}

.btn-outline-secondary {
    color: var(--neutral-600);
    border: 1px solid var(--neutral-border);
    background: var(--default-background);
}

.btn-outline-secondary:hover {
    background: var(--neutral-100);
    border-color: var(--neutral-300);
    color: var(--default-font);
}

.btn-outline-danger {
    color: var(--error-500);
    border: 1px solid var(--neutral-border);
    background: var(--default-background);
}

.btn-outline-danger:hover {
    background: var(--error-subtle);
    border-color: var(--error-400);
    color: var(--error-500);
}

.btn-primary {
    background: var(--brand-primary);
    border: 1px solid var(--brand-primary);
    color: var(--neutral-0);
}

.btn-danger {
    background: var(--default-background);
    border: 1px solid var(--neutral-border);
    color: var(--error-500);
}

.btn-danger:hover {
    background: var(--error-subtle);
    border-color: var(--error-400);
}

.btn-link {
    background: none;
    border: none;
    color: var(--subtext-color);
    padding: 0;
    font-size: inherit;
    cursor: pointer;
    text-decoration: none;
}

.btn-link:hover {
    color: var(--default-font);
}

/* Ensure d-flex works properly */
.d-flex {
    display: flex !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.align-items-center {
    align-items: center !important;
}

.d-inline {
    display: inline-block !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.btn-primary:hover {
    background: var(--brand-900);
    border-color: var(--brand-900);
}

.btn-secondary {
    background: var(--neutral-200);
    border-color: var(--neutral-200);
    color: var(--default-font);
}

.btn-secondary:hover {
    background: var(--neutral-300);
    border-color: var(--neutral-300);
}

/* Tables */
.table {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--default-font);
    border-color: var(--neutral-border);
}

.table thead th {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--subtext-color);
    background: var(--neutral-50);
    border-bottom: 1px solid var(--neutral-border);
    padding: var(--space-2) var(--space-3);
}

.table tbody td {
    padding: var(--space-2) var(--space-3);
    vertical-align: middle;
    border-bottom: 1px solid var(--neutral-100);
}

.table-sm thead th,
.table-sm tbody td {
    padding: var(--space-2);
}

.table tfoot td {
    padding-top: var(--space-6);
    padding-bottom: var(--space-6);
}

.order-update-bar {
    padding: var(--space-4) 0;
    margin-top: var(--space-4);
}

.order-update-form {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.tracking-link-bar {
    margin-bottom: var(--space-3);
}

/* Reprint Labels card — Print Selected button + counter on the same row */
.reprint-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

/* Add-to-cart card on supplier catalog product pages (product.html) */
.add-to-cart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.add-to-cart-row { display: flex; gap: var(--space-2); align-items: stretch; }
.add-to-cart-row .form-control { flex: 0 0 auto; max-width: 80px; }

.tracking-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--brand-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.tracking-link:hover {
    text-decoration: underline;
}

.allocation-apply-form {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* Allocation Row - Expandable editor */
.allocation-row-content {
    background: var(--neutral-50);
    padding: var(--space-3) var(--space-4);
}

.allocation-editor {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.allocation-field {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.allocation-field label {
    font-size: 13px;
    color: var(--subtext-color);
    margin: 0;
    min-width: 50px;
}

.allocation-note {
    margin-top: var(--space-3);
    max-width: 600px;
}

.btn-apply-all {
    padding: var(--space-1) var(--space-3);
    font-size: 11px;
    background: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    color: var(--text-color);
    cursor: pointer;
    margin-left: var(--space-3);
}

.btn-apply-all:hover {
    background: var(--neutral-200);
}

.alloc-input {
    width: 50px;
    padding: var(--space-1) var(--space-2);
    font-size: 13px;
    text-align: center;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
}

.alloc-input:focus {
    outline: none;
    border-color: var(--brand-primary);
}

.alloc-input.updated {
    animation: flash-green 0.5s ease-out;
}

.alloc-input.alloc-error {
    border-color: var(--error-500);
    background-color: var(--error-subtle);
}

.alloc-note.updated {
    animation: flash-green 0.5s ease-out;
}

.alloc-input::-webkit-inner-spin-button,
.alloc-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.allocation-status-row {
    margin-top: var(--space-2);
}

.alloc-status {
    font-size: 13px;
    color: var(--subtext-color);
}

/* Expand toggle for rows */
.expand-toggle {
    cursor: pointer;
    user-select: none;
}

.expand-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 10px;
    color: var(--subtext-color);
}

.expand-arrow.expanded {
    transform: rotate(90deg);
}

/* Allocation summary display */
.allocation-summary {
    font-size: 11px;
    color: var(--subtext-color);
}

/* Status Pill Styles */
.status-pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 400;
    border: 1px solid;
}
.status-draft {
    background-color: var(--neutral-100);
    border-color: var(--neutral-200);
    color: var(--neutral-600);
}
.status-submitted {
    background-color: var(--neutral-100);
    border-color: var(--neutral-200);
    color: var(--neutral-600);
}
.status-confirmed {
    background-color: var(--info-subtle);
    border-color: light-dark(#bee5eb, rgba(59, 130, 246, 0.3));
    color: light-dark(#0c5460, rgb(96, 165, 250));
}
.status-shipping {
    background-color: var(--neutral-100);
    border-color: var(--neutral-200);
    color: var(--neutral-600);
}
.status-shipped {
    background-color: var(--warning-subtle);
    border-color: light-dark(#f0e6cc, rgba(251, 191, 36, 0.3));
    color: light-dark(#856404, rgb(251, 191, 36));
}
.status-delivered {
    background-color: var(--success-subtle);
    border-color: light-dark(#c3e6cb, rgba(34, 197, 94, 0.3));
    color: var(--success-500);
}
.status-received {
    background-color: var(--success-subtle);
    border-color: light-dark(#c3e6cb, rgba(34, 197, 94, 0.3));
    color: var(--success-500);
}
.status-uploaded {
    background-color: var(--success-subtle);
    border-color: light-dark(#c3e6cb, rgba(34, 197, 94, 0.3));
    color: var(--success-500);
}
.status-failed {
    background-color: var(--error-subtle);
    border-color: light-dark(#f5c6cb, rgba(239, 68, 68, 0.3));
    color: var(--error-500);
}
.status-cancelled {
    background-color: var(--error-subtle);
    border-color: light-dark(#f5c6cb, rgba(239, 68, 68, 0.3));
    color: var(--error-500);
}
.status-default {
    background-color: var(--neutral-100);
    border-color: var(--neutral-200);
    color: var(--neutral-600);
}

/* Form Controls */
.form-control {
    font-family: var(--font-body);
    font-size: 14px;
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.form-control:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(38, 38, 38, 0.1);
    outline: none;
}

.form-control-sm {
    padding: var(--space-1) var(--space-2);
    font-size: 13px;
}

.form-select {
    font-family: var(--font-body);
    font-size: 14px;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-4) var(--space-2) var(--space-3);
    background-color: var(--default-background);
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.form-select:focus {
    border-color: var(--brand-primary);
    outline: none;
}

.form-select-sm {
    padding: var(--space-2) var(--space-4) var(--space-2) var(--space-3);
    font-size: 13px;
}

/* Cards */
.card {
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
    background: var(--default-background);
    margin-bottom: var(--space-4);
}

.card-header {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--neutral-border);
    background: transparent;
}

.card-body {
    padding: var(--space-4);
}

/* Alerts */
.alert {
    font-family: var(--font-body);
    font-size: 14px;
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
}

.alert-info {
    background: var(--neutral-50);
    border-color: var(--neutral-200);
    color: var(--subtext-color);
}

/* Cart-specific table styling */
.cart-header th {
    background: var(--neutral-50) !important;
}

.cart-header th:nth-last-child(3) {
    padding-left: var(--space-4);
    border-left: 1px solid var(--neutral-200);
}

.cart-row:hover {
    background: var(--neutral-50);
}

/* Custom-order row tints — flag rows that have customer allocations so staff
   spot them at a glance. State priority: paid > drafted > pending. !important
   keeps the tint visible when the caret-expand reveals the allocation-row
   (which has its own !important background) and during hover. The tint also
   carries over to the immediately-following allocation-row so the expanded
   panel still reads as part of the same custom-order group. */
.cart-row.co-row-pending td,
.cart-row.co-row-pending + .allocation-row td {
    background: var(--warning-subtle, #fef3c7) !important;
}
.cart-row.co-row-drafted td,
.cart-row.co-row-drafted + .allocation-row td {
    background: var(--info-subtle, #e0f2fe) !important;
}
.cart-row.co-row-paid td,
.cart-row.co-row-paid + .allocation-row td {
    background: var(--success-subtle, #dcfce7) !important;
}
.cart-row.co-row:hover td {
    filter: brightness(0.97);
}

/* Allocation breakdown segments — left-aligned in the leftmost cell of the
   Total row. The Total label/value sit tightly together at the right via
   .alloc-total-tight (single cell, small gap between label and value). */
.alloc-total-row .alloc-breakdown-h-cell {
    text-align: left;
    font-size: 12px;
    font-weight: normal;
    color: var(--subtext-color);
}
.alloc-total-row .alloc-total-tight {
    white-space: nowrap;
}
.alloc-total-row .alloc-total-tight strong + strong {
    margin-left: var(--space-2);
}
.alloc-breakdown-h-segment {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.alloc-breakdown-h-segment strong {
    font-weight: 600;
}
.alloc-breakdown-h-sep {
    margin: 0 var(--space-2);
    color: var(--neutral-300);
}
.co-text-pending {
    color: var(--warning-700, #b45309);
}
.co-text-drafted {
    color: var(--info-700, #075985);
}
.co-text-paid {
    color: var(--success-700, #15803d);
}
.co-text-unallocated {
    color: var(--error-500, #ef4444);
}

.cart-row td:nth-last-child(3) {
    padding-left: var(--space-4);
    border-left: 1px solid var(--neutral-100);
}

/* Transfer animations */
.cart-row {
    transition:
        transform 0.3s ease,
        opacity 0.3s ease;
}

.cart-row.transfer-to-nola {
    transform: translateX(50px);
    opacity: 0;
}

.cart-row.transfer-to-vegas {
    transform: translateX(-50px);
    opacity: 0;
}

.cart-qty-input {
    width: 55px !important;
    text-align: center;
    font-size: 13px !important;
}

.cart-qty-input.bg-danger-subtle {
    background: var(--error-subtle) !important;
    border-color: var(--error-400) !important;
}

/* Allocation row */
.allocation-row td {
    background: var(--neutral-50) !important;
}

.alloc-input {
    width: 50px !important;
    text-align: center;
}

/* Sub-grid for the expanded allocation row: cells line up with the
   parent table columns. Spacer (cols 1-2) under expand+thumb is empty;
   left cell (cols 3-5) holds the comment thread aligned to SKU; right
   cell (cols 6-11) holds allocate inputs aligned to Qty. */
.alloc-cell-spacer,
.alloc-cell-comment,
.alloc-cell-controls {
    padding: var(--space-2) var(--space-3);
    vertical-align: top;
}
.alloc-cell-comment {
    padding-right: var(--space-4);
}

/* Allocate inputs stacked vertically — input on the left, label on
   the right. Sits under the Qty column of the parent table. */
.alloc-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
}
.alloc-input-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* Unallocated reference: read-only sibling of the editable allocate
   inputs. Same shape and label rhythm so the eye groups it; muted
   background to telegraph "you can't type here". Auto-updates as
   the editable inputs change above. When fully allocated, the input
   swaps for a green check + "Allocated" label. */
.alloc-unallocated {
    margin-top: var(--space-2);
}
.alloc-unallocated-value {
    background: var(--neutral-100);
    cursor: default;
    color: var(--default-font);
    font-weight: 600;
}
.alloc-unallocated.is-over .alloc-unallocated-value {
    color: var(--danger-color, #c00);
    border-color: var(--danger-color, #c00);
}
.alloc-unallocated.is-over .alloc-unallocated-label {
    color: var(--danger-color, #c00) !important;
}
/* Check icon: hidden by default, sized to occupy the same slot as the
   readonly input so the row alignment with BV/Salida/Online/Staff
   doesn't shift when it appears. */
.alloc-unallocated .alloc-allocated-icon {
    display: none;
    width: 50px;
    text-align: center;
    color: var(--success-500, #22c55e);
    font-size: 16px;
}
.alloc-unallocated.is-fully-allocated .alloc-unallocated-value {
    display: none;
}
.alloc-unallocated.is-fully-allocated .alloc-allocated-icon {
    display: inline-flex;
    justify-content: center;
}
.alloc-unallocated.is-fully-allocated .alloc-unallocated-label {
    color: var(--success-500, #22c55e) !important;
    font-weight: 500;
}

/* Generic cart table (non-SLS suppliers) */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.cart-table th {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--subtext-color);
    padding: var(--space-2) var(--space-2);
    border-bottom: 1px solid var(--neutral-border);
    white-space: nowrap;
}

.cart-table td {
    padding: var(--space-2) var(--space-2);
    border-bottom: 1px solid var(--neutral-100);
    vertical-align: middle;
}

.cart-table tbody tr:hover {
    background: var(--neutral-50);
}

.stock-in {
    color: var(--success-color, #28a745);
    font-size: 11px;
    font-weight: 500;
}

.stock-out {
    color: var(--danger-color, #dc3545);
    font-size: 11px;
    font-weight: 500;
}

/* Product thumbnail in cart */
.product-thumb-sm {
    width: 40px;
    min-width: 40px;
}

.product-thumb-sm img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

/* Line total styling */
.line-total strong {
    color: var(--default-font);
}

/* Transfer and remove buttons */
.transfer-btn,
.cart-row form button {
    width: 24px;
    height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Cart totals section */
.products-area > div:last-child {
    margin-top: var(--space-4);
}

/* Subcategory list */
.subcategory-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.subcategory-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--neutral-100);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--default-font);
    text-decoration: none;
    transition: background 0.15s ease;
}

.subcategory-item:hover {
    background: var(--neutral-200);
    color: var(--default-font);
}

.subcategory-item .badge {
    background: var(--neutral-300);
    color: var(--neutral-700);
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-size: 11px;
}

/* Active category in sidebar */
.categories-sidebar .category-list li.active a {
    background: var(--brand-primary);
    color: var(--neutral-0);
}

/* Category count in search results */
.category-count {
    color: var(--neutral-500);
    font-size: 11px;
}

.categories-sidebar .category-list li.active .category-count {
    color: var(--neutral-200);
}

/* Scrape Stats Card */
.scrape-stats-card {
    background: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-5);
}

.scrape-stats-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--subtext-color);
    margin-bottom: var(--space-3);
}

.scrape-stats-grid {
    display: flex;
    gap: var(--space-5);
    flex-wrap: wrap;
}

.scrape-stat {
    display: flex;
    flex-direction: column;
    min-width: 80px;
}

.scrape-stat .stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--default-font);
    line-height: 1.2;
}

.scrape-stat .stat-value.stat-positive {
    color: var(--success-500);
}

.scrape-stat .stat-value.stat-warning {
    color: var(--warning-500);
}

.scrape-stat .stat-value.stat-negative {
    color: var(--error-400);
}

.scrape-stat .stat-label {
    font-size: 11px;
    color: var(--subtext-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scrape-stat.clickable-stat {
    cursor: pointer;
    padding: var(--space-2);
    margin: calc(-1 * var(--space-2));
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.scrape-stat.clickable-stat:hover {
    background: var(--neutral-200);
}

/* Price change table layout */
.price-change-header,
.price-change-row {
    grid-template-columns: 1fr 120px 80px 80px 70px 40px 60px 40px 60px !important;
}

/* Discontinued table layout */
.discontinued-row {
    opacity: 0.7;
}

/* Breadcrumb styling */
.breadcrumb {
    font-family: var(--font-body);
    font-size: 13px;
    padding: 0;
    margin-bottom: var(--space-4);
    background: transparent;
}

.breadcrumb-item a {
    color: var(--subtext-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--brand-primary);
}

.breadcrumb-item.active {
    color: var(--default-font);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--neutral-400);
}

/* Toast notifications */
.toast {
    font-family: var(--font-body);
    border-radius: var(--radius-md);
}

/* Small text helper — one notch below body */
.small {
    font-size: 13px;
}

/* Text utilities */
.text-muted {
    color: var(--subtext-color) !important;
}

/* Background utilities */
.bg-light {
    background: var(--neutral-50) !important;
}

/* -----------------------------------------------------------------------------
   Image Lightbox
   ----------------------------------------------------------------------------- */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.lightbox.show {
    display: flex;
}

.lightbox-container {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
}

.lightbox-content {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.lightbox-image-wrap {
    position: relative;
    flex-shrink: 0;
    width: 70vh;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--neutral-0);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.lightbox-image-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    background: rgb(41, 37, 36);
    border: 1px solid rgb(87, 83, 78);
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 10px;
    line-height: 1;
    opacity: 0.9;
    transition: opacity 0.15s;
    border-radius: var(--radius-sm);
    z-index: 10;
}

.lightbox-close:hover {
    opacity: 1;
    background: rgb(68, 64, 60);
}

/* HUD Panel — always dark (overlays dark lightbox backdrop) */
.lightbox-hud {
    background: rgb(28, 25, 23);
    border: 1px solid rgb(68, 64, 60);
    border-radius: var(--radius-md);
    padding: 20px;
    width: 260px;
    flex-shrink: 0;
    color: rgb(245, 245, 244);
}

.lightbox-sku {
    font-size: 16px;
    font-weight: 500;
    color: white;
    margin-bottom: 4px;
}

.lightbox-desc {
    font-size: 14px;
    color: rgb(168, 162, 158);
    margin-bottom: 8px;
    line-height: 1.4;
}

.lightbox-brand {
    font-size: 13px;
    color: rgb(120, 113, 108);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgb(68, 64, 60);
}

/* Pricing */
.lightbox-pricing {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgb(68, 64, 60);
}

.lightbox-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.lightbox-price-row:last-child {
    margin-bottom: 0;
}

.lightbox-label {
    font-size: 11px;
    color: rgb(120, 113, 108);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lightbox-value {
    font-size: 14px;
    color: rgb(214, 211, 209);
}

.lightbox-net {
    font-weight: 500;
    color: white;
}

/* Inventory */
.lightbox-inventory {
    margin-bottom: 16px;
}

.lightbox-inv-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.lightbox-inv-row .lightbox-label {
    width: 50px;
}

.lightbox-stock {
    font-size: 14px;
    color: rgb(168, 162, 158);
    width: 40px;
    text-align: right;
}

.lightbox-qty-input {
    width: 70px;
    padding: 6px 8px;
    font-size: 14px;
    background: rgb(41, 37, 36);
    border: 1px solid rgb(87, 83, 78);
    border-radius: var(--radius-sm);
    color: white;
    text-align: center;
}

.lightbox-qty-input:focus {
    outline: none;
    border-color: rgb(168, 162, 158);
    background: rgb(68, 64, 60);
}

.lightbox-qty-input::placeholder {
    color: rgb(87, 83, 78);
}

.lightbox-moq {
    font-size: 11px;
    color: rgb(120, 113, 108);
    margin-top: 4px;
}

/* Navigation */
.lightbox-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid rgb(68, 64, 60);
}

.lightbox-nav-btn {
    background: rgb(41, 37, 36);
    border: 1px solid rgb(87, 83, 78);
    color: rgb(168, 162, 158);
    padding: 6px 10px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.lightbox-nav-btn:hover {
    background: rgb(68, 64, 60);
    color: white;
}

.lightbox-nav-count {
    font-size: 13px;
    color: rgb(120, 113, 108);
}

/* Make product thumbnails clickable */
.product-thumb {
    cursor: pointer;
    transition: opacity 0.15s;
}

.product-thumb:hover {
    opacity: 0.8;
}

.product-thumb img {
    border-radius: var(--radius-sm);
}

/* -----------------------------------------------------------------------------
   Product Details Images (Browse Page Expansion)
   ----------------------------------------------------------------------------- */

.product-details-images {
    display: flex;
    gap: var(--space-4);
    flex-shrink: 0;
}

.detail-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.detail-image img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    background: var(--default-background);
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
}

.detail-image .image-label {
    font-size: 11px;
    color: var(--subtext-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-image-swatch img {
    width: 80px;
    height: 80px;
}

/* -----------------------------------------------------------------------------
   Product Page Gallery (Multi-image support)
   ----------------------------------------------------------------------------- */

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.product-main-image {
    background: var(--neutral-50);
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.product-main-image img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.product-thumbnails {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.product-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: #fff;
    border: 2px solid var(--neutral-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s ease;
    padding: 4px;
}

.product-thumbnail:hover {
    border-color: var(--neutral-400);
}

.product-thumbnail.active {
    border-color: var(--brand-primary);
}

.product-swatch-display {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-2);
}

.swatch-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-sm);
}

.swatch-label {
    font-size: 13px;
    color: var(--subtext-color);
}

/* Product Images Row - horizontal layout at top */
.product-images-row {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    align-items: flex-start;
}

.product-image-item {
    position: relative;
    background: var(--neutral-50);
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.product-image-item:hover {
    border-color: var(--neutral-400);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-image-item img {
    max-width: 150px;
    max-height: 150px;
    object-fit: contain;
    display: block;
}

.image-type-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: var(--brand-primary);
    color: var(--neutral-0);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    font-weight: 500;
}

/* Product Info Section */
.product-info-section {
    margin-bottom: var(--space-4);
}

.product-info-section .product-sku {
    margin-bottom: var(--space-2);
}

.product-info-section .product-description {
    font-size: 1.1rem;
    max-width: 600px;
    margin-bottom: var(--space-2);
}

.product-info-section .product-extended-description {
    max-width: 600px;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Product Details Expanded Panel - Images Row */
.product-details-images-row {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    align-items: flex-start;
    margin-bottom: var(--space-4);
}

/* Two-column layout for description and info */
.product-details-columns {
    display: flex;
    gap: var(--space-5);
    flex-wrap: wrap;
}

.detail-image-item {
    position: relative;
    background: var(--neutral-50);
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
    padding: var(--space-2);
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.detail-image-item:hover {
    border-color: var(--neutral-400);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.detail-image-item img {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
    display: block;
}

.image-type-label {
    display: block;
    text-align: center;
    font-size: 10px;
    color: var(--subtext-color);
    margin-top: 4px;
    text-transform: uppercase;
}

/* Product Details Description */
.product-details-description {
    flex: 1;
    min-width: 300px;
    max-width: 600px;
}

.product-details-description .product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.product-details-description .extended-description {
    font-size: 0.9rem;
    color: var(--subtext-color);
    line-height: 1.5;
}

/* Product Details Info (right column) */
.product-details-info {
    flex: 0 0 auto;
}

/* Override old product-details-images if still used */
.product-details-images {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-bottom: var(--space-3);
}

/* Lightbox Carousel Controls - Dots only */
.detail-carousel-controls {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 10;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
}

.detail-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.detail-carousel-dot:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.2);
}

.detail-carousel-dot.active {
    background: rgb(255, 255, 255);
}

/* -----------------------------------------------------------------------------
   Sidebar Enhancements (shared across pages)
   ----------------------------------------------------------------------------- */

.categories-sidebar .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.categories-sidebar .sidebar-header-action {
    color: var(--subtext-color);
    opacity: 0.6;
    transition: opacity 0.15s;
}

.categories-sidebar .sidebar-header-action:hover {
    opacity: 1;
    color: var(--brand-primary);
}

.categories-sidebar .sidebar-empty {
    padding: var(--space-3) var(--space-4);
    font-size: 13px;
    color: var(--subtext-color);
}

/* -----------------------------------------------------------------------------
   Products Page Table
   ----------------------------------------------------------------------------- */

.shop-products-page .product-table {
    margin: 0 calc(-1 * var(--space-6));
}

.shop-products-page .product-table-header,
.shop-products-page .product-table-row {
    display: grid;
    grid-template-columns: 40px 60px 1fr 140px 130px 100px 100px 70px;
    padding: var(--space-3) var(--space-6);
    gap: var(--space-3);
    align-items: center;
    border-bottom: 1px solid var(--neutral-100);
}

.shop-products-page .product-table-row:hover {
    background: var(--neutral-100);
    margin: 0;
    padding: var(--space-3) var(--space-6);
}

/* Make clickable product rows display properly as links */
.shop-products-page a.product-table-row {
    text-decoration: none;
    color: inherit;
    display: grid;
}

.shop-products-page .product-table-header {
    font-size: 11px;
    font-weight: 500;
    color: var(--subtext-color);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    position: sticky;
    top: -16px; /* Offset for products-area padding */
    background: var(--default-background);
    z-index: 40;
    margin-top: calc(-1 * var(--space-4));
}

.col-checkbox {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.col-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--brand-primary);
}

.product-table-row .col-checkbox {
    opacity: 0;
    transition: opacity 0.15s;
}

.product-table-row:hover .col-checkbox,
.product-table-row.selected .col-checkbox {
    opacity: 1;
}

.product-table-row.selected {
    background: light-dark(rgba(79, 70, 229, 0.08), rgba(148, 142, 137, 0.12));
}

/* Selection Action Bar */
.selection-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--neutral-800, #1f2937);
    color: white;
    padding: var(--space-3) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    transform: translateY(100%);
    transition: transform 0.2s ease;
    z-index: 100;
}

.selection-bar.visible {
    transform: translateY(0);
}

.selection-bar #selectionCount {
    font-weight: 600;
}

.selection-bar .selection-hint {
    color: var(--neutral-400, #9ca3af);
    font-size: 14px;
}

.selection-bar .btn-clear-selection {
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: 1px solid var(--neutral-600, #4b5563);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition:
        background 0.15s,
        border-color 0.15s;
}

.selection-bar .btn-clear-selection:hover {
    background: var(--neutral-700, #374151);
    border-color: var(--neutral-500, #6b7280);
}

.selection-bar .btn-selection-action {
    padding: var(--space-2) var(--space-3);
    background: var(--neutral-0);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--brand-800);
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.selection-bar .btn-selection-action:hover {
    background: var(--neutral-200);
}

.selection-bar.dragging {
    cursor: grabbing;
}

/* Drag and Drop States */
.product-table-row.dragging {
    opacity: 0.5;
}

.category-list li.drag-over {
    background: light-dark(rgba(79, 70, 229, 0.15), rgba(148, 142, 137, 0.15));
    border-radius: var(--radius-sm);
}

.category-list li.drag-over > a {
    color: var(--brand-primary);
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--neutral-800, #1f2937);
    color: white;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: 14px;
    opacity: 0;
    transition:
        opacity 0.2s,
        transform 0.2s;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-notification.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-notification.toast-success {
    background: var(--success-500);
}

.toast-notification.toast-error {
    background: var(--error-500);
}

.col-thumb {
    width: 50px;
}

.product-cell-sku {
    font-size: 13px;
}

.product-cell-sku code {
    background: var(--neutral-100);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 11px;
}

.product-cell-title {
    font-size: 14px;
    color: var(--default-font);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-cell-vendor {
    font-size: 13px;
    color: var(--subtext-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-thumb {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-thumb.empty {
    background: var(--neutral-100);
}

/* Status badges */
.status-badge {
    display: inline-block;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: capitalize;
    font-weight: 500;
}

.status-badge.status-draft {
    background: var(--neutral-100);
    color: var(--subtext-color);
}

.status-badge.status-needs_images,
.status-badge.status-needs-images {
    background: var(--warning-subtle);
    color: light-dark(#856404, rgb(251, 191, 36));
}

.status-badge.status-needs_description,
.status-badge.status-needs-description {
    background: var(--info-subtle);
    color: light-dark(#004085, rgb(96, 165, 250));
}

.status-badge.status-ready_for_review,
.status-badge.status-ready-for-review {
    background: var(--success-subtle);
    color: light-dark(#155724, rgb(74, 222, 128));
}

.status-badge.status-published {
    background: var(--success-500);
    color: var(--neutral-0);
}

.status-badge.status-approved {
    background: var(--success-500);
    color: var(--neutral-0);
}

/* Review badges */
.review-badge {
    display: inline-block;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.review-approved {
    background: var(--success-500);
    color: var(--neutral-0);
}

.review-pending {
    background: var(--warning-subtle);
    color: light-dark(#856404, rgb(251, 191, 36));
}

.btn-approve {
    background: var(--success-500);
    color: var(--neutral-0);
    border: 1px solid var(--success-500);
}

.btn-approve:hover {
    opacity: 0.9;
}

/* Review Queue */
.review-queue-header {
    margin-bottom: 1.5rem;
}

.review-queue-header h1 {
    margin: 0 0 0.25rem;
}

.review-queue .product-table-header,
.review-queue .product-table-row {
    display: grid;
    grid-template-columns: 60px 1fr 130px 120px 90px 70px 60px;
    padding: var(--space-3) var(--space-6);
    gap: var(--space-3);
    align-items: center;
    border-bottom: 1px solid var(--neutral-100);
}

.review-queue .product-table-row {
    cursor: pointer;
}

.review-queue .product-table-row:hover {
    background: var(--neutral-50);
    margin: 0;
    padding: var(--space-3) var(--space-6);
}

.review-queue .product-table-header {
    font-size: 11px;
    font-weight: 500;
    color: var(--subtext-color);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    position: sticky;
    top: 0;
    background: var(--default-background);
    z-index: 1;
}

.review-row {
    border-bottom: 1px solid var(--neutral-100);
}

.review-row .product-table-row {
    border-bottom: none;
}

.review-row-expanded {
    background: var(--neutral-50);
}

.review-row-detail {
    padding: var(--space-4) var(--space-6) var(--space-4) 84px;
}

.review-detail-content {
    display: grid;
    grid-template-columns: minmax(0, 700px) 160px;
    gap: var(--space-6);
    margin-bottom: var(--space-3);
}

.review-detail-description h4 {
    font-size: 11px;
    font-weight: 500;
    color: var(--subtext-color);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: var(--space-2);
}

.review-description-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--default-font);
    max-height: 200px;
    overflow-y: auto;
}

.review-meta-list {
    font-size: 13px;
    margin: 0;
}

.review-meta-list dt {
    font-weight: 500;
    color: var(--subtext-color);
    margin-top: var(--space-2);
}

.review-meta-list dt:first-child {
    margin-top: 0;
}

.review-meta-list dd {
    margin: 0;
}

.review-detail-actions {
    display: flex;
    gap: var(--space-2);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--subtext-color);
}

/* Pagination */
.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-top: 1px solid var(--neutral-border);
}

.pagination-btn {
    font-size: 13px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    color: var(--default-font);
    text-decoration: none;
    transition:
        background 0.15s,
        border-color 0.15s;
}

.pagination-btn:hover {
    background: var(--neutral-50);
    border-color: var(--neutral-300);
}

.pagination-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.pagination-info {
    font-size: 13px;
    color: var(--subtext-color);
}

/* Lazy load / infinite scroll */
.load-more-container {
    padding: var(--space-4);
    text-align: center;
}

.loading-spinner {
    font-size: 14px;
    color: var(--subtext-color);
    padding: var(--space-3);
}

.load-more-trigger {
    height: 1px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: var(--space-8);
    color: var(--subtext-color);
}

.empty-state p {
    margin: 0 0 var(--space-2);
}

.empty-state a {
    color: var(--brand-primary);
}

/* Products Top Bar */
.products-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background: var(--default-background);
    border-bottom: 1px solid var(--neutral-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.products-top-bar-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex: 1;
}

.products-top-bar-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.products-top-bar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3);
    flex: 1;
}

.products-summary {
    font-size: 14px;
    color: var(--subtext-color);
}

/* Products Search */
.products-search {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.products-search svg {
    position: absolute;
    left: 10px;
    color: var(--subtext-color);
    pointer-events: none;
}

.products-search input {
    padding: var(--space-2) var(--space-3);
    padding-left: 34px;
    padding-right: 34px;
    width: 400px;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--default-background);
    transition:
        border-color 0.15s,
        width 0.2s;
}

.products-search input:focus {
    outline: none;
    border-color: var(--brand-primary);
    width: 450px;
}

.products-search input::placeholder {
    color: var(--subtext-color);
}

.products-search .search-clear {
    position: absolute;
    right: 1px;
    top: 1px;
    bottom: 1px;
    width: 32px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--neutral-400);
    display: flex;
    align-items: center;
    justify-content: center;
}

.products-search .search-clear:hover {
    color: var(--neutral-600);
}

/* Status Dropdown */
.status-dropdown {
    position: relative;
}

.status-dropdown-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--default-background);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--default-font);
    cursor: pointer;
    transition: border-color 0.15s;
}

.status-dropdown-btn:hover {
    border-color: var(--neutral-300);
}

.status-dropdown-btn .status-count {
    font-weight: 400;
    color: var(--subtext-color);
}

.status-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--default-background);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 220px;
    z-index: 100;
    overflow: hidden;
}

.status-dropdown-menu.show {
    display: block;
}

.status-dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    font-size: 14px;
    color: var(--default-font);
    text-decoration: none;
    transition: background 0.15s;
}

.status-dropdown-item:hover {
    background: var(--neutral-50);
}

.status-dropdown-item.active {
    background: var(--neutral-100);
    font-weight: 500;
}

.status-dropdown-item .count {
    color: var(--subtext-color);
    font-size: 13px;
}

.status-dropdown-divider {
    height: 1px;
    background: var(--neutral-200);
    margin: var(--space-1) 0;
}

/* Sort dropdown */
.sort-dropdown {
    position: relative;
}

.sort-dropdown-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--default-background);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--default-font);
    cursor: pointer;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.sort-dropdown-btn:hover {
    border-color: var(--neutral-300);
}

.sort-dropdown-btn:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(var(--brand-primary-rgb, 0, 0, 0), 0.1);
}

.sort-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--default-background);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 100;
    padding: var(--space-2) 0;
}

.sort-dropdown-menu.show {
    display: block;
}

.sort-dropdown-section {
    padding: var(--space-2) var(--space-4);
    font-size: 11px;
    font-weight: 600;
    color: var(--subtext-color);
    text-transform: uppercase;
}

.sort-dropdown-divider {
    height: 1px;
    background: var(--neutral-100);
    margin: var(--space-2) 0;
}

.sort-option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.sort-option:hover {
    background: var(--neutral-50);
}

.sort-option input[type="radio"] {
    margin: 0;
    accent-color: var(--brand-primary);
}

/* =============================================================================
   Dashboard Page Styles
   ============================================================================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard card spans the full grid (e.g. supplier catalogs table) */
.dashboard-card-wide {
    grid-column: 1 / -1;
}

.dashboard-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
}

.dashboard-table th {
    text-align: left;
    font-weight: 500;
    color: var(--subtext-color);
    padding: 4px 8px 4px 0;
    border-bottom: 1px solid var(--neutral-border);
}

.dashboard-table td {
    padding: 5px 8px 5px 0;
    border-bottom: 1px solid var(--neutral-border);
}

.dashboard-table tr:last-child td {
    border-bottom: none;
}

.dashboard-table a {
    color: var(--brand-primary);
    text-decoration: none;
}

.dashboard-table a:hover {
    text-decoration: underline;
}

/* Linked card header (e.g. "Upcoming Classes" → /classes) inherits header
   styling so it doesn't look like a body link in a heading slot. */
.dashboard-card-header-link {
    color: inherit;
    text-decoration: none;
}

.dashboard-card-header-link:hover {
    text-decoration: underline;
}

.attention-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--default-font);
    font-size: 14px;
    transition: background 0.15s;
}

.attention-item:hover {
    background: var(--neutral-50);
}

.attention-count {
    font-weight: 600;
    font-size: 16px;
    min-width: 32px;
    color: var(--brand-primary);
}

.attention-review .attention-count {
    color: var(--success-500);
}

.status-error {
    background: var(--red-100);
    color: var(--red-700);
}

/* =============================================================================
   Carts Overview Page Styles
   ============================================================================= */

.carts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-summary-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--neutral-border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--default-font);
    transition: background 0.15s, border-color 0.15s;
}

.cart-summary-card:hover {
    background: var(--neutral-50);
    border-color: var(--brand-primary);
}

.cart-supplier-name {
    font-weight: 500;
    font-size: 14px;
}

.cart-summary-stats {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--subtext-color);
}

.suppliers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-3);
}

.supplier-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--default-font);
    background: var(--default-background);
    transition: border-color 0.15s, background 0.15s;
}

.supplier-card:hover {
    border-color: var(--neutral-300);
    background: var(--neutral-50);
}

.supplier-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.supplier-card-name {
    font-size: 15px;
    font-weight: 500;
}

.supplier-card-arrow {
    color: var(--subtext-color);
    transition: transform 0.15s;
}

.supplier-card:hover .supplier-card-arrow {
    transform: translateX(2px);
    color: var(--default-font);
}

.supplier-card-stats {
    display: flex;
    gap: var(--space-5);
}

.supplier-stat {
    display: flex;
    flex-direction: column;
}

.supplier-stat-value {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.1;
    color: var(--default-font);
}

.supplier-stat-label {
    font-size: 11px;
    color: var(--subtext-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.supplier-card-footer {
    font-size: 11px;
    color: var(--subtext-color);
}

.supplier-card-empty {
    font-size: 12px;
    color: var(--neutral-400);
    font-style: italic;
}

/* Cross-supplier search — Google-style centered bar between Active Carts and All Suppliers */
.cross-supplier-search {
    display: flex;
    justify-content: center;
    margin: var(--space-8) auto;
    max-width: 720px;
    width: 100%;
}

.cross-supplier-search-wrap {
    position: relative;
    width: 100%;
}

.cross-supplier-search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--subtext-color);
    pointer-events: none;
}

.cross-supplier-search-input {
    width: 100%;
    height: 52px;
    padding: 0 var(--space-5) 0 52px;
    font-size: 16px;
    font-family: var(--font-mono);
    color: var(--default-font);
    background: var(--default-background);
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-full, 9999px);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.cross-supplier-search-input::placeholder {
    color: var(--subtext-color);
}

.cross-supplier-search-input:hover {
    border-color: var(--neutral-300);
}

.cross-supplier-search-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px light-dark(rgba(13, 110, 253, 0.12), rgba(148, 142, 137, 0.18));
}

/* Search Results Table */
.search-results-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
}

.search-results-table th {
    text-align: left;
    font-weight: 500;
    color: var(--subtext-color);
    padding: 6px 8px;
    border-bottom: 1px solid var(--neutral-border);
    white-space: nowrap;
    user-select: none;
}

.search-results-table th.sortable {
    cursor: pointer;
}

.search-results-table th.sortable:hover {
    color: var(--default-font);
}

.search-results-table th.sort-asc::after {
    content: ' \25B2';
    font-size: 9px;
}

.search-results-table th.sort-desc::after {
    content: ' \25BC';
    font-size: 9px;
}

.search-results-table td {
    padding: 5px 8px;
    border-bottom: 1px solid var(--neutral-border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

/* Visually group consecutive rows that share a UPC — drop the divider between
   group members, and alternate the entire group's background so adjacent groups
   are obviously distinct. */
.search-results-table tr.same-upc-as-next td {
    border-bottom-color: transparent;
}

.search-results-table tr.group-even {
    background: light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.04));
}

.search-results-table a {
    color: var(--brand-primary);
    text-decoration: none;
}

.search-results-table a:hover {
    text-decoration: underline;
}

/* -----------------------------------------------------------------------------
   Profile & Settings pages (Web Awesome)
   ----------------------------------------------------------------------------- */

/* Page heading — Ringside Compressed Bold for brand display feel.
   Uppercase + condensed gives the punchy look from the brand guide.
   Apply to the single primary heading on each page (the equivalent of
   "DASHBOARD" / "ORDERS" / "RECEIVING"). */
.page-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 32px;
    line-height: 1;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    margin: 0 0 var(--space-4);
}

/* Section heading — smaller Ringside for secondary headings within a
   page (e.g. "All Suppliers" beneath the page heading on /carts). */
.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin: var(--space-6) 0 var(--space-3);
}

.page-heading-mono {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 18px;
    margin-bottom: var(--space-4);
}

/* Brand utility classes for selective use elsewhere */
.brand-display { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em; }
.brand-flair { font-family: var(--font-flair); font-style: italic; }
.brand-script { font-family: var(--font-script); }
.brand-heritage { font-family: var(--font-heritage); }

.capitalize {
    text-transform: capitalize;
}

/* Responsive 2- and 3-column layout grids — replaces dead Bootstrap row/col
   markup. Stacks below 768px, sits side-by-side above. */
.layout-grid-2,
.layout-grid-3 {
    display: grid;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
    .layout-grid-2 {
        grid-template-columns: 1fr 1fr;
    }
    .layout-grid-3 {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Cards inside a grid column should fill the column, not space themselves
   from each other (the grid gap handles that). */
.layout-grid-2 wa-card,
.layout-grid-3 wa-card {
    margin-bottom: 0;
}

/* When cards stack inside a grid cell (multiple cards in one column), space
   them with a wrapper. */
.layout-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* Tighter card spacing for these settings/profile pages */
.profile-card,
.settings-card {
    --spacing: var(--space-4);
}

/* Avatar + change-photo button row */
.profile-avatar-row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.profile-avatar {
    --size: 64px;
}

/* Definition list for account details */
.profile-details {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: var(--space-2) var(--space-3);
    font-size: 14px;
    margin: 0;
}

.profile-details dt {
    color: var(--subtext-color);
    font-weight: 400;
}

.profile-details dd {
    margin: 0;
    color: var(--default-font);
}

/* Stack form fields with consistent spacing */
.profile-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* Notification preferences card on /profile */
.profile-section-hint {
    color: var(--subtext-color);
    font-size: 13px;
    margin-bottom: var(--space-3);
}
.profile-notify-row {
    margin-bottom: var(--space-2);
}
.profile-notify-hint {
    color: var(--subtext-color);
    font-size: 11px;
}
.profile-notify-status {
    color: var(--subtext-color);
    font-size: 11px;
    min-height: 14px;
    margin-top: var(--space-2);
}

/* Inline-style replacement: status saved confirmation */
.settings-save-status {
    color: var(--success-500);
    font-size: 11px;
    margin-top: var(--space-1);
}

/* Page header with heading + right-aligned controls (e.g. activity log filter) */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
    gap: var(--space-3);
}

.page-header .page-heading {
    margin-bottom: 0;
}

.user-filter {
    min-width: 180px;
}

/* Activity log table */
.activity-card {
    --spacing: 0;
}

.activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.activity-table thead th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--subtext-color);
    border-bottom: 1px solid var(--neutral-border);
}

.activity-table tbody td {
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--neutral-border);
}

.activity-table tbody tr:last-child td {
    border-bottom: none;
}

.activity-time {
    color: var(--subtext-color);
    white-space: nowrap;
    width: 1%;
}

.activity-user {
    font-weight: 500;
    white-space: nowrap;
}

.activity-link {
    color: var(--subtext-color);
    font-size: 13px;
    margin-left: var(--space-1);
}

.activity-link:hover {
    color: var(--default-font);
}

/* Empty state for activity log */
.activity-empty {
    text-align: center;
}

.activity-empty::part(body) {
    padding: var(--space-8) var(--space-6);
}

.activity-empty-icon {
    font-size: 48px;
    color: var(--neutral-400);
    margin-bottom: var(--space-4);
    display: block;
}

.activity-empty-title {
    color: var(--subtext-color);
    margin: 0 0 var(--space-2);
    font-weight: 500;
}

.activity-empty-body {
    color: var(--subtext-color);
    font-size: 14px;
    margin: 0;
}

/* Settings page sub-headers (e.g. "Import Catalogs"). Margin handled by
   .settings-field-group's flex gap below — keep this as just a label. */
.settings-subheading {
    font-size: 11px;
    color: var(--subtext-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
    font-weight: 500;
}

/* Settings details list — mirrors .profile-details for consistency.
   Uses --wa-space tokens so spacing matches WA components throughout. */
.settings-details {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: var(--wa-space-xs, 8px) var(--wa-space-s, 12px);
    align-items: center;
    font-size: 14px;
    margin: 0;
}

.settings-details dt {
    color: var(--subtext-color);
    font-weight: 400;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.04em;
}

.settings-details dd {
    margin: 0;
    color: var(--default-font);
}

/* Settings field group — flex column with gap so subheading, description,
   and action button get consistent vertical breathing room. */
.settings-field-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.settings-field-group:last-child {
    margin-bottom: 0;
}

/* Tighten any nested <p> margins inside a field group — gap handles spacing */
.settings-field-group > p {
    margin: 0;
}

/* When field groups sit inside a layout grid, the grid already provides
   inter-cell spacing — drop the field-group's own bottom margin. */
.layout-grid-2 .settings-field-group,
.layout-grid-3 .settings-field-group {
    margin-bottom: 0;
}

/* Users management card */
.users-card {
    --spacing: 0;
}

.users-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: var(--space-3);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.users-table thead th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--subtext-color);
    border-bottom: 1px solid var(--neutral-border);
}

.users-table tbody td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--neutral-border);
    vertical-align: middle;
    height: 56px;
}

.users-table tbody tr:last-child td {
    border-bottom: none;
}

.user-name-cell {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: 500;
}

/* Override the global wa-avatar 2px border for the smaller in-table avatars */
.user-avatar-sm {
    --size: 32px;
}

.user-avatar-sm::part(base) {
    border: none;
}

.user-mono {
    font-family: var(--mono-font, monospace);
    color: var(--subtext-color);
}

.user-meta {
    color: var(--subtext-color);
    white-space: nowrap;
}

.user-actions {
    text-align: right;
    width: 1%;
    white-space: nowrap;
}

/* Stack form fields inside user dialogs */
.user-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.form-error {
    color: var(--danger-600, #c62828);
    font-size: 14px;
    padding: var(--space-2) var(--space-3);
    background: var(--danger-50, #ffebee);
    border-radius: 4px;
}

/* -----------------------------------------------------------------------------
   Orders page (Web Awesome)
   ----------------------------------------------------------------------------- */

.orders-toolbar {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

/* Top row: filters on the left, Sync All on the right, all aligned */
.orders-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.orders-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}

.orders-filters wa-select {
    min-width: 140px;
}

/* Sync status lines sit below the action row, right-aligned under Sync All */
.sync-statuses {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-4);
    font-size: 13px;
    color: var(--subtext-color);
}

.sync-status-line {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    line-height: 1.6;
}

/* Spinning rotate icon for the "Sync All" button */
wa-icon.spinning {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Order list tables (orders, receiving, etc.) — shared header / row look */
.orders-table .order-header th,
.receiving-table .receive-header th {
    background: transparent;
    border-bottom: 1px solid var(--neutral-border) !important;
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--subtext-color);
    padding: 0.5rem;
}

.orders-table .sort-link {
    color: var(--subtext-color);
    text-decoration: none;
}

.orders-table .sort-link:hover {
    color: var(--default-font);
}

.orders-table .sort-link.active {
    color: var(--default-font);
    font-weight: 600;
}

.orders-table tbody td,
.receiving-table tbody td {
    font-size: 0.85rem;
    vertical-align: middle;
}

.orders-table .order-row,
.receiving-table .order-row {
    cursor: pointer;
}

.orders-table .order-row:hover,
.receiving-table .order-row:hover {
    background-color: var(--neutral-50);
}

/* =============================================================================
   Schedule (staff scheduling)
   ============================================================================= */

/* Page header layout: heading on the left, action toolbar on the right.
   Wraps onto two lines on narrower viewports. */
.page-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.schedule-week-range {
    color: var(--subtext-color);
    font-size: 0.875rem;
    margin-top: var(--space-3);
    margin-bottom: var(--space-5);
}

.schedule-grid-wrap {
    overflow-x: auto;
    border: 1px solid var(--neutral-border);
    border-radius: var(--space-2);
    background: var(--default-background);
}

/* Each week is its own self-contained block. In week view there's just one;
   in month view 4 stack vertically with breathing room between them. */
.schedule-week-block + .schedule-week-block {
    margin-top: var(--space-5);
}

.schedule-week-block-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--subtext-color);
    margin-bottom: var(--space-2);
    padding-left: var(--space-1);
}

.schedule-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 1200px;
}

.schedule-grid thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--subtext-color);
    text-align: left;
    padding: var(--space-3);
    background: var(--default-background);
}

.schedule-grid .schedule-staff-col {
    width: 140px;
    position: sticky;
    left: 0;
    background: var(--default-background);
    z-index: 1;
    border-right: 1px solid var(--neutral-border);
    border-bottom: 1px solid var(--neutral-border);
}

/* Day-group header (spans both location sub-columns) */
.schedule-day-group {
    text-align: left;
    border-bottom: 1px solid var(--neutral-border);
    border-left: 1px solid var(--neutral-border);
}

.schedule-day-group.is-today {
    background: var(--neutral-50);
}

.schedule-day-group.is-today .schedule-day-name,
.schedule-day-group.is-today .schedule-day-date {
    color: var(--default-font);
}

.schedule-day-name {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
}

.schedule-day-date {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--default-font);
    margin-top: 2px;
    text-transform: none;
    letter-spacing: 0;
}

/* Per-location header row */
.schedule-loc-header-row .schedule-loc-col {
    text-align: left;
    padding: var(--space-1) var(--space-3);
    font-size: 0.65rem;
    color: var(--subtext-color);
    border-bottom: 1px solid var(--neutral-border);
    border-left: 1px dashed var(--neutral-border);
    background: var(--default-background);
}

.schedule-loc-header-row .schedule-loc-col.is-day-start {
    border-left: 1px solid var(--neutral-border);
}

.schedule-loc-header-row .schedule-loc-col.is-today {
    background: var(--neutral-50);
}

.schedule-loc-header-row .schedule-loc-col.is-toggleable {
    cursor: pointer;
    user-select: none;
    transition: background 0.1s ease;
}

.schedule-loc-header-row .schedule-loc-col.is-toggleable:hover {
    background: var(--neutral-100);
}

.schedule-grid tbody tr + tr td {
    border-top: 1px solid var(--neutral-border);
}

.schedule-staff-cell {
    padding: var(--space-3);
    font-weight: 500;
    font-size: 0.875rem;
    position: sticky;
    left: 0;
    background: var(--default-background);
    z-index: 1;
    border-right: 1px solid var(--neutral-border);
    vertical-align: top;
}

/* Right-edge total-hours column. Mirrors the staff column's role on the right. */
.schedule-grid .schedule-hours-col {
    width: 64px;
    border-left: 1px solid var(--neutral-border);
    border-bottom: 1px solid var(--neutral-border);
    background: var(--default-background);
    text-align: right;
}

.schedule-hours-cell {
    padding: var(--space-3);
    font-variant-numeric: tabular-nums;
    font-size: 0.875rem;
    color: var(--default-font);
    border-left: 1px solid var(--neutral-border);
    text-align: right;
    vertical-align: top;
    background: var(--default-background);
}

.schedule-hours-cell.is-zero {
    color: var(--subtext-color);
}

.schedule-cell {
    padding: var(--space-1) 6px;
    vertical-align: top;
    min-height: 64px;
    height: 64px;
    border-left: 1px dashed var(--neutral-border);
}

/* Stronger divider between days; dashed within a day (between BV/Salida) */
.schedule-cell.is-day-start {
    border-left: 1px solid var(--neutral-border);
}

.schedule-cell.is-today {
    background: light-dark(rgb(252, 250, 247), rgb(28, 25, 22));
}

.schedule-cell.is-clickable {
    cursor: pointer;
}

.schedule-cell.is-clickable:hover {
    background: var(--neutral-50);
}

.schedule-shift {
    display: block;
    background: light-dark(rgb(247, 244, 240), rgb(38, 34, 30));
    border: 1px solid var(--neutral-border);
    border-radius: 4px;
    padding: 4px 6px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: transform 0.05s ease;
}

.schedule-shift:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Optimistic-create state: shown while POST is in flight. */
.schedule-shift.is-pending {
    opacity: 0.55;
    animation: schedule-shift-pulse 1.2s ease-in-out infinite;
}

@keyframes schedule-shift-pulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 0.85; }
}

.schedule-shift-time {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--default-font);
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.schedule-shift-repeat {
    font-size: 0.65rem;
    opacity: 0.6;
    margin-left: auto;
}

/* ----- Dialog form layout (shared between shift + template dialogs) ------ */

.dialog-form-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.dialog-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.dialog-footer-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
}

.dialog-divider {
    border: 0;
    border-top: 1px solid var(--neutral-border);
    margin: var(--space-4) 0;
}

.dialog-section-heading {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--subtext-color);
    margin: 0 0 var(--space-3) 0;
}

.flex-spacer {
    flex: 1 1 auto;
}

/* ----- Recurring templates list ----- */

.templates-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.template-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--neutral-border);
    border-radius: 6px;
    background: var(--default-background);
}

.template-row-info {
    flex: 1 1 auto;
    min-width: 0;
}

.template-row-actions {
    display: flex;
    gap: var(--space-2);
    flex-shrink: 0;
}

/* ----- Day-box header: labels on left, ... dropdown on right ----- */

.schedule-day-group-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2);
    width: 100%;
    text-transform: none;
    letter-spacing: 0;
}

.schedule-day-labels {
    flex: 1 1 auto;
    min-width: 0;
}

.schedule-day-actions {
    flex: 0 0 auto;
    text-transform: none;
    letter-spacing: 0;
}

.schedule-day-actions-trigger::part(base) {
    padding: 2px 6px;
    min-height: 0;
    color: var(--subtext-color);
    line-height: 1;
}

.schedule-day-actions-trigger wa-icon {
    font-size: 0.9rem;
}

/* ----- Location sub-column header: name + (optional) CLOSED chip ----- */

.schedule-loc-name {
    margin-right: 4px;
}

.schedule-loc-closed-tag {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: light-dark(rgb(180, 83, 9), rgb(217, 119, 6));
    background: light-dark(rgb(255, 247, 237), rgb(45, 30, 15));
    border: 1px solid light-dark(rgb(254, 215, 170), rgb(120, 53, 15));
    padding: 1px 4px;
    border-radius: 3px;
    vertical-align: middle;
}

/* ----- Closed cell (location dark on this date) ----- */

.schedule-cell.is-closed {
    background-image: repeating-linear-gradient(
        135deg,
        light-dark(rgba(120, 113, 108, 0.06), rgba(168, 162, 158, 0.05)) 0,
        light-dark(rgba(120, 113, 108, 0.06), rgba(168, 162, 158, 0.05)) 6px,
        transparent 6px,
        transparent 12px
    );
}

.schedule-cell.is-closed.is-clickable:hover {
    background-color: var(--neutral-50);
}

/* A shift on a closed (date, location) is "voided" visually — the data
   stays so reopening restores it, but it shouldn't read as an active shift. */
.schedule-cell.is-closed .schedule-shift {
    background-image: repeating-linear-gradient(
        135deg,
        light-dark(rgba(120, 113, 108, 0.22), rgba(168, 162, 158, 0.22)) 0,
        light-dark(rgba(120, 113, 108, 0.22), rgba(168, 162, 158, 0.22)) 4px,
        transparent 4px,
        transparent 8px
    );
    opacity: 0.55;
}

.schedule-cell.is-closed .schedule-shift-time {
    text-decoration: line-through;
}

/* ----- Weekly hours editor dialog ----- */

.hours-editor {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--space-2);
}

.hours-editor th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--subtext-color);
    text-align: left;
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--neutral-border);
}

.hours-editor td {
    padding: var(--space-2) var(--space-3);
    vertical-align: middle;
    border-bottom: 1px solid var(--neutral-border);
}

.hours-editor tr:last-child td {
    border-bottom: none;
}

.hours-editor tr.is-closed td:first-child {
    color: var(--subtext-color);
}

.hours-editor wa-select {
    min-width: 110px;
}

/* ----- Multi-location weekly hours editor ----- */

.hours-editor-multi .hours-day-col {
    width: 70px;
}

.hours-editor-multi .hours-loc-col {
    width: auto;
}

.hours-day-label {
    font-weight: 500;
    white-space: nowrap;
}

.hours-cell {
    /* Each cell holds one location's controls for a single weekday */
    min-width: 240px;
}

.hours-cell-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
}

.hours-cell-inner.is-closed .hours-slots-list,
.hours-cell-inner.is-closed .hours-add-slot-btn {
    display: none;
}

.hours-slots-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.hours-slot-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hours-dash {
    color: var(--subtext-color);
    user-select: none;
}

.hours-remove-slot-btn::part(base) {
    color: var(--subtext-color);
    padding: 0 4px;
    min-height: 0;
}

.hours-remove-slot-btn:hover::part(base) {
    color: var(--default-font);
}

.hours-add-slot-btn::part(base) {
    color: var(--subtext-color);
    padding: 2px 6px;
    font-size: 0.8rem;
}

/* Make the dialog wide enough to show both locations side-by-side.
   Web Awesome's wa-dialog exposes `--width` for this — `::part(panel)`
   doesn't exist on this component. */
wa-dialog.wa-dialog-wide {
    --width: min(95vw, 960px);
}
