/*
 * EasyBizPOS — Portal Theme ("Pro" layer)
 * Loaded AFTER custom.css. It re-values the design tokens declared there and
 * restyles the shell and the shared Bootstrap components, so every portal
 * module picks up the same look without per-view edits.
 *
 * THE LOOK
 * --------
 *   Frame     one dark navy L — the sidebar and the header share a colour,
 *             so the navigation recedes and the white content sheet leads.
 *   Content   white cards on a cool grey canvas: 14px radius, hairline
 *             border, soft low shadow. No heavy borders anywhere.
 *   Headline  gradient KPI tiles, each with label, value, delta and a
 *             sparkline — identity colour, never state.
 *   Actions   colour is a claim about consequence:
 *               primary  blue    main affirmative action (save, create)
 *               success  green   a good state reached (approve, receive, pay)
 *               info     cyan    non-mutating (view, print, export)
 *               warning  amber   reversible caution (hold, adjust)
 *               danger   red     destructive (delete, void, cancel)
 *               secondary slate  dismiss, back, filter
 *
 * Every colour still resolves through a token, so dark mode keeps working
 * from the single [data-bs-theme] switch.
 */

/* ============================================================
   1. TOKENS — LIGHT
   ============================================================ */
:root {
    /* Surfaces */
    --srf-0:        #eef2f8;
    --srf-1:        #ffffff;
    --srf-2:        #f5f7fb;
    --srf-3:        #f9fafd;
    --srf-hover:    #f3f6fd;
    --srf-sunken:   #eef1f7;

    /* Ink */
    --ink:          #0f172a;
    --ink-2:        #334155;
    --ink-3:        #64748b;
    --ink-4:        #94a3b8;

    /* Lines */
    --line:         #e2e8f0;
    --line-2:       #edf1f7;
    --line-3:       #d5dde9;

    /* Brand = primary blue */
    --c-brand:      #2563eb;
    --c-brand-hi:   #1d4ed8;
    --c-brand-lo:   #1e40af;
    --c-brand-soft: #eaf1fe;
    --c-brand-edge: #bfd3fb;
    --c-brand-ink:  #1d4ed8;
    --c-brand-ring: rgba(37, 99, 235, .28);

    --a-primary:       #2563eb;
    --a-primary-hover: #1d4ed8;
    --a-primary-tint:  #eaf1fe;
    --a-primary-edge:  #bfd3fb;
    --a-primary-ink:   #1e40af;

    --a-success:       #16a34a;
    --a-success-hover: #15803d;
    --a-success-tint:  #e8f7ee;
    --a-success-edge:  #a7e3be;
    --a-success-ink:   #166534;

    --a-info:          #0891b2;
    --a-info-hover:    #0e7490;
    --a-info-tint:     #e3f5fa;
    --a-info-edge:     #9ed9e8;
    --a-info-ink:      #155e75;

    --a-warning:       #d97706;
    --a-warning-hover: #b45309;
    --a-warning-tint:  #fef3e2;
    --a-warning-edge:  #f7cf91;
    --a-warning-ink:   #92400e;

    --a-danger:        #dc2626;
    --a-danger-hover:  #b91c1c;
    --a-danger-tint:   #fdecec;
    --a-danger-edge:   #f6b4b4;
    --a-danger-ink:    #991b1b;

    --a-neutral:       #64748b;
    --a-neutral-hover: #475569;
    --a-neutral-tint:  #f1f5f9;
    --a-neutral-edge:  #cbd5e1;
    --a-neutral-ink:   #334155;

    --a-accent:        #22c55e;
    --a-accent-ink:    #15803d;
    --a-cool:          #0891b2;
    --a-cool-hover:    #0e7490;

    /* Frame (sidebar + header) — navy in both themes */
    --fr-bg:        #0b1739;
    --fr-bg-2:      #0e1d46;
    --fr-line:      rgba(255, 255, 255, .07);
    --sb-bg:        linear-gradient(180deg, #0e1d46 0%, #0b1739 45%, #09132f 100%);
    --sb-solid:     #0b1739;
    --sb-line:      rgba(255, 255, 255, .07);
    --sb-ink:       #c3cde3;
    --sb-ink-hi:    #ffffff;
    --sb-ink-dim:   #7f8db0;
    --sb-hover:     rgba(255, 255, 255, .07);
    --sb-active:    #1f6feb;
    --sb-accent:    #60a5fa;
    --tb-bg:        #0b1739;
    --tb-line:      rgba(255, 255, 255, .07);

    /* Geometry */
    --r-xl:         16px;
    --r-lg:         14px;
    --r-md:         10px;
    --r-sm:         8px;
    --r-xs:         6px;
    --r-pill:       999px;

    /* Elevation — soft and low, never a hard drop */
    --shadow-1:     0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .05);
    --shadow-2:     0 4px 14px -2px rgba(15, 23, 42, .08);
    --shadow-3:     0 16px 40px -12px rgba(15, 23, 42, .25);
    --shadow-card:  0 1px 2px rgba(15, 23, 42, .04), 0 6px 18px -8px rgba(15, 23, 42, .08);

    --ebp-sidebar-width:           256px;
    --ebp-sidebar-collapsed-width: 76px;
    --ebp-topbar-height:           64px;
    --ebp-border-radius:           var(--r-lg);
    --ebp-card-shadow:             var(--shadow-card);

    /* Gradient tiles — the reference's six tile colours, used for KPI tiles
       across the portal: violet, green, orange, blue, magenta, teal. */
    --g-purple: linear-gradient(135deg, #5a4af4 0%, #8e6cf8 100%);
    --g-green:  linear-gradient(135deg, #12a150 0%, #2fcf6e 100%);
    --g-orange: linear-gradient(135deg, #f57200 0%, #ffa726 100%);
    --g-blue:   linear-gradient(135deg, #1565e8 0%, #3d8bff 100%);
    --g-pink:   linear-gradient(135deg, #e0145f 0%, #ff4d8b 100%);
    --g-teal:   linear-gradient(135deg, #0a9fa8 0%, #1fc8c4 100%);
    --g-indigo: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
    --g-amber:  linear-gradient(135deg, #c2410c 0%, #f59e0b 100%);
    --g-red:    linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
    --g-slate:  linear-gradient(135deg, #334155 0%, #64748b 100%);
    --g-lime:   linear-gradient(135deg, #3f7a0e 0%, #65a30d 100%);
}

/* ============================================================
   2. TOKENS — DARK
   ============================================================ */
[data-bs-theme="dark"] {
    --srf-0:        #0a1224;
    --srf-1:        #111c33;
    --srf-2:        #16233f;
    --srf-3:        #13203a;
    --srf-hover:    #1a2a4b;
    --srf-sunken:   #0d172d;

    --ink:          #e8eef8;
    --ink-2:        #c5d0e2;
    --ink-3:        #93a3bd;
    --ink-4:        #6b7c98;

    --line:         #22324f;
    --line-2:       #1c2a45;
    --line-3:       #2a3b5c;

    --c-brand:      #3b82f6;
    --c-brand-hi:   #60a5fa;
    --c-brand-lo:   #2563eb;
    --c-brand-soft: rgba(59, 130, 246, .16);
    --c-brand-edge: rgba(59, 130, 246, .45);
    --c-brand-ink:  #93c5fd;
    --c-brand-ring: rgba(59, 130, 246, .40);

    --a-primary:       #2563eb;
    --a-primary-hover: #1d4ed8;
    --a-primary-tint:  rgba(59, 130, 246, .16);
    --a-primary-edge:  rgba(59, 130, 246, .45);
    --a-primary-ink:   #93c5fd;

    --a-success:       #16a34a;
    --a-success-hover: #15803d;
    --a-success-tint:  rgba(34, 197, 94, .14);
    --a-success-edge:  rgba(34, 197, 94, .42);
    --a-success-ink:   #86efac;

    --a-info:          #0891b2;
    --a-info-hover:    #0e7490;
    --a-info-tint:     rgba(6, 182, 212, .14);
    --a-info-edge:     rgba(6, 182, 212, .42);
    --a-info-ink:      #67e8f9;

    --a-warning:       #d97706;
    --a-warning-hover: #b45309;
    --a-warning-tint:  rgba(245, 158, 11, .15);
    --a-warning-edge:  rgba(245, 158, 11, .45);
    --a-warning-ink:   #fcd34d;

    --a-danger:        #dc2626;
    --a-danger-hover:  #b91c1c;
    --a-danger-tint:   rgba(239, 68, 68, .15);
    --a-danger-edge:   rgba(239, 68, 68, .45);
    --a-danger-ink:    #fca5a5;

    --a-neutral:       #475569;
    --a-neutral-hover: #5b6b82;
    --a-neutral-tint:  rgba(148, 163, 184, .12);
    --a-neutral-edge:  #2a3b5c;
    --a-neutral-ink:   #c5d0e2;

    --a-accent-ink:    #86efac;

    --fr-bg:        #070f24;
    --fr-bg-2:      #0a1530;
    --sb-bg:        linear-gradient(180deg, #0a1530 0%, #070f24 100%);
    --sb-solid:     #070f24;
    --tb-bg:        #070f24;

    --shadow-1:     0 1px 2px rgba(0, 0, 0, .35);
    --shadow-2:     0 6px 16px -4px rgba(0, 0, 0, .5);
    --shadow-3:     0 16px 40px -12px rgba(0, 0, 0, .65);
    --shadow-card:  0 1px 2px rgba(0, 0, 0, .3), 0 8px 20px -10px rgba(0, 0, 0, .55);
}

/* ============================================================
   3. BASE
   ============================================================ */
body {
    font-size: 0.84rem;
    color: var(--ink-2);
    background-color: var(--srf-0);
}

a { color: var(--c-brand-ink); }
a:hover { color: var(--c-brand-hi); }

::selection { background: rgba(37, 99, 235, .22); color: var(--ink); }

/* Figures stay in the body face with tabular digits — the monospace face
   made every amount read as code. */
.num, .amount, .price, td.num {
    font-family: var(--ebp-font-family);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

/* ============================================================
   4. SIDEBAR
   ============================================================ */
.ebp-sidebar {
    background: var(--sb-bg);
    border-right: 0;
    box-shadow: 4px 0 24px -12px rgba(2, 8, 23, .6);
}
.ebp-sidebar::after { display: none; }

.ebp-sidebar .sidebar-brand {
    height: var(--ebp-topbar-height);
    padding: 0 1rem;
    gap: 0.7rem;
    background: var(--fr-bg);
    border-bottom: 1px solid var(--fr-line);
}

.ebp-sidebar .sidebar-brand .brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: #ffffff;
    box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .55);
    overflow: hidden;
    padding: 3px;
}
.ebp-sidebar .sidebar-brand .brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scale(1.35);
}

.ebp-sidebar .sidebar-brand .brand-name {
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.ebp-sidebar .sidebar-brand .brand-sub {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    color: #fcc419;
}

.ebp-sidebar .sidebar-nav { padding: 0.75rem 0.7rem 1rem; }

/* Top-level items and group headers share one row style */
.ebp-sidebar .nav-item .nav-link,
.ebp-sidebar .nav-group-header {
    gap: 0.75rem;
    margin: 2px 0;
    padding: 0.62rem 0.8rem;
    border-radius: var(--r-md);
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--sb-ink);
}

.ebp-sidebar .nav-link .nav-icon { font-size: 1.05rem; width: 1.3rem; }

.ebp-sidebar .nav-item .nav-link:hover,
.ebp-sidebar .nav-group-header:hover {
    background: var(--sb-hover);
    color: var(--sb-ink-hi);
}

/* Active page: one solid blue pill, the only saturated fill in the rail. */
.ebp-sidebar .nav-item .nav-link.active {
    background: var(--sb-active);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 8px 18px -8px rgba(37, 99, 235, .85);
}
.ebp-sidebar .nav-item .nav-link.active .nav-icon { color: #ffffff; }
.ebp-sidebar .nav-item .nav-link.active::before { display: none; }

/* Group headers: a coloured glyph, no chip — reads as a top-level item */
.ebp-sidebar .nav-group { margin-top: 0; }

.ebp-sidebar .nav-group-header .group-icon {
    width: 1.3rem;
    height: auto;
    background: none !important;
    box-shadow: none !important;
    font-size: 1.05rem;
    border-radius: 0;
}

.ebp-sidebar .nav-group-header .group-title {
    font-size: 0.83rem;
    font-weight: 500;
    color: inherit;
}

.ebp-sidebar .nav-group-header .group-chevron {
    font-size: 0.72rem;
    color: var(--sb-ink-dim);
}

.ebp-sidebar .nav-group-header[aria-expanded="true"] {
    background: rgba(255, 255, 255, .05);
    color: var(--sb-ink-hi);
}
.ebp-sidebar .nav-group-header[aria-expanded="true"] .group-chevron {
    color: var(--sb-ink-hi);
}

/* The header of the group holding the current page stays lit while closed. */
.ebp-sidebar .nav-group.has-active > .nav-group-header { color: var(--sb-ink-hi); }
.ebp-sidebar .nav-group.has-active > .nav-group-header .group-title { font-weight: 600; }

.ebp-sidebar .nav-group[data-accent="green"]   .group-icon { color: #4ade80; }
.ebp-sidebar .nav-group[data-accent="blue"]    .group-icon { color: #60a5fa; }
.ebp-sidebar .nav-group[data-accent="orange"]  .group-icon { color: #fb923c; }
.ebp-sidebar .nav-group[data-accent="teal"]    .group-icon { color: #2dd4bf; }
.ebp-sidebar .nav-group[data-accent="purple"]  .group-icon { color: #c084fc; }
.ebp-sidebar .nav-group[data-accent="indigo"]  .group-icon { color: #a5b4fc; }
.ebp-sidebar .nav-group[data-accent="emerald"] .group-icon { color: #34d399; }
.ebp-sidebar .nav-group[data-accent="pink"]    .group-icon { color: #f472b6; }
.ebp-sidebar .nav-group[data-accent="cyan"]    .group-icon { color: #22d3ee; }
.ebp-sidebar .nav-group[data-accent="amber"]   .group-icon { color: #fbbf24; }
.ebp-sidebar .nav-group[data-accent="red"]     .group-icon { color: #f87171; }
.ebp-sidebar .nav-group[data-accent="slate"]   .group-icon { color: #cbd5e1; }

/* Nested links: indented under a guide rail */
.ebp-sidebar .nav-group-links .nav {
    position: relative;
    margin: 0.15rem 0 0.35rem 1.45rem;
    padding-left: 0.55rem;
    border-left: 1px solid rgba(255, 255, 255, .09);
}
.ebp-sidebar .nav-group-links .nav-link {
    padding: 0.46rem 0.7rem;
    font-size: 0.78rem;
    gap: 0.6rem;
}
.ebp-sidebar .nav-group-links .nav-link .nav-icon { font-size: 0.92rem; width: 1.1rem; }
.ebp-sidebar .nav-group-links .nav-link::after { display: none; }

.ebp-sidebar .nav-group-links.show { max-height: 900px; }

/* Logout sits in the rail like any item, in the danger hue. */
.ebp-sidebar .nav-link.nav-logout { color: #fca5a5; }
.ebp-sidebar .nav-link.nav-logout .nav-icon { color: #f87171; }
.ebp-sidebar .nav-link.nav-logout:hover { background: rgba(239, 68, 68, .14); color: #fecaca; }

.ebp-sidebar .nav-sep {
    height: 1px;
    margin: 0.6rem 0.4rem;
    background: rgba(255, 255, 255, .07);
}

/* Footer collapse control */
.ebp-sidebar .sidebar-footer { border-top: 1px solid var(--fr-line); padding: 0.55rem 0.7rem; }
.ebp-sidebar .sidebar-footer .sf-toggle { border-radius: var(--r-md); font-size: 0.76rem; }

/* ============================================================
   5. HEADER
   ============================================================ */
.ebp-topbar {
    height: var(--ebp-topbar-height);
    padding: 0 1.25rem;
    gap: 0.9rem;
    background: var(--tb-bg);
    border-bottom: 1px solid var(--tb-line);
    box-shadow: 0 6px 20px -14px rgba(2, 8, 23, .8);
    color: #ffffff;
}
.ebp-topbar::after { display: none; }

.ebp-topbar .topbar-toggle {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: var(--r-md);
    color: #ffffff;
    font-size: 1.35rem;
}
.ebp-topbar .topbar-toggle:hover { background: rgba(255, 255, 255, .08); }

.ebp-topbar .topbar-brand { color: #ffffff; font-size: 0.95rem; }

/* Search — jumps to any page in the menu */
.tb-search {
    position: relative;
    flex: 0 1 420px;
    min-width: 0;
}
.tb-search-box {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    height: 42px;
    padding: 0 0.55rem 0 0.9rem;
    background: #ffffff;
    border-radius: var(--r-md);
    box-shadow: 0 2px 8px -2px rgba(0, 0, 0, .3);
}
.tb-search-box > i { color: #64748b; font-size: 0.95rem; }
.tb-search-box input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 0.84rem;
    color: #0f172a;
}
.tb-search-box input::placeholder { color: #94a3b8; }
.tb-search-box kbd {
    flex-shrink: 0;
    padding: 0.14rem 0.4rem;
    font-size: 0.64rem;
    font-family: var(--ebp-font-family);
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: var(--r-xs);
    box-shadow: none;
}

.tb-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 380px;
    overflow-y: auto;
    padding: 0.35rem;
    background: var(--srf-1);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-3);
    z-index: 1060;
}
.tb-search-results[hidden] { display: none; }
.tb-search-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.65rem;
    border-radius: var(--r-sm);
    color: var(--ink-2);
    text-decoration: none;
}
.tb-search-item i {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border-radius: var(--r-sm);
    background: var(--a-primary-tint);
    color: var(--a-primary);
    font-size: 0.9rem;
    flex-shrink: 0;
}
.tb-search-item .t { font-weight: 600; color: var(--ink); font-size: 0.82rem; }
.tb-search-item .g { font-size: 0.7rem; color: var(--ink-3); }
.tb-search-item.is-active,
.tb-search-item:hover { background: var(--srf-hover); color: var(--ink); }
.tb-search-empty { padding: 1rem; text-align: center; color: var(--ink-3); font-size: 0.8rem; }

.ebp-topbar .topbar-actions { gap: 0.5rem; min-width: 0; }

/* The main column must never grow to fit the header — that pushes the whole
   page wider than a phone screen. */
.ebp-main { min-width: 0; }

/* Date pill */
.tb-date {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 40px;
    padding: 0 0.9rem;
    background: #ffffff;
    border-radius: var(--r-md);
    color: #0f172a;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}
.tb-date i { color: #475569; }

/* Icon buttons on the navy bar */
.tb-icon,
.ebp-topbar .theme-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: var(--r-md);
    background: transparent;
    color: #e2e8f0;
    font-size: 1.15rem;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.tb-icon:hover,
.tb-icon[aria-expanded="true"],
.ebp-topbar .theme-toggle:hover,
.ebp-topbar .theme-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, .09);
    color: #ffffff;
}
.tb-icon .tb-badge {
    position: absolute;
    top: 4px;
    right: 3px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-grid;
    place-items: center;
    border-radius: var(--r-pill);
    background: #ef4444;
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--tb-bg);
}

/* POS — the business's main action gets the one filled button in the bar */
.tb-pos {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 40px;
    padding: 0 1rem;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #ffffff !important;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 18px -10px rgba(34, 197, 94, .9);
    white-space: nowrap;
}
.tb-pos:hover { filter: brightness(1.06); }

.tb-install {
    height: 40px;
    border-radius: var(--r-md) !important;
    color: #bbf7d0 !important;
    border-color: rgba(134, 239, 172, .5) !important;
    background: transparent !important;
}

/* User chip */
.tb-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    height: 48px;
    padding: 0 0.5rem 0 0.35rem;
    margin-left: 0.25rem;
    border: 0;
    border-radius: var(--r-md);
    background: transparent;
    color: #ffffff;
    text-align: left;
}
.tb-user:hover, .tb-user[aria-expanded="true"] { background: rgba(255, 255, 255, .07); }
.tb-avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, .85);
    overflow: hidden;
}
.tb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tb-user-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.tb-user-name { font-size: 0.82rem; font-weight: 700; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-user-sub  { font-size: 0.68rem; font-weight: 600; color: #4ade80; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-user .bi-chevron-down { font-size: 0.7rem; color: #cbd5e1; }

/* Branch switcher — which shop the whole portal is looking at */
.tb-branch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 40px;
    padding: 0 0.8rem;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .04);
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
.tb-branch:hover, .tb-branch[aria-expanded="true"] { background: rgba(255, 255, 255, .09); color: #ffffff; }
.tb-branch > .bi-shop, .tb-branch > .bi-buildings { color: #4ade80; font-size: 0.95rem; }
.tb-branch .bi-chevron-down { font-size: 0.7rem; color: #cbd5e1; }
.tb-branch-label { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.tb-branch.is-pinned { cursor: default; }
.tb-branch.is-pinned:hover { background: rgba(255, 255, 255, .04); color: #e2e8f0; }
.branch-menu { min-width: 260px; max-height: 70vh; overflow-y: auto; }
.branch-menu .dropdown-item { display: flex; align-items: center; gap: 0.55rem; }
.branch-menu .dropdown-item .bi-check2 { margin-left: auto; color: var(--bs-success); }
.branch-menu .branch-main-tag { font-size: 0.62rem; }

/* Dropdowns hanging off the bar */
.ebp-topbar .dropdown-menu {
    margin-top: 0.5rem !important;
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-3);
    padding: 0.35rem;
    overflow: hidden;
}
.ebp-topbar .dropdown-menu .dropdown-item { border-radius: var(--r-sm); padding: 0.5rem 0.7rem; font-size: 0.8rem; }
.ebp-topbar .notif-menu { width: 340px; padding: 0; }
.ebp-topbar .notif-menu .notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--line-2);
    font-weight: 700;
    color: var(--ink);
}
.ebp-topbar .notif-menu .notif-item {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--line-2);
}
.ebp-topbar .notif-menu .notif-ico {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    border-radius: var(--r-sm);
    background: var(--a-primary-tint);
}
.ebp-topbar .notif-menu .notif-foot { padding: 0.6rem; text-align: center; }
.ebp-topbar .notif-menu .notif-foot a { font-weight: 600; font-size: 0.78rem; text-decoration: none; }

.tb-search-toggle { display: none; }

/* ============================================================
   6. CONTENT SHEET
   ============================================================ */
.ebp-content { padding: 1.4rem 1.5rem 2rem; }

/* Auto breadcrumb, built from the active menu item */
.ebp-crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: -0.2rem 0 0.7rem;
    font-size: 0.74rem;
    color: var(--ink-3);
}
.ebp-crumbs:empty { display: none; }
.ebp-crumbs a { color: var(--ink-3); text-decoration: none; display: inline-flex; align-items: center; gap: 0.3rem; }
.ebp-crumbs a:hover { color: var(--a-primary); }
.ebp-crumbs .sep { font-size: 0.6rem; color: var(--ink-4); }
.ebp-crumbs .here { color: var(--ink); font-weight: 600; }

/* Page header — title left, actions right; no rule under it */
.page-header,
.ebp-content .page-header {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 1.15rem;
    gap: 0.75rem;
}
.page-header h1,
.ebp-content .page-header h1 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    color: var(--ink);
}
.page-header .page-sub { margin: 0.15rem 0 0; font-size: 0.8rem; color: var(--ink-3); }

/* ============================================================
   7. CARDS
   ============================================================ */
.ebp-content .card,
.ebp-content .stat-card,
.ebp-content .qa-center,
.ebp-content .dash-card,
.ebp-content .kpi,
.ebp-content .rpt-filter {
    border-radius: var(--r-lg) !important;
}

.ebp-content .card {
    --card-r: var(--r-lg);
    border-radius: var(--card-r) !important;
    background: var(--srf-1);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
}
/* Cards that wrap a data table get tighter corners than content cards */
.ebp-content .card:has(> .table-responsive, > .table, > .card-body.p-0 > .table-responsive) {
    --card-r: var(--r-sm);
}

.ebp-content .card-header {
    border-radius: calc(var(--card-r) - 1px) calc(var(--card-r) - 1px) 0 0 !important;
    background: var(--srf-1);
    border-bottom: 1px solid var(--line-2);
    padding: 0.85rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink);
}
.ebp-content .card-header h1, .ebp-content .card-header h2,
.ebp-content .card-header h3, .ebp-content .card-header h4,
.ebp-content .card-header h5, .ebp-content .card-header h6 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
}
.ebp-content .card-header i { color: var(--a-primary); }

.ebp-content .card-body { padding: 1.1rem; }

.ebp-content .card-footer {
    border-radius: 0 0 calc(var(--card-r) - 1px) calc(var(--card-r) - 1px) !important;
    background: var(--srf-1);
    border-top: 1px solid var(--line-2);
    padding: 0.7rem 1.1rem;
}

/* Tables flush inside a card follow the card's corners */
.ebp-content .card > .table-responsive:first-child,
.ebp-content .card > .table:first-child,
.ebp-content .card > .card-body.p-0:first-child > .table-responsive:first-child {
    border-top-left-radius: calc(var(--card-r) - 1px);
    border-top-right-radius: calc(var(--card-r) - 1px);
}
.ebp-content .card > .table-responsive:last-child,
.ebp-content .card > .card-body.p-0:last-child > .table-responsive:last-child {
    border-bottom-left-radius: calc(var(--card-r) - 1px);
    border-bottom-right-radius: calc(var(--card-r) - 1px);
}

/* Stat cards (used by module index pages) — white card with an icon chip… */
.ebp-content .stat-card {
    padding: 1.05rem 1.15rem;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
    background: var(--srf-1);
}
.ebp-content .stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.stat-card .stat-label {
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink-3);
}
.stat-card .stat-value {
    font-family: var(--ebp-font-family);
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.stat-card .stat-icon { width: 46px; height: 46px; border-radius: 12px; font-size: 1.25rem; }

/* …and the coloured variants become the dashboard's gradient tiles. */
.ebp-content .stat-card-success,
.ebp-content .stat-card-primary,
.ebp-content .stat-card-info,
.ebp-content .stat-card-warning,
.ebp-content .stat-card-danger {
    border: 0;
    color: #ffffff;
    box-shadow: 0 12px 24px -16px rgba(15, 23, 42, .6);
}
.ebp-content .stat-card-success,
.ebp-content .stat-card-success:hover { background: var(--g-green); }
.ebp-content .stat-card-primary,
.ebp-content .stat-card-primary:hover { background: var(--g-blue); }
.ebp-content .stat-card-info,
.ebp-content .stat-card-info:hover    { background: var(--g-teal); }
.ebp-content .stat-card-warning,
.ebp-content .stat-card-warning:hover { background: var(--g-orange); }
.ebp-content .stat-card-danger,
.ebp-content .stat-card-danger:hover  { background: var(--g-pink); }
.ebp-content .stat-card-success .stat-icon,
.ebp-content .stat-card-primary .stat-icon,
.ebp-content .stat-card-info .stat-icon,
.ebp-content .stat-card-warning .stat-icon,
.ebp-content .stat-card-danger .stat-icon { background: rgba(255, 255, 255, .2); color: #ffffff; }

/* ============================================================
   8. TABLES — hairline rows, no grid, soft header band
   ============================================================ */
.ebp-content .table {
    font-size: 0.8rem;
    color: var(--ink-2);
    border-collapse: separate;
    border-spacing: 0;
    --bs-table-bg: transparent;
}
.ebp-content .table,
.ebp-content .table thead,
.ebp-content .table tbody,
.ebp-content .table tfoot,
.ebp-content .table tr,
.ebp-content .table th,
.ebp-content .table td {
    border: 0 !important;
}
.ebp-content .table > :not(caption) > * > * {
    border-bottom: 1px solid var(--line-2) !important;
}
.ebp-content .table thead th,
.ebp-content .table-light,
.ebp-content .table thead.table-light th {
    background: var(--srf-2) !important;
    color: var(--ink-2) !important;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid var(--line) !important;
}
.ebp-content .table tbody td,
.ebp-content .table tfoot td,
.ebp-content .table tfoot th {
    padding: 0.45rem 0.7rem;
}
.ebp-content .table tbody tr:last-child > * { border-bottom: 0 !important; }
.ebp-content .table tfoot > tr > * {
    background: var(--srf-3);
    font-weight: 700;
    color: var(--ink);
    border-top: 1px solid var(--line) !important;
}

.ebp-content .ebp-table tbody tr:nth-child(even) td { background-color: transparent; }
.ebp-content .ebp-table tbody tr:hover td,
.ebp-content .table-hover > tbody > tr:hover > *,
.ebp-content .table tbody tr:hover > td {
    background-color: var(--srf-hover) !important;
}

.ebp-content .table a { color: var(--a-primary-ink); font-weight: 600; }
[data-bs-theme="dark"] .ebp-content .table a { color: var(--c-brand-ink); }

.ebp-content .table tbody tr.table-success td { background: var(--a-success-tint) !important; }

/* Row action buttons: compact, rounded, colour by consequence */
.ebp-content .table .btn-sm,
.ebp-content .table-actions .btn { padding: 0.18rem 0.45rem; }

/* ============================================================
   9. BUTTONS
   ============================================================ */
.btn,
.ebp-content .btn,
.ebp-content .btn-sm,
.ebp-content .btn-lg,
.ebp-content .btn-xs {
    border-radius: var(--r-sm) !important;
}
.btn {
    font-weight: 600;
    letter-spacing: 0;
    gap: 0.4rem;
    justify-content: center;
}
.ebp-content .btn    { padding: 0.5rem 1rem; font-size: 0.8rem; }
.ebp-content .btn-sm { padding: 0.36rem 0.75rem; font-size: 0.75rem; }
.ebp-content .btn-lg { padding: 0.7rem 1.35rem; font-size: 0.92rem; }
.ebp-content .btn-xs { padding: 0.2rem 0.5rem; font-size: 0.68rem; border-radius: var(--r-xs) !important; }
.ebp-content .btn-icon { width: 32px; height: 32px; }

/* Filled buttons lift slightly so they read as pressable */
.btn-primary, .btn-success, .btn-info, .btn-warning, .btn-danger, .btn-secondary {
    box-shadow: 0 1px 2px rgba(15, 23, 42, .12), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.btn-primary   { --btn-ring: rgba(37, 99, 235, .32); }
.btn-success   { --btn-ring: rgba(22, 163, 74, .32); }
.btn-info      { --btn-ring: rgba(8, 145, 178, .32); }
.btn-warning   { --btn-ring: rgba(217, 119, 6, .32); }
.btn-danger    { --btn-ring: rgba(220, 38, 38, .32); }
.btn-secondary { --btn-ring: rgba(100, 116, 139, .32); }

.btn-primary:hover, .btn-success:hover, .btn-info:hover,
.btn-warning:hover, .btn-danger:hover, .btn-secondary:hover {
    box-shadow: 0 6px 14px -6px rgba(15, 23, 42, .35);
}

.btn-outline-primary   { --btn-ring: rgba(37, 99, 235, .28); color: var(--a-primary-ink); border-color: var(--a-primary-edge); background: var(--srf-1); }
.btn-outline-success   { color: var(--a-success-ink); border-color: var(--a-success-edge); background: var(--srf-1); }
.btn-outline-info      { color: var(--a-info-ink);    border-color: var(--a-info-edge);    background: var(--srf-1); }
.btn-outline-warning   { color: var(--a-warning-ink); border-color: var(--a-warning-edge); background: var(--srf-1); }
.btn-outline-danger    { color: var(--a-danger-ink);  border-color: var(--a-danger-edge);  background: var(--srf-1); }
.btn-outline-secondary { color: var(--ink-2);         border-color: var(--line-3);         background: var(--srf-1); }
.btn-outline-dark      { background: var(--srf-1); }

.btn-outline-primary:hover, .btn-outline-primary:active,
.btn-check:checked + .btn-outline-primary { background: var(--a-primary); border-color: var(--a-primary); color: #fff; }
.btn-outline-success:hover, .btn-outline-success:active,
.btn-check:checked + .btn-outline-success { background: var(--a-success); border-color: var(--a-success); color: #fff; }
.btn-outline-info:hover, .btn-outline-info:active { background: var(--a-info); border-color: var(--a-info); color: #fff; }
.btn-outline-warning:hover, .btn-outline-warning:active { background: var(--a-warning); border-color: var(--a-warning); color: #fff; }
.btn-outline-danger:hover, .btn-outline-danger:active { background: var(--a-danger); border-color: var(--a-danger); color: #fff; }
.btn-outline-secondary:hover, .btn-outline-secondary:active,
.btn-check:checked + .btn-outline-secondary { background: var(--srf-hover); border-color: var(--ink-4); color: var(--ink); }

.btn-light { background: var(--srf-1); border-color: var(--line-3); color: var(--ink-2); }

.btn-link { color: var(--a-primary-ink); font-weight: 600; }
.btn-link:hover { color: var(--a-primary-hover); }

/* Button groups keep outer corners only */
.btn-group > .btn:not(:last-child):not(.dropdown-toggle),
.btn-group > .btn-group:not(:last-child) > .btn {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}
.btn-group > .btn:nth-child(n + 2),
.btn-group > .btn-group:nth-child(n + 2) > .btn {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
.input-group > .btn { border-radius: 0 !important; }
.input-group > .btn:last-child { border-top-right-radius: var(--r-sm) !important; border-bottom-right-radius: var(--r-sm) !important; }
.input-group > .btn:first-child { border-top-left-radius: var(--r-sm) !important; border-bottom-left-radius: var(--r-sm) !important; }

/* ============================================================
   10. BADGES & PILLS
   ============================================================ */
.ebp-content .badge,
.ebp-content .status-badge {
    border-radius: var(--r-pill) !important;
    padding: 0.3rem 0.65rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: capitalize;
    border: 0;
}

/* Solid pills — white ink on the action hue */
.ebp-content .badge.text-bg-primary,   .ebp-content .badge.bg-primary   { background: var(--a-primary) !important; color: #fff !important; }
.ebp-content .badge.text-bg-success,   .ebp-content .badge.bg-success   { background: var(--a-success) !important; color: #fff !important; }
.ebp-content .badge.text-bg-info,      .ebp-content .badge.bg-info      { background: var(--a-info)    !important; color: #fff !important; }
.ebp-content .badge.text-bg-warning,   .ebp-content .badge.bg-warning   { background: #ea580c          !important; color: #fff !important; }
.ebp-content .badge.text-bg-danger,    .ebp-content .badge.bg-danger    { background: var(--a-danger)  !important; color: #fff !important; }
.ebp-content .badge.text-bg-secondary, .ebp-content .badge.bg-secondary { background: var(--a-neutral) !important; color: #fff !important; }
.ebp-content .badge.text-bg-dark,      .ebp-content .badge.bg-dark      { background: #1e293b          !important; color: #fff !important; }
.ebp-content .badge.text-bg-light,     .ebp-content .badge.bg-light     { background: var(--srf-2)     !important; color: var(--ink-2) !important; box-shadow: inset 0 0 0 1px var(--line); }

/* Soft pills — tint + ink, for dense status columns */
.status-badge.active, .status-badge.paid, .status-badge.completed { background: var(--a-success-tint); color: var(--a-success-ink); }
.status-badge.pending   { background: var(--a-warning-tint); color: var(--a-warning-ink); }
.status-badge.cancelled,
.status-badge.overdue   { background: var(--a-danger-tint);  color: var(--a-danger-ink); }
.status-badge.inactive  { background: var(--a-neutral-tint); color: var(--ink-3); }

/* Shared pill used by the dashboard and available to any view */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.22rem 0.65rem;
    border-radius: var(--r-pill);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    color: #ffffff;
    background: var(--a-neutral);
}
.pill-low      { background: #ef4444; }
.pill-critical { background: #ea580c; }
.pill-out      { background: #991b1b; }
.pill-ok       { background: var(--a-success); }
.pill-soft-primary { background: var(--a-primary-tint); color: var(--a-primary-ink); }
.pill-soft-success { background: var(--a-success-tint); color: var(--a-success-ink); }
.pill-soft-warning { background: var(--a-warning-tint); color: var(--a-warning-ink); }
.pill-soft-danger  { background: var(--a-danger-tint);  color: var(--a-danger-ink); }

/* ============================================================
   11. FORMS
   ============================================================ */
.ebp-content .form-control,
.ebp-content .form-select,
.ebp-content .input-group-text,
.ebp-content .per-page-select {
    border-radius: var(--r-sm) !important;
    border: 1px solid var(--line-3);
    background-color: var(--srf-1);
    color: var(--ink);
}
.ebp-content .form-control,
.ebp-content .form-select { min-height: 38px; height: auto; font-size: 0.82rem; }
.ebp-content .form-control-sm,
.ebp-content .form-select-sm { min-height: 32px; font-size: 0.76rem; }
.ebp-content textarea.form-control { min-height: 76px; }

.ebp-content .input-group > .form-control:not(:first-child),
.ebp-content .input-group > .form-select:not(:first-child),
.ebp-content .input-group > .input-group-text:not(:first-child) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}
.ebp-content .input-group > .form-control:not(:last-child),
.ebp-content .input-group > .form-select:not(:last-child),
.ebp-content .input-group > .input-group-text:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.ebp-content .form-control:focus,
.ebp-content .form-select:focus {
    border-color: var(--a-primary);
    box-shadow: 0 0 0 3px var(--c-brand-ring);
}
.ebp-content .form-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink-2);
    margin-bottom: 0.35rem;
}
.form-check-input:checked,
.form-switch .form-check-input:checked { background-color: var(--a-primary); border-color: var(--a-primary); }
.form-check-input { border-radius: 0.3em; }
.form-switch .form-check-input { border-radius: 2em; }
.form-check-input[type="radio"] { border-radius: 50%; }

/* ============================================================
   12. ALERTS, MODALS, DROPDOWNS, PAGINATION, TABS, LISTS
   ============================================================ */
.ebp-content .alert {
    border-radius: var(--r-md) !important;
    border: 1px solid transparent;
    border-left-width: 1px !important;
    padding: 0.8rem 1rem;
    box-shadow: var(--shadow-1);
}
.ebp-content .alert-success { background: var(--a-success-tint); border-color: var(--a-success-edge); color: var(--a-success-ink); }
.ebp-content .alert-info,
.ebp-content .alert-primary { background: var(--a-primary-tint); border-color: var(--a-primary-edge); color: var(--a-primary-ink); }
.ebp-content .alert-warning { background: var(--a-warning-tint); border-color: var(--a-warning-edge); color: var(--a-warning-ink); }
.ebp-content .alert-danger  { background: var(--a-danger-tint);  border-color: var(--a-danger-edge);  color: var(--a-danger-ink); }

.modal-content,
.ebp-content .modal-content {
    border-radius: var(--r-xl) !important;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-3);
    overflow: hidden;
}
.modal-header,
.ebp-content .modal-header {
    border-radius: 0 !important;
    background: var(--srf-1);
    border-bottom: 1px solid var(--line-2);
    padding: 1rem 1.25rem;
}
.modal-header .modal-title { font-size: 1rem; font-weight: 700; color: var(--ink); }
.ebp-content .modal-body { border-radius: 0 !important; padding: 1.25rem; }
.modal-footer,
.ebp-content .modal-footer {
    border-radius: 0 !important;
    background: var(--srf-3);
    border-top: 1px solid var(--line-2);
    padding: 0.8rem 1.25rem;
}

.dropdown-menu,
.ebp-content .dropdown-menu {
    border-radius: var(--r-md) !important;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-3);
    padding: 0.3rem;
}
.dropdown-item { border-radius: var(--r-xs); padding: 0.45rem 0.7rem; font-size: 0.8rem; }
.dropdown-item:active { background: var(--a-primary); color: #fff; }

.ebp-content .pagination { gap: 4px; }
.ebp-content .pagination .page-link,
.pagination .page-item .page-link {
    border-radius: var(--r-sm) !important;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.6rem;
    border: 1px solid var(--line);
    background: var(--srf-1);
    color: var(--ink-2);
    font-weight: 600;
}
.ebp-content .pagination .page-item.active .page-link,
.pagination .page-item.active .page-link {
    background: var(--a-primary);
    border-color: var(--a-primary);
    color: #fff;
    box-shadow: 0 4px 10px -4px rgba(37, 99, 235, .7);
}
.ebp-content .pagination .page-link:hover,
.pagination .page-item .page-link:hover { background: var(--a-primary-tint); border-color: var(--a-primary-edge); color: var(--a-primary-ink); }

.ebp-content .table-footer {
    background: var(--srf-1);
    border-top: 1px solid var(--line-2);
    border-radius: 0 0 calc(var(--card-r, var(--r-lg)) - 1px) calc(var(--card-r, var(--r-lg)) - 1px);
}

/* Tabs: underline style, blue active */
.ebp-content .nav-tabs {
    border-bottom: 1px solid var(--line);
    gap: 0.25rem;
}
.ebp-content .nav-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0 !important;
    color: var(--ink-3);
    font-weight: 600;
    padding: 0.6rem 0.9rem;
    margin-bottom: -1px;
    background: transparent;
}
.ebp-content .nav-tabs .nav-link:hover { color: var(--ink); border-bottom-color: var(--line-3); }
.ebp-content .nav-tabs .nav-link.active {
    color: var(--a-primary-ink);
    border-color: transparent;
    border-bottom-color: var(--a-primary);
    background: transparent;
}
[data-bs-theme="dark"] .ebp-content .nav-tabs .nav-link.active { color: var(--c-brand-ink); }

.ebp-content .nav-pills .nav-link { border-radius: var(--r-sm); font-weight: 600; color: var(--ink-3); }
.ebp-content .nav-pills .nav-link.active { background: var(--a-primary); color: #fff; }

.ebp-content .list-group { border-radius: var(--r-md) !important; }
.ebp-content .list-group-item { border-color: var(--line-2); }
.ebp-content .list-group-item:first-child { border-top-left-radius: var(--r-md) !important; border-top-right-radius: var(--r-md) !important; }
.ebp-content .list-group-item:last-child { border-bottom-left-radius: var(--r-md) !important; border-bottom-right-radius: var(--r-md) !important; }
.ebp-content .list-group-flush > .list-group-item { border-radius: 0 !important; }

.ebp-content .progress { border-radius: var(--r-pill) !important; height: 8px; background: var(--srf-sunken); }
.ebp-content .progress-bar { border-radius: var(--r-pill) !important; background-color: var(--a-primary); }

.ebp-content .toast { border-radius: var(--r-md) !important; }

/* Description lists on show pages */
.ebp-content .card-body dl.row dt { text-transform: none; letter-spacing: 0; font-size: 0.78rem; color: var(--ink-3); }
.ebp-content .card-body dl.row dd { font-size: 0.84rem; color: var(--ink); border-bottom-style: solid; border-bottom-color: var(--line-2); }

/* Utility overrides that custom.css points at the old green */
.text-primary, .link-primary { color: var(--a-primary-ink) !important; }
[data-bs-theme="dark"] .text-primary,
[data-bs-theme="dark"] .link-primary { color: var(--c-brand-ink) !important; }
.text-success { color: var(--a-success-ink) !important; }
.bg-primary   { background-color: var(--a-primary) !important; }
.bg-success   { background-color: var(--a-success) !important; }
.text-bg-primary { background-color: var(--a-primary) !important; color: #fff !important; }
.text-bg-success { background-color: var(--a-success) !important; color: #fff !important; }
.border-primary  { border-color: var(--a-primary) !important; }

/* SweetAlert2 confirm buttons follow the action colours */
.swal2-popup { border-radius: var(--r-xl) !important; }
.swal2-styled.swal2-confirm { background-color: var(--a-primary) !important; border-radius: var(--r-sm) !important; }
.swal2-styled.swal2-cancel  { background-color: var(--a-neutral) !important; border-radius: var(--r-sm) !important; }
.swal2-styled.swal2-deny    { background-color: var(--a-danger) !important;  border-radius: var(--r-sm) !important; }

/* ============================================================
   13. DASHBOARD + REPORT PRIMITIVES (shared dash-*, kpi, rpt-*)
   Reports inherit the dashboard's look: rounded soft cards and
   gradient KPI tiles.
   ============================================================ */
.dash {
    --dash-line:     var(--line);
    --dash-hairline: var(--line-2);
    --viz-accent:    var(--a-primary);
    --viz-accent-2:  var(--a-primary-hover);
    --viz-wash:      var(--a-primary-tint);
}

.dash-head {
    border-bottom: 0;
    padding-bottom: 0;
    align-items: center;
}
.dash-head h1 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.015em; }
.dash-head-sub { font-size: 0.8rem; }

.dash-card {
    background: var(--srf-1);
    border: 1px solid var(--line) !important;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.dash-card-head {
    background: var(--srf-1) !important;
    border-bottom: 1px solid var(--line-2) !important;
    padding: 0.85rem 1.1rem !important;
}
.dash-card-head h2 {
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: var(--ink) !important;
}
.dash-card-head h2 i { color: var(--a-primary); }
.dash-card-head .sub { font-size: 0.74rem; color: var(--ink-3); }
.dash-card-head a.sub { color: var(--a-primary-ink); font-weight: 600; }
.dash-card-body { padding: 1rem 1.1rem; }

.kpi {
    border: 1px solid var(--line) !important;
    border-top-width: 1px !important;
    box-shadow: var(--shadow-card);
    padding: 1rem 1.1rem;
}
.kpi-label { text-transform: none; letter-spacing: 0; font-size: 0.78rem; font-weight: 600; }
.kpi-value { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-meter, .kpi-meter span { border-radius: var(--r-pill); }

.dash-filter,
.dash-mode-toggle {
    border: 1px solid var(--line) !important;
    border-radius: var(--r-md);
    background: var(--srf-1);
    padding: 3px;
    gap: 2px;
    box-shadow: var(--shadow-1);
}
.dash-filter a,
.dash-mode-btn {
    border: 0 !important;
    border-radius: var(--r-sm);
    padding: 0.4rem 0.8rem;
    font-size: 0.76rem;
}
.dash-filter a[aria-current="true"],
.dash-mode-btn[aria-pressed="true"] {
    background: var(--a-primary);
    color: #fff;
    box-shadow: 0 4px 10px -4px rgba(37, 99, 235, .7);
}

.viz-legend-row .swatch { border-radius: 3px; }
.viz-table { border-radius: var(--r-sm); }
.rank-track, .rank-fill { border-radius: var(--r-pill); }
.till { border-radius: var(--r-md); }
.qty-chip { border-radius: var(--r-pill); }

/* Reports: tinted tiles become gradient tiles in the tone's own hue */
.rpt .tone-emerald { --t-grad: var(--g-green); }
.rpt .tone-blue    { --t-grad: var(--g-blue); }
.rpt .tone-violet  { --t-grad: var(--g-purple); }
.rpt .tone-amber   { --t-grad: var(--g-orange); }
.rpt .tone-rose    { --t-grad: var(--g-pink); }
.rpt .tone-cyan    { --t-grad: var(--g-teal); }
.rpt .tone-teal    { --t-grad: var(--g-teal); }
.rpt .tone-indigo  { --t-grad: var(--g-indigo); }
.rpt .tone-slate   { --t-grad: var(--g-slate); }
.rpt .tone-lime    { --t-grad: var(--g-lime); }

.rpt .kpi--t {
    background: var(--t-grad, var(--g-blue));
    border: 0 !important;
    color: #fff;
    box-shadow: 0 12px 24px -16px rgba(15, 23, 42, .6);
}
.rpt .kpi--t .kpi-label,
.rpt .kpi--t .kpi-value,
.rpt .kpi--t .kpi-meta,
.rpt .kpi--t .kpi-meta *,
.rpt .kpi--t .delta { color: #fff !important; opacity: 1; }
.rpt .kpi--t .kpi-label { opacity: .9; }
.rpt .kpi-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .2);
    color: #fff;
    font-size: 1rem;
}
.rpt .kpi--t .kpi-ico { color: #fff; }
.rpt .kpi--t .kpi-meter { background: rgba(255, 255, 255, .25); }
.rpt .kpi--t .kpi-meter span { background: #fff; }

.rpt .dash-card--t .dash-card-head {
    background: var(--srf-1) !important;
    border-top: 0 !important;
    margin-top: 0;
}
.rpt .dash-card--t .dash-card-head h2 { color: var(--ink) !important; }
.rpt .dash-card--t .dash-card-head .sub { color: var(--ink-3); opacity: 1; }

.rpt .rpt-btn { border-radius: var(--r-sm); border-color: var(--line-3); padding: 0.42rem 0.85rem; font-size: 0.76rem; }
.rpt .rpt-btn-go { background: var(--a-primary); border-color: var(--a-primary); }
.rpt .rpt-btn-go:hover { background: var(--a-primary-hover); border-color: var(--a-primary-hover); }

.rpt-filter {
    background: var(--srf-1) !important;
    border: 1px solid var(--line) !important;
    border-top-width: 1px !important;
    box-shadow: var(--shadow-card);
    padding: 0.9rem 1rem !important;
}
.rpt-field label { text-transform: none; letter-spacing: 0; font-size: 0.74rem; font-weight: 600; color: var(--ink-2); }
.rpt-field .form-control,
.rpt-field .form-select { border-radius: var(--r-sm) !important; min-height: 36px; border-color: var(--line-3); }
/* custom.css sets the report select's `background` shorthand, which drops
   Bootstrap's caret — put it back. */
.rpt-field .form-select {
    background-image: var(--bs-form-select-bg-img);
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.25rem;
}

/* Quick actions — a slim card of chips */
.ebp-content .qa-center {
    border: 1px solid var(--line);
    border-top: 1px solid var(--line);
    box-shadow: var(--shadow-card);
    padding: 0.75rem 1rem;
}
.qa-center-head { border-bottom: 0 !important; margin-bottom: 0.6rem; padding-bottom: 0; align-items: center; }
.qa-center-title { font-size: 0.92rem !important; color: var(--ink) !important; }
.qa-center-title i { color: #f59e0b; }
.qa-grid { display: flex !important; flex-wrap: wrap; gap: 0.5rem !important; }
.qa-tile {
    flex-direction: row !important;
    min-height: 0 !important;
    gap: 0.5rem !important;
    padding: 0.4rem 0.8rem 0.4rem 0.4rem !important;
    border-radius: var(--r-pill) !important;
    background: var(--srf-1) !important;
    border: 1px solid var(--line) !important;
    box-shadow: var(--shadow-1);
}
.qa-tile:hover { border-color: var(--a-primary-edge) !important; background: var(--a-primary-tint) !important; transform: translateY(-1px); }
.qa-tile-icon { width: 30px !important; height: 30px !important; border-radius: 50% !important; font-size: 0.88rem !important; }
.qa-tile-label { font-size: 0.76rem !important; white-space: nowrap; }

/* Quick actions as a dropdown panel off the dashboard title row */
.qa-menu {
    width: min(620px, 92vw);
    padding: 0.85rem !important;
}
.qa-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink);
}
.qa-menu-head i.bi-lightning-charge-fill { color: #f59e0b; margin-right: 0.35rem; }
.qa-menu .qa-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    max-height: min(60vh, 460px);
    overflow-y: auto;
    padding: 2px;
}
.qa-menu .qa-tile { border-radius: var(--r-md) !important; }
.qa-menu .qa-tile-label { white-space: normal; text-align: left; }

/* ============================================================
   14. DASHBOARD (db-*)
   ============================================================ */
.db { --db-gap: 1.1rem; }

.db-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.db-head h1 { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.015em; color: var(--ink); }
.db-head p  { margin: 0.1rem 0 0; font-size: 0.8rem; color: var(--ink-3); }
.db-head-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.db-row {
    display: grid;
    gap: var(--db-gap);
    margin-bottom: var(--db-gap);
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: stretch;
}
.db-row:empty { display: none; }

/* ── Gradient KPI tiles ── */
.db-kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.gtile {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 152px;
    padding: 1rem 1.1rem 0;
    border-radius: var(--r-lg);
    color: #ffffff;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 14px 26px -18px rgba(15, 23, 42, .75);
    transition: transform .18s ease, box-shadow .18s ease;
    isolation: isolate;
    container-type: inline-size;
}
a.gtile:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 18px 30px -16px rgba(15, 23, 42, .8); }

/* A faint ring of light top-right, the way the tiles in the reference glow */
.gtile::before {
    content: "";
    position: absolute;
    top: -46px;
    right: -46px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 70%);
    z-index: -1;
}

.gtile--purple { background: var(--g-purple); }
.gtile--green  { background: var(--g-green); }
.gtile--orange { background: var(--g-orange); }
.gtile--blue   { background: var(--g-blue); }
.gtile--pink   { background: var(--g-pink); }
.gtile--teal   { background: var(--g-teal); }
.gtile--red    { background: var(--g-red); }

/* Label + icon share a fixed-height row, so every value lands on the same
   line whether its label takes one line or two. */
.gtile-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 46px;
}
.gtile-label { font-size: 0.82rem; font-weight: 600; line-height: 1.25; opacity: .95; padding-top: 0.1rem; }
/* The figure scales with the tile's own width, so a seven-digit amount still
   fits a narrow tile; the currency code steps down so the digits lead. */
.gtile-value {
    margin-top: -0.35rem;
    font-size: clamp(1.1rem, 12.5cqi, 1.6rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.gtile-value .cur { font-size: 0.62em; font-weight: 700; margin-right: 0.2em; opacity: .92; letter-spacing: 0; }
.gtile-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    opacity: .95;
}
.gtile-meta .up::before   { content: "▲"; font-size: 0.6rem; margin-right: 0.2rem; }
.gtile-meta .down::before { content: "▼"; font-size: 0.6rem; margin-right: 0.2rem; }
.gtile-meta .flat         { opacity: .85; }
.gtile-ico {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .25);
    font-size: 1.35rem;
    color: #ffffff;
}
.gtile-spark {
    position: relative;
    height: 46px;
    margin: auto -1.1rem 0;
}
.gtile-spark canvas { display: block; }
.gtile-foot {
    margin-top: auto;
    padding: 0.55rem 0 0.8rem;
    font-size: 0.72rem;
    opacity: .9;
    border-top: 1px solid rgba(255, 255, 255, .18);
}

/* ── Cards ── */
.db-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--srf-1);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-card);
}
.db-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.95rem 1.15rem 0.35rem;
}
.db-card-head h2 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
}
.db-card-head h2 small { font-size: 0.74rem; font-weight: 600; color: var(--ink-3); }
.db-card-body { flex: 1 1 auto; padding: 0.7rem 1.15rem 1rem; min-width: 0; }
.db-card-body.is-flush { padding: 0.4rem 0 0.2rem; }
.db-card-foot {
    padding: 0.7rem 1.15rem;
    border-top: 1px solid var(--line-2);
    text-align: center;
}
.db-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--a-primary-ink);
    text-decoration: none;
}
.db-link:hover { color: var(--a-primary-hover); gap: 0.5rem; }
[data-bs-theme="dark"] .db-link { color: var(--c-brand-ink); }

/* Range dropdown in a card head */
.db-select {
    height: 32px;
    padding: 0 1.9rem 0 0.7rem;
    border: 1px solid var(--line-3);
    border-radius: var(--r-sm);
    background-color: var(--srf-1);
    color: var(--ink-2);
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m4 6 4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.55rem center;
    background-size: 12px;
}
.db-select:focus { outline: 0; border-color: var(--a-primary); box-shadow: 0 0 0 3px var(--c-brand-ring); }

/* Inline chart legend (Sales / Profit) */
.db-legend {
    display: flex;
    justify-content: center;
    gap: 1.1rem;
    margin-bottom: 0.4rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--ink-2);
}
.db-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.db-legend i {
    display: inline-block;
    width: 18px;
    height: 4px;
    border-radius: 4px;
}
.db-legend b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }

.db-chart { position: relative; height: 230px; }
.db-chart.is-sm { height: 210px; }

/* ── Donut + legend ── */
.db-donut-wrap {
    display: grid;
    grid-template-columns: minmax(150px, 190px) 1fr;
    align-items: center;
    gap: 1.1rem;
}
.db-donut { position: relative; aspect-ratio: 1; }
.db-donut-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
}
.db-donut-center span {
    width: 58px;
    height: 58px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: var(--srf-1);
    box-shadow: var(--shadow-2);
    font-size: 1.45rem;
    color: var(--ink-2);
}
.db-keys { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.db-key { display: grid; grid-template-columns: 12px 1fr auto; gap: 0.1rem 0.6rem; align-items: center; }
.db-key .dot { width: 11px; height: 11px; border-radius: 50%; }
.db-key .name { font-size: 0.8rem; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-key .pct  { font-size: 0.82rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.db-key .val  { grid-column: 2 / 4; font-size: 0.72rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ── Icon list rows (collection, stock summary) ── */
.db-list { display: flex; flex-direction: column; }
.db-li {
    display: grid;
    grid-template-columns: 36px 1fr auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--line-2);
}
.db-li:last-child { border-bottom: 0; }
.db-li.no-pct { grid-template-columns: 36px 1fr auto; }
.db-li .name { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-li .val  { font-size: 0.86rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.db-li .pct  { font-size: 0.78rem; font-weight: 700; color: var(--ink-3); min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }

.db-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.4rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--r-md);
    background: var(--srf-2);
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--ink);
}
.db-total strong { font-size: 1.05rem; font-weight: 800; color: var(--a-success-ink); font-variant-numeric: tabular-nums; }

/* Icon chip — one per row, tinted in its own hue */
.ichip {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    font-size: 1rem;
    flex-shrink: 0;
}
.ichip--green  { background: rgba(22, 163, 74, .12);  color: #16a34a; }
.ichip--blue   { background: rgba(37, 99, 235, .12);  color: #2563eb; }
.ichip--orange { background: rgba(234, 88, 12, .12);  color: #ea580c; }
.ichip--purple { background: rgba(124, 58, 237, .12); color: #7c3aed; }
.ichip--teal   { background: rgba(13, 148, 136, .13); color: #0d9488; }
.ichip--red    { background: rgba(220, 38, 38, .12);  color: #dc2626; }
.ichip--pink   { background: rgba(219, 39, 119, .12); color: #db2777; }
.ichip--amber  { background: rgba(217, 119, 6, .13);  color: #d97706; }
.ichip--slate  { background: rgba(100, 116, 139, .14); color: #475569; }
[data-bs-theme="dark"] .ichip--green  { color: #4ade80; }
[data-bs-theme="dark"] .ichip--blue   { color: #60a5fa; }
[data-bs-theme="dark"] .ichip--orange { color: #fb923c; }
[data-bs-theme="dark"] .ichip--purple { color: #c084fc; }
[data-bs-theme="dark"] .ichip--teal   { color: #2dd4bf; }
[data-bs-theme="dark"] .ichip--red    { color: #f87171; }
[data-bs-theme="dark"] .ichip--pink   { color: #f472b6; }
[data-bs-theme="dark"] .ichip--amber  { color: #fbbf24; }
[data-bs-theme="dark"] .ichip--slate  { color: #cbd5e1; }

/* ── Dashboard tables ── */
.db-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.8rem; }
.db-table th {
    padding: 0.6rem 0.75rem;
    background: var(--srf-2);
    color: var(--ink-2);
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
    text-align: left;
}
.db-table th:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.db-table th:last-child  { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.db-table td {
    padding: 0.62rem 0.75rem;
    border-bottom: 1px solid var(--line-2);
    color: var(--ink-2);
    vertical-align: middle;
}
.db-table tr:last-child td { border-bottom: 0; }
.db-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-table .rank { width: 1%; color: var(--ink-3); font-weight: 700; }
/* The name column takes whatever width is left and truncates, so the figure
   and status columns are never pushed off the card. */
.db-table .item { width: 100%; max-width: 0; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-table .item .sku { font-weight: 400; color: var(--ink-3); }
.db-table .strong { font-weight: 800; color: var(--ink); }
.db-table-wrap { padding: 0 1.15rem; overflow-x: auto; }

/* ── Low stock card: the one tinted card on the page ── */
.db-card--alert {
    background: linear-gradient(180deg, #fff1f2 0%, var(--srf-1) 55%);
    border-color: #fecdd3;
}
.db-card--alert .db-card-head h2 { color: #be123c; }
.db-card--alert .db-card-head h2 i { color: #e11d48; }
.db-card--alert .db-card-head h2 small { color: #be123c; opacity: .75; }
.db-card--alert .db-table th { background: rgba(254, 205, 211, .45); }
.db-card--alert .db-card-foot { border-top-color: #ffe4e6; }
[data-bs-theme="dark"] .db-card--alert {
    background: linear-gradient(180deg, rgba(225, 29, 72, .14) 0%, var(--srf-1) 55%);
    border-color: rgba(244, 63, 94, .35);
}
[data-bs-theme="dark"] .db-card--alert .db-card-head h2,
[data-bs-theme="dark"] .db-card--alert .db-card-head h2 small { color: #fda4af; }
[data-bs-theme="dark"] .db-card--alert .db-table th { background: rgba(244, 63, 94, .14); }
[data-bs-theme="dark"] .db-card--alert .db-card-foot { border-top-color: rgba(244, 63, 94, .2); }

/* ── Recent transactions feed ── */
.db-feed { display: flex; flex-direction: column; }
.db-feed-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 1.15rem;
    border-bottom: 1px solid var(--line-2);
    color: inherit;
    text-decoration: none;
}
.db-feed-row:last-child { border-bottom: 0; }
a.db-feed-row:hover { background: var(--srf-hover); color: inherit; }
.db-feed-row .ichip { width: 34px; height: 34px; border-radius: 9px; font-size: 0.92rem; }
.db-feed-row .ref { font-size: 0.78rem; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-feed-row .party { font-size: 0.72rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-feed-row .amt { font-size: 0.8rem; font-weight: 800; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-feed-row .time { font-size: 0.68rem; color: var(--ink-3); text-align: right; white-space: nowrap; }

/* ── Branch bars ── */
.db-bars { display: flex; flex-direction: column; gap: 0.8rem; padding-top: 0.3rem; }
.db-bar { display: grid; grid-template-columns: minmax(80px, 110px) 1fr; align-items: center; gap: 0.75rem; }
.db-bar .name { font-size: 0.78rem; font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-bar .track { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }
.db-bar .fill {
    height: 18px;
    border-radius: 5px;
    min-width: 4px;
    transition: width .5s ease;
}
.db-bar .v { font-size: 0.76rem; font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── Empty states ── */
.db-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-height: 170px;
    padding: 1rem;
    text-align: center;
    color: var(--ink-3);
}
.db-empty i {
    width: 52px;
    height: 52px;
    display: inline-grid;
    place-items: center;
    margin-bottom: 0.3rem;
    border-radius: 50%;
    background: var(--srf-2);
    font-size: 1.35rem;
    color: var(--ink-4);
}
.db-empty .t { font-size: 0.84rem; font-weight: 700; color: var(--ink-2); }
.db-empty .s { font-size: 0.74rem; max-width: 260px; }

/* ── Workspace launcher (phone default) ──
   Module tiles: white cards with a gradient icon in the module's identity
   hue. POS is the one filled tile — it is the business's main action. */
.ws { margin-bottom: var(--db-gap); }

.ws-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: var(--db-gap);
}

.ws-tone-green  { --ws-grad: var(--g-green);  --ws-glow: rgba(22, 163, 74, .45);  --ws-edge: #86efac; }
.ws-tone-blue   { --ws-grad: var(--g-blue);   --ws-glow: rgba(37, 99, 235, .45);  --ws-edge: #93c5fd; }
.ws-tone-purple { --ws-grad: var(--g-purple); --ws-glow: rgba(99, 76, 244, .45);  --ws-edge: #c4b5fd; }
.ws-tone-orange { --ws-grad: var(--g-orange); --ws-glow: rgba(245, 114, 0, .45);  --ws-edge: #fdba74; }
.ws-tone-pink   { --ws-grad: var(--g-pink);   --ws-glow: rgba(224, 20, 95, .42);  --ws-edge: #f9a8d4; }
.ws-tone-teal   { --ws-grad: var(--g-teal);   --ws-glow: rgba(10, 159, 168, .45); --ws-edge: #5eead4; }
.ws-tone-indigo { --ws-grad: var(--g-indigo); --ws-glow: rgba(67, 56, 202, .45);  --ws-edge: #a5b4fc; }

.ws-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    min-width: 0;
    min-height: 150px;
    padding: 1.05rem 1.1rem 1rem;
    border-radius: var(--r-lg);
    background: var(--srf-1);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
    color: var(--ink);
    text-decoration: none;
    overflow: hidden;
    isolation: isolate;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
/* A wash of the module's hue rises from the corner on hover */
.ws-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--ws-grad);
    opacity: 0;
    z-index: -1;
    transition: opacity .18s ease;
    -webkit-mask-image: radial-gradient(130% 100% at 100% 0%, #000 0%, transparent 55%);
            mask-image: radial-gradient(130% 100% at 100% 0%, #000 0%, transparent 55%);
}
.ws-tile:hover,
.ws-tile:focus-visible {
    color: var(--ink);
    transform: translateY(-3px);
    border-color: var(--ws-edge);
    box-shadow: 0 18px 32px -20px var(--ws-glow), var(--shadow-1);
}
.ws-tile:hover::before,
.ws-tile:focus-visible::before { opacity: .09; }
.ws-tile:focus-visible { outline: 2px solid var(--a-primary); outline-offset: 2px; }
.ws-tile:active { transform: translateY(-1px); }

.ws-tile-ico {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 13px;
    background: var(--ws-grad);
    color: #ffffff;
    font-size: 1.25rem;
    box-shadow: 0 10px 18px -10px var(--ws-glow), inset 0 1px 0 rgba(255, 255, 255, .25);
    transition: transform .18s ease;
}
.ws-tile:hover .ws-tile-ico { transform: scale(1.06) rotate(-4deg); }

.ws-tile-copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    margin-top: auto;
    padding-right: 2.4rem;
}
.ws-tile-copy strong {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ws-tile-copy small { font-size: 0.74rem; line-height: 1.35; color: var(--ink-3); }

.ws-tile-go {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: var(--srf-2);
    color: var(--ink-3);
    font-size: 0.9rem;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}
.ws-tile:hover .ws-tile-go,
.ws-tile:focus-visible .ws-tile-go {
    background: var(--ws-grad);
    color: #ffffff;
    transform: translateX(2px);
}

/* Featured (POS): the one filled tile, twice as wide */
.ws-tile.is-featured {
    grid-column: span 2;
    background: var(--ws-grad);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 16px 30px -18px var(--ws-glow);
}
.ws-tile.is-featured::before {
    background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 60%);
    opacity: 1;
    -webkit-mask-image: none;
            mask-image: none;
}
.ws-tile.is-featured:hover,
.ws-tile.is-featured:focus-visible {
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 22px 36px -18px var(--ws-glow);
}
.ws-tile.is-featured .ws-tile-ico {
    background: rgba(255, 255, 255, .2);
    border: 1px solid rgba(255, 255, 255, .3);
    box-shadow: none;
}
.ws-tile.is-featured .ws-tile-copy strong { font-size: 1.15rem; color: #ffffff; }
.ws-tile.is-featured .ws-tile-copy small  { color: rgba(255, 255, 255, .88); font-size: 0.78rem; }
.ws-tile.is-featured .ws-tile-go {
    width: auto;
    height: 36px;
    padding: 0 0.95rem;
    gap: 0.4rem;
    display: inline-flex;
    align-items: center;
    border-radius: var(--r-pill);
    background: #ffffff;
    color: #15803d;
    font-weight: 700;
    font-size: 0.78rem;
}
.ws-tile.is-featured .ws-tile-go::before { content: "Start selling"; }
.ws-tile.is-featured:hover .ws-tile-go { background: #ffffff; color: #15803d; }
.ws-tile.is-featured .ws-tile-copy { padding-right: 9rem; }
/* Oversized watermark of the module's glyph */
.ws-tile-mark {
    position: absolute;
    right: -0.4rem;
    top: -1.4rem;
    font-size: 7.5rem;
    line-height: 1;
    color: rgba(255, 255, 255, .12);
    z-index: -1;
    pointer-events: none;
    transform: rotate(-8deg);
    transition: transform .3s ease;
}
.ws-tile.is-featured:hover .ws-tile-mark { transform: rotate(-4deg) scale(1.05); }

[data-bs-theme="dark"] .ws-tile:hover::before,
[data-bs-theme="dark"] .ws-tile:focus-visible::before { opacity: .16; }

@media (max-width: 767.98px) {
    .ws-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
    .ws-tile { min-height: 132px; padding: 0.9rem 0.9rem 0.85rem; gap: 0.7rem; }
    .ws-tile-ico { width: 40px; height: 40px; font-size: 1.1rem; border-radius: 11px; }
    .ws-tile-copy { padding-right: 0; }
    .ws-tile-copy strong { font-size: 0.86rem; }
    .ws-tile-copy small { font-size: 0.7rem; }
    .ws-tile-go { display: none; }
    .ws-tile.is-featured .ws-tile-go { display: inline-flex; right: 0.9rem; bottom: 0.9rem; height: 32px; }
    .ws-tile.is-featured .ws-tile-copy { padding-right: 8.5rem; }
    .ws-tile.is-featured .ws-tile-copy strong { font-size: 1.02rem; }
}

@media (max-width: 420px) {
    .ws-tile.is-featured .ws-tile-go::before { content: "Start"; }
    .ws-tile.is-featured .ws-tile-copy { padding-right: 5.5rem; }
}

/* Mode switch: Workspace / Overview */
.db.is-workspace .db-analytics { display: none !important; }
.db .dash-workspace-launcher { display: none; }
.db.is-workspace .dash-workspace-launcher { display: block; }

/* ============================================================
   15. RESPONSIVE
   ============================================================ */
@media (max-width: 1399.98px) {
    .tb-date { display: none; }
}

@media (max-width: 1199.98px) {
    .tb-user-text { display: none; }
    .tb-user .bi-chevron-down { display: none; }
}

@media (max-width: 991.98px) {
    .ebp-topbar { padding: 0 0.75rem; gap: 0.5rem; }
    .ebp-topbar .topbar-brand { display: none; }
    .tb-search { flex: 1 1 auto; }
}

@media (max-width: 767.98px) {
    .ebp-content { padding: 1rem 0.9rem 1.5rem; }
    .tb-search-toggle { display: inline-grid; }
    .tb-search {
        display: none;
        position: absolute;
        left: 0.6rem;
        right: 0.6rem;
        top: calc(var(--ebp-topbar-height) - 52px);
        z-index: 1050;
    }
    .ebp-topbar.search-open .tb-search { display: block; }
    .tb-search-box kbd { display: none; }
    .tb-pos span { display: none; }
    .tb-pos { padding: 0 0.75rem; }
    .tb-branch-label, .tb-branch .bi-chevron-down { display: none; }
    .tb-branch { padding: 0 0.7rem; }
    .ebp-topbar .theme-toggle { display: none; }
    .tb-fullscreen { display: none; }
    /* Settings is also in the account menu, so it gives way first. */
    .tb-settings { display: none; }
    .ebp-topbar .topbar-actions { gap: 0.25rem; }
    .tb-user { padding: 0 0.2rem; margin-left: 0; }

    .db-row { grid-template-columns: 1fr; }
    .db-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
    .gtile { min-height: 132px; padding: 0.85rem 0.9rem 0; }
    .gtile-ico { width: 36px; height: 36px; font-size: 1.05rem; border-radius: 10px; }
    .gtile-spark { margin: auto -0.9rem 0; height: 38px; }
    .db-donut-wrap { grid-template-columns: 1fr; justify-items: center; }
    .db-donut { width: 190px; }
    .db-keys { width: 100%; }
    .page-header h1, .ebp-content .page-header h1 { font-size: 1.15rem; }
}

@media (max-width: 420px) {
    .db-kpis { grid-template-columns: 1fr; }
}

@media print {
    .ebp-topbar, .ebp-sidebar, .ebp-crumbs { display: none !important; }
    .gtile { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) {
    .gtile, .db-bar .fill, .qa-tile, .ebp-content .stat-card,
    .ws-tile, .ws-tile-ico, .ws-tile-go, .ws-tile-mark { transition: none !important; transform: none !important; }
}
