/*
 * IkokoHub - admin skin (brand guide: docs/brand/my-naija-restaurants.md).
 * Loaded only when the active theme is `ikokohub` (see layouts/partials/css.blade.php),
 * and loaded last so it settles the cascade against vendor.css and app.css.
 *
 * Themes follow the landing page contract: every colour is a token declared on bare
 * :root for light, then repeated in TWO dark blocks -
 * @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) } and
 * :root[data-theme="dark"] - so an explicit choice wins in either direction.
 * Never give a colour its only definition inside the media query.
 *
 * The --lh-* token prefix is historical and kept on purpose: views and JS read these names.
 *   --lh-gold         PRIMARY fill, Naija Green #0B6B3A in both themes, carries white text
 *   --lh-gold-ink     primary used AS TEXT - Naija Green in light, light green #6FCF97 in dark
 *   --lh-chrome-accent Palm Gold #F2B33D, only on the dark sidebar/top bar
 * Jollof #E8552D is the accent; Pepper #B42318 is errors only.
 *
 * Contrast (WCAG AA needs 4.5:1 text / 3:1 UI), approximate:
 *   LIGHT  white on Naija Green 6.6:1; Naija Green on white 6.6:1; Ink on Cream 17:1
 *   DARK   #6FCF97 on surface #1D1814 9:1; Cream on surface 15:1
 *   CHROME (warm ink in both themes) Cream on ink 17:1; Palm Gold on ink 9.5:1
 */

:root {
    color-scheme: light;

    /* Brand constants - identical in both themes */
    --lh-gold: #0B6B3A;
    --lh-gold-bright: #0E7F45;
    --lh-gold-deep: #085A30;
    --lh-cream: #FBF6EE;
    --lh-btn-ink: #FFFFFF;

    /* Chrome (sidebar + top bar) stays ink in both themes */
    --lh-chrome: #14110F;
    --lh-chrome-2: #1E1914;
    --lh-chrome-line: #3A322B;
    --lh-chrome-text: #FBF6EE;
    --lh-chrome-accent: #F2B33D;
    /* Menu was #B5AB9E / labels #A1978B / icons #867D72 - passing, but dull on
       near-black. Each moves up one step, keeping the same order of emphasis. */
    --lh-chrome-menu: #E3DCD0;
    --lh-chrome-label: #B5AB9E;
    --lh-chrome-icon: #B5AB9E;

    /* Content surfaces */
    --lh-canvas: #FBF6EE;
    --lh-surface: #FFFFFF;
    --lh-surface-2: #FFFDF9;
    --lh-surface-3: #F4EEE3;
    --lh-tint: #EEF6F0;

    --lh-line: #E7DFD1;
    --lh-line-soft: #F0E9DC;

    --lh-text: #14110F;
    --lh-text-muted: #5E564D;
    --lh-text-faint: #7A7168;
    --lh-text-ghost: #A39A8F;

    --lh-gold-ink: #0B6B3A;
    --lh-gold-ink-hover: #084D2A;
    --lh-gold-tint: rgba(11, 107, 58, .12);
    --lh-gold-line: rgba(11, 107, 58, .45);
    --lh-gold-ring: rgba(11, 107, 58, .18);
    --lh-focus: #0B6B3A;

    --lh-field-bg: #FFFFFF;
    --lh-field-disabled-bg: #F4EEE3;
    --lh-field-disabled-fg: #7A7168;
    --lh-btn-disabled-bg: #F0E9DC;
    --lh-btn-disabled-fg: #A39A8F;

    --lh-row-hover: #EEF6F0;
    --lh-row-stripe: #FDFAF5;

    --lh-success-fg: #0B6B3A;
    --lh-success-bg: #DCEFE2;
    --lh-warning-fg: #93370D;
    --lh-warning-bg: #FCEFC7;
    --lh-danger-fg: #B42318;
    --lh-danger-bg: #FEE4E2;
    --lh-info-fg: #0B6B3A;
    --lh-info-bg: #DCEFE2;

    --lh-shadow-card: 0 1px 2px 0 rgba(20, 17, 15, .04);
    --lh-shadow-card-hover: 0 2px 6px -1px rgba(20, 17, 15, .07);
    --lh-shadow-pop: 0 10px 28px -10px rgba(20, 17, 15, .22);
    --lh-shadow-modal: 0 24px 48px -12px rgba(20, 17, 15, .28);
    --lh-scrim: rgba(20, 17, 15, .55);
    --lh-selection: rgba(11, 107, 58, .22);

    --lh-scroll-thumb: #CFC8BB;
    --lh-scroll-thumb-hover: #A9A193;

    /* Highcharts reads these through JS - see layouts/partials/javascripts.blade.php */
    --lh-chart-grid: #E7DFD1;
    --lh-chart-axis: #5E564D;

    /* Light-on-dark strokes read thinner, so dark mode carries one step more weight. */
    --lh-body-weight: 400;

    --lh-radius: 8px;
    --lh-radius-lg: 12px;

    --lh-font: "Plus Jakarta Sans", Manrope, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --lh-display: "Bricolage Grotesque", "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;

        --lh-canvas: #14110F;
        --lh-surface: #1D1814;
        --lh-surface-2: #25201B;
        --lh-surface-3: #2D2721;
        --lh-tint: rgba(111, 207, 151, .07);

        --lh-line: rgba(255, 255, 255, .12);
        --lh-line-soft: rgba(255, 255, 255, .07);

        --lh-text: #FBF6EE;
        --lh-text-muted: #C4BBAE;
        --lh-text-faint: #A1978B;
        --lh-text-ghost: #867D72;

        --lh-gold-ink: #6FCF97;
        --lh-gold-ink-hover: #9BE0B8;
        --lh-gold-tint: rgba(111, 207, 151, .1);
        --lh-gold-line: rgba(111, 207, 151, .4);
        --lh-gold-ring: rgba(111, 207, 151, .22);
        --lh-focus: #6FCF97;

        --lh-field-bg: rgba(255, 255, 255, .04);
        --lh-field-disabled-bg: rgba(255, 255, 255, .06);
        --lh-field-disabled-fg: #A1978B;
        --lh-btn-disabled-bg: rgba(255, 255, 255, .06);
        --lh-btn-disabled-fg: #867D72;

        --lh-row-hover: rgba(111, 207, 151, .07);
        --lh-row-stripe: rgba(255, 255, 255, .022);

        --lh-success-fg: #7FE3B8;
        --lh-success-bg: rgba(127, 227, 184, .13);
        --lh-warning-fg: #F0C87F;
        --lh-warning-bg: rgba(240, 200, 127, .13);
        --lh-danger-fg: #FF8B8B;
        --lh-danger-bg: rgba(255, 139, 139, .13);
        --lh-info-fg: #D9D2C7;
        --lh-info-bg: rgba(255, 255, 255, .07);

        --lh-shadow-card: none;
        --lh-shadow-card-hover: 0 2px 10px -2px rgba(0, 0, 0, .5);
        --lh-shadow-pop: 0 12px 32px -10px rgba(0, 0, 0, .65);
        --lh-shadow-modal: 0 26px 60px -12px rgba(0, 0, 0, .7);
        --lh-scrim: rgba(10, 8, 7, .86);
        --lh-selection: rgba(111, 207, 151, .3);

        --lh-scroll-thumb: #3A332D;
        --lh-scroll-thumb-hover: #524A42;

        --lh-chart-grid: rgba(255, 255, 255, .1);
        --lh-chart-axis: #C4BBAE;
        --lh-body-weight: 500;
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;

    --lh-canvas: #14110F;
    --lh-surface: #1D1814;
    --lh-surface-2: #25201B;
    --lh-surface-3: #2D2721;
    --lh-tint: rgba(111, 207, 151, .07);

    --lh-line: rgba(255, 255, 255, .12);
    --lh-line-soft: rgba(255, 255, 255, .07);

    --lh-text: #FBF6EE;
    --lh-text-muted: #C4BBAE;
    --lh-text-faint: #A1978B;
    --lh-text-ghost: #867D72;

    --lh-gold-ink: #6FCF97;
    --lh-gold-ink-hover: #9BE0B8;
    --lh-gold-tint: rgba(111, 207, 151, .1);
    --lh-gold-line: rgba(111, 207, 151, .4);
    --lh-gold-ring: rgba(111, 207, 151, .22);
    --lh-focus: #6FCF97;

    --lh-field-bg: rgba(255, 255, 255, .04);
    --lh-field-disabled-bg: rgba(255, 255, 255, .06);
    --lh-field-disabled-fg: #A1978B;
    --lh-btn-disabled-bg: rgba(255, 255, 255, .06);
    --lh-btn-disabled-fg: #867D72;

    --lh-row-hover: rgba(111, 207, 151, .07);
    --lh-row-stripe: rgba(255, 255, 255, .022);

    --lh-success-fg: #7FE3B8;
    --lh-success-bg: rgba(127, 227, 184, .13);
    --lh-warning-fg: #F0C87F;
    --lh-warning-bg: rgba(240, 200, 127, .13);
    --lh-danger-fg: #FF8B8B;
    --lh-danger-bg: rgba(255, 139, 139, .13);
    --lh-info-fg: #D9D2C7;
    --lh-info-bg: rgba(255, 255, 255, .07);

    --lh-shadow-card: none;
    --lh-shadow-card-hover: 0 2px 10px -2px rgba(0, 0, 0, .5);
    --lh-shadow-pop: 0 12px 32px -10px rgba(0, 0, 0, .65);
    --lh-shadow-modal: 0 26px 60px -12px rgba(0, 0, 0, .7);
    --lh-scrim: rgba(10, 8, 7, .86);
    --lh-selection: rgba(111, 207, 151, .3);

    --lh-scroll-thumb: #3A332D;
    --lh-scroll-thumb-hover: #524A42;

    --lh-chart-grid: rgba(255, 255, 255, .1);
    --lh-chart-axis: #C4BBAE;
    --lh-body-weight: 500;
}

/*
 * daisyUI palette. The bundle ships a blue/violet theme in oklch triplets on :root;
 * re-declaring the same custom properties retints every tw-dw-* component at once,
 * which is the only way to reach them without rebuilding the bundle.
 */
:root {
    --p: 48.8% 0.1 154;      /* primary  - Naija Green */
    --pc: 100% 0 0;           /* on green - white */
    --s: 62.5% 0.19 38;       /* secondary - Jollof */
    --sc: 17% 0.01 60;
    --a: 82.5% 0.15 80;      /* accent   - Palm Gold */
    --ac: 17% 0.01 60;
    --n: 17% 0.01 60;      /* neutral  - Ink */
    --nc: 97% 0.012 85;
    --in: 40% 0.08 154;
    --inc: 100% 0 0;
    --su: 49.87% 0.1167 157.06;
    --suc: 100% 0 0;
    --wa: 53.94% 0.1562 42.99;
    --wac: 100% 0 0;
    --er: 50.03% 0.1821 29.51;
    --erc: 100% 0 0;
    --b1: 100% 0 0;
    --b2: 97% 0.012 85;
    --b3: 94% 0.016 85;
    --bc: 17% 0.01 60;
    --rounded-btn: 0.5rem;
    --rounded-box: 0.75rem;
    --btn-focus-scale: 1;        /* the shrink-on-press bounce reads as a toy */
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --in: 78% 0.1 154;
        --inc: 17% 0.01 60;
        --su: 84.00% 0.1000 165.00;
        --suc: 17% 0.01 60;
        --wa: 84.00% 0.1000 80.00;
        --wac: 17% 0.01 60;
        --er: 74.00% 0.1200 22.00;
        --erc: 17% 0.01 60;
        --b1: 20% 0.008 60;
        --b2: 17% 0.008 60;
        --b3: 14% 0.006 60;
        --bc: 97% 0.012 85;
    }
}

:root[data-theme="dark"] {
    --in: 78% 0.1 154;
    --inc: 17% 0.01 60;
    --su: 84.00% 0.1000 165.00;
    --suc: 17% 0.01 60;
    --wa: 84.00% 0.1000 80.00;
    --wac: 17% 0.01 60;
    --er: 74.00% 0.1200 22.00;
    --erc: 17% 0.01 60;
    --b1: 20% 0.008 60;
    --b2: 17% 0.008 60;
    --b3: 14% 0.006 60;
    --bc: 97% 0.012 85;
}

/* Outlines use the primary green on light grounds. */
.tw-dw-btn-outline.tw-dw-btn-primary,
.tw-dw-btn-outline.tw-dw-btn-secondary {
    color: var(--lh-gold-ink);
    border-color: var(--lh-gold-deep);
}
.tw-dw-btn-outline.tw-dw-btn-primary:hover,
.tw-dw-btn-outline.tw-dw-btn-secondary:hover {
    background-color: var(--lh-gold);
    border-color: var(--lh-gold-deep);
    color: var(--lh-btn-ink);
}

/* ------------------------------------------------------------------ base */

html,
html.tw-bg-white { background-color: var(--lh-canvas); }

body,
body.tw-bg-gray-100 {
    font-family: var(--lh-font);
    background-color: var(--lh-canvas);
    color: var(--lh-text);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.005em;
}

body,
.form-control,
.btn,
table,
.select2-container { font-family: var(--lh-font); }

/* Numbers line up in tables and on the dashboard. */
table td, table th,
.lh-stat__value,
.tw-font-mono { font-variant-numeric: tabular-nums; }

a { color: var(--lh-gold-ink); }
a:hover, a:focus { color: var(--lh-gold-ink-hover); }

/* One visible focus treatment everywhere. Never remove the outline. */
:focus-visible {
    outline: 2px solid var(--lh-focus);
    outline-offset: 2px;
    border-radius: 4px;
}
.theme-header-bg :focus-visible,
.side-bar :focus-visible,
#side-bar :focus-visible { outline-color: var(--lh-chrome-accent); }

::selection { background: var(--lh-selection); color: var(--lh-text); }

/* Tailwind colour utilities are baked into the compiled bundle, so the tokens have
   to be pushed back through them - that is what carries several hundred views into
   dark mode without editing their markup. */
.tw-bg-white { background-color: var(--lh-surface); }
.tw-bg-gray-50, .hover\:tw-bg-gray-50:hover { background-color: var(--lh-surface-2); }
.tw-bg-gray-100, .hover\:tw-bg-gray-100:hover { background-color: var(--lh-surface-3); }
.tw-text-black, .tw-text-gray-900, .hover\:tw-text-gray-900:hover { color: var(--lh-text); }
.tw-text-gray-800, .tw-text-gray-700, .tw-text-gray-600, .tw-text-gray-500 { color: var(--lh-text-muted); }
.tw-text-gray-400, .tw-text-gray-300 { color: var(--lh-text-faint); }
.tw-ring-gray-200, .tw-ring-gray-100 { --tw-ring-color: var(--lh-line); }
.tw-border-gray-100, .tw-border-gray-200, .tw-border-gray-300 { border-color: var(--lh-line); }
.tw-divide-gray-200 > :not([hidden]) ~ :not([hidden]) { border-color: var(--lh-line); }
.placeholder\:tw-text-gray-500::placeholder, .placeholder\:tw-text-gray-400::placeholder { color: var(--lh-text-ghost); }

/* The stock `primary` scale in the compiled bundle is blue - retint it. */
.tw-text-primary-600, .tw-text-primary-700, .tw-text-primary-800,
.hover\:tw-text-primary-600:hover, .hover\:tw-text-primary-700:hover { color: var(--lh-gold-ink); }
.tw-bg-primary-50, .hover\:tw-bg-primary-50:hover { background-color: var(--lh-tint); }
.tw-bg-primary-100 { background-color: var(--lh-gold-tint); }
.tw-bg-primary-500, .tw-bg-primary-700, .tw-bg-primary-800,
.hover\:tw-bg-primary-500:hover, .hover\:tw-bg-primary-700:hover { background-color: var(--lh-chrome-2); }
.tw-border-primary-500, .hover\:tw-border-primary-500:hover, .focus\:tw-border-primary-500:focus,
.focus\:tw-border-primary-400:focus, .hover\:tw-border-primary-300:hover { border-color: var(--lh-gold-deep); }
.tw-border-primary-500\/30 { border-color: rgba(242, 179, 61, .18); }
.focus\:tw-ring-primary-100:focus, .focus\:tw-ring-primary-200:focus,
.focus\:tw-ring-primary-500:focus { --tw-ring-color: var(--lh-gold-ring); }
.group-focus-within\:tw-text-primary-500 { color: var(--lh-gold-ink); }

/* --------------------------------------------------------- theme helpers */

/* Flat ink bar. The gradient is what read as dated; the hairline does the work. */
.theme-header-bg {
    background-image: none;
    background-color: var(--lh-chrome);
    border-bottom: 1px solid rgba(242, 179, 61, .16) !important;
}

.theme-logo-bg {
    background-color: var(--lh-chrome);
    border-right-color: rgba(242, 179, 61, .16) !important;
}

/* Top-bar controls: quiet by default, Palm Gold only on interaction. */
.theme-btn-bg {
    background-color: rgba(255, 255, 255, .05);
    color: var(--lh-chrome-text);
    box-shadow: inset 0 0 0 1px rgba(242, 179, 61, .22);
    --tw-ring-color: transparent;
}
.theme-btn-bg:hover {
    background-color: rgba(242, 179, 61, .14);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(242, 179, 61, .45);
}
.theme-btn-bg:active,
.theme-btn-bg:focus,
.theme-btn-bg:focus-visible {
    background-color: rgba(242, 179, 61, .2);
    color: #fff;
    outline: 2px solid var(--lh-chrome-accent);
    outline-offset: 1px;
}

/* The one Jollof call to action in the bar. */
.theme-header-bg a.theme-btn-bg[href*="pos/create"] {
    background-color: #E8552D;
    color: #14110F;
    box-shadow: inset 0 0 0 1px #C8431F;
    font-weight: 600;
}
.theme-header-bg a.theme-btn-bg[href*="pos/create"]:hover {
    background-color: #F06A43;
    color: #14110F;
}

/* Module buttons that sit in the ink bar (clock in/out, back-to-user). */
.theme-header-bg .btn {
    background-image: none;
    border-radius: var(--lh-radius);
    font-size: 12.5px;
    padding: 6px 12px;
}
.theme-header-bg .btn.bg-blue,
.theme-header-bg .btn.bg-yellow,
.theme-header-bg .btn.btn-danger {
    background-color: rgba(255, 255, 255, .05) !important;
    color: var(--lh-chrome-text) !important;
    box-shadow: inset 0 0 0 1px rgba(242, 179, 61, .22);
}
.theme-header-bg .btn.bg-blue:hover,
.theme-header-bg .btn.bg-yellow:hover,
.theme-header-bg .btn.btn-danger:hover {
    background-color: rgba(242, 179, 61, .14) !important;
    color: #fff !important;
}

/* Menus dropped from the ink bar belong to the content surface, not the chrome. */
.theme-header-bg ul.tw-bg-white,
.theme-header-bg .tw-dw-dropdown-content { background-color: var(--lh-surface); }

/* ------------------------------------------------------------ theme flip */

.lh-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: var(--lh-radius);
    background-color: rgba(255, 255, 255, .05);
    box-shadow: inset 0 0 0 1px rgba(242, 179, 61, .22);
    color: var(--lh-chrome-text);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
.lh-theme-toggle:hover { background-color: rgba(242, 179, 61, .14); color: var(--lh-chrome-accent); }
.lh-theme-toggle:focus-visible { outline: 2px solid var(--lh-chrome-accent); outline-offset: 1px; }
.lh-theme-toggle svg { width: 17px; height: 17px; display: block; }
.lh-theme-toggle .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .lh-theme-toggle .icon-moon { display: none; }
    :root:not([data-theme="light"]) .lh-theme-toggle .icon-sun { display: block; }
}
:root[data-theme="dark"] .lh-theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .lh-theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .lh-theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .lh-theme-toggle .icon-sun { display: none; }

/* The POS bar is a content surface, not chrome, so the toggle matches its buttons. */
.pos-header .lh-theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background-color: var(--lh-surface);
    box-shadow: inset 0 0 0 2px var(--lh-line);
    color: var(--lh-text-muted);
    flex-shrink: 0;
}
.pos-header .lh-theme-toggle:hover { background-color: var(--lh-tint); color: var(--lh-gold-ink); }
.pos-header .lh-theme-toggle:focus-visible { outline-color: var(--lh-focus); }

/* -------------------------------------------------------------- side bar */

aside.side-bar {
    background-color: var(--lh-chrome) !important;
    border-right: 1px solid var(--lh-chrome-line);
}

.side-bar-heading { color: var(--lh-chrome-text); }

.lh-brand {
    height: 66px !important;
    padding: 0 18px;
    text-decoration: none;
}
.lh-brand:hover, .lh-brand:focus { text-decoration: none; }
.lh-brand__lockup {
    display: block;
    width: 202px;
    max-width: 100%;
    height: auto;
}

/* Menu search */
aside.side-bar input#sidebar-search { color: var(--lh-chrome-text); }
aside.side-bar input#sidebar-search::placeholder { color: var(--lh-chrome-label); }
aside.side-bar .tw-bg-gray-100.tw-border-gray-200 {
    background-color: rgba(255, 255, 255, .04) !important;
    border-color: var(--lh-chrome-line) !important;
    border-right-color: var(--lh-chrome-line) !important;
}
aside.side-bar .tw-bg-gray-100.tw-border-gray-200:focus-within {
    border-color: rgba(242, 179, 61, .5) !important;
    background-color: rgba(255, 255, 255, .07) !important;
}
aside.side-bar > .tw-border-r { border-right-color: transparent !important; }
aside.side-bar .tw-text-gray-400 { color: var(--lh-chrome-label) !important; }

/* Menu items */
#side-bar {
    border-right: 0 !important;
    scrollbar-color: #3A332D transparent;
}
#side-bar a {
    color: var(--lh-chrome-menu) !important;
    font-weight: 500;
    letter-spacing: -0.003em;
}
#side-bar a svg, #side-bar a i { color: var(--lh-chrome-icon); }

#side-bar .theme-sidebar-hover:hover,
#side-bar .theme-sidebar-hover:active,
#side-bar .theme-sidebar-hover:focus {
    background-color: rgba(255, 255, 255, .05);
    color: var(--lh-chrome-text) !important;
}
#side-bar a:hover svg, #side-bar a:hover i { color: var(--lh-chrome-accent); }

#side-bar .theme-sidebar-active {
    background-color: rgba(242, 179, 61, .12);
    color: var(--lh-chrome-text) !important;
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--lh-chrome-accent);
}
#side-bar a.theme-sidebar-active svg,
#side-bar a.theme-sidebar-active i { color: var(--lh-chrome-accent); }

#side-bar .theme-sidebar-child-hover:hover,
#side-bar .theme-sidebar-child-hover:active,
#side-bar .theme-sidebar-child-hover:focus { color: var(--lh-chrome-text) !important; }
#side-bar .theme-sidebar-child-active { color: var(--lh-chrome-accent) !important; font-weight: 600; }

#side-bar .chiled .tw-bg-gray-100 { background-color: var(--lh-chrome-line) !important; }
#side-bar .tw-text-gray-400 { color: var(--lh-chrome-label) !important; }
#side-bar .tw-text-gray-500 { color: var(--lh-chrome-icon) !important; }

#sidebar-no-results {
    background-color: var(--lh-chrome);
    border-right-color: transparent !important;
    color: var(--lh-chrome-label) !important;
}

/* ---------------------------------------------------------- page heading */

main { background-color: var(--lh-canvas) !important; }
#scrollable-container { background-color: var(--lh-canvas); }

section.content-header { padding: 26px 24px 4px; }
section.content-header > h1 {
    font-family: var(--lh-display);
    font-size: 34px !important;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: .005em;
    color: var(--lh-text) !important;
    margin: 0;
}
section.content-header > h1 > small {
    display: block;
    margin-top: 6px;
    font-family: var(--lh-font);
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.5;
    color: var(--lh-text-muted) !important;
}
section.content { padding: 12px 24px 28px; }

@media (max-width: 767px) {
    section.content-header { padding: 18px 16px 2px; }
    section.content-header > h1 { font-size: 26px !important; }
    section.content { padding: 10px 16px 24px; }
}

/* -------------------------------------------------------------- surfaces */

/* Restrained borders instead of stacked shadows; no hover lift. */
.tw-shadow-sm { --tw-shadow: var(--lh-shadow-card); box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--lh-shadow-card); }
.hover\:tw-shadow-md:hover { --tw-shadow: var(--lh-shadow-card-hover); box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--lh-shadow-card-hover); }
.hover\:tw--translate-y-0\.5:hover { --tw-translate-y: 0px; }

/* --------------------------------------------------------------- buttons */

.btn {
    font-family: var(--lh-font);
    font-weight: 600;
    font-size: 13px;
    border-radius: var(--lh-radius);
    border-width: 1px;
    padding: 7px 14px;
    box-shadow: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:focus-visible { outline: 2px solid var(--lh-focus); outline-offset: 2px; }
.btn.disabled, .btn[disabled], fieldset[disabled] .btn {
    opacity: 1;
    background-color: var(--lh-btn-disabled-bg);
    border-color: var(--lh-line);
    color: var(--lh-btn-disabled-fg);
    box-shadow: none;
}

.btn-primary,
.btn-primary:focus {
    background-color: var(--lh-gold);
    border-color: var(--lh-gold-deep);
    color: var(--lh-btn-ink);
}
.btn-primary:hover,
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
    background-color: var(--lh-gold-bright);
    border-color: var(--lh-gold-deep);
    color: var(--lh-btn-ink);
}

.btn-default {
    background-color: var(--lh-surface);
    border-color: var(--lh-line);
    color: var(--lh-text);
}
.btn-default:hover, .btn-default:focus, .btn-default:active {
    background-color: var(--lh-tint);
    border-color: var(--lh-gold-line);
    color: var(--lh-text);
}

.btn-info {
    background-color: var(--lh-chrome-2);
    border-color: var(--lh-chrome-2);
    color: var(--lh-cream);
}
.btn-info:hover, .btn-info:focus, .btn-info:active {
    background-color: var(--lh-chrome-line);
    border-color: var(--lh-chrome-line);
    color: #fff;
}

.btn-link { color: var(--lh-gold-ink); box-shadow: none; }
.btn-link:hover { color: var(--lh-gold-ink-hover); }

/* The gradient pill on every index screen. */
.tw-dw-btn.tw-from-indigo-600.tw-to-blue-500,
a.tw-from-indigo-600.tw-to-blue-500,
button.tw-from-indigo-600.tw-to-blue-500 {
    background-image: none !important;
    background-color: var(--lh-gold) !important;
    color: var(--lh-btn-ink) !important;
    border: 1px solid var(--lh-gold-deep) !important;
    border-radius: var(--lh-radius) !important;
    font-family: var(--lh-font);
    font-weight: 600 !important;
    font-size: 13px;
    height: auto;
    min-height: 0;
    padding: 8px 16px;
    box-shadow: none;
    text-transform: none;
}
.tw-dw-btn.tw-from-indigo-600.tw-to-blue-500:hover,
a.tw-from-indigo-600.tw-to-blue-500:hover,
button.tw-from-indigo-600.tw-to-blue-500:hover {
    background-color: var(--lh-gold-bright) !important;
    color: var(--lh-btn-ink) !important;
}
/* Only the create action is primary; exports and the rest step back. */
a.tw-from-indigo-600.tw-to-blue-500:not([href*="/create"]):not([href*="/add"]) {
    background-color: var(--lh-surface) !important;
    color: var(--lh-text) !important;
    border-color: var(--lh-line) !important;
}
a.tw-from-indigo-600.tw-to-blue-500:not([href*="/create"]):not([href*="/add"]):hover {
    background-color: var(--lh-tint) !important;
    color: var(--lh-text) !important;
    border-color: var(--lh-gold-deep) !important;
}

/* Gradient-clipped text links (login screen) */
.tw-from-indigo-500.tw-to-blue-500.tw-bg-clip-text {
    background-image: none !important;
    -webkit-text-fill-color: var(--lh-gold-ink);
    color: var(--lh-gold-ink) !important;
}

/* ------------------------------------------------------------- semantics */

.text-info, .text-primary { color: var(--lh-gold-ink) !important; }
.text-muted { color: var(--lh-text-faint) !important; }
.text-success { color: var(--lh-success-fg) !important; }
.text-warning { color: var(--lh-warning-fg) !important; }
.text-danger, .text-red { color: var(--lh-danger-fg) !important; }

/* Help markers are supporting detail, not a second focal point. */
i.hover-q.fa-info-circle {
    color: var(--lh-text-faint) !important;
    font-size: 12px;
    vertical-align: baseline;
    cursor: help;
}
i.hover-q.fa-info-circle:hover { color: var(--lh-gold-ink) !important; }

.label, .badge {
    font-family: var(--lh-font);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: .01em;
    border-radius: 5px;
    padding: 3px 7px;
}
.label-primary, .bg-primary { background-color: var(--lh-chrome-2) !important; color: var(--lh-cream) !important; }
.label-info { background-color: var(--lh-info-bg) !important; color: var(--lh-info-fg) !important; }
.label-success { background-color: var(--lh-success-bg) !important; color: var(--lh-success-fg) !important; }
.label-warning { background-color: var(--lh-warning-bg) !important; color: var(--lh-warning-fg) !important; }
.label-danger { background-color: var(--lh-danger-bg) !important; color: var(--lh-danger-fg) !important; }

.alert { border-radius: var(--lh-radius); border-width: 1px; font-size: 13.5px; }
.alert-info { background-color: var(--lh-tint); border-color: var(--lh-gold-line); color: var(--lh-text); }
.alert-success { background-color: var(--lh-success-bg); border-color: var(--lh-success-fg); color: var(--lh-success-fg); }
.alert-warning { background-color: var(--lh-warning-bg); border-color: var(--lh-warning-fg); color: var(--lh-warning-fg); }
.alert-danger { background-color: var(--lh-danger-bg); border-color: var(--lh-danger-fg); color: var(--lh-danger-fg); }

/* AdminLTE boxes / bootstrap panels still used on a few screens */
.box, .panel, .well {
    border: 1px solid var(--lh-line);
    border-top: 1px solid var(--lh-line);
    border-radius: var(--lh-radius-lg);
    box-shadow: none;
    background: var(--lh-surface);
    color: var(--lh-text);
}
.box > .box-header, .panel > .panel-heading {
    border-bottom: 1px solid var(--lh-line-soft);
    background: transparent;
    color: var(--lh-text);
    padding: 14px 18px;
}
.box-header > .box-title, .panel-title {
    font-family: var(--lh-display);
    font-size: 20px;
    font-weight: 500;
    color: var(--lh-text);
}

/* ----------------------------------------------------------------- forms */

label, .control-label {
    font-family: var(--lh-font);
    font-weight: 600;
    font-size: 13px;
    color: var(--lh-text);
    margin-bottom: 6px;
}

.form-control {
    height: 38px;
    padding: 7px 11px;
    font-size: 13.5px;
    color: var(--lh-text);
    background-color: var(--lh-field-bg);
    border: 1px solid var(--lh-line);
    border-radius: var(--lh-radius);
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.form-control { height: auto; }
.form-control::placeholder { color: var(--lh-text-ghost); }
.form-control:focus {
    border-color: var(--lh-gold-deep);
    box-shadow: 0 0 0 3px var(--lh-gold-ring);
    outline: none;
}
.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control {
    background-color: var(--lh-field-disabled-bg);
    color: var(--lh-field-disabled-fg);
    cursor: not-allowed;
}
.has-error .form-control { border-color: var(--lh-danger-fg); }
.has-error .help-block { color: var(--lh-danger-fg); }
.help-block { color: var(--lh-text-faint); }
.input-group-addon {
    background-color: var(--lh-surface-3);
    border-color: var(--lh-line);
    color: var(--lh-text-muted);
    border-radius: var(--lh-radius);
    font-size: 13px;
}
/* Field prefixes are labels, not accents - the AdminLTE colour classes on them go quiet. */
.input-group-addon[class*="bg-"] {
    background-color: var(--lh-surface-3) !important;
    color: var(--lh-text-muted) !important;
    border-color: var(--lh-line) !important;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--lh-gold-deep); }

/* iCheck: the old sprite was gold, so the boxes are drawn in CSS in Naija Green (#0B6B3A) instead. */
.icheckbox_square-blue, .iradio_square-blue {
    background: #fff none;
    border: 2px solid #0B6B3A;
    border-radius: 4px;
    box-sizing: border-box;
    height: 22px;
    width: 22px;
}
.iradio_square-blue { border-radius: 50%; }
.icheckbox_square-blue.hover, .iradio_square-blue.hover { background-color: #DCEFE2; }
.icheckbox_square-blue.checked {
    background: #0B6B3A url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
}
.iradio_square-blue.checked {
    background: radial-gradient(circle, #0B6B3A 0 4px, #fff 5px);
}
.icheckbox_square-blue.disabled, .iradio_square-blue.disabled { border-color: #9aa59f; background-color: #eef1ef; }
.icheckbox_square-blue.checked.disabled { background-color: #9aa59f; }
.iradio_square-blue.checked.disabled { background: radial-gradient(circle, #9aa59f 0 4px, #eef1ef 5px); }

/* select2 matches the native control exactly */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    height: 38px;
    border: 1px solid var(--lh-line);
    border-radius: var(--lh-radius);
    background-color: var(--lh-field-bg);
}
.select2-container--default .select2-selection--multiple { height: auto; min-height: 38px; }
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    padding-left: 11px;
    color: var(--lh-text);
    font-size: 13.5px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b { border-top-color: var(--lh-text-faint); }
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b { border-bottom-color: var(--lh-text-faint); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--lh-text-ghost); }
.select2-container--default .select2-selection--single .select2-selection__clear { color: var(--lh-text-faint); }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--lh-gold-deep);
    box-shadow: 0 0 0 3px var(--lh-gold-ring);
}
.select2-container--default .select2-selection--multiple .select2-selection__rendered { color: var(--lh-text); }
.select2-dropdown {
    background-color: var(--lh-surface);
    border-color: var(--lh-line);
    border-radius: var(--lh-radius);
    box-shadow: var(--lh-shadow-pop);
    color: var(--lh-text);
}
.select2-results__option { color: var(--lh-text); }
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--lh-gold);
    color: var(--lh-btn-ink);
}
.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: var(--lh-tint);
    color: var(--lh-text);
}
.select2-container--default .select2-results__group { color: var(--lh-text-faint); }
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--lh-tint);
    border-color: var(--lh-gold-line);
    color: var(--lh-text);
    border-radius: 5px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove { color: var(--lh-text-muted); }
.select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--lh-field-bg);
    color: var(--lh-text);
    border-color: var(--lh-line);
    border-radius: 6px;
}
.select2-container--default .select2-search--inline .select2-search__field { color: var(--lh-text); }
.select2-container--default .select2-results__option[aria-disabled=true] { color: var(--lh-text-ghost); }

/* Date and time pickers append to <body>, so they need the tokens too. */
.daterangepicker,
.bootstrap-datetimepicker-widget.dropdown-menu {
    background-color: var(--lh-surface);
    border-color: var(--lh-line);
    color: var(--lh-text);
    box-shadow: var(--lh-shadow-pop);
}
.daterangepicker .calendar-table { background-color: var(--lh-surface); border-color: var(--lh-line); }
.daterangepicker td.available:hover, .daterangepicker th.available:hover { background-color: var(--lh-tint); color: var(--lh-text); }
.daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date {
    background-color: transparent; color: var(--lh-text-ghost);
}
.daterangepicker td.in-range { background-color: var(--lh-tint); color: var(--lh-text); }
.daterangepicker td.active, .daterangepicker td.active:hover { background-color: var(--lh-gold); color: var(--lh-btn-ink); }
.daterangepicker .ranges li { color: var(--lh-text); }
.daterangepicker .ranges li:hover { background-color: var(--lh-tint); }
.daterangepicker .ranges li.active { background-color: var(--lh-gold); color: var(--lh-btn-ink); }
.daterangepicker .drp-buttons { border-top-color: var(--lh-line); }
.daterangepicker select.hourselect, .daterangepicker select.minuteselect,
.daterangepicker select.ampmselect, .daterangepicker select.monthselect, .daterangepicker select.yearselect {
    background-color: var(--lh-field-bg); color: var(--lh-text); border-color: var(--lh-line);
}
.bootstrap-datetimepicker-widget td.day:hover, .bootstrap-datetimepicker-widget td span:hover { background-color: var(--lh-tint); }
.bootstrap-datetimepicker-widget td.active, .bootstrap-datetimepicker-widget td.active:hover { background-color: var(--lh-gold); color: var(--lh-btn-ink); }

/* ---------------------------------------------------------------- tables */

table.table {
    background-color: transparent;
    border-color: var(--lh-line-soft);
    font-size: 13.5px;
    color: var(--lh-text);
}
table.table > thead > tr > th,
table.dataTable > thead > tr > th {
    background-color: var(--lh-surface-2);
    border-bottom: 1px solid var(--lh-line) !important;
    border-color: var(--lh-line-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lh-text-muted);
    vertical-align: middle;
    padding: 11px 12px;
    white-space: nowrap;
}
table.table > tbody > tr > td {
    font-weight: var(--lh-body-weight);
    border-color: var(--lh-line-soft);
    padding: 11px 12px;
    vertical-align: middle;
    color: var(--lh-text);
}
table.table-striped > tbody > tr:nth-of-type(odd) { background-color: var(--lh-row-stripe); }
table.table-hover > tbody > tr:hover,
table.table > tbody > tr:hover { background-color: var(--lh-row-hover); }
table.table > tfoot > tr > th,
table.table > tfoot > tr > td {
    background-color: var(--lh-surface-2);
    border-top: 1px solid var(--lh-line) !important;
    font-weight: 700;
    color: var(--lh-text);
}
table.table > tbody > tr.bg-gray > td,
table.table tr.bg-gray, .bg-gray { background-color: var(--lh-surface-3) !important; color: var(--lh-text) !important; }

/* DataTables chrome */

/*
 * The toolbar row is dealt out by common.js as col-sm-1 / col-sm-8 / col-sm-3,
 * and "Show 25 entries" does not fit in 8.33%, so it painted over the export
 * buttons. Sizing the three cells to their content is stabler than re-guessing
 * the column split, which has to hold at every breakpoint and translation.
 */
.dataTables_wrapper > .row:first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
}
.dataTables_wrapper > .row:first-child > div {
    float: none;
    width: auto;
    padding-left: 0;
    padding-right: 0;
}
.dataTables_wrapper > .row:first-child > div:last-of-type { margin-left: auto; }
.dataTables_wrapper .dataTables_length { white-space: nowrap; }

.dataTables_wrapper { font-size: 13px; font-weight: var(--lh-body-weight); color: var(--lh-text-muted); }
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info { color: var(--lh-text-muted); }
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    height: 34px;
    border: 1px solid var(--lh-line);
    border-radius: var(--lh-radius);
    padding: 4px 9px;
    color: var(--lh-text);
    background-color: var(--lh-field-bg);
}
.dataTables_wrapper .dataTables_filter input::placeholder { color: var(--lh-text-ghost); }
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--lh-gold-deep);
    box-shadow: 0 0 0 3px var(--lh-gold-ring);
    outline: none;
}
.dataTables_wrapper .dt-buttons .dt-button,
.dataTables_wrapper .dt-buttons .btn {
    background-image: none;
    background-color: var(--lh-surface);
    border: 1px solid var(--lh-line);
    border-radius: var(--lh-radius);
    color: var(--lh-text);
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 12px;
    margin-right: 6px;
    box-shadow: none;
}
.dataTables_wrapper .dt-buttons .dt-button:hover,
.dataTables_wrapper .dt-buttons .btn:hover {
    background-color: var(--lh-tint);
    border-color: var(--lh-gold-deep);
    color: var(--lh-text);
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 5px 11px;
    margin-left: 2px;
    color: var(--lh-text-muted) !important;
    background: none !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--lh-tint) !important;
    border-color: var(--lh-line) !important;
    color: var(--lh-text) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--lh-gold) !important;
    border-color: var(--lh-gold-deep) !important;
    color: var(--lh-btn-ink) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    color: var(--lh-text-ghost) !important;
    background: none !important;
    border-color: transparent !important;
    cursor: not-allowed;
}
/* Bootstrap-flavoured pagination markup, used by some DataTables builds */
.pagination > li > a, .pagination > li > span {
    background-color: transparent;
    border-color: var(--lh-line);
    color: var(--lh-text-muted);
}
.pagination > li > a:hover { background-color: var(--lh-tint); color: var(--lh-text); }
.pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > span {
    background-color: var(--lh-gold);
    border-color: var(--lh-gold-deep);
    color: var(--lh-btn-ink);
}
.dataTables_wrapper .dataTables_processing {
    background: var(--lh-surface);
    border: 1px solid var(--lh-line);
    border-radius: var(--lh-radius);
    box-shadow: var(--lh-shadow-pop);
    color: var(--lh-text);
    font-weight: 600;
}
.dataTables_scrollHead, .dataTables_scrollBody { background-color: transparent; }
table.dataTable.no-footer { border-bottom-color: var(--lh-line); }
/* Sorting arrows are Glyphicons text, so they inherit the header colour. */
table.dataTable thead .sorting_asc_disabled:after,
table.dataTable thead .sorting_desc_disabled:after { color: var(--lh-text-ghost); }

/* Empty state actually reads as one. */
table.dataTable td.dataTables_empty {
    padding: 40px 12px;
    text-align: center;
    color: var(--lh-text-faint);
    font-size: 13.5px;
    font-style: normal;
}

/* ------------------------------------------------------- tabs and modals */

.nav-tabs { border-bottom: 1px solid var(--lh-line); }
.nav-tabs > li > a {
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--lh-text-muted);
    font-weight: 600;
    font-size: 13.5px;
    padding: 10px 14px;
    margin-right: 4px;
    background-color: transparent;
}
.nav-tabs > li > a:hover { background-color: transparent; color: var(--lh-text); border-bottom-color: var(--lh-line); }
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
    border: 0;
    border-bottom: 2px solid var(--lh-gold-deep);
    background-color: transparent;
    color: var(--lh-text);
}

.modal-content {
    background-color: var(--lh-surface);
    color: var(--lh-text);
    border: 1px solid var(--lh-line);
    border-radius: var(--lh-radius-lg);
    box-shadow: var(--lh-shadow-modal);
}
.modal-header {
    border-bottom: 1px solid var(--lh-line-soft);
    padding: 16px 20px;
}
.modal-header .close { color: var(--lh-text-muted); opacity: .8; text-shadow: none; }
.modal-header .modal-title {
    font-family: var(--lh-display);
    font-size: 22px;
    font-weight: 500;
    color: var(--lh-text);
}
.modal-body { padding: 20px; }
.modal-footer { border-top: 1px solid var(--lh-line-soft); padding: 14px 20px; }
.modal-backdrop, .modal-backdrop.in { opacity: 1; background-color: var(--lh-scrim); }

.dropdown-menu {
    background-color: var(--lh-surface);
    border: 1px solid var(--lh-line);
    border-radius: var(--lh-radius);
    box-shadow: var(--lh-shadow-pop);
    padding: 6px;
}
.dropdown-menu > li > a {
    border-radius: 5px;
    padding: 7px 10px;
    font-size: 13px;
    color: var(--lh-text);
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus { background-color: var(--lh-tint); color: var(--lh-text); }
.dropdown-menu .divider { background-color: var(--lh-line-soft); }

.popover {
    font-family: var(--lh-font);
    background-color: var(--lh-surface);
    border-color: var(--lh-line);
    color: var(--lh-text);
    box-shadow: var(--lh-shadow-pop);
}
.popover-title { background-color: var(--lh-surface-2); border-bottom-color: var(--lh-line-soft); color: var(--lh-text); }
.popover.bottom > .arrow:after { border-bottom-color: var(--lh-surface-2); }
.popover.top > .arrow:after { border-top-color: var(--lh-surface); }
.tooltip-inner {
    font-family: var(--lh-font);
    background-color: var(--lh-chrome);
    color: var(--lh-cream);
    border-radius: 6px;
    font-size: 12px;
    padding: 6px 9px;
}
.tooltip.top .tooltip-arrow { border-top-color: var(--lh-chrome); }
.tooltip.bottom .tooltip-arrow { border-bottom-color: var(--lh-chrome); }

/* Sweetalert dialogs are appended to <body>. */
.swal-modal { background-color: var(--lh-surface); border: 1px solid var(--lh-line); border-radius: var(--lh-radius-lg); }
.swal-title { color: var(--lh-text); font-family: var(--lh-display); font-weight: 500; }
.swal-text { color: var(--lh-text-muted); }
.swal-button { background-color: var(--lh-gold); color: var(--lh-btn-ink); border-radius: var(--lh-radius); font-family: var(--lh-font); }
.swal-button:not([disabled]):hover { background-color: var(--lh-gold-bright); }
.swal-button--cancel { background-color: var(--lh-surface-3); color: var(--lh-text); }
.swal-button--cancel:not([disabled]):hover { background-color: var(--lh-line-soft); }

/* --------------------------------------------------------- filters panel */

.pf-btn::before { background: var(--lh-gold-deep) !important; }
.pf-btn > span > span:first-child {
    background: var(--lh-gold-tint) !important;
    color: var(--lh-gold-ink) !important;
    border-radius: 6px !important;
}
.pf-chevron { color: var(--lh-text-faint) !important; }
.pf-btn:hover { background-color: var(--lh-tint) !important; }

/* ------------------------------------------------------------- dashboard */

.lh-dash { padding: 26px 24px 0; }
.lh-dash__head { align-items: flex-end; margin-bottom: 20px; }
.lh-dash__eyebrow {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--lh-text-faint);
}
.lh-dash__title {
    font-family: var(--lh-display);
    font-size: 34px;
    font-weight: 500;
    line-height: 1.1;
    color: var(--lh-text);
    margin: 0;
}
.lh-dash__controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lh-dash__control { min-width: 220px; }
.lh-dash__date { display: inline-flex; align-items: center; gap: 7px; height: 38px; white-space: nowrap; }

.lh-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
@media (max-width: 1279px) { .lh-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) {
    .lh-dash { padding: 18px 16px 0; }
    .lh-dash__title { font-size: 26px; }
    .lh-dash__control { min-width: 0; flex: 1 1 100%; }
    .lh-dash__date { width: 100%; justify-content: center; }
    .lh-stat-grid { grid-template-columns: minmax(0, 1fr); }
}

.lh-stat {
    background-color: var(--lh-surface);
    border: 1px solid var(--lh-line);
    border-radius: var(--lh-radius-lg);
    padding: 16px 18px;
}
.lh-stat__label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--lh-text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lh-stat__value {
    display: block;
    margin-top: 8px;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--lh-text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lh-stat--accent { border-color: var(--lh-gold-line); box-shadow: inset 3px 0 0 var(--lh-gold); }

.lh-section-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* Dashboard panels: one heading treatment, one icon treatment, no six-colour circles. */
.lh-panels { padding-top: 22px !important; }
.lh-panels h3 {
    font-family: var(--lh-display) !important;
    font-size: 22px !important;
    font-weight: 500 !important;
    line-height: 1.2;
    color: var(--lh-text);
    margin: 0;
}
.lh-panels .tw-border-2.tw-rounded-full {
    width: 30px !important;
    height: 30px !important;
    border: 0 !important;
    border-radius: 7px !important;
    background: var(--lh-gold-tint);
}
.lh-panels .tw-border-2.tw-rounded-full svg { color: var(--lh-gold-ink) !important; width: 16px; height: 16px; }

/* Dashboard chart frames were dashed placeholder boxes. */
#scrollable-container .tw-border-dashed {
    border-style: solid;
    border-color: var(--lh-line-soft);
    background-color: var(--lh-surface);
}

/* ------------------------------------------------------------------- POS */

/*
 * The POS terminal is a separate, purpose-built surface whose views carry
 * arbitrary-value Tailwind classes (tw-bg-[#f8fafc] and friends). Redefining
 * those generated classes retints the whole screen without touching the markup
 * that its jQuery binds to. Semantic icon colours (green paid, red void) stay.
 */
.tw-bg-\[\#f8fafc\], .\!tw-bg-\[\#f8fafc\] { background-color: var(--lh-surface-2) !important; }
.tw-bg-\[\#f3f4f6\] { background-color: var(--lh-surface-2); }
.tw-bg-\[\#e2e8f0\] { background-color: var(--lh-line-soft); }
.tw-border-\[\#e2e8f0\], .\!tw-border-\[\#e2e8f0\] { border-color: var(--lh-line) !important; }
.tw-border-\[\#e5e7eb\] { border-color: var(--lh-line); }
.tw-text-\[\#94a3b8\], .\!tw-text-\[\#94a3b8\] { color: var(--lh-text-faint) !important; }
.tw-text-\[\#64748b\], .tw-text-\[\#A5ADBB\] { color: var(--lh-text-muted); }
.tw-bg-slate-100 { background-color: var(--lh-surface-3); }
.tw-text-slate-400 { color: var(--lh-text-faint); }
.tw-text-slate-600, .tw-text-slate-700 { color: var(--lh-text); }
.tw-bg-\[\#646EE4\] { background-color: var(--lh-chrome-2); }
.hover\:tw-bg-\[\#414aac\]:hover { background-color: var(--lh-chrome-line); }
.tw-bg-\[\#001F3E\] { background-color: var(--lh-chrome); }

.\!tw-bg-\[\#f3f4f6\] { background-color: var(--lh-surface-2) !important; }

/* app.css pins the cart rows with !important, so these have to match it. */
body.lockscreen #pos_table > tbody > tr:nth-child(odd) { background: var(--lh-surface) !important; }
body.lockscreen #pos_table > tbody > tr:nth-child(even) { background: var(--lh-surface-2) !important; }
body.lockscreen #pos_table > tbody > tr:hover { background: var(--lh-row-hover) !important; }
body.lockscreen #pos_table > tbody > tr > td { border-top-color: var(--lh-line-soft) !important; }
body.lockscreen #pos_table .form-control,
body.lockscreen #pos_table .input-group .form-control.pos_quantity,
body.lockscreen #pos_table .input-group .form-control.pos_unit_price_inc_tax,
body.lockscreen #pos_table .form-control.pos_line_total {
    color: var(--lh-text);
    background-color: var(--lh-field-bg);
    border-color: var(--lh-line);
}
.product_box { color: var(--lh-text); border-color: var(--lh-line); }
.pos-nav-divider { background-color: var(--lh-line) !important; }
.pos-header .tw-border-2 { border-color: var(--lh-line); }

/* ------------------------------------------------------------ login page */

.lh-auth-brand { display: block; }
.lh-auth-brand img { display: block; width: 232px; max-width: 60vw; height: auto; }

.lh-auth-card {
    background: var(--lh-surface);
    border: 1px solid var(--lh-line);
    border-radius: 14px;
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .55);
}
.lh-auth-title {
    font-family: var(--lh-display);
    font-size: 28px;
    font-weight: 500;
    color: var(--lh-text);
    margin: 0;
}
.lh-auth-sub { font-size: 13.5px; color: var(--lh-text-muted); margin: 4px 0 0; }

.lh-auth-card input[type="text"],
.lh-auth-card input[type="password"] {
    background-color: var(--lh-field-bg) !important;
    color: var(--lh-text) !important;
    border-color: var(--lh-line) !important;
    border-radius: var(--lh-radius) !important;
    height: 44px !important;
    font-weight: 500;
}
.lh-auth-card input[type="text"]:focus,
.lh-auth-card input[type="password"]:focus {
    border-color: var(--lh-gold-deep) !important;
    box-shadow: 0 0 0 3px var(--lh-gold-ring);
}
.lh-auth-card .show_hide_icon svg { stroke: var(--lh-text-muted); }

.lh-auth-submit {
    width: 100%;
    height: 46px;
    margin-top: 8px;
    border: 1px solid var(--lh-gold-deep);
    border-radius: var(--lh-radius);
    background-color: var(--lh-gold);
    color: var(--lh-btn-ink);
    font-family: var(--lh-font);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .01em;
    transition: background-color .15s ease;
}
.lh-auth-submit:hover { background-color: var(--lh-gold-bright); color: var(--lh-btn-ink); }
.lh-auth-submit:focus-visible { outline: 2px solid var(--lh-cream); outline-offset: 2px; }

/* The auth shell is ink in both themes, so its chrome links use the chrome tokens. */
body.pace-done { background: var(--lh-chrome); }
body.pace-done > .container-fluid .tw-text-white { color: var(--lh-cream); }
body.pace-done .tw-border-white { border-color: rgba(242, 179, 61, .45) !important; }
body.pace-done .tw-border-white a { color: var(--lh-chrome-accent) !important; }

/* ----------------------------------------------------------------- print */

/*
 * Receipts go to an 80mm thermal roll, not to A4.
 *
 * Without a page size the browser lays the receipt out for A4 and the driver
 * shrinks it to fit the roll, which on a thermal head is a narrow column of
 * unreadable text up the left of the paper. Pin the page to the roll width and
 * let the height run.
 *
 * All of it hangs off .printing-receipt, which __print_thermal() in
 * functions.js adds for the duration of the print. A bare @media print would
 * apply to every other Ctrl+P in the admin too, and since #receipt_section is
 * in the main layout and normally empty, reports and stock sheets would come
 * out as one blank 80mm page.
 *
 * 58mm tills: change the two 80mm values. @page cannot read a custom property
 * in Chrome, so a variable here would only look configurable.
 */
@page thermal-roll {
    size: 80mm auto;
    margin: 0;
}

@media print {
    body { background: #fff; color: #000; }
    .theme-header-bg { background-color: #fff !important; border: 0 !important; }

    body.printing-receipt { width: 80mm; }

    /*
     * #receipt_section sits several levels inside <main>, so "hide every child
     * of body but one" does not reach it: hide everything that is neither the
     * receipt, one of its ancestors, nor one of its descendants. Hiding rather
     * than shifting off-page matters because a kiosk print is silent - a stray
     * sheet is only noticed at the printer.
     */
    body.printing-receipt *:not(:has(#receipt_section)):not(#receipt_section):not(#receipt_section *) {
        display: none !important;
    }

    /* The ancestors carry the receipt but must contribute no layout of their own. */
    body.printing-receipt *:has(#receipt_section) {
        display: block !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #fff !important;
    }

    body.printing-receipt #receipt_section {
        page: thermal-roll;
        display: block !important;
        position: static !important;
        width: 80mm !important;
        max-width: 80mm !important;
        margin: 0 !important;
        padding: 2mm 3mm !important;
        background: #fff !important;
        color: #000 !important;
        font-size: 11px !important;
        line-height: 1.35 !important;
    }

    /* Thermal heads have no greys - anything not solid black dithers or drops out. */
    body.printing-receipt #receipt_section * {
        color: #000 !important;
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
        max-width: 100% !important;
        float: none !important;
    }

    /*
     * The receipt is Bootstrap markup sized for a screen: the totals and
     * payment tables sit in col-xs-6, which at 80mm leaves them ~110px wide and
     * breaks every amount across two lines. On a roll there is only one column.
     */
    body.printing-receipt #receipt_section .row { margin-left: 0 !important; margin-right: 0 !important; }
    body.printing-receipt #receipt_section [class*="col-"] {
        width: 100% !important;
        float: none !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Auto layout, not fixed: fixed splits the width evenly and wraps the amounts. */
    body.printing-receipt #receipt_section table { width: 100% !important; table-layout: auto; border-collapse: collapse; }
    body.printing-receipt #receipt_section td,
    body.printing-receipt #receipt_section th { padding: 1px 2px !important; }
    body.printing-receipt #receipt_section td:not(:first-child),
    body.printing-receipt #receipt_section th:not(:first-child) { white-space: nowrap; }
    body.printing-receipt #receipt_section td:first-child { word-wrap: break-word; overflow-wrap: anywhere; }

    /* Screen heading sizes eat a third of the roll before the first item. */
    body.printing-receipt #receipt_section h2 { font-size: 15px !important; margin: 0 0 2px !important; font-weight: 700; }
    body.printing-receipt #receipt_section h3 { font-size: 13px !important; margin: 0 0 2px !important; font-weight: 700; }
    body.printing-receipt #receipt_section h4 { font-size: 12px !important; margin: 0 0 2px !important; }
    body.printing-receipt #receipt_section p { margin: 0 0 2px !important; }
    body.printing-receipt #receipt_section hr { margin: 3px 0 !important; border-top: 1px solid #000 !important; }

    body.printing-receipt #receipt_section img { max-width: 100% !important; height: auto !important; filter: grayscale(1) contrast(2); }

    body.printing-receipt #receipt_section tr,
    body.printing-receipt #receipt_section td,
    body.printing-receipt #receipt_section p { page-break-inside: avoid; }
}

/*
 * AdminLTE's tab shell wraps most list screens. It carries a hardcoded white
 * background, so in dark mode the table's translucent rows were compositing
 * over white and cream body text fell to 1.14:1 against it.
 */
.nav-tabs-custom,
.nav-tabs-custom > .tab-content,
.tab-content {
    background-color: var(--lh-surface);
    color: var(--lh-text);
}

.nav-tabs-custom > .nav-tabs {
    background-color: transparent;
    border-bottom-color: var(--lh-border);
}

.nav-tabs-custom > .nav-tabs > li.active > a,
.nav-tabs-custom > .nav-tabs > li.active > a:hover,
.nav-tabs-custom > .nav-tabs > li.active > a:focus {
    background-color: var(--lh-surface);
    color: var(--lh-text);
}

.nav-tabs-custom > .nav-tabs > li > a {
    color: var(--lh-text-muted);
}

/* ------------------------------------------------------------------ auth
 * Split sign-in: brand on the left, form on the right. The aside is ink in
 * both themes so the mark always sits on the ground it was drawn for; only
 * the form side follows the theme.
 */
.lh-auth { padding: 0; }

.lh-auth__split {
    display: flex;
    flex-wrap: wrap;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
}

.lh-auth__aside {
    display: flex;
    align-items: center;
    padding: clamp(32px, 5vw, 72px);
    background:
        radial-gradient(120% 90% at 15% 0%, rgba(242, 179, 61, .10), transparent 60%),
        linear-gradient(160deg, #1E1914 0%, #14110F 100%);
    border-right: 1px solid rgba(242, 179, 61, .16);
}

.lh-auth__aside-inner { max-width: 34rem; }

.lh-auth__mark {
    width: min(320px, 78%);
    height: auto;
    margin-bottom: 2rem;
}

.lh-auth__line {
    margin: 0 0 1.75rem;
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: #F2B33D;
}

.lh-auth__note {
    margin: 0;
    max-width: 30ch;
    font-family: "Bricolage Grotesque", "Plus Jakarta Sans", sans-serif;
    font-size: clamp(21px, 2.1vw, 27px);
    line-height: 1.35;
    color: #FBF6EE;
}

.lh-auth__panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--lh-canvas, #FBF6EE);
}

/* The absolute lockup in the panel would duplicate the aside's. */
@media (min-width: 992px) {
    .lh-auth__panel .lh-auth-brand { display: none; }
}

@media (max-width: 991px) {
    .lh-auth__aside { display: none; }
    .lh-auth__split { min-height: auto; }
}

/*
 * The sign-in card is a flex item with only a max-width, so it collapsed to
 * its content once the panel narrowed. Give it a real width and a comfortable
 * ceiling, and centre it in whatever space the panel has.
 */
.lh-auth__panel .tw-dw-max-w-md,
.lh-auth__panel form {
    width: 100%;
    max-width: 27rem;
}

.lh-auth__panel > .row,
.lh-auth__panel > .row > div {
    width: 100%;
}

.lh-auth__panel .tw-dw-card,
.lh-auth__panel .tw-dw-rounded-box {
    margin-inline: auto;
}

/*
 * daisyUI's label puts the field name and the "forgot password" link on one
 * line; at this width they overlapped. Let them share the row properly.
 */
.lh-auth__panel .tw-dw-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

.lh-auth__panel .tw-dw-label a {
    flex: none;
    white-space: nowrap;
    font-size: 12px;
}

/* The language and register links are absolutely positioned; without a
   positioned panel they anchored to the viewport and drifted over the split. */
.lh-auth__panel { position: relative; }

/* The auth links are hardcoded tw-text-white for the old blue header; on the
   light form side that is invisible. Follow the theme instead. */
.lh-auth__panel a.tw-text-white,
.lh-auth__panel .tw-text-white a,
.lh-auth__panel .tw-text-white {
    color: var(--lh-text) !important;
}

.lh-auth__panel a.tw-text-white:hover,
.lh-auth__panel .tw-text-white a:hover {
    color: var(--lh-gold-ink) !important;
}

.lh-auth__panel .tw-border-white {
    border-color: var(--lh-border) !important;
}

/* Wide screens: keep both halves proportionate rather than letting the aside
   sprawl and the copy strand itself against the far left edge. */
@media (min-width: 1500px) {
    .lh-auth__aside-inner {
        max-width: 30rem;
        margin-inline: auto;
    }
}

.lh-auth__mark {
    max-width: 340px;
}

/* Belt and braces: the duplicate lockup is absolutely positioned and has
   escaped its container before. Hide it wherever the aside is showing. */
@media (min-width: 992px) {
    .lh-auth .lh-auth-brand { display: none !important; }
}
