/* ================================================================
   Biashara Sauti - the shop app's stylesheet (mybiz/, the Android app)
   Colours, sizes and curves come from tokens.css, loaded just before
   this file. One layer: each component is defined once, in its section
   below, with its phone/desktop rules right after it.

   Phones are the main, tuned experience. Breakpoints: up to 1023px is
   the phone/tablet layout with the bottom nav; from 1024px the bottom
   nav becomes the sidebar. Hover effects only exist for a real mouse
   (hover: hover and pointer: fine), so a tap never leaves a tile stuck
   in its hover state.
   ================================================================ */

/* ================================================================
   Base: page, text, links, fields
   Phones are the default; wider screens add rules in media queries right after
   each component. Nothing may poke out of its card: fields never grow wider than
   their box (phones give date pickers a built-in minimum width). Hover effects
   sit behind (hover: hover) and (pointer: fine) - on a phone a tap fakes :hover
   and it stays stuck. Press feedback uses :active.
   ================================================================ */
* { box-sizing: border-box; }
/* Font size preference (Mipangilio > Ukubwa wa Maandishi) - the whole
   stylesheet is written in fixed px, so "zoom" (not a text-only rule) is what actually
   scales everything consistently, including fixed-position bars/modals. Kati (medium,
   no attribute) is the existing default and stays untouched. */
body[data-font-size="small"] { zoom: 0.88; }
body[data-font-size="large"] { zoom: 1.18; }
a { color: inherit; text-decoration: none; }
input[type=text], input[type=number], input[type=password], input[type=tel], textarea, select {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    background: var(--input-bg);
    color: var(--input-text);
}
input[type=date] { padding: 14px; font-size: 16px; background: var(--input-bg); color: var(--input-text); }
input:focus, textarea:focus, select:focus { outline: none; }
.icon-lg { font-size: 34px; line-height: 1; }
.icon-hero { font-size: 40px; line-height: 1; }
.h2-tight { margin: 8px 0 2px; }
button, input, select, textarea { font-family: inherit; }
input[type=text],
input[type=number],
input[type=password],
input[type=tel],
input[type=date],
input[type=email],
textarea,
select {
    transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
/* Fields already show a green ring on focus - no second (old blue) outline on top. */
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 2px; outline: none; }
input, select, textarea { max-width: 100%; min-width: 0; }
input[type=date]::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type=date]::-webkit-calendar-picker-indicator { margin-left: auto; cursor: pointer; }
label {
    display: block;
    font-size: 13px;
    margin: 12px 0 6px;
    color: var(--ink);
    font-weight: 500;
}
textarea { resize: vertical; min-height: 80px; border-radius: var(--r-lg); border: 1px solid var(--line); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
.ui-ico { flex-shrink: 0; }
.pw-field { position: relative; }
.pw-field > input[type] { padding-right: 52px; }
.pw-field > .pw-eye { position: absolute; top: 50%; right: 3px; transform: translateY(-50%); }
.pw-eye[data-shown="true"] .pw-eye-hide { display: block; }
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;   /* no font inflation in landscape */
    overscroll-behavior: none;   /* no pull-to-refresh: one stray pull on the till reloads the page and empties the cart */
}
/* viewport-fit=cover (page heads) lets the page run under the notch and the home bar; these pad it back.
   Bottom: .bottom-nav, .app-shell and the sheets already add env(safe-area-inset-bottom). */
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    -webkit-tap-highlight-color: transparent;
    font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}
/* Taps fire at once (no wait to see if it is a double-tap zoom). Pinch zoom still works. */
a,
button,
[role="button"],
[onclick],
label,
summary,
select,
input[type=checkbox],
input[type=radio],
input[type=submit],
.product-tile,
.settings-row {
    touch-action: manipulation;
}
/* Keyboard focus: one ring for everything you can tab to. :where() keeps it at zero
   specificity, so fields (which show a soft ring of their own) and list rows can still override it. */
:where(a, button, summary, [tabindex], [role="button"]):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Switching light/dark: every transition is paused for a frame (header.php adds the class),
   so cards, text and the page change colour together instead of one after the other. */
.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
    /* Reduced motion, in one place: nothing moves, slides or bounces. Fades and colour changes
       stay, because they carry meaning (something appeared, something is selected) without movement. */
    *, *::before, *::after {
        animation-duration: 1ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-property: opacity, color, background-color, border-color, box-shadow, visibility !important;
        scroll-behavior: auto !important;
    }
}

/* ================================================================
   App shell: page frame, top bar, sidebar, bottom nav
   Phones and the app: the logo in the top bar with Settings and the bell on the
   right, and a floating round bottom bar with the POS button raised in a notch
   in the middle. From 1024px the bottom bar becomes the left sidebar (it can
   collapse to an icon rail) and the top bar shows the page title.
   ================================================================ */
.app-shell {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    padding-bottom: 90px;   /* room for bottom nav */
}
.topbar {
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.biz-monogram {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.topbar .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.topbar .avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    border: none;
    cursor: pointer;
}
.topbar .user-menu { position: relative; }
.topbar .user-menu .dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--card);
    min-width: 200px;
    z-index: 30;
    padding: 8px;
}
.topbar .user-menu .dropdown .user-name {
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    margin-bottom: 6px;
}
.topbar .user-menu .dropdown-section-label {
    padding: 4px 10px 2px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}
.topbar .user-menu .dropdown-current {
    display: block;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
}
.topbar .user-menu .dropdown-divider { border-top: 1px solid var(--line); margin: 6px 2px; }
.topbar .branch-menu .dropdown { min-width: 220px; }
.topbar .branch-menu .dropdown-current { color: var(--ink); }
.settings-btn { font-size: 18px; }
.page { padding: 16px; flex: 1; }
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    background: var(--card);
    border-top: 1px solid var(--line);
    display: flex;
    z-index: 20;
}
/* Business name header inside the sidebar - desktop-only (see the >=1024px section),
   a plain horizontal tab bar has no room or need for it. */
.sidebar-brand { display: none; }
.bottom-nav a { flex: 1; text-align: center; position: relative; transition: color var(--dur-fast) ease; }
.bottom-nav a .ico { font-size: 20px; }
.bottom-nav a.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: var(--blue);
    display: none;
}
/* Owner has 6 tabs - keep exactly 5 comfortably visible and let the rest peek/scroll,
   instead of squeezing every icon down to fit. */
.bottom-nav.bottom-nav-scroll { overflow-x: auto; scroll-behavior: smooth; -ms-overflow-style: none; scrollbar-width: none; }
.bottom-nav.bottom-nav-scroll::-webkit-scrollbar { display: none; }
.bottom-nav.bottom-nav-scroll a { flex: 0 0 20%; min-width: 20%; }
/* Headings, titles and the brand use the same standard UI font as body text, set
   bold and in full ink so the important sections stand out from the content. */
.topbar h1,
.dash-greeting,
.section-title,
.sauti-title,
.sidebar-brand-name,
.info-modal-title,
.guide-intro h2,
.h2-tight {
    font-family: inherit;
}
.topbar-left > div:last-child { min-width: 0; }
.topbar h1 {
    margin: 0;
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.topbar .user-menu .dropdown a {
    padding: 10px;
    border-radius: var(--r-sm);
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.topbar .user-menu .dropdown a.dropdown-logout { color: var(--red); }
.bottom-nav a.active .ico { transform: none; background: var(--brand-soft); }
.topbar-logo img { width: 72%; height: 72%; object-fit: contain; display: block; }
.settings-btn:active,
.notif-bell:active,
.theme-btn:active,
.icon-btn:active,
.qty-box .qty-btn:active:not(:disabled),
.cart-remove-btn:active {
    scale: .92;
}
.bottom-nav a:not(.nav-pos):active .ico { scale: .92; }
@media (max-width: 1023px) {
    .desktop-only, .bottom-nav a.nav-desktop { display: none !important; }
    body[data-theme="dark"] .bottom-nav { filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .55)); }
    /* The bar itself, with the notch the POS button sits in. */
    .bottom-nav::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        border-radius: inherit;
        background: var(--card);
        -webkit-mask: radial-gradient(circle at 50% 2px, transparent 35px, #000 36px);
        mask: radial-gradient(circle at 50% 2px, transparent 35px, #000 36px);
    }
    /* Room for the chip: the logo stays, its words go (the chip names the branch). */
    .topbar.has-branch-chip .topbar-brand-text { display: none; }
    .bottom-nav.no-pos::before { -webkit-mask: none; mask: none; }
    .page:has(> .db-top), .page:has(> .sauti) { padding-bottom: 0; }
}
@media (max-width: 899px) {
    .app-shell:has(> .page > .db-top) { min-height: 100vh; min-height: 100dvh; }
    .page:has(> .db-top) { display: flex; flex-direction: column; }
    /* Spare height goes to the action cards and the Sauti card, half each. */
    .page > .db-top:has(> .db-qa) { flex: 1 0 auto; display: flex; flex-direction: column; }
    .page > .db-top > .db-qa { flex: 1 0 auto; }
    .page > .sauti { flex: 1 0 auto; display: flex; flex-direction: column; }
    .page > .sauti > .sauti-track { flex: 1 0 auto; }
}
@media (max-width: 420px) { .topbar-left > .biz-monogram { display: none; } }
@media (min-width: 640px) {
    .app-shell { max-width: 640px; box-shadow: var(--shadow-lift); }
    .bottom-nav { max-width: 640px; }
}
@media (min-width: 768px) {
    .app-shell { max-width: 760px; }
    .bottom-nav { max-width: 760px; }
}
@media (min-width: 1024px) {
    .app-shell:has(> .bottom-nav) {
        max-width: none;
        width: auto;
        margin: 0 0 0 220px;
        box-shadow: none;
        padding-bottom: 0;
    }
    .app-shell:has(> .bottom-nav) > .page { width: 100%; max-width: 1200px; margin: 0 auto; padding: 28px 32px 48px; }
    /* The topbar's own monogram is redundant now that the sidebar has the business
       name in its own header - the topbar is left with just the page title. */
    .app-shell:has(> .bottom-nav) > .topbar .biz-monogram { display: none; }
    .bottom-nav.bottom-nav-scroll a {
        flex: none;
        min-width: 0;
        width: auto;
        display: flex;
        align-items: center;
        text-align: left;
        transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
    }
}
.bottom-nav a .ico {
    display: block;
    width: 46px;
    height: 30px;
    padding: 4px 12px;
    box-sizing: border-box;
    border-radius: var(--r-pill);
    margin: 0;
}
@media (max-width: 420px) {
    /* Large text (Settings > Ukubwa wa Maandishi) zooms everything: drop the shortcut so the title
       still fits - the same Light/Dark switch is in Settings > Mwonekano. */
    body[data-font-size="large"] .theme-btn { display: none; }
}
@media (min-width: 1024px) {
    .bottom-nav a .ico { font-size: 19px; }
    .bottom-nav a.active::before {
        top: 8px;
        bottom: 8px;
        left: 0;
        width: 3px;
        height: auto;
        transform: none;
        border-radius: 0 4px 4px 0;
    }
    .sidebar-brand-text { min-width: 0; }
    .sidebar-brand .biz-monogram {
        flex-shrink: 0;
        width: 40px;
        height: 40px;
        background: var(--solid);
        color: var(--on-solid);
    }
    .bottom-nav, .app-shell:has(> .bottom-nav), .floating-cart-bar {
        transition: width var(--dur-base) var(--ease-in-out), max-width var(--dur-base) var(--ease-in-out), margin-left var(--dur-base) var(--ease-in-out), left var(--dur-base) var(--ease-in-out);
    }
    .sidebar-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
    body.sidebar-collapsed .app-shell:has(> .bottom-nav) { margin-left: 76px; }
    body.sidebar-collapsed .sidebar-brand-text, body.sidebar-collapsed .bottom-nav .nav-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
    body.sidebar-collapsed .bottom-nav a::after, body.sidebar-collapsed .sidebar-toggle::after {
        content: attr(data-label);
        position: absolute;
        left: calc(100% + 12px);
        top: 50%;
        transform: translateY(-50%);
        padding: 6px 10px;
        border-radius: var(--r-sm);
        background: #1a1a1c;
        color: #fff;
        font-size: 12.5px;
        font-weight: 500;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--dur-fast) var(--ease-out);
        z-index: 60;
    }
    body.sidebar-collapsed .bottom-nav a:focus-visible::after, body.sidebar-collapsed .sidebar-toggle:focus-visible::after { opacity: 1; }
}
@media (min-width: 1024px) { @media (hover: hover) and (pointer: fine) {
    body.sidebar-collapsed .bottom-nav a:hover::after, body.sidebar-collapsed .sidebar-toggle:hover::after { opacity: 1; }
} }
@media (min-width: 1024px) {
    .mobile-only { display: none !important; }
    /* Slimmer top bar, and the sidebar's header the same height so the two still line up. */
    .app-shell:has(> .bottom-nav) > .topbar { box-sizing: border-box; padding: 10px 32px; min-height: 64px; }
    .topbar h1 { font-size: 17px; }
}
.bottom-nav a .ico { transition: background var(--dur-fast) ease, color var(--dur-fast) ease, scale var(--dur-press) var(--ease-out); }
@media (max-width: 1023px) {
    .topbar:not(.is-home) .topbar-brand { display: none; }
    .topbar:not(.is-home) .topbar-title { display: block; min-width: 0; }
    .topbar:not(.is-home) h1 { font-size: 19px; line-height: 1.2; }
    .topbar:not(.is-home) .sub { display: none; }
}

/* ================================================================
   Menus: user menu, branch switcher, notifications
   The user menu and the bell open under their button. The branch chip opens a
   dropdown on wide screens and a bottom sheet on phones (includes/branch_switcher.php,
   openBranchSwitcher() in footer.php).
   ================================================================ */
/* The branch menu (a business with branches): a chip with the branch's name, on every screen size. */
.branch-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.branch-btn-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-menu { position: relative; }
.notif-bell { position: relative; font-size: 18px; }
.notif-badge {
    position: absolute;
    padding: 0 4px;
    border-radius: var(--r-pill);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.notif-menu .notif-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow);
    width: 300px;
    max-width: 82vw;
    max-height: 70vh;
    max-height: 70dvh;
    overflow-y: auto;
    padding: 10px;
    z-index: 30;
}
.notif-section { margin-bottom: 10px; }
.notif-section:last-child { margin-bottom: 0; }
.notif-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    margin-bottom: 6px;
}
.notif-item { padding: 8px 6px; border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: none; }
.notif-text { font-size: 13px; font-weight: 600; color: var(--ink); }
.notif-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.notif-done-btn {
    margin-top: 6px;
    border: 1px solid var(--line);
    background: var(--button-outline-bg);
    color: var(--button-outline-text);
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
}
.notif-empty { text-align: center; font-size: 13px; padding: 16px 6px; }
.branch-sheet a.branch-row:focus-visible { background: var(--surface); }
.notif-notice .notif-text { display: flex; align-items: flex-start; gap: 6px; }
/* Lists and sheets that scroll on their own: reaching the end must not scroll the page behind. */
.notif-menu .notif-dropdown, .sale-confirm-body, .customer-results, #cartCard, .bottom-nav { overscroll-behavior: contain; }
@media (hover: hover) and (pointer: fine) { .branch-sheet a.branch-row:hover { background: var(--surface); } }
@media (max-width: 420px) { .branch-btn-name { max-width: 110px; } }
@media (max-width: 360px) { .branch-btn-name { max-width: 84px; } }
/* (App shell, continued: these must come after the rules above) */
/* Menus (user, branch, bell) grow out of their button instead of popping in: from 96% and
   transparent, 150ms; closing is quicker (100ms) because by then the eye has moved on.
   A closed menu stays in the page, invisible, so it can animate out. */
.topbar .user-menu .dropdown, .notif-menu .notif-dropdown {
    display: block;
    visibility: hidden;
    opacity: 0;
    transform: scale(.96);
    transform-origin: top right;
    transition: opacity 100ms var(--ease-out), transform 100ms var(--ease-out), visibility 0s linear 100ms;
}
.topbar .user-menu.open .dropdown, .notif-menu.open .notif-dropdown {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
@media (max-width: 639px) {
    .topbar .notif-menu { position: static; }
    .notif-menu .notif-dropdown {
        left: 10px;
        right: 10px;
        top: calc(100% + 6px);
        width: auto;
        max-width: none;
        max-height: min(70dvh, 560px);
        transform-origin: calc(100% - 56px) 0;
    }
}

/* ================================================================
   Building blocks: cards, buttons, tabs, stats, alerts, badges
   Cards, pill buttons (purple for the main action), page tabs as one segmented
   control, stat tiles (statCard(): the figure's colour means money in or out,
   the accent never does), alerts and badges.
   ================================================================ */
.card { background: var(--card); padding: 16px; margin-bottom: 14px; overflow-wrap: anywhere; }
.card-compact { padding: 12px 16px; }
.tabs-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.tabs-bar::-webkit-scrollbar { display: none; }
.tabs-bar > a, .tabs-bar > button { flex: 1 1 0; white-space: nowrap; }
.report-export { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.filter-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; align-items: end; }
.stat {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px 8px;
}
.stat.green { background: var(--green-bg); }
.stat .label { font-size: 12px; margin-bottom: 6px; padding-right: 36px; min-height: 28px; }
.stat .info-icon { margin-left: 0; flex-shrink: 0; }
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: scale var(--dur-press) var(--ease-out), background var(--dur-fast) ease, border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.btn:active { scale: .97; }
.btn-red { background: var(--red); color: #fff; }
.btn-block { margin-bottom: 10px; }
.btn-sm { padding: 10px 14px; font-size: 14px; width: auto; }
.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: none; }
.list-row .name { font-weight: 700; font-size: 14px; }
.list-row .meta { font-size: 12px; color: var(--muted); }
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    font-size: 11px;
    font-weight: 700;
}
.product-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.product-table { width: 100%; border-collapse: collapse; background: var(--card); }
.product-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    vertical-align: middle;
    white-space: nowrap;
}
.product-table th {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    white-space: nowrap;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
}
.product-table tr:last-child td { border-bottom: none; }
.product-table td.product-table-name { white-space: normal; font-weight: 600; }
.product-table td.product-table-num { color: var(--muted); font-weight: 600; font-size: 12px; width: 28px; }
.product-table tbody tr:nth-child(even) { background: rgba(0,0,0,0.025); }
body[data-theme="dark"] .product-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.03); }
.product-table tfoot td { border-top: 2px solid var(--line); border-bottom: none; background: var(--green-bg); color: var(--green-dark); }
.alert { padding: 12px 14px; font-size: 13px; margin-bottom: 14px; }
.period-bar::-webkit-scrollbar { display: none; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.section-title { margin: 18px 0 8px; }
.section-title-row .section-title { margin: 0; }
.day-header .day-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.day-header .day-total { font-size: 13px; font-weight: 700; color: var(--red-dark); }
.record-table th.num, .record-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Right-aligned money columns in product tables. */
.product-table th.num, .product-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Report toolbar: period segmented control + date range + (Performance) filters,
   all in one card so the controls read as a single unit. */
.card.rf-bar {
    padding: 10px;
    max-width: none !important;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}
.btn .ui-ico { flex-shrink: 0; }
.btn:disabled, .btn[disabled] { opacity: .55; box-shadow: none; cursor: not-allowed; }
.stat-body { flex: 1; min-width: 0; width: 100%; }
.stat.neutral { color: var(--ink); }
.stat.neutral .stat-ico { background: var(--surface); color: var(--muted); }
.stat.red { background: var(--red-bg); color: var(--red); }
.stat.blue { background: var(--blue-bg); color: var(--blue-dark); }
.stat.warn { background: var(--warn-bg); color: var(--warn-dark); }
.card table { overflow-wrap: normal; }
.tabs-bar > a.btn, .tabs-bar > button.btn {
    flex: 1 1 0;
    min-width: 0;
    white-space: normal;
    line-height: 1.2;
    text-align: center;
    overflow-wrap: normal;
}
.card.ex-filter-card { padding: 12px; max-width: none !important; }
.card.ex-chart { padding: 18px; }
.btn:focus-visible,
.tabs-bar > .btn:focus-visible,
.product-tile:focus-visible,
.bottom-nav a:focus-visible,
.settings-btn:focus-visible,
.notif-bell:focus-visible,
.theme-btn:focus-visible,
.topbar .avatar:focus-visible,
.ex-bar:focus-visible,
.ex-del:focus-visible,
.lg-lang a:focus-visible,
.lg-submit:focus-visible,
.lg-eye:focus-visible,
.lg-label-row a:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}
/* Scrolling chip and tab bars: an edge fades out while there is more to scroll that way (the
   footer script sets the classes), and a chip scrolled to never ends up under the fade. */
.tabs-bar, .period-bar, .rf-periods { scroll-padding-inline: 28px; }
/* Empty states: "nothing here yet" looks the same on every page - an empty tray in a soft circle
   over the message, with room around it. (Pages write it as <div class="card center muted">, or
   <div class="empty-state"> for an empty list inside a card.) */
.card.center.muted, .empty-state { padding: 28px 20px; font-size: 14px; line-height: 1.5; }
.empty-state { text-align: center; color: var(--muted); }   /* the same, for an empty list inside a card */
.card.center.muted::before, .empty-state::before {
    content: "";
    display: block;
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%238a8f98' stroke-linecap='round' stroke-width='1.5'%3E%3Cpath d='M2 12C2 7.28595 2 4.92893 3.46447 3.46447C4.92893 2 7.28595 2 12 2C16.714 2 19.0711 2 20.5355 3.46447C22 4.92893 22 7.28595 22 12C22 16.714 22 19.0711 20.5355 20.5355C19.0711 22 16.714 22 12 22C7.28595 22 4.92893 22 3.46447 20.5355C2 19.0711 2 16.714 2 12Z'/%3E%3Cpath d='M2 13H5.16026C6.06543 13 6.51802 13 6.91584 13.183C7.31367 13.3659 7.60821 13.7096 8.19729 14.3968L8.80271 15.1032C9.39179 15.7904 9.68633 16.1341 10.0842 16.317C10.482 16.5 10.9346 16.5 11.8397 16.5H12.1603C13.0654 16.5 13.518 16.5 13.9158 16.317C14.3137 16.1341 14.6082 15.7904 15.1973 15.1032L15.8027 14.3968C16.3918 13.7096 16.6863 13.3659 17.0842 13.183C17.482 13 17.9346 13 18.8397 13H22'/%3E%3C/g%3E%3C/svg%3E") center / 22px no-repeat;
}
.scroll-fade-start {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 28px);
    mask-image: linear-gradient(to right, transparent, #000 28px);
}
.scroll-fade-end {
    -webkit-mask-image: linear-gradient(to left, transparent, #000 28px);
    mask-image: linear-gradient(to left, transparent, #000 28px);
}
.scroll-fade-start.scroll-fade-end {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent);
}
/* (Base, continued: these must come after the rules above) */
/* the login style (.lg-eye) keeps its own colours */
.pw-eye:focus-visible { outline: 3px solid var(--gold, #c99a2e); outline-offset: 2px; }
/* (Building blocks, continued: these must come after the rules above) */
/* Search fields: a real magnifier instead of an emoji in the placeholder */
input.search-field {
    padding-left: 44px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%235f6168' stroke-linecap='round' stroke-width='1.5'%3E%3Ccircle cx='11.5' cy='11.5' r='9.5'/%3E%3Cpath d='M18.2173 18.2178L21.9999 22.0004'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 16px center;
}
body[data-theme="dark"] input.search-field {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%239ba1ab' stroke-linecap='round' stroke-width='1.5'%3E%3Ccircle cx='11.5' cy='11.5' r='9.5'/%3E%3Cpath d='M18.2173 18.2178L21.9999 22.0004'/%3E%3C/g%3E%3C/svg%3E");
}
.product-table tr:target td { background: var(--warn-bg); transition: background-color .6s ease; }
@media (hover: hover) and (pointer: fine) {
    .product-table tbody tr { transition: background var(--dur-fast) ease; }
    .product-table tbody tr:hover { background: var(--line); }
    .btn-red:hover { background: var(--red-dark); color: #fff; }
    .tabs-bar > .btn-outline:hover { border: 0; }
}
@media (max-width: 480px) { .tabs-bar > .btn .ui-ico { display: none; } }
/* (App shell, continued: these must come after the rules above) */
/* Theme button shows the theme you would switch TO: a moon in light mode, a sun in dark mode. */
.theme-btn .icon-sun, .theme-btn[aria-pressed="true"] .icon-moon { display: none; }
.theme-btn[aria-pressed="true"] .icon-sun { display: block; }
/* (Building blocks, continued: these must come after the rules above) */
@media (max-width: 360px) { .stat-ico .ui-ico { width: 15px; height: 15px; } }
/* (App shell, continued: these must come after the rules above) */
@media (min-width: 1024px) { .sidebar-toggle .ico { width: 20px; height: 20px; } }
/* (Building blocks, continued: these must come after the rules above) */
@media (max-width: 360px) { .stat .label { padding-right: 30px; min-height: 24px; } }
@media (min-width: 768px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) {
    .stat-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
    /* A single text/number field stretched across a 1200px-wide card reads as
       unfinished, not spacious - cap individual fields to a natural typing width.
       Grids/tables are unaffected since this only ever narrows, never widens. */
    .card input[type=text],
    .card input[type=number],
    .card input[type=password],
    .card input[type=tel],
    .card input[type=date],
    .card select {
        max-width: 480px;
    }
    /* A one-column data-entry form (Ongeza Bidhaa, Ongeza Mfanyakazi, Kikapu, ...) is a
       single narrow column of fields - stretching its card to the full page width just
       leaves a wide empty box around it. Cap the card itself so it reads as a proper form,
       not a data table. Filter bars are excluded - those want the width for their grid of
       side-by-side fields. Scoped to `> form` (direct child) so it never touches a card
       that merely contains a small nested form, like a single-button "Got it" row. */
    .card:has(> form:not(.filter-panel)) { max-width: 560px; }
    .card .bs-select { max-width: 480px; }
}

/* ================================================================
   Help: info icon, tooltip, modal, logout confirm
   infoIcon(): tap the "i" for a plain-language note (a sheet on phones), or
   hover it with a mouse for a bubble. The logout confirm reuses the modal.
   ================================================================ */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(0,0,0,0.14);
    color: inherit;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 11px;
    font-weight: 600;
    font-style: italic;
    text-transform: lowercase;
    margin-left: 5px;
    cursor: pointer;
    vertical-align: middle;
    line-height: 1;
    flex-shrink: 0;
}
body[data-theme="dark"] .info-icon { background: rgba(255,255,255,0.2); }
.info-icon:focus-visible { background: var(--blue); color: #fff; outline: none; }
/* Hover bubble for the "i" (mouse/trackpad only - touch keeps the tap popup) */
.info-tip {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    max-width: 300px;
    width: max-content;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    background: #0f172a;
    color: #f8fafc;
    box-shadow: 0 10px 28px rgba(2, 6, 23, .28);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), visibility 0s linear var(--dur-fast);
}
.info-tip.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.info-tip::after {
    content: "";
    position: absolute;
    left: var(--arrow-x, 50%);
    bottom: -5px;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    background: inherit;
    transform: rotate(45deg);
    border-radius: 2px;
}
.info-tip.below::after { bottom: auto; top: -5px; }
.info-tip-title { font-size: 12.5px; font-weight: 700; margin-bottom: 3px; }
.info-tip-text { font-size: 12.5px; line-height: 1.5; white-space: pre-line; color: #cbd5e1; }
body[data-theme="dark"] .info-tip { background: #f8fafc; color: #0f172a; box-shadow: 0 10px 28px rgba(0, 0, 0, .5); }
body[data-theme="dark"] .info-tip-text { color: #334155; }
/* Sheets and dialogs: one look and one motion for every overlay - help (i), log out, branch,
   stock count, restock and the sale confirmation; the dropdown and date sheets in fields.js match.
   Wide screens: a dialog a little above the middle that fades in from 96%. Phones: a sheet that
   slides up from the bottom, where the thumb is, and can be swiped down (assets/js/sheet.js).
   A closed overlay stays in the page, invisible, so it animates out as well as in. */
.info-modal-overlay, .sale-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(2, 6, 23, .5);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur-base) var(--ease-out), visibility 0s linear var(--dur-sheet);
}
/* (Menus, continued: these must come after the rules above) */
.branch-sheet-overlay { z-index: 130; }

/* ================================================================
   Sales: product grid, cart, confirm, discounts, customers
   The till: product grid, the cart (Kikapu) with its quantity stepper, discount,
   customer picker and the confirm sheet. Wide screens put the products and the
   cart side by side, like a real till.
   ================================================================ */
.sale-confirm-overlay { z-index: 900; }
/* (Help, continued: these must come after the rules above) */
.info-modal-overlay.open, .sale-confirm-overlay.open {
    opacity: 1;
    visibility: visible;
    transition: opacity var(--dur-base) var(--ease-out);
}
/* (Sales, continued: these must come after the rules above) */
.sale-confirm-overlay[hidden] { display: none; }
/* (Help, continued: these must come after the rules above) */
.info-modal, .sale-confirm {
    width: 100%;
    max-width: 480px;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    margin-bottom: 8vh;
    background: var(--card);
    color: var(--ink);
    border-radius: var(--r-xl);
    padding: 20px;
    box-shadow: var(--shadow-lift);
    opacity: 0;
    transform: scale(.96);
    transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.open > .info-modal, .open > .sale-confirm { opacity: 1; transform: none; }
/* (Sales, continued: these must come after the rules above) */
/* The sale confirmation scrolls its middle part only, so Yes / No stay in view. */
.sale-confirm {
    max-width: 440px;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}
/* (Help, continued: these must come after the rules above) */
.logout-confirm { max-width: 400px; padding-top: 26px; text-align: center; }
/* The "are you sure?" dialog (footer.php) shares the log-out look: a trash can for removing, and for
   a non-destructive question (a new temporary password) a purple refresh sign. */
.confirm-ico-danger, .confirm-ico-neutral { display: inline-flex; }
.confirm-ico-neutral { display: none; }
#confirmOverlay.is-neutral .confirm-ico-danger { display: none; }
#confirmOverlay.is-neutral .confirm-ico-neutral { display: inline-flex; }
#confirmOverlay.is-neutral .logout-confirm-ico { background: var(--brand-soft); color: var(--brand-ink); }
.info-modal-close {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
}
@media (max-width: 639px) {
    .info-modal-overlay, .sale-confirm-overlay { align-items: flex-end; padding: 0; }
    .info-modal, .sale-confirm {
        max-width: none;
        max-height: 92dvh;
        margin: 0;
        border-radius: var(--r-xl) var(--r-xl) 0 0;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
        opacity: 1;
        transform: translateY(100%);
        transition: transform var(--dur-sheet) var(--ease-drawer);
    }
    .sale-confirm { padding-bottom: env(safe-area-inset-bottom); }
    /* The grip says "this can be pulled down". */
    .info-modal::before, .sale-confirm::before {
        content: "";
        display: block;
        flex-shrink: 0;
        width: 40px;
        height: 5px;
        margin: -8px auto 14px;
        border-radius: var(--r-pill);
        background: var(--line);
    }
    .sale-confirm::before { margin: 8px auto 0; }
}
/* (Building blocks, continued: these must come after the rules above) */
.period-bar > a.active { background: var(--blue); color: #fff; border-color: var(--blue); }
/* (App shell, continued: these must come after the rules above) */
.bottom-nav a.active, body[data-theme="dark"] .bottom-nav a.active { color: var(--brand-ink); font-weight: 600; }
/* (Help, continued: these must come after the rules above) */
.info-modal-title {
    font-size: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.info-modal-text { font-size: 14px; line-height: 1.55; color: var(--ink); white-space: pre-line; }
@media (hover: hover) and (pointer: fine) { .info-icon:hover { background: var(--blue); color: #fff; outline: none; } }

/* ================================================================
   Dropdowns and date picker (assets/js/fields.js)
   assets/js/fields.js puts a themed button in place of each <select> and date
   field; the real one stays, hidden. The choices open as a bottom sheet on phones
   and in the app, or as a list under the button on wide screens.
   ================================================================ */
.bs-select-btn:disabled { opacity: .55; cursor: not-allowed; }
.bs-select-panel.is-up { transform: translateY(4px); }
.bs-select-panel.is-open { opacity: 1; transform: none; }
.bs-select-option[hidden] { display: none; }
.bs-select-option[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.bs-select-text { min-width: 0; overflow-wrap: anywhere; }
.bs-select-option[aria-selected="true"] .bs-select-check { display: flex; }
.bs-select-overlay.is-open { opacity: 1; }
.bs-select-panel.is-sheet.is-open { transform: none; }
.bs-select-panel.is-sheet .bs-select-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.bs-select-panel.is-sheet .bs-select-list { flex: 1; min-height: 0; max-height: none; }
.bs-select-panel.is-sheet .bs-select-option { min-height: 52px; padding: 10px 14px; border-radius: var(--r-md); font-size: 16px; }
.bs-select-panel.is-sheet .bs-select-option + .bs-select-option { margin-top: 2px; }
body.bs-select-locked { overflow: hidden; }
.bs-date .bs-select-btn { justify-content: flex-start; }
.bs-select-panel.is-sheet .bs-cal { padding: 0 4px; }
.bs-cal-title .bs-select-chev { width: 14px; height: 14px; }
.bs-cal-day:disabled, .bs-cal-nav:disabled, .bs-cal-month:disabled, .bs-cal-link:disabled { opacity: .32; cursor: not-allowed; }
.bs-cal-day:focus-visible,
.bs-cal-nav:focus-visible,
.bs-cal-title:focus-visible,
.bs-cal-month:focus-visible,
.bs-cal-link:focus-visible {
    outline: 2px solid var(--focus, var(--brand));
    outline-offset: 2px;
}
/* Phones and the app: bigger days to tap. */
.bs-select-panel.is-sheet .bs-cal-day { width: min(100%, 46px); font-size: 16px; }
.bs-select-panel.is-sheet .bs-cal-title { font-size: 16px; }
@media (hover: hover) and (pointer: fine) {
    .bs-cal-day:not(:disabled):not(.is-selected):hover { background: var(--brand-soft); color: var(--brand-ink); }
}

/* ================================================================
   Sign in, sign up and the other account pages
   Sign in, sign up, verify, forgot/reset password, set password, PIN, choose
   business, setup and trial ended (includes/auth_page.php), the shop-link login
   (login.php) and the offline app's own screens. Phone: the dark brand band on
   top with the form card overlapping it. Wide screens: side by side.
   ================================================================ */
.login-mark { width: 68px; height: 68px; margin: 0 auto 14px; font-size: 28px; }
.login-card form { text-align: left; }
.pin-input { letter-spacing: 6px; font-size: 20px; font-weight: 700; text-align: center; }
.login-footer-brand strong { color: var(--ink); font-family: inherit; font-weight: 700; }
.lg-brand > * { position: relative; }
.lg-mark img { width: 72%; height: 72%; object-fit: contain; display: block; }
.lg-hero h1 {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
    color: #fff;
    font-weight: 600;
    letter-spacing: -0.03em;
}
.lg-hero p {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--hero-muted);
    font-weight: 500;
}
.lg-biz h2 { margin: 0; font-size: 22px; color: var(--ink); }
.lg-biz p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.lg-input input {
    flex: 1;
    min-width: 0;
    margin: 0;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 14px 0 0;
    height: 52px;
    font-size: 16px;
    font-weight: 600;
    color: var(--input-text);
    max-width: none !important;
}
/* (Base, continued: these must come after the rules above) */
input.input-error { border-color: var(--red) !important; }
/* (Sign in, sign up and the other account pages, continued: these must come after the rules above) */
.lg-input input:focus { outline: none; }
.lg-submit:active { scale: .97; }
/* Sent: a spinner in place of the label, and no more taps until the next page arrives
   (assets/js/busy-submit.js). It spins fast on purpose - a quick spinner makes the wait feel shorter. */
.lg-submit.is-busy { position: relative; color: transparent; pointer-events: none; }
.lg-submit.is-busy::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 20px;
    height: 20px;
    margin: auto;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lgSpin .6s linear infinite;
}
@keyframes lgSpin { to { transform: rotate(360deg); } }
.lg-foot strong { color: var(--ink); }
.lg-field label { margin: 0; font-size: 13px; color: var(--ink); font-weight: 500; }
.login-wrap::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: 720px;
    height: 720px;
    top: -470px;
    right: -340px;
    pointer-events: none;
    filter: blur(30px);
    background: radial-gradient(closest-side at 46% 58%, rgba(234, 88, 12, 0.7), rgba(234, 88, 12, 0) 48%), radial-gradient(closest-side at 55% 64%, rgba(250, 204, 21, 0.65), rgba(250, 204, 21, 0) 70%);
}
.choose-text span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.choose-badge.tone-warn { background: var(--warn-bg); color: var(--warn-dark); }
@media (min-width: 900px) {
    .lg-hero { max-width: 460px; }
    .lg-hero h1 { font-size: 38px; line-height: 1.12; }
    .lg-hero p { font-size: 16px; }
}

/* ================================================================
   Dashboard
   One phone screen with no scrolling: today's figures in one card, quick
   actions, then Sauti ya Biashara as sliding cards (what needs attention, and
   advice). Computers: figures and action tiles side by side, three Sauti cards
   at a time.
   ================================================================ */
.insight-icon { font-size: 22px; flex-shrink: 0; line-height: 1.2; }
.insight-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.sauti-dots i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    animation: sautiDot 1s infinite ease-in-out;
}
.sauti-dots i:nth-child(2) { animation-delay: .15s; }
.sauti-dots i:nth-child(3) { animation-delay: .3s; }
.db-hero > * { position: relative; }
.db-hero-rings circle { fill: none; stroke: var(--gold); stroke-width: 2; }
.db-hero .info-icon { color: #fff; }
.db-hero-value small {
    font-size: 15px;
    font-weight: 700;
    color: var(--hero-muted);
    margin-left: 6px;
    letter-spacing: 0;
}
.db-spark-area { fill: var(--gold); fill-opacity: .18; }
.db-spark-line {
    fill: none;
    stroke: var(--gold);
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}
.db-hero-minis small { font-size: 10.5px; font-weight: 700; color: var(--hero-muted); }
body[data-theme="dark"] .db-hero { border: 1px solid var(--line); }
.db-hero-minis > div {
    padding: 10px 12px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.07);
}
.db-scope a .ui-ico { display: none; }
.db-glance.db-hero { padding: 14px 16px 12px; gap: 5px; border-radius: var(--r-xl); }
.db-glance .db-spark { height: 28px; min-height: 0; flex: 0 0 28px; }
.db-hero-minis .db-mini-value small { font-size: 11px; font-weight: 700; color: var(--hero-muted); }
.db-qa-item:active { scale: .97; }
.db-qa-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.db-qa-ico .ui-ico { width: 24px; height: 24px; }
.sauti-pos b { color: var(--ink); }
.sauti-track::-webkit-scrollbar { display: none; }
.sauti-track:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sauti-card.tone-bad { --tone: var(--red); --tone-bg: var(--red-bg); --tone-ink: var(--red-dark); }
.sauti-card.tone-warn { --tone: var(--warn); --tone-bg: var(--warn-bg); --tone-ink: var(--warn-dark); }
.sauti-card.tone-info { --tone: var(--blue); --tone-bg: var(--blue-bg); --tone-ink: var(--blue-dark); }
.sauti-card.tone-good { --tone: var(--green); --tone-bg: var(--green-bg); --tone-ink: var(--green-dark); }
.sauti-card-go::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.sauti-card-go:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sauti-note textarea {
    flex: 1;
    min-width: 0;
    min-height: 0;
    height: 62px;   /* two lines: the example in it ("Mfano: ...") was cut in half at one (V10) */
    margin: 0;
    padding: 8px 12px;
    font-size: 13.5px;
    line-height: 1.35;
    resize: none;
    border-radius: var(--r-md);
}
.sauti-note .sauti-card-go::after { content: none; }
.sauti.all-visible .sauti-pos, .sauti.all-visible .sauti-nav, .sauti.all-visible .sauti-dots { display: none; }
.sauti-dots span.on { width: 18px; background: var(--ink); }
@media (hover: hover) and (pointer: fine) { .sauti-arrow:hover { box-shadow: var(--shadow-lift); } }
@media (max-width: 899px) {
    /* The sales card keeps a credit-card shape; its line fills what is left inside it. */
    .db-glance.db-hero { aspect-ratio: 1.586; }
    .db-glance .db-spark { flex-grow: 1; height: auto; max-height: none; }
    .db-spark-empty { flex-grow: 1; }
}
@media (max-width: 899px) and (max-height: 799px) { .db-glance .db-spark { height: 24px; flex-basis: 24px; } }
@media (max-width: 899px) and (min-height: 800px) {
    .db-glance.db-hero { padding: 16px 18px 14px; gap: 6px; }
    .db-glance .db-spark { height: 34px; flex-basis: 34px; }
    .db-qa-ico .ui-ico { width: 26px; height: 26px; }
}
@media (min-width: 900px) {
    .db-scope a .ui-ico { display: inline-block; }
    .db-top.is-split { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
    .db-glance.db-hero { padding: 22px 24px 20px; gap: 10px; }
    .db-glance .db-spark { flex: 1 1 64px; height: auto; min-height: 64px; max-height: 120px; }
    .db-top:not(.is-split) .db-qa { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-auto-rows: auto; }
}
@media (min-width: 900px) { @media (hover: hover) and (pointer: fine) {
    .db-qa-item.tone-green:hover .db-qa-go { background: #fff; color: var(--brand); }
} }
@media (min-width: 900px) {
    .db-qa.n-1 .db-qa-item,
    .db-qa.n-2 .db-qa-item,
    .db-qa.n-3 .db-qa-item,
    .db-top:not(.is-split) .db-qa-item {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        padding-right: 56px;
    }
    .sauti-pos { margin-right: 6px; }
}
@keyframes sautiDot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
/* (Sales, continued: these must come after the rules above) */
.product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-height: 304px;   /* exactly 2 rows x 2 cols = 4 tiles (148px tile + 8px gap) */
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    scroll-behavior: smooth;
}
.product-tile .pname {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-tile .pprice { color: var(--green-dark); font-weight: 700; font-size: 13px; }
.product-tile .pstock { color: var(--muted); font-size: 11px; }
.product-tile {
    background: var(--product-tile-bg);
    border: 1.5px solid var(--line);
    padding: 8px;
    text-align: left;
    cursor: pointer;
    height: 148px;   /* fixed so every row is identical and the 4-tile window never bleeds */
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}
/* How many of this product are in the cart (each tap adds one). */
.product-tile .ptile-qty {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 1;
    min-width: 26px;
    padding: 2px 7px;
    border-radius: var(--r-pill);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
/* Tapped again but no more stock: a short shake. */
.product-tile.at-limit { animation: tileShake .3s ease; border-color: var(--red, #c0392b); }
.product-tile.out-of-stock { opacity: .5; cursor: not-allowed; }
.product-tile.out-of-stock .pstock { color: var(--red, #c0392b); font-weight: 700; }
.ptile-photo {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: var(--r-sm);
    margin-bottom: 5px;
    display: block;
}
.ptile-photo-placeholder { display: flex; align-items: center; justify-content: center; font-size: 22px; }
.cart-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
/* An empty cart shows only its title and this line (wide screens; on phones the card is hidden then). */
#cartCard.is-empty > :not(:first-child):not(.cart-empty) { display: none; }   /* all but its title */
.cart-actions { margin-top: 12px; }
.cart-empty { display: none; }
#cartCard.is-empty .cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 28px 12px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}
.cart-empty-ico {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface);
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info .cart-item-name {
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qty-box { display: flex; align-items: center; flex-shrink: 0; }
.cart-remove-btn {
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qty-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--r-sm);
    border: none;
    background: var(--line);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
}
input.qty-input {
    width: 44px;
    height: 30px;
    text-align: center;
    padding: 0 2px;
    margin: 0;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
/* (Base, continued: these must come after the rules above) */
input[type=date], input[type=time], input[type=datetime-local], input[type=month] {
    display: block;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    min-height: 50px;
    line-height: 1.2;
}
input[type=text],
input[type=number],
input[type=password],
input[type=tel],
input[type=date],
input[type=email],
select {
    border-radius: var(--r-pill);
    border: 1px solid var(--line);
    padding-left: 18px;
    padding-right: 18px;
}
/* (Sales, continued: these must come after the rules above) */
/* Sale cart: discount and extra money stay folded behind one link until needed (UX_AUDIT S-6). */
.cart-extras-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 44px; margin: 4px 0 0; padding: 0 2px;
    background: none; border: 0; color: var(--brand-ink);
    font: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
}
#cartCard.show-extras .cart-extras-toggle { display: none; }
#cartCard:not(.show-extras) .discount-row,
#cartCard:not(.show-extras) #extraFields { display: none !important; }

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 16px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
    margin-top: 10px;
}
.pay-method-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pay-btn { flex: 1; min-width: 120px; }
.floating-cart-bar .fcb-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}
.floating-cart-bar .fcb-count {
    font-size: 11px;
    opacity: .85;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* (App shell, continued: these must come after the rules above) */
@media (min-width: 1024px) { .bottom-nav.bottom-nav-scroll { overflow-x: hidden; } }
/* (Building blocks, continued: these must come after the rules above) */
.card.ex-list { padding: 0; overflow: hidden; }
/* (Dashboard, continued: these must come after the rules above) */
.sauti-card-foot .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* (Sales, continued: these must come after the rules above) */
.floating-cart-bar .fcb-total { font-size: 15px; font-weight: 700; }
.floating-cart-bar .fcb-action {
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
/* Go-to-Kikapu button (Chagua Bidhaa card): a way out of the product grid's own scroll, so it
   never traps someone trying to reach Kikapu below. It sits in the card's header row, beside the
   title - in the grid's corner it covered the last tile (V8). Brand purple, legible in dark mode. */
.goto-cart-fab {
    position: absolute;
    top: 9px;
    right: 12px;
    height: 30px;
    padding: 0 12px 0 10px;
    gap: 6px;
    border-radius: var(--r-pill);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
}
.class-group-title:first-child { margin-top: 0; }
.category-expense-panel-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.category-expense-table th, .category-expense-table td { font-size: 12px; }
.sale-confirm-head h3 { margin: 0; font-size: 17px; }
.sale-confirm-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.sale-confirm-items li { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.sale-confirm-line > span:last-child { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.sale-confirm-line.is-discount > span:last-child { color: var(--warn-dark); }
.sale-confirm-line.is-warn > span:last-child { color: var(--warn-dark); }
.sale-confirm-total span { font-size: 13.5px; font-weight: 700; }
.sale-confirm-total strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.sale-confirm-meta .sale-confirm-line > span:last-child { color: var(--ink); }
.sale-confirm-meta .sale-confirm-line.is-warn > span:last-child { color: var(--warn-dark); }
/* (Building blocks, continued: these must come after the rules above) */
@media (hover: hover) and (pointer: fine) {
    body[data-theme="dark"] .btn-outline.btn-blue:hover,
    body[data-theme="dark"] .btn-outline.btn-green:hover {
        background: var(--brand);
        border-color: var(--brand);
        color: #fff;
    }
    .topbar .user-menu .dropdown a:hover { background: var(--surface); }
}
/* (App shell, continued: these must come after the rules above) */
@media (max-width: 1023px) {
    .bottom-nav a.nav-pos.active .ico {
        position: absolute;
        top: -26px;
        left: 50%;
        transform: translateX(-50%);
        width: 56px;
        height: 56px;
        padding: 16px;
        border-radius: 50%;
        color: #fff;
        transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) ease;
        background: var(--brand-hover);
        box-shadow: 0 0 0 4px var(--brand-soft), 0 10px 20px -6px rgba(134, 79, 254, .65);
    }
    .bottom-nav a.nav-pos:active .ico { transform: translateX(-50%) scale(.94); }
}
/* (Sales, continued: these must come after the rules above) */
.sale-confirm-actions .btn:disabled { opacity: .65; cursor: wait; }
#saleDateInput { margin-bottom: 14px; }
.qty-box .qty-btn:disabled { opacity: .35; cursor: not-allowed; }
.qty-box .qty-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Needs this specificity: the generic pill padding for number fields would leave no room for the digits. */
.qty-box input.qty-input {
    width: 40px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
    appearance: textfield;
}
.qty-box input.qty-input::-webkit-outer-spin-button,
.qty-box input.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.qty-box input.qty-input:focus { box-shadow: none; outline: 2px solid var(--focus); outline-offset: -2px; border-radius: var(--r-sm); }
.disc-type:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.customer-pick > label { display: flex; align-items: center; gap: 6px; }
#customerSearchBox { position: relative; }
.customer-add span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.customer-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.customer-head > div { min-width: 0; overflow-wrap: anywhere; }
details.customer-edit > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}
details.customer-edit > summary::-webkit-details-marker { display: none; }
.paid-now label:first-child { margin-top: 0; }
details.forgive-debt { margin: -4px 0 8px; padding: 0 0 10px; border-bottom: 1px solid var(--line); }
details.forgive-debt > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}
details.forgive-debt > summary::-webkit-details-marker { display: none; }
a.customer-row > .badge { flex-shrink: 0; white-space: nowrap; }
/* Press feedback the moment the finger lands (.btn, the dashboard tiles and the POS button already
   have theirs). `scale` rather than transform, so hover lifts and centring transforms are kept. */
.product-tile:active, .choose-item:active { scale: .97; }
@media (hover: hover) and (pointer: fine) { .qty-box .qty-btn:hover:not(:disabled) { background: var(--brand-soft); color: var(--brand-ink); } }
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) {
    /* Mauzo on a wide screen works like a till: products on the left, Kikapu always in its own
       column on the right - empty or not, so the grid never moves under the pointer when the first
       item goes in (V5). Confirm stays in view at the foot of the cart however long it gets. The
       phone's ways of reaching the cart (floating bar, header button) are hidden; JS sets their
       display inline, and the cart's, hence !important. */
    #tabPanelBidhaa { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
    #tabPanelBidhaa > .card { margin: 0; }
    #productPickerCard { min-width: 0; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; max-height: none; overflow-y: visible; }
    .product-tile { height: 172px; padding: 10px; }
    .ptile-photo { height: 80px; margin-bottom: 8px; }
    .product-tile .pname, .product-tile .pprice { font-size: 14px; }
    .product-tile .pstock { font-size: 12px; }
    #cartCard {
        display: block !important;
        position: sticky;
        top: 84px;
        max-height: calc(100vh - 104px);
        max-height: calc(100dvh - 104px);
        overflow-y: auto;
    }
    .cart-actions {
        position: sticky;
        bottom: -12px;
        z-index: 1;
        margin: 0 -16px -12px;
        padding: 12px 16px;
        background: var(--card);
        box-shadow: 0 -10px 16px -14px rgba(16, 24, 40, .35);
    }
    .goto-cart-fab, .floating-cart-bar { display: none !important; }
}
/* Laptops (1024-1279px): a narrower cart and tiles, so the products still get two columns or more. */
/* Mauzo Ya Leo > Kwa Miamala on phones: each sale is a card - time, how it was paid and the total on
   top, the items across the full width under them, the discount (if any) last. As a five-column
   table the item list wrapped one word per line. */
@media (max-width: 639px) {
    .txn-table thead { display: none; }
    .txn-table, .txn-table tbody { display: block; }
    .txn-table tr {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-areas: "time pay total" "items items items" "disc disc disc";
        gap: 4px 10px;
        padding: 12px 14px;
        border-bottom: 1px solid var(--line-soft);
    }
    .txn-table tr:last-child { border-bottom: 0; }
    .txn-table td { display: block; padding: 0; border: 0; background: none !important; height: auto; }
    .txn-table td:nth-child(1) { display: none; }
    .txn-table td:nth-child(2) { grid-area: time; color: var(--muted); font-weight: 600; }
    .txn-table td:nth-child(3) { grid-area: items; font-weight: 600; line-height: 1.4; }
    .txn-table td:nth-child(4) { grid-area: pay; color: var(--muted); }
    .txn-table .txn-disc { grid-area: disc; font-size: 12.5px; color: var(--muted); }
    .txn-table .txn-disc::before { content: attr(data-label) ": "; }
    .txn-table .txn-disc.is-none { display: none; }
    .txn-table .txn-total { grid-area: total; text-align: right; }
}
/* Watu > Waliosajiliwa on phones: each person is a card - name and status on top, role and number
   under them, the action buttons in their own row. As a six-column table it scrolled sideways, and
   reaching the buttons pushed the names off the screen. */
@media (max-width: 639px) {
    .people-table thead { display: none; }
    .people-table, .people-table tbody { display: block; }
    .people-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "name status" "role phone" "actions actions";
        gap: 6px 10px;
        align-items: center;
        padding: 14px;
        border-bottom: 1px solid var(--line-soft);
    }
    .people-table tr:last-child { border-bottom: 0; }
    .people-table td { display: block; padding: 0; border: 0; background: none !important; }
    .people-table td:nth-child(1) { display: none; }
    .people-table td:nth-child(2) { grid-area: name; font-size: 15px; }
    .people-table td:nth-child(3) { grid-area: role; }
    .people-table td:nth-child(4) { grid-area: phone; text-align: right; color: var(--muted); font-size: 13px; }
    .people-table td:nth-child(5) { grid-area: status; text-align: right; }
    .people-table td:nth-child(6) { grid-area: actions; padding-top: 4px; }
}
/* A short note under a field, always visible - in place of an (i) for things that fit in one line. */
.field-hint { margin: 5px 4px 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.field-hint .ui-ico { vertical-align: -0.15em; color: var(--warn); }
.section-hint { margin: -6px 0 10px; font-size: 12.5px; color: var(--muted); }
.settings-panel > .field-hint:first-child { margin: 0 0 10px; }
.table-legend { margin: 8px 4px 0; }
/* Customers: which branch's customers, as a small switch at the right (the dashboard's). */
.scope-row { display: flex; justify-content: flex-end; margin-bottom: 12px; }
@media (min-width: 1024px) {
    /* Customers on a wide screen: find and add side by side, full width. */
    .customers-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; margin-bottom: 14px; }
    .customers-tools > .card { max-width: none; margin: 0; }
    .customers-tools input[type=text] { max-width: none; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
    #tabPanelBidhaa { grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
}
@keyframes tileShake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes floatingCartIn {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
/* Each list repeats the element's existing transitions, plus scale. */
.product-tile {
    transition: box-shadow var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out), scale var(--dur-press) var(--ease-out);
}
.cart-remove-btn { transition: scale var(--dur-press) var(--ease-out); }

/* ================================================================
   Products: list, photo upload, restock, stock history, transfers
   Product form and list, photo upload, duplicate names, restocking
   (restockProducts()), stock history and transfers between branches.
   ================================================================ */
/* Products: a name that is already used (under the name field), and the list of duplicates */
.name-taken {
    margin: 6px 0 0;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    background: var(--red-bg);
    color: var(--red-dark);
    font-size: 13px;
    line-height: 1.4;
}
/* (Building blocks, continued: these must come after the rules above) */
.btn-outline { color: var(--button-outline-text); }
/* (App shell, continued: these must come after the rules above) */
.icon-btn {
    width: 38px;
    height: 38px;
    background: var(--button-outline-bg);
    color: var(--button-outline-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
}
/* (Building blocks, continued: these must come after the rules above) */
.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-active { background: var(--green-bg); color: var(--green-dark); }
.badge-suspended { background: var(--red-bg); color: var(--red-dark); }
.alert-success { background: var(--green-bg); color: var(--green-dark); }
.alert-error { background: var(--red-bg); color: var(--red-dark); }
.alert-info { background: var(--blue-bg); color: var(--blue-dark); }
.alert-warning { background: var(--warn-bg); color: var(--warn-dark); }
.muted { color: var(--muted); }
/* (Sign in, sign up and the other account pages, continued: these must come after the rules above) */
.login-footer-brand { text-align: center; margin-top: 22px; font-size: 12px; color: var(--muted); }
/* (Dashboard, continued: these must come after the rules above) */
.insight-text { font-size: 13px; color: var(--muted); line-height: 1.45; }
.dash-greeting { font-size: 20px; color: var(--ink); margin: 2px 0 14px; }
.db-greet-date { font-weight: 600; color: var(--muted); }
/* (Sales, continued: these must come after the rules above) */
.floating-cart-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 78px;
    max-width: 480px;
    margin: 0 auto;
    z-index: 25;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    animation: floatingCartIn .2s ease;
}
.goto-cart-fab-badge { font-size: 14px; font-weight: 700; color: inherit; }
.category-expense-amount-cell { font-weight: 700; color: var(--ink); text-align: right; white-space: nowrap; }
.stock-low { color: var(--red); font-weight: 700; }
@media (min-width: 640px) { .floating-cart-bar { max-width: 640px; } }
@media (min-width: 1024px) {
    /* Keep the floating cart bar (Mauzo) clear of the sidebar and closer to the
       bottom edge now that there's no bottom tab bar to sit above. */
    .floating-cart-bar { left: 220px; right: 0; bottom: 24px; max-width: 700px; }
}
@media (max-width: 1023px) { .floating-cart-bar { left: 12px; right: 12px; bottom: calc(92px + env(safe-area-inset-bottom)); } }
/* (Products, continued: these must come after the rules above) */
.name-taken[hidden] { display: none; }
.name-taken a { color: inherit; font-weight: 700; white-space: nowrap; }
.duplicate-group { margin: 4px 0; }
.duplicate-group a { font-weight: 700; }
.product-photo-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--r-sm);
    flex-shrink: 0;
}
.product-photo-placeholder { display: flex; align-items: center; justify-content: center; font-size: 20px; }
.product-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.upload-zone-text b { color: var(--brand-ink); font-weight: 600; }
.upload[data-state="picked"] .upload-zone, .upload[data-state="current"] .upload-zone { display: none; }
.upload[data-state="picked"] .upload-file, .upload[data-state="current"] .upload-file { display: flex; }
.upload[data-state="current"] .upload-remove { display: none; }
.restock-line label, .transfer-send-line label { display: block; margin: 0 0 6px; font-size: 13px; }
.restock-line select, .transfer-send-line select { margin-top: 4px; padding-right: 36px; }
.restock-line-nums input { margin-top: 4px; }
.stock-readonly b { font-size: 20px; margin-right: auto; }
.transfer-card > input[name="receive_note"] { margin: 10px 0; }
.transfer-send-line .restock-remove { position: static; align-self: center; }
.transfer-send-line:has(.restock-remove) { grid-template-columns: minmax(0, 1fr) 96px 36px; }
.stock-history .list-row > b, .transfer-history .list-row > .badge { flex-shrink: 0; white-space: nowrap; }
.restock-line:only-child .restock-remove { display: none; }
@media (max-width: 360px) { .transfer-send-line:has(.restock-remove) { grid-template-columns: minmax(0, 1fr) 76px 36px; } }
/* (Dashboard, continued: these must come after the rules above) */
@media (min-width: 900px) {
    .db-qa.n-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .db-qa.n-1, .db-qa.n-2, .db-qa.n-3 { grid-template-columns: minmax(0, 1fr); }
}

/* ================================================================
   Expenses
   Add form, filter toolbar, the Spending by Category chart and the expense
   lists (a table on wide screens).
   ================================================================ */
.ex-chart-total { text-align: right; }
.ex-chart-total span { font-size: 12px; font-weight: 600; color: var(--muted); }
.ex-bar.is-dim { opacity: .42; }
.ex-bar-value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ex-bar.is-top .ex-bar-fill { background: var(--ex-bar); }
.ex-list[hidden], .ex-row[hidden] { display: none !important; }
/* (Sales, continued: these must come after the rules above) */
.customer-chosen[hidden],
.new-customer[hidden],
#customerSearchBox[hidden],
.discount-preview[hidden],
.field-error[hidden] {
    display: none !important;
}
.paid-now[hidden], .customer-credit[hidden] { display: none !important; }
/* (Expenses, continued: these must come after the rules above) */
.ex-amount {
    flex-shrink: 0;
    font-weight: 700;
    color: var(--red-dark);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
}
.ex-filter-chip[hidden] { display: none; }
.ex-bars > li { min-width: 0; }
.ex-head .ex-del-space, .ex-head .ex-cat-ico { height: 1px; }
.ex-filter-chip .ui-ico { margin-left: 2px; }
@media (hover: hover) and (pointer: fine) { .ex-bar:hover { background: var(--bg); } }
.ex-bar[aria-pressed="true"] { background: var(--ex-tint); }
@media (max-width: 640px) { .ex-filter .rf-select, .ex-filter .rf-apply { grid-column: 1 / -1; } }
@media (min-width: 760px) {
    .ex-head .ex-cat-ico { background: none; }
    .ex-cat { flex: 1.3 1 0; }
    .ex-src, .ex-who { flex: 1 1 0; }
    .ex-amount { flex: 0 0 120px; }
}
@media (min-width: 760px) { @media (hover: hover) and (pointer: fine) { .ex-row:not(.ex-head):hover { background: var(--bg); } } }
/* (Building blocks, continued: these must come after the rules above) */
@media (hover: hover) and (pointer: fine) {
    .btn-outline.btn-blue:hover, .btn-outline.btn-green:hover {
        background: var(--brand-hover);
        border-color: var(--brand-hover);
        color: #fff;
    }
}
/* (Base, continued: these must come after the rules above) */
.pw-field > .pw-eye[data-shown="true"] { color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .pw-field > .pw-eye:hover { color: var(--ink); } }
/* (Menus, continued: these must come after the rules above) */
.branch-sheet .branch-row.is-current { background: var(--green-bg); color: var(--green-dark); }
.branch-sheet .branch-row.is-pending { color: var(--muted); }
.notif-notice .notif-text .ui-ico { flex-shrink: 0; margin-top: 2px; color: var(--brand); }
/* (Building blocks, continued: these must come after the rules above) */
@media (hover: hover) and (pointer: fine) { .tabs-bar > .btn-outline:hover { background: transparent; color: var(--ink); } }
/* (Dropdowns and date picker (assets/js/fields.js), continued: these must come after the rules above) */
.bs-select-btn[aria-expanded="true"] .bs-select-chev { transform: rotate(180deg); color: var(--brand-ink); }
@media (hover: hover) and (pointer: fine) { .bs-cal-link:not(:disabled):hover { background: var(--brand-soft); } }
/* (Dashboard, continued: these must come after the rules above) */
.db-hero-minis .db-mini-value.neg { color: #fca5a5; }
/* The stock keeper's glance (they see no sales): what the stock is worth, and three counts that
   open the product list. */
.db-stock-sub { margin: 2px 0 10px; font-size: 12.5px; color: var(--hero-muted); }
.db-hero-minis .db-mini-value.warn { color: #fcd34d; }
.db-hero-minis a.db-mini {
    color: inherit;
    text-decoration: none;
    transition: background-color var(--dur-fast) ease, scale var(--dur-press) var(--ease-out);
}
.db-hero-minis a.db-mini:active { scale: .97; }
@media (hover: hover) and (pointer: fine) { .db-hero-minis a.db-mini:hover { background: rgba(255, 255, 255, .14); } }
.db-qa-item.tone-green .db-qa-ico { background: rgba(255, 255, 255, 0.18); color: #fff; }
.db-qa-item.tone-blue .db-qa-ico { background: var(--blue-bg); color: var(--blue-dark); }
.db-qa-item.tone-gold .db-qa-ico { background: var(--warn-bg); color: var(--warn-dark); }
.db-qa-item.tone-orange .db-qa-ico { background: var(--red-bg); color: var(--red-dark); }
@media (hover: hover) and (pointer: fine) {
    .db-qa-item.tone-green:hover { color: #fff; }
    .sauti-card:hover .sauti-card-go { background: var(--ink); color: var(--card); box-shadow: none; }
}
@media (min-width: 900px) { @media (hover: hover) and (pointer: fine) {
    .db-qa-item.tone-green:hover { border-color: transparent; }
    .db-qa-item:hover .db-qa-go { background: var(--ink); border-color: var(--ink); color: var(--card); transform: translate(2px, -2px); }
} }
@media (min-width: 900px) {
    .db-qa-item.tone-green .db-qa-go { background: rgba(255, 255, 255, 0.16); border-color: transparent; color: #fff; }
    .db-qa.n-1 .db-qa-go, .db-qa.n-2 .db-qa-go, .db-qa.n-3 .db-qa-go, .db-top:not(.is-split) .db-qa-go { top: 50%; margin-top: -15px; }
}
/* (Products, continued: these must come after the rules above) */
.upload.is-drag .upload-zone { border-color: var(--brand); background: var(--brand-soft); }
/* nothing new chosen yet - nothing to remove */
.upload.is-error .upload-zone { border-color: var(--red); }
.upload.is-error .upload-zone-hint { color: var(--red); }

/* ================================================================
   Reports
   Performance, Products, Money and Branches: period selector, filters, charts
   (trend, bars, donut), pockets and the sales history.
   ================================================================ */
.donut-chart {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    flex-shrink: 0;
}
.donut-hole .donut-total-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.donut-hole .donut-total-value { font-size: 14px; font-weight: 700; color: var(--ink); }
.donut-legend-dot { width: 12px; height: 12px; border-radius: var(--r-pill); flex-shrink: 0; }
.donut-legend-name { font-weight: 700; flex: 1; min-width: 0; }
.donut-legend-value { font-weight: 700; white-space: nowrap; }
.donut-legend-value.negative { color: var(--red-dark); }
.donut-legend-row-clickable:active { background: var(--bg); }
.donut-legend-row-clickable.active { background: var(--bg); }
.donut-legend-arrow { color: var(--muted); font-size: 11px; flex-shrink: 0; }
.pocket-row + .pocket-row { margin-top: 12px; }
/* (Sign in, sign up and the other account pages, continued: these must come after the rules above) */
.lg-card .alert { margin: 0; text-align: left; }
/* (Sales, continued: these must come after the rules above) */
.sale-confirm-lines:not(:empty) {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
    display: grid;
    gap: 6px;
}
.sale-confirm-actions .btn { margin: 0; width: 100%; }
/* (Expenses, continued: these must come after the rules above) */
.ex-filter .rf-field { margin: 0; }
.ex-filter .rf-field-label { margin: 0; }
.ex-insight .ui-ico { color: var(--ex-bar); flex-shrink: 0; margin-top: 1px; }
/* (Reports, continued: these must come after the rules above) */
.pocket-top .muted { font-size: 12px; font-weight: 500; }
/* (App shell, continued: these must come after the rules above) */
.topbar .sub { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar h1,
.dash-greeting,
.db-greet .dash-greeting,
.section-title,
.sidebar-brand-name,
.info-modal-title,
.guide-intro h2,
.h2-tight,
.pv-card-title,
.ex-chart-title,
.sale-confirm-head h3,
.lg-biz h2,
.lg-logo-name {
    font-weight: 600;
    letter-spacing: -0.02em;
}
@media (min-width: 1024px) { .topbar .sub { font-size: 12px; margin-top: 1px; } }
/* (Building blocks, continued: these must come after the rules above) */
.tabs-bar > .btn {
    padding: 8px 14px;
    border: 0;
    box-shadow: none;
    font-size: 14px;
    border-radius: var(--r-pill);
    min-height: 42px;
    font-weight: 500;
}
.stat .label { color: var(--muted); opacity: 1; font-weight: 700; }
.stat .value { white-space: normal; font-size: 18px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 480px) { .tabs-bar > .btn { padding: 8px 6px; font-size: 13px; gap: 5px; } }
@media (max-width: 360px) { .stat .value { font-size: 15px; } }
/* (Help, continued: these must come after the rules above) */
.logout-confirm .info-modal-title { justify-content: center; font-size: 18px; margin-bottom: 6px; }
.logout-confirm-actions .btn { flex: 1; padding: 13px; font-size: 15px; text-decoration: none; }
/* (Sign in, sign up and the other account pages, continued: these must come after the rules above) */
.lg-input .pin-input { text-align: left; letter-spacing: .35em; font-size: 18px; }
.invite-actions .btn { flex: 1; min-width: 110px; }
.setup-top .btn { width: auto; flex-shrink: 0; }
/* (Dashboard, continued: these must come after the rules above) */
.db-hero-value, .stat .value, .pv-kpi-value, .ex-chart-total b, .sale-confirm-total strong { font-weight: 600; letter-spacing: -0.02em; }
/* (Sales, continued: these must come after the rules above) */
.sale-confirm-items .sci-name { flex: 1; min-width: 0; font-weight: 600; }
.sale-confirm-items .sci-qty { color: var(--muted); font-size: 13px; white-space: nowrap; }
.sale-confirm-items .sci-amt {
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    min-width: 96px;
    text-align: right;
}
.sale-confirm-line.is-strong { font-weight: 700; }
.customer-search-form .btn { width: auto; min-width: 48px; margin: 0; }
/* (Expenses, continued: these must come after the rules above) */
@media (min-width: 760px) { .ex-head .ex-c, .ex-head .ex-main, .ex-head .ex-amount { color: var(--muted); font-size: 11px; font-weight: 700; } }
/* (Reports, continued: these must come after the rules above) */
.pocket-top > b { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* (Sign in, sign up and the other account pages, continued: these must come after the rules above) */
.choose-text b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* (Dashboard, continued: these must come after the rules above) */
.db-hero-minis b {
    display: block;
    font-size: 17px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    margin-top: auto;
    padding-top: 4px;
}
/* (Expenses, continued: these must come after the rules above) */
.ex-chart-total b { display: block; font-size: 20px; color: var(--red-dark); font-variant-numeric: tabular-nums; }
.ex-list-head b { font-size: 14px; color: var(--red-dark); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) { .ex-chart-total b { display: inline; } }
/* (Reports, continued: these must come after the rules above) */
.pocket-track span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--green); }
/* (Building blocks, continued: these must come after the rules above) */
.section-title .ui-ico,
.name > .ui-ico,
.label > .ui-ico,
.notif-section-title .ui-ico,
.alert > .ui-ico,
.badge .ui-ico,
.class-group-title .ui-ico,
.dropdown-current .ui-ico,
.user-menu .dropdown a .ui-ico,
.muted > .ui-ico,
.login-footer-brand .ui-ico,
td .ui-ico,
a > .ui-ico,
p > .ui-ico,
.settings-panel .ui-ico {
    display: inline-block;
    vertical-align: -0.18em;
}
/* (Base, continued: these must come after the rules above) */
.pw-eye .pw-eye-hide, .pw-eye[data-shown="true"] .pw-eye-show { display: none; }
/* (App shell, continued: these must come after the rules above) */
@media (min-width: 1024px) {
    .sidebar-toggle .icon-expand { display: none; }
    body.sidebar-collapsed .sidebar-toggle .icon-collapse { display: none; }
    body.sidebar-collapsed .sidebar-toggle .icon-expand { display: block; }
}
/* (Sign in, sign up and the other account pages, continued: these must come after the rules above) */
/* (Dashboard, continued: these must come after the rules above) */
.db-hero-minis span {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--hero-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    line-height: 1.25;
}
/* (Products, continued: these must come after the rules above) */
@media (max-width: 420px) { .upload-action span { display: none; } }
/* (Reports, continued: these must come after the rules above) */
.pocket-chip.credit { background: var(--warn-bg); color: var(--warn-dark); }
.rf-top > * { min-width: 0; }
.rf-periods::-webkit-scrollbar { display: none; }
.rf-custom { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.rf-filters { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }
.pv-kpi { text-align: right; }
.pv-delta span { font-weight: 500; color: var(--muted); }
.pv-delta.up { color: var(--green-dark); }
.pv-delta.down { color: var(--red-dark); }
.pv-chart { position: relative; width: 100%; }
#pvTrendChart { height: 240px; }
.pv-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pv-chart text { font-size: 11px; fill: var(--muted); font-family: inherit; }
.pv-gridline { stroke: var(--pv-grid); stroke-width: 1; }
.pv-baseline { stroke: var(--line); stroke-width: 1; }
.pv-crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.pv-bar-row.is-dimmed { opacity: 0.45; }
.pv-bar-value { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pv-donut-slice { stroke: var(--card); stroke-width: 2; cursor: pointer; transition: opacity var(--dur-fast) var(--ease-out); }
.pv-donut.has-focus .pv-donut-slice:not(.is-focus) { opacity: 0.35; }
.pv-legend-row.is-focus { background: var(--bg); }
.pv-legend-row.is-dimmed { opacity: 0.5; }
.pv-legend-name { flex: 1; min-width: 0; font-weight: 600; color: var(--ink); }
.pv-legend-value {
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    min-width: 92px;
    text-align: right;
}
.pv-legend-value.negative { color: var(--red-dark); }
.pv-tooltip b { display: block; font-weight: 700; margin-bottom: 2px; }
/* (Building blocks, continued: these must come after the rules above) */
.count-alert b { font-weight: 700; }
/* (Dashboard, continued: these must come after the rules above) */
.sauti-card-text b { font-weight: 700; }
/* (Reports, continued: these must come after the rules above) */
.pv-seg button {
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    padding: 6px 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
}
.pv-history-table .pv-day-row { cursor: pointer; background: var(--bg) !important; user-select: none; }
.pv-history-table .pv-day-row td { border-top: 1px solid var(--line); }
.pv-history-table .pv-day-row:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
/* (Products, continued: these must come after the rules above) */
.upload-input:focus-visible ~ .upload-zone, .upload-input:focus-visible ~ .upload-file {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}
/* (Reports, continued: these must come after the rules above) */
.pv-day.is-open .pv-chevron { transform: rotate(90deg); }
.pv-day:not(.is-open) .pv-tx-row { display: none; }
.pv-profit { color: var(--green-dark); font-weight: 600; }
.pv-profit.neg { color: var(--red-dark); }
.rf-field input[type=date], .rf-select select {
    max-width: none !important;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--line);
    background-color: var(--input-bg);
    min-height: 42px;
    border-radius: var(--r-pill);
}
/* (Base, continued: these must come after the rules above) */
input:focus,
textarea:focus,
select:focus,
body[data-theme="dark"] input:focus,
body[data-theme="dark"] textarea:focus,
body[data-theme="dark"] select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
/* (Dropdowns and date picker (assets/js/fields.js), continued: these must come after the rules above) */
.bs-select-search input {
    width: 100%;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--input-bg);
    color: var(--input-text);
    font: inherit;
    font-size: 15px;
}
.bs-select-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
/* (Sign in, sign up and the other account pages, continued: these must come after the rules above) */
.pin-lock-row input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; }
/* (Sales, continued: these must come after the rules above) */
@media (pointer: coarse) {
    .qty-box input.qty-input,
    .rf-field input[type=date],
    .rf-select select,
    .bs-select-search input,
    .sauti-note textarea {
        font-size: 16px;
    }
}
/* (Reports, continued: these must come after the rules above) */
.rf-select select {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M19 9L12 15L5 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
.pv-line {
    fill: none;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
    stroke: var(--brand);
}
.pv-area { opacity: 0.12; fill: var(--brand); }
.pv-dot { stroke: var(--card); stroke-width: 2; fill: var(--brand); }
.pv-bar-row.is-selected .pv-bar-name { color: var(--brand-ink); }
.pv-bar-row:focus-visible { box-shadow: 0 0 0 2px var(--brand); }
.donut-legend-arrow.is-open { transform: rotate(180deg); }
/* Reports filters: compact pills, tinted while a filter is on. */
.rf-select .bs-select-btn { min-height: 42px; padding: 0 12px 0 14px; font-size: 14px; font-weight: 600; }
.rf-select.is-set .bs-select-btn { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.rf-select.is-set .bs-select-chev { color: var(--brand-ink); }
/* Filter bars (Reports, Expenses history): compact pills, like the dropdowns there. */
.rf-field .bs-select-btn { min-height: 42px; padding: 0 14px; font-size: 14px; font-weight: 600; }
/* (Sign in, sign up and the other account pages, continued: these must come after the rules above) */
.lg-input .otp-input { letter-spacing: .5em; font-size: 22px; font-variant-numeric: tabular-nums; }
/* Temporary passwords (phone-number login) are words, not 6 digits: no wide spacing. */
.pin-display.is-password { letter-spacing: .02em; font-size: 24px; overflow-wrap: anywhere; }
/* (Dashboard, continued: these must come after the rules above) */
.db-greet .dash-greeting {
    margin: 0;
    font-size: 21px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.db-glance .db-hero-value { font-size: 30px; }
.db-hero-minis .db-delta {
    flex-shrink: 0;
    font-size: 10.5px;
    padding: 1px 6px;
    letter-spacing: 0;
    text-transform: none;
}
@media (max-width: 899px) and (min-height: 800px) { .db-glance .db-hero-value { font-size: 34px; } }
@media (min-width: 900px) {
    .db-greet .dash-greeting { font-size: 24px; }
    .db-glance .db-hero-value { font-size: 42px; }
}
/* (Sales, continued: these must come after the rules above) */
.customer-result .muted { flex-shrink: 0; font-size: 12.5px; }
.customer-links .btn {
    width: auto;
    margin: 0;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 12.5px;
}
/* (Reports, continued: these must come after the rules above) */
.rf-field .bs-select { width: 100%; }
@media (hover: hover) and (pointer: fine) { .rf-periods > a:hover { color: var(--ink); } }
.rf-periods > a.is-active,
body[data-theme="dark"] .rf-periods > a.is-active,
.pv-seg button.is-active,
body[data-theme="dark"] .pv-seg button.is-active {
    background: var(--seg-active);
    color: var(--ink);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
}
@media (hover: hover) and (pointer: fine) { .rf-select select:hover { border-color: var(--muted); } }
.rf-select.is-set select, body[data-theme="dark"] .rf-select.is-set select {
    border-color: var(--brand);
    background-color: var(--brand-soft);
    color: var(--brand-ink);
}
@media (hover: hover) and (pointer: fine) {
    .rf-clear:hover { color: var(--red); }
    .pv-bar-row:hover .pv-bar-fill { filter: brightness(1.08); }
}
@media (max-width: 560px) {
    .rf-range { align-self: flex-start; }
    .rf-filters, .rf-custom { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .rf-apply { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
    .pv-seg { width: 100%; }
    .pv-seg button { flex: 1; justify-content: center; }
    .pv-kpi { text-align: left; }
}
@media (min-width: 900px) { .pv-card-wide { grid-column: 1 / -1; } }
@media (min-width: 1024px) { .rf-select .bs-select { max-width: none; } }

/* ================================================================
   Customers and layaways
   Lipa Kidogo (layaway) orders: filters, lines and progress.
   ================================================================ */
.layaway-head > div { min-width: 0; overflow-wrap: anywhere; }
.layaway-progress > span { display: block; height: 100%; background: var(--green); border-radius: var(--r-pill); }
/* (Dashboard, continued: these must come after the rules above) */
.sauti-dots span {
    width: 6px;
    height: 6px;
    border-radius: var(--r-pill);
    background: var(--line);
    transition: width var(--dur-base) var(--ease-in-out), background var(--dur-fast) ease;
}
/* (Customers and layaways, continued: these must come after the rules above) */
.layaway-line select, .layaway-line input { margin: 0; }
.layaway-line .restock-remove { position: static; }

/* ================================================================
   People
   The role picker and role chips (PLAN.md item 6).
   ================================================================ */
.role-picker legend {
    padding: 0;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}
.role-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft, var(--green-bg)); }
.role-option input { margin-top: 3px; flex-shrink: 0; }
/* (Products, continued: these must come after the rules above) */
.transfer-line input { width: 96px; flex-shrink: 0; text-align: center; }
/* (Sales, continued: these must come after the rules above) */
.discount-input-row input { flex: 1; min-width: 0; margin: 0; }
.customer-search-form input { flex: 1; min-width: 0; margin: 0; }
/* (People, continued: these must come after the rules above) */
.role-option-text b { font-size: 14px; color: var(--ink); }
.role-option-text small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }

/* ================================================================
   Settings
   Settings rows and panels.
   ================================================================ */
.settings-list { padding: 4px 16px; }
.settings-item { border-bottom: 1px solid var(--line); }
.settings-item:last-child { border-bottom: none; }
.settings-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    cursor: pointer;
    color: inherit;
    text-decoration: none;
}
.settings-row-icon {
    width: 36px;
    height: 36px;
    background: var(--bg);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}
.settings-row-text { flex: 1; min-width: 0; }
.settings-row-title { font-weight: 700; font-size: 14px; display: block; }
.settings-row-sub {
    font-size: 12px;
    color: var(--muted);
    display: block;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.settings-row-chevron { color: var(--muted); font-size: 18px; flex-shrink: 0; transition: transform var(--dur-fast) var(--ease-out); }
.settings-row-chevron.open { transform: rotate(90deg); }
.settings-panel { padding: 2px 0 16px 48px; }
/* Section-level icon tinting - gives each settings group its own color identity so the
   page reads as a few clear, distinct groups at a glance rather than one long flat list. */
.settings-row-icon.tint-blue { border-color: transparent; }
.settings-row-icon.tint-green { border-color: transparent; }
.settings-row-icon.tint-warn { border-color: transparent; }
/* (Expenses, continued: these must come after the rules above) */
.ex-list-head + .ex-row, .ex-head + .ex-row { border-top: 0; }
@media (hover: hover) and (pointer: fine) {
    .ex-del:hover { color: var(--red); border-color: var(--red); background: var(--red-bg); }
    .btn-blue:hover, .btn-green:hover { background: var(--brand-hover); color: #fff; }
    .btn-outline:hover, body[data-theme="dark"] .btn-outline:hover { border-color: var(--ink); color: var(--ink); }
}
/* (App shell, continued: these must come after the rules above) */
@media (max-width: 1023px) {
    .bottom-nav a.nav-pos .ico {
        position: absolute;
        top: -26px;
        left: 50%;
        transform: translateX(-50%);
        width: 56px;
        height: 56px;
        padding: 16px;
        border-radius: 50%;
        background: var(--brand);
        color: #fff;
        box-shadow: 0 10px 20px -6px rgba(134, 79, 254, .65);
        transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) ease;
    }
}
@media (min-width: 1024px) { @media (hover: hover) and (pointer: fine) {
    .bottom-nav a.active:hover { background: var(--brand-soft); color: var(--brand-ink); }
} }
@media (max-width: 1023px) { .bottom-nav a.nav-pos.active { color: var(--brand-ink); } }
@media (min-width: 1024px) { @media (hover: hover) and (pointer: fine) {
    .bottom-nav a.sidebar-logout:hover { background: var(--red-bg); color: var(--red); }
} }
/* (Menus, continued: these must come after the rules above) */
a.notif-item.notif-notice:focus-visible { background: var(--surface); }
@media (hover: hover) and (pointer: fine) { a.notif-item.notif-notice:hover { background: var(--surface); } }
/* (Building blocks, continued: these must come after the rules above) */
/* A chosen option keeps both classes (e.g. the selected payment method at checkout, the
   current language in Settings): the filled look must always win over the outline. */
.btn-outline.btn-blue, .btn-outline.btn-green { background: var(--brand); border-color: var(--brand); color: #fff; }
/* (App shell, continued: these must come after the rules above) */
.topbar .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--yellow);
    color: #1a1a1c;
    font-weight: 600;
}
@media (hover: hover) and (pointer: fine) {
    .settings-btn:hover,
    .notif-bell:hover,
    .theme-btn:hover,
    body[data-theme="dark"] .settings-btn:hover,
    body[data-theme="dark"] .notif-bell:hover {
        background: var(--card);
        color: var(--ink);
        border-color: var(--ink);
    }
    .icon-btn:hover { border-color: var(--ink); }
}
@media (min-width: 1024px) { @media (hover: hover) and (pointer: fine) { .sidebar-toggle:hover { background: var(--surface); color: var(--ink); } } }
/* (Menus, continued: these must come after the rules above) */
.notif-done-btn .ui-ico { color: var(--green); }
/* (Building blocks, continued: these must come after the rules above) */
.card.tabs-bar {
    overflow-x: visible;
    background: var(--seg-track);
    border: 0;
    padding: 4px;
    gap: 4px;
    border-radius: var(--r-pill);
}
.tabs-bar > .btn-outline { background: transparent; color: var(--muted); box-shadow: none; }
.tabs-bar > .btn-blue, .tabs-bar > .btn-green {
    background: var(--seg-active);
    color: var(--ink);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
}
.stat.green, body[data-theme="dark"] .stat.green { color: var(--green); }
.section-title .ui-ico, .class-group-title .ui-ico { color: var(--brand-ink); }
.status-ico.is-good { color: var(--green); }
.status-ico.is-bad { color: var(--red); }
/* (Help, continued: these must come after the rules above) */
.logout-confirm .info-modal-text { color: var(--muted); }
.logout-confirm-actions .btn-red { background: #dc2626; color: #fff; }
/* (Dropdowns and date picker (assets/js/fields.js), continued: these must come after the rules above) */
/* filtered out by the search box */
.bs-select-option.is-active { background: var(--surface); }
.bs-select-option[aria-selected="true"] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.bs-select-panel.is-sheet {
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 520px;
    max-height: 78vh;
    max-height: 78dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    border: 0;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding: 8px 12px calc(16px + env(safe-area-inset-bottom));
    opacity: 1;
    transform: translateY(100%);
    transition: transform var(--dur-sheet) var(--ease-drawer);
}
.bs-select-value.is-placeholder { color: var(--muted); }
.bs-cal-day.is-today { box-shadow: inset 0 0 0 1.5px var(--brand); color: var(--brand-ink); font-weight: 600; }
.bs-cal-day.is-selected, .bs-cal-day.is-selected.is-today { background: var(--brand); color: #fff; box-shadow: none; font-weight: 600; }
.bs-cal-month.is-selected { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.bs-cal-link.is-muted { color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .bs-select-btn:hover { border-color: var(--muted); } }
.bs-select-btn:focus-visible, .bs-select-btn[aria-expanded="true"] {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
@media (hover: hover) and (pointer: fine) {
    .bs-cal-nav:not(:disabled):hover,
    .bs-cal-title:hover,
    .bs-cal-month:not(:disabled):not(.is-selected):hover {
        background: var(--surface);
    }
}
/* (Sign in, sign up and the other account pages, continued: these must come after the rules above) */
.lg-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); color: var(--brand-ink); }
.lg-eye[data-shown="true"] { color: var(--brand-ink); }
.choose-item:focus-visible { border-color: var(--brand); }
@media (hover: hover) and (pointer: fine) {
    .lg-eye:hover { color: var(--brand-ink); }
    .lg-submit:hover { background: var(--brand-hover); }
    .choose-item:hover { border-color: var(--brand); }
}
/* (Dashboard, continued: these must come after the rules above) */
.db-hero .info-icon { background: rgba(255, 255, 255, 0.16); }
.db-delta.up { background: var(--lime); color: #1a1a1c; font-weight: 600; }
.db-delta.down { background: var(--peach); color: #1a1a1c; font-weight: 600; }
/* (Sales, continued: these must come after the rules above) */
.product-tile .ptile-qty { background: var(--brand); }
.qty-box .qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    color: var(--ink);
}
.customer-result:last-child { border-bottom: 0; }
@media (hover: hover) and (pointer: fine) {
    .product-tile:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); border-color: var(--brand); }
}
.product-tile.selected { border-color: var(--brand); background: var(--brand-soft); }
@media (hover: hover) and (pointer: fine) { .cart-remove-btn:hover { background: var(--red-bg); border-color: var(--red); color: var(--red); } }
.qty-box .qty-btn { transition: background-color var(--dur-fast) ease, scale var(--dur-press) var(--ease-out); }
/* (Products, continued: these must come after the rules above) */
@media (hover: hover) and (pointer: fine) {
    .upload-zone:hover { border-color: var(--brand); background: var(--brand-soft); }
    .upload-action:hover { border-color: var(--ink); }
    .upload-remove:hover { border-color: var(--red); color: var(--red); background: var(--red-bg); }
}
/* (Reports, continued: these must come after the rules above) */
.pv-seg button.is-active .pv-seg-count,
body[data-theme="dark"] .pv-seg button.is-active .pv-seg-count {
    background: var(--brand-soft);
    color: var(--brand-ink);
}
/* (Settings, continued: these must come after the rules above) */
.settings-row-icon.tint-blue { background: var(--cyan-soft); }
.settings-row-icon.tint-green { background: var(--lime-soft); }
.settings-row-icon.tint-warn { background: var(--yellow-soft); }
@media (hover: hover) and (pointer: fine) { .settings-logout:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); } }

/* ================================================================
   Audit log
   The audit log list.
   ================================================================ */
.audit-name .ui-ico { color: var(--muted); }
/* (Sign in, sign up and the other account pages, continued: these must come after the rules above) */
.choose-badge.tone-red { background: var(--red-bg); color: var(--red-dark); }
/* (App shell, continued: these must come after the rules above) */
.icon-btn.is-urgent { border-color: var(--red); color: var(--red-dark); background: var(--red-bg); }
/* (Menus, continued: these must come after the rules above) */
.branch-sheet .branch-row {
    min-height: 48px;
    padding: 0 12px;
    border-radius: var(--r-md);
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
}
/* (Sign in, sign up and the other account pages, continued: these must come after the rules above) */
.invite-text .ui-ico { flex-shrink: 0; margin-top: 2px; color: var(--brand); }
/* (People, continued: these must come after the rules above) */
.role-chip.role-manager { background: var(--blue-bg); color: var(--blue-dark); }
.role-chip.role-viewer { background: var(--warn-bg); color: var(--warn-dark); }
/* (Dashboard, continued: these must come after the rules above) */
.db-hero-minis > .db-mini {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 12px;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.08);
}
.db-hero-minis .db-mini-label {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--hero-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.db-hero-minis .db-mini-value {
    display: block;
    margin: 0;
    padding: 0;
    font-size: 19px;
    line-height: 1.2;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.db-hero-minis .db-mini-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 18px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--hero-muted);
    white-space: nowrap;
    overflow: hidden;
}
.sauti-note .sauti-card-go { background: var(--ink); color: var(--card); box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .db-qa-item:hover { color: var(--ink); box-shadow: var(--shadow-lift); } }
.db-qa-item.tone-green { background: var(--brand); border-color: transparent; color: #fff; }
@media (max-width: 899px) and (max-height: 799px) { .db-hero-minis .db-mini-sub { display: none; } }
@media (min-width: 900px) {
    .db-hero-minis > .db-mini { padding: 12px 16px; }
    .db-hero-minis .db-mini-label { font-size: 11.5px; }
    .db-hero-minis .db-mini-value { font-size: 24px; }
    .db-hero-minis .db-mini-sub { font-size: 12.5px; }
}
@media (min-width: 900px) { @media (hover: hover) and (pointer: fine) {
    .db-qa-item:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: 0 16px 32px -14px rgba(16, 24, 40, 0.3); }
} }
@media (min-width: 900px) { .db-qa-item:active { transform: translateY(0); box-shadow: var(--shadow); } }
/* (Sales, continued: these must come after the rules above) */
.disc-type.active { background: var(--blue); color: #fff; }
.customer-result:focus-visible { background: var(--blue-bg); }
.customer-clear:focus-visible { background: var(--card); color: var(--red); }
.pstock.preserved {
    color: var(--warn-dark);
    display: flex;
    align-items: center;
    gap: 3px;
    justify-content: center;
}
@media (hover: hover) and (pointer: fine) {
    .customer-result:hover { background: var(--blue-bg); }
    .customer-clear:hover { background: var(--card); color: var(--red); }
}
/* (Products, continued: these must come after the rules above) */
.restock-remove:focus-visible { background: var(--card); color: var(--red); }
.stock-history .stock-in { color: var(--green); }
.stock-history .stock-out { color: var(--red); }
.transfer-card-head .meta { font-size: 12.5px; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .restock-remove:hover { background: var(--card); color: var(--red); } }
/* (Settings, continued: these must come after the rules above) */
.settings-row:active,
a.notif-item.notif-notice:active,
.branch-sheet a.branch-row:active,
.customer-result:active {
    background: var(--line-soft);
}

/* ================================================================
   Guide
   The guide: intro, topic chips and steps.
   ================================================================ */
.guide-intro { text-align: center; padding: 24px 18px; }
.guide-intro h2 { margin: 6px 0 6px; font-size: 18px; }
.guide-intro p { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin: 0; }
.guide-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.guide-nav a {
    flex: 0 0 auto;
    padding: 8px 14px;
    border-radius: var(--r-pill);
    font-size: 12.5px;
    background: var(--card);
    color: var(--ink);
}
/* (Building blocks, continued: these must come after the rules above) */
.period-bar > a {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 14px;
    border-radius: var(--r-pill);
    font-size: 13px;
    font-weight: 700;
    border: 1.5px solid var(--line);
    color: var(--ink);
    background: var(--card);
}
/* (App shell, continued: these must come after the rules above) */
.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 2px;
    min-height: 52px;
    font-size: 11px;
    color: var(--muted);
    text-decoration: none;
}
.bottom-nav a { font-weight: 500; }
@media (min-width: 1024px) {
    .bottom-nav a {
        flex: none;
        min-width: 0;
        width: auto;
        text-align: left;
        transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
    }
    .bottom-nav.bottom-nav-scroll a, .bottom-nav a {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        min-height: 46px;
        padding: 0 12px;
        font-size: 14px;
    }
}
@media (max-width: 1023px) {
    .bottom-nav a {
        min-height: 0;
        height: 100%;
        padding: 6px 2px;
        gap: 2px;
        font-size: 11px;
    }
}
@media (min-width: 1024px) {
    .bottom-nav a .ico {
        width: 20px;
        height: 20px;
        padding: 0;
        border-radius: 0;
        background: none !important;
    }
    body.sidebar-collapsed .sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }
    /* Collapsed: the label appears beside the icon on hover or keyboard focus. */
    body.sidebar-collapsed .bottom-nav {
        width: 76px;
        max-width: 76px;
        padding-left: 12px;
        padding-right: 12px;
        overflow: visible;
    }
    body.sidebar-collapsed .bottom-nav a, body.sidebar-collapsed .sidebar-toggle {
        justify-content: center;
        padding: 0;
        position: relative;
    }
}
/* (Sign in, sign up and the other account pages, continued: these must come after the rules above) */
.lg-label-row a { font-size: 13px; }
.lg-lang a {
    min-width: 40px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    text-decoration: none;
    border-radius: var(--r-pill);
    font-weight: 600;
}
.lg-label-row a, body[data-theme="dark"] .lg-label-row a { color: var(--brand-ink); font-weight: 600; }
/* (Dashboard, continued: these must come after the rules above) */
.db-scope a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 34px;
    padding: 0 11px;
    border-radius: var(--r-pill);
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
}
@media (min-width: 900px) { .db-scope a { font-size: 12.5px; min-height: 36px; padding: 0 14px; } }
/* (Sales, continued: these must come after the rules above) */
a.customer-row { color: inherit; text-decoration: none; gap: 10px; }
/* (Products, continued: these must come after the rules above) */
.stock-readonly a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    font-size: 13.5px;
    min-height: 44px;
}
/* (Reports, continued: these must come after the rules above) */
.rf-periods > a {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 7px 13px;
    font-size: 13px;
    color: var(--muted);
    transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}
.rf-periods > a, .pv-seg button { border-radius: var(--r-pill); font-weight: 500; }
/* (Customers and layaways, continued: these must come after the rules above) */
.layaway-filter a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 8px;
    border-radius: var(--r-pill);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--muted);
    text-decoration: none;
    text-align: center;
}
/* (Guide, continued: these must come after the rules above) */
.guide-card { display: flex; gap: 14px; }
.guide-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.guide-body { flex: 1; min-width: 0; }
.guide-desc { font-size: 13.5px; line-height: 1.65; color: var(--ink); margin: 0 0 12px; }
.guide-steps {
    margin: 0 0 12px;
    padding-left: 20px;
    font-size: 13px;
    line-height: 1.75;
    color: var(--ink);
}
/* (Building blocks, continued: these must come after the rules above) */
.period-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
/* (App shell, continued: these must come after the rules above) */
@media (min-width: 640px) { .page { padding: 20px 24px; } }
@media (min-width: 1024px) {
    /* Bottom tab bar becomes a left sidebar, full height. */
    .bottom-nav {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        right: auto;
        width: 220px;
        max-width: 220px;
        margin: 0;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        border-top: none;
        overflow-y: auto;
        overflow-x: hidden;
    }
    /* Business name, alone at the top of the sidebar - sized to the sidebar's own
       220px column, not the full page width. Bled out to the sidebar's edges (the
       negative margin cancels its parent's padding) so its border-bottom runs the
       full width, roughly level with the topbar's own border-bottom next door. */
    .sidebar-brand { display: flex; align-items: center; gap: 10px; }
    .sidebar-brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* (Building blocks, continued: these must come after the rules above) */
.section-title-row { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 0 8px; }
.day-header { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 6px; }
/* (Sign in, sign up and the other account pages, continued: these must come after the rules above) */
.pin-display {
    font-size: 34px;
    letter-spacing: 10px;
    font-weight: 700;
    text-align: center;
    background: var(--blue-bg);
    color: var(--blue-dark);
    padding: 18px;
    border-radius: var(--r-md);
    margin: 14px 0;
}
.login-wrap {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
}
.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--card);
    box-shadow: var(--shadow-lift);
    padding: 32px 26px 26px;
    text-align: center;
}
/* (Dashboard, continued: these must come after the rules above) */
.insight-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: var(--r-md);
    margin-bottom: 10px;
    border-left: 4px solid var(--line);
    background: var(--card);
    box-shadow: var(--shadow);
}
.insight-tip { border-left-color: var(--blue); }
.insight-warning { border-left-color: var(--warn); }
.insight-opportunity { border-left-color: var(--green); }
.insight-money { border-left-color: var(--green-dark); }
/* (Sales, continued: these must come after the rules above) */
.class-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    margin: 18px 0 8px;
}
.class-count-badge {
    background: var(--line);
    color: var(--muted);
    border-radius: var(--r-pill);
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
}
.category-expense-panel {
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px;
    margin-top: 12px;
    background: linear-gradient(180deg, var(--card), var(--bg));
}
/* (Reports, continued: these must come after the rules above) */
.donut-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 8px 0;
}
.donut-hole {
    position: absolute;
    inset: 18px;
    background: var(--card);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4px;
}
.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 160px;
    flex: 1;
}
.donut-legend-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.donut-legend-row-clickable {
    cursor: pointer;
    padding: 4px;
    margin: -4px;
    border-radius: var(--r-sm);
    transition: background var(--dur-fast) ease;
}
.pocket-list { padding: 14px 16px; }
/* (App shell, continued: these must come after the rules above) */
.bottom-nav { padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
@media (max-width: 1023px) { .app-shell { padding-bottom: calc(112px + env(safe-area-inset-bottom)); } }
/* (Building blocks, continued: these must come after the rules above) */
.stat {
    position: relative;
    background: var(--card) !important;
    border: 1px solid var(--line);
    box-shadow: none;
    padding: 16px;
}
@media (max-width: 360px) { .stat { padding: 14px 12px; } }
/* (Dropdowns and date picker (assets/js/fields.js), continued: these must come after the rules above) */
.bs-select-search { padding: 2px 2px 8px; }
/* (Reports, continued: these must come after the rules above) */
.pocket-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    font-size: 14px;
    margin-bottom: 6px;
}
/* (App shell, continued: these must come after the rules above) */
.topbar { padding: 12px 16px; gap: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sidebar-toggle { display: none; }
.topbar-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
@media (max-width: 1023px) { .topbar-left > .biz-monogram, .topbar-title { display: none; } }
@media (max-width: 420px) {
    .topbar { gap: 8px; padding-left: 14px; padding-right: 14px; }
    /* the business name is still on the line below the title */
    .topbar-actions { gap: 6px; }
}
@media (min-width: 1024px) {
    .bottom-nav { gap: 4px; padding: 16px 14px 14px; }
    .sidebar-brand { margin: -16px -14px 14px; padding: 16px 16px; box-sizing: border-box; }
    .sidebar-brand-name { font-size: 15px; }
    .sidebar-brand { min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
}
/* (Menus, continued: these must come after the rules above) */
.notif-section-title { display: flex; align-items: center; gap: 6px; }
.branch-row { display: flex; align-items: center; gap: 8px; }
.branch-sheet-list { display: flex; flex-direction: column; gap: 4px; }
/* (Building blocks, continued: these must come after the rules above) */
.section-title { text-transform: none; font-size: 16px; color: var(--ink); }
.stat-sub { margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.status-ico { display: inline-flex; vertical-align: -2px; margin-right: 2px; }
/* Stock count (offline sync): products whose stock went below zero must be counted. */
.count-badge {
    display: inline-block;
    margin-left: 6px;
    font-size: 11px;
    padding: 2px 7px;
    vertical-align: middle;
}
/* (Help, continued: these must come after the rules above) */
.logout-confirm-actions { display: flex; gap: 10px; margin-top: 20px; }
/* (Dropdowns and date picker (assets/js/fields.js), continued: these must come after the rules above) */
.bs-select-check { display: none; flex-shrink: 0; }
.bs-select-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 6px 12px;
    flex-shrink: 0;
}
.bs-select-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.bs-cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.bs-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
.bs-cal-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 6px 0 2px; }
/* (Sign in, sign up and the other account pages, continued: these must come after the rules above) */
.lg-brand-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lg-logo { display: flex; align-items: center; gap: 10px; }
.lg-logo-name { font-size: 17px; }
.lg-main {
    flex: 1;
    display: flex;
    justify-content: center;
    margin-top: -30px;
    position: relative;
}
.lg-biz { display: flex; align-items: center; gap: 14px; }
.lg-form { display: grid; gap: 16px; }
.lg-field { display: grid; gap: 7px; }
.lg-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.lg-foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
.login-mark, .icon-lg, .icon-hero { display: flex; align-items: center; justify-content: center; }
.auth-btn { width: 100%; justify-content: center; }
.choose-list { display: grid; gap: 10px; }
.choose-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.invite-text {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 14px;
    line-height: 1.4;
}
.invite-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.setup-page { max-width: 560px; margin: 0 auto; padding: 20px 16px 40px; }
.setup-lead { margin: 6px 0 16px; font-size: 14px; }
.setup-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* Settings > My PIN: one line per business the PIN can lock. */
.pin-lock-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 2px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}
@media (max-width: 420px) { .setup-row { grid-template-columns: 1fr; } }
@media (min-width: 900px) {
    .lg-main { flex: 1 1 50%; margin: 0; align-items: center; padding: 32px; }
}
/* (Dashboard, continued: these must come after the rules above) */
.db-hero-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.db-hero-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--hero-muted);
}
.db-hero-value { font-size: 38px; line-height: 1.05; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.db-hero-cmp { font-size: 12.5px; font-weight: 500; color: var(--hero-muted); margin-top: -6px; }
.db-greet-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
/* Today: sales with its hourly line, and profit + number of sales inside the same card */
.db-top { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
/* Quick actions: cards you tap, three to a row (two rows for six) */
.db-qa { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.db-qa-go { display: none; }
.sauti-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sauti-nav { display: none; gap: 6px; }
.sauti-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
@media (max-width: 899px) and (max-height: 799px) {
    .db-top { gap: 8px; }
    .db-qa { gap: 6px; }
    .sauti-bar { margin-bottom: 4px; }
}
@media (max-width: 899px) and (min-height: 800px) {
    .db-top { gap: 14px; }
    .db-qa { gap: 8px; }
}
@media (min-width: 900px) { .db-hero-value { font-size: 44px; } }
@media (max-width: 360px) { .db-hero-value { font-size: 32px; } }
@media (min-width: 900px) {
    .db-greet-text { flex-direction: row; align-items: baseline; gap: 10px; }
    .db-top { gap: 18px; }
    /* Action tiles: a grid of cards as tall as the figures card beside it */
    .db-qa {
        grid-auto-flow: row;
        grid-auto-columns: auto;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: 1fr;
        gap: 14px;
    }
    .sauti-bar { margin-bottom: 12px; }
    .sauti-nav { display: flex; }
}
/* (Sales, continued: these must come after the rules above) */
.sale-confirm-head {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--line);
}
.sale-confirm-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}
.sale-confirm-line { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.sale-confirm-meta { margin-top: 12px; display: grid; gap: 6px; color: var(--muted); }
.sale-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 10px;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--line);
}
.fcb-action { gap: 6px; }
.discount-input-row { display: flex; gap: 8px; align-items: stretch; }
.new-customer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.customer-search-form { display: flex; gap: 8px; }
.customer-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}
.customer-head { display: flex; gap: 12px; align-items: flex-start; }
.reserved-warning { margin-bottom: 10px; }
.customer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.customer-links .btn { white-space: nowrap; }
@media (max-width: 300px) { .customer-links { grid-template-columns: 1fr; } }
a.debts-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 560px; color: inherit; text-decoration: none; }
a.debts-link > span:first-child { min-width: 0; line-height: 1.45; }
a.debts-link .ui-ico { vertical-align: -3px; margin-right: 2px; }
/* (Products, continued: these must come after the rules above) */
.upload { position: relative; margin-bottom: 4px; }
.restock-open { width: 100%; margin-bottom: 12px; justify-content: center; }
.restock-help { margin: 0 0 10px; }
.restock-line-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.restock-avg { font-size: 12.5px; font-weight: 600; min-height: 1em; }
.transfer-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin-bottom: 8px;
}
.transfer-note { margin: 0 0 8px; font-size: 13px; }
.transfer-send-line {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 8px;
    align-items: end;
    padding-right: 0;
}
@media (max-width: 360px) { .transfer-send-line { grid-template-columns: minmax(0, 1fr) 84px; } }
/* (Expenses, continued: these must come after the rules above) */
.ex-filter {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 10px;
    align-items: end;
    margin: 0;
}
.ex-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}
.ex-chart-title {
    margin: 0;
    font-size: 16px;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 6px;
}
.ex-chart-sub { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.ex-empty { padding: 18px 0 6px; color: var(--muted); font-size: 13.5px; }
.ex-bar-count { font-size: 12px; font-weight: 600; color: var(--muted); }
.ex-del-form { margin: 0; flex-shrink: 0; }
.ex-bars {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    gap: 2px;
    grid-template-columns: minmax(0, 1fr);
}
@media (max-width: 759px) { .ex-amount { padding-top: 2px; font-size: 14px; } }
@media (max-width: 640px) {
    .ex-filter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .ex-chart-total {
        text-align: left;
        width: 100%;
        display: flex;
        align-items: baseline;
        gap: 8px;
    }
}
@media (max-width: 420px) {
    .ex-bar-count { display: none; }
    .ex-bar-value { font-size: 12.5px; }
}
@media (min-width: 760px) { .ex-meta-m { display: none; } }
/* (Reports, continued: these must come after the rules above) */
.pocket-track { height: 8px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
/* (App shell, continued: these must come after the rules above) */
.nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* (Menus, continued: these must come after the rules above) */
.notif-badge {
    top: -5px;
    right: -5px;
    border: 2px solid var(--card);
    min-width: 20px;
    height: 20px;
}
.notif-done-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: var(--r-pill);
    font-weight: 600;
}
.branch-row-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1023px) { .branch-btn { height: 40px; } }
/* (Building blocks, continued: these must come after the rules above) */
.stat-ico {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, currentColor 14%, transparent);
}
.alert { border-radius: var(--r-md); border: 1px solid transparent; }
.alert-success { border-color: rgba(22, 163, 74, .25); }
.card { border-radius: var(--r-lg); border: 1px solid var(--line); box-shadow: none; }
.btn { border-radius: var(--r-pill); font-weight: 600; }
.stat { border-radius: var(--r-lg); }
@media (max-width: 360px) { .stat-ico { top: 10px; right: 10px; width: 26px; height: 26px; } }
/* (Dropdowns and date picker (assets/js/fields.js), continued: these must come after the rules above) */
.bs-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: var(--r-md);
    font-size: 15px;
    cursor: pointer;
    user-select: none;
}
/* (Sign in, sign up and the other account pages, continued: these must come after the rules above) */
.lg-shell {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}
.lg-brand {
    position: relative;
    overflow: hidden;
    color: #fff;
    padding: 22px 22px 54px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
/* The logo (navy artwork) sits on a white tile, which reads on the dark panel in both themes. */
.lg-mark {
    width: 40px;
    height: 40px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
}
.lg-lang { display: flex; padding: 3px; background: rgba(255, 255, 255, .1); border-radius: var(--r-pill); }
.lg-card {
    width: 100%;
    background: var(--card);
    padding: 24px max(22px, calc((100% - 440px) / 2)) 28px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.lg-biz-mark {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.lg-input {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--input-bg);
    color: var(--muted);
    transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.lg-eye {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.lg-submit {
    position: relative;
    overflow: hidden;
    min-height: 54px;
    border: 0;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background var(--dur-fast) ease, scale var(--dur-press) var(--ease-out);
}
.choose-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--r-pill);
    white-space: nowrap;
}
@media (min-width: 900px) {
    .lg-shell { flex-direction: row; }
    .lg-brand { flex: 1 1 50%; padding: 40px 56px; gap: 36px; }
}
/* (Dashboard, continued: these must come after the rules above) */
.db-hero {
    position: relative;
    overflow: hidden;
    padding: 20px 20px 16px;
    background: var(--brand-deep);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}
.db-hero-rings {
    position: absolute;
    right: -70px;
    top: -80px;
    width: 220px;
    height: 220px;
    opacity: .16;
    pointer-events: none;
}
.db-delta {
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--r-pill);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 8px;
}
.db-spark {
    display: block;
    width: 100%;
    height: 62px;
    flex: 1 1 62px;
    min-height: 62px;
    max-height: 190px;
}
.db-qa-label { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-qa-ico {
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
@media (max-width: 899px) and (max-height: 799px) { .db-qa-ico { width: 40px; height: 40px; border-radius: var(--r-md); } }
@media (max-width: 899px) and (min-height: 800px) { .db-qa-ico { width: 50px; height: 50px; border-radius: var(--r-md); } }
@media (min-width: 900px) {
    .db-hero { padding: 24px 24px 18px; }
    .db-qa-label { white-space: normal; }
    .db-qa-ico { width: 48px; height: 48px; border-radius: var(--r-md); }
}
/* (Sales, continued: these must come after the rules above) */
.sale-confirm-body { padding: 14px 20px; overflow-y: auto; }
.sale-confirm-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    background: var(--green-bg);
    color: var(--green-dark);
}
.product-tile { border-radius: var(--r-lg); }
/* (Products, continued: these must come after the rules above) */
.upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
/* (Expenses, continued: these must come after the rules above) */
.ex-insight {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 14px 0 6px;
    padding: 10px 12px;
    border-radius: var(--r-md);
    background: var(--ex-tint);
    color: var(--ink);
    font-size: 13px;
    line-height: 1.45;
}
.ex-bar {
    display: block;
    width: 100%;
    padding: 9px 8px;
    border: 0;
    border-radius: var(--r-md);
    background: transparent;
    font: inherit;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: background var(--dur-fast) ease, opacity var(--dur-fast) var(--ease-out);
}
.ex-bar-ico {
    width: 28px;
    height: 28px;
    border-radius: var(--r-sm);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ex-tint);
    color: var(--ex-bar);
}
.ex-bar-track {
    display: block;
    height: 8px;
    margin: 7px 0 0 36px;
    border-radius: 4px;
    background: var(--pv-grid);
    overflow: hidden;
}
.ex-bar-fill { display: block; height: 100%; border-radius: 4px; background: var(--ex-bar-soft); }
.ex-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 12px;
    border-radius: var(--r-pill);
    border: 1px solid var(--ex-bar);
    background: var(--ex-tint);
    color: var(--ink);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}
.ex-list-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--muted);
}
.ex-cat-ico {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ex-tint);
    color: var(--ex-bar);
}
.ex-desc {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ex-meta-m {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ex-del, .ex-del-space { width: 36px; height: 36px; flex-shrink: 0; }
.ex-del {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--muted);
    cursor: pointer;
    transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
@media (max-width: 759px) {
    .ex-desc {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow-wrap: anywhere;
    }
    .ex-meta-m { white-space: normal; }
}
@media (max-width: 420px) { .ex-bar-track { margin-left: 34px; } }
@media (min-width: 760px) {
    .ex-chip {
        display: inline-block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
        padding: 3px 10px;
        border-radius: var(--r-pill);
        background: var(--bg);
        font-size: 12px;
        font-weight: 700;
    }
}
/* (Reports, continued: these must come after the rules above) */
.pocket-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--r-pill);
    font-size: 12px;
    font-weight: 700;
    background: var(--green-bg);
    color: var(--green-dark);
}
.rf-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.rf-periods {
    position: relative;
    display: flex;
    gap: 2px;
    padding: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    max-width: 100%;
}
.rf-range {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: var(--r-pill);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}
.rf-custom, .rf-filters {
    display: grid;
    gap: 10px;
    align-items: end;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}
.rf-field { display: grid; gap: 4px; margin: 0; min-width: 0; }
.rf-field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    padding-left: 2px;
}
.rf-apply { min-height: 42px; padding: 0 18px; }
.rf-clear {
    align-self: end;
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
}
.pv-card { display: flex; flex-direction: column; }
.pv-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.pv-card-title { margin: 0; font-size: 15px; color: var(--ink); }
.pv-card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pv-kpi-value { font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.pv-delta { font-size: 12px; font-weight: 700; margin-top: 2px; }
.pv-empty {
    padding: 28px 8px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Top sellers: horizontal bars (HTML, so long product names wrap cleanly) */
.pv-bars {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}
.pv-bar-row { cursor: default; border-radius: var(--r-sm); outline: none; transition: opacity var(--dur-fast) var(--ease-out); }
/* (Base, continued: these must come after the rules above) */
/* One focus ring everywhere: purple, offset from the element. */
:focus-visible { outline-color: var(--focus); }
/* (Dropdowns and date picker (assets/js/fields.js), continued: these must come after the rules above) */
.bs-select-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 288px;
    overflow-y: auto;
    overscroll-behavior: contain;
    outline: none;
}
/* (Reports, continued: these must come after the rules above) */
.pv-bar-label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 5px;
}
.pv-bar-rank {
    width: 18px;
    flex-shrink: 0;
    color: var(--muted);
    font-weight: 700;
    font-size: 12px;
}
.pv-bar-name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pv-bar-track {
    height: 10px;
    margin-left: 26px;
    border-radius: 4px;
    background: var(--pv-grid);
    overflow: hidden;
}
/* Money holding donut */
.pv-donut-wrap {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
}
.pv-donut { width: 170px; height: 170px; flex-shrink: 0; }
.pv-donut-center-label { font-size: 11px; font-weight: 600; fill: var(--muted); }
.pv-donut-center-value { font-size: 17px; font-weight: 700; fill: var(--ink) !important; }
.pv-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
    flex: 1;
    min-width: 180px;
}
/* (Building blocks, continued: these must come after the rules above) */
.card, .card > *, .stat, .pv-card { min-width: 0; }
/* (Dropdowns and date picker (assets/js/fields.js), continued: these must come after the rules above) */
.bs-select { position: relative; width: 100%; min-width: 0; }
.bs-select-value {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* (Sales, continued: these must come after the rules above) */
.customer-chosen-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* (Products, continued: these must come after the rules above) */
.upload-meta { flex: 1; min-width: 0; }
.transfer-line-name { font-weight: 600; min-width: 0; }
/* The app's dropdown inside a row of fields: it may shrink (its text gets "...") instead of pushing the row wider. */
.transfer-send-line > label, .restock-line > label, .layaway-line > * { min-width: 0; }
/* (Expenses, continued: these must come after the rules above) */
.ex-bar-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    min-width: 0;
}
.ex-bar-name {
    flex: 1;
    min-width: 0;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ex-bar-pct {
    min-width: 42px;
    text-align: center;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--r-pill);
    background: var(--bg);
    color: var(--ink);
}
.ex-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-top: 1px solid var(--line);
    min-width: 0;
}
.ex-main { flex: 2 1 0; min-width: 0; }
.ex-c {
    display: none;
    min-width: 0;
    font-size: 13px;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ex-head { display: none; }
@media (max-width: 420px) {
    .ex-bar-label { font-size: 13px; gap: 6px; }
    .ex-bar-pct { min-width: 0; padding: 2px 5px; }
}
@media (min-width: 760px) {
    .ex-head {
        display: flex;
        padding-top: 9px;
        padding-bottom: 9px;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .05em;
        color: var(--muted);
    }
}
@media (max-width: 759px) { .ex-row { align-items: flex-start; gap: 10px; padding: 12px 14px; } }
@media (min-width: 760px) {
    .ex-c { display: block; }
    .ex-time { flex: 0 0 48px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
}
/* (Reports, continued: these must come after the rules above) */
.pv-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 3px 6px;
    margin: 0 -6px;
    border-radius: var(--r-sm);
    transition: background var(--dur-fast) ease, opacity var(--dur-fast) var(--ease-out);
}
.pv-legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.pv-legend-pct { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
/* Shared tooltip */
.pv-tooltip {
    position: fixed;
    z-index: 50;
    pointer-events: none;
    color: #fff;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.5;
    box-shadow: 0 6px 18px rgba(0,0,0,.28);
    max-width: 240px;
}
/* Sales history with view switch */
.pv-history-head { align-items: center; }
.pv-seg { display: inline-flex; padding: 3px; gap: 2px; }
.pv-seg-count {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: var(--r-pill);
    background: var(--line);
    color: var(--ink);
}
.pv-table-wrap { margin: 0; }
.pv-chevron { color: var(--muted); transition: transform var(--dur-fast) var(--ease-out); display: inline-flex; width: auto; }
.pv-items {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 2px;
    white-space: normal;
    max-width: 280px;
}
/* (Building blocks, continued: these must come after the rules above) */
.btn-blue, .btn-green { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
/* (App shell, continued: these must come after the rules above) */
.topbar-brand {
    display: none;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}
.topbar-brand-name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
    white-space: nowrap;
}
.topbar-brand-shop {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 1023px) { .topbar-brand { display: flex; } }
@media (min-width: 1024px) {
    .sidebar-brand-name { color: var(--ink); }
    .sidebar-brand-app { font-size: 11.5px; margin-top: 1px; color: var(--muted); font-weight: 500; }
}
/* (Menus, continued: these must come after the rules above) */
.branch-row-note { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
/* above the bottom menu and the field sheets */
.branch-sheet-sub { margin: -4px 0 12px; font-size: 13px; color: var(--muted); }
/* (Building blocks, continued: these must come after the rules above) */
.btn-red { box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.btn-outline { background: var(--button-outline-bg); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
/* (Base, continued: these must come after the rules above) */
.icon-lg {
    width: 72px;
    height: 72px;
    margin: 0 auto 8px;
    border-radius: 50%;
    background: var(--lime-soft);
    color: var(--green);
}
.icon-hero {
    width: 80px;
    height: 80px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-ink);
}
.pw-eye {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
}
/* (App shell, continued: these must come after the rules above) */
.topbar { background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.biz-monogram, body[data-theme="dark"] .biz-monogram {
    background: var(--solid);
    color: var(--on-solid);
    border-radius: 50%;
    font-weight: 600;
}
.settings-btn, .notif-bell, .theme-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.topbar .user-menu .dropdown, .notif-dropdown { border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lift); }
.bottom-nav {
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -8px 24px -18px rgba(16, 24, 40, .35);
}
.icon-btn { border-radius: 50%; border: 1px solid var(--line); }
.topbar-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--r-md);
    flex-shrink: 0;
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
}
.topbar { border-top: env(safe-area-inset-top, 0px) solid transparent; }
@media (max-width: 420px) { .settings-btn, .notif-bell, .theme-btn, .topbar .avatar { width: 38px; height: 38px; } }
@media (min-width: 1024px) {
    .bottom-nav { background: var(--card); border-right: 1px solid var(--line); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (max-width: 1023px) {
    .bottom-nav {
        left: 12px;
        right: 12px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        max-width: 456px;
        margin: 0 auto;
        height: 66px;
        padding: 0 6px;
        align-items: stretch;
        overflow: visible;
        border: 0;
        border-radius: var(--r-xl);
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        filter: drop-shadow(0 12px 22px rgba(16, 24, 40, .16)) drop-shadow(0 1px 2px rgba(16, 24, 40, .1));
    }
}
@media (min-width: 1024px) {
    .sidebar-brand { border-bottom: 1px solid var(--line); }
    .sidebar-toggle {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        min-height: 44px;
        margin-top: auto;
        padding: 0 12px;
        border: 0;
        border-radius: var(--r-md);
        background: transparent;
        color: var(--muted);
        font: inherit;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
    }
    .settings-btn, .notif-bell, .theme-btn, .topbar .avatar { width: 38px; height: 38px; }
    .sidebar-logo { width: 38px; height: 38px; border-radius: var(--r-sm); }
}
.settings-btn, .notif-bell, .theme-btn {
    transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease, scale var(--dur-press) var(--ease-out);
}
.icon-btn {
    transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease, background-color var(--dur-fast) ease, scale var(--dur-press) var(--ease-out);
}
/* (Menus, continued: these must come after the rules above) */
.notif-badge { background: var(--brand); }
.notif-all-btn {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: var(--brand);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 4px;
}
/* (Help, continued: these must come after the rules above) */
.logout-confirm-ico {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--red-bg);
    color: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
}
/* (Dropdowns and date picker (assets/js/fields.js), continued: these must come after the rules above) */
.bs-select-native {
    position: absolute !important;
    left: 50%;
    bottom: 0;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0;
    pointer-events: none;
    clip-path: inset(50%);
}
/* (App shell, continued: these must come after the rules above) */
@media (max-width: 1023px) {
    .bottom-nav, .floating-cart-bar {
        left: calc(12px + env(safe-area-inset-left, 0px));
        right: calc(12px + env(safe-area-inset-right, 0px));
    }
}
/* (Dropdowns and date picker (assets/js/fields.js), continued: these must come after the rules above) */
.bs-select-btn {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 16px 0 18px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--input-bg);
    color: var(--input-text);
    font: inherit;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.bs-select-chev { flex-shrink: 0; color: var(--muted); transition: transform var(--dur-base) var(--ease-out); }
/* The list of choices */
.bs-select-panel {
    position: fixed;
    z-index: 120;
    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lift);
    padding: 6px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.bs-select-empty { padding: 18px 12px; text-align: center; color: var(--muted); font-size: 14px; }
/* Phones and the app: a bottom sheet */
.bs-select-overlay {
    position: fixed;
    inset: 0;
    z-index: 119;
    background: rgba(2, 6, 23, .5);
    opacity: 0;
    transition: opacity var(--dur-base) var(--ease-out);
}
.bs-select-grip {
    width: 40px;
    height: 5px;
    border-radius: var(--r-pill);
    background: var(--line);
    margin: 2px auto 10px;
    flex-shrink: 0;
}
.bs-select-close {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--card);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.bs-date-ico { flex-shrink: 0; color: var(--muted); }
.bs-cal-panel { padding: 12px; }
.bs-cal-nav {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--card);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.bs-cal-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.bs-cal-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 6px 0 4px;
    text-align: center;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
}
.bs-cal-day {
    justify-self: center;
    width: min(100%, 42px);
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.bs-cal-month {
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.bs-cal-foot {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line-soft, var(--line));
}
.bs-cal-link {
    padding: 8px 14px;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--brand-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
/* (Sign in, sign up and the other account pages, continued: these must come after the rules above) */
.lg-brand { background: var(--brand-deep); }
.lg-input { border: 1px solid var(--line); border-radius: var(--r-pill); padding-left: 18px; }
.lg-submit {
    border-radius: var(--r-pill);
    background: var(--brand);
    font-weight: 600;
    box-shadow: 0 10px 24px -12px rgba(134, 79, 254, .7);
}
.login-wrap { position: relative; overflow: hidden; isolation: isolate; background: var(--bg); }
.login-card { border: 1px solid var(--line); border-radius: var(--r-xl); }
.login-mark {
    border-radius: 50%;
    background: var(--solid);
    color: var(--on-solid);
    box-shadow: none;
    font-weight: 600;
}
.choose-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--r-lg);
    color: var(--ink);
    text-decoration: none;
    background: var(--card);
}
.choose-mark {
    width: 42px;
    height: 42px;
    border-radius: var(--r-md);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 700;
    font-size: 18px;
}
/* An invitation to a business (staff added by an owner): Accept / Refuse, above the businesses. */
.invite-card {
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px solid var(--brand);
    border-radius: var(--r-lg);
    background: var(--brand-soft);
    color: var(--ink);
}
.setup-shell { min-height: 100vh; min-height: 100svh; background: var(--bg); }
.setup-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
}
.setup-hello { margin: 0; font-size: 24px; letter-spacing: -0.02em; color: var(--ink); }
.setup-preview {
    margin-top: 16px;
    opacity: .45;
    filter: saturate(.6);
    pointer-events: none;
    user-select: none;
}
/* (Base, continued: these must come after the rules above) */
/* Holding a finger on a control must not select its label or pop the copy / share menu.
   Controls only - names, amounts and phone numbers on the page stay selectable. */
button,
.btn,
[role="button"],
.bottom-nav a,
.tabs-bar > *,
.rf-periods > a,
.layaway-filter a,
.product-tile,
.choose-item,
.db-qa-item,
.bs-select-btn,
.sauti-arrow,
.branch-row {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
/* (Sign in, sign up and the other account pages, continued: these must come after the rules above) */
@media (min-width: 900px) {
    .lg-card {
        max-width: 440px;
        padding: 32px 30px;
        border-radius: var(--r-xl);
        border: 1px solid var(--line);
        box-shadow: var(--shadow-lift);
    }
}
.choose-item { transition: border-color var(--dur-fast) ease, scale var(--dur-press) var(--ease-out); }
/* (Dashboard, continued: these must come after the rules above) */
.db-hero { border-radius: var(--r-xl); box-shadow: none; }
/* the inline tints set the circle; the line icon stays ink */
.insight-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
}
.db-scope {
    display: inline-flex;
    padding: 3px;
    border-radius: var(--r-pill);
    background: var(--input-bg);
    border: 1px solid var(--line);
    flex-shrink: 0;
}
.sauti-card {
    --tone: var(--muted);
    --tone-bg: var(--input-bg);
    --tone-ink: var(--ink);
    position: relative;
    flex: 0 0 100%;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px 14px;
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    background: linear-gradient(120deg, var(--tone-bg) 0%, var(--card) 70%) var(--card);
}
@media (max-width: 899px) and (max-height: 799px) { .sauti-card { padding: 10px 14px; } }
@media (max-width: 899px) and (min-height: 800px) { .sauti-card { padding: 14px 16px; } }
@media (min-width: 900px) {
    .sauti-card { flex: 1 0 calc((100% - 32px) / 3); max-width: calc((100% - 32px) / 3 * 1.5 + 16px); min-height: 120px; padding: 18px; }
}
/* (Sales, continued: these must come after the rules above) */
.floating-cart-bar {
    background: var(--brand);
    border-radius: var(--r-pill);
    padding: 12px 22px;
    box-shadow: 0 12px 28px -10px rgba(134, 79, 254, .65);
}
.goto-cart-fab {
    background: var(--brand);
    border: 0;
    box-shadow: 0 6px 14px -6px rgba(134, 79, 254, .6);
    filter: none;
}
.ptile-photo-placeholder, .product-photo-placeholder { background: var(--surface); color: var(--muted); }
.sale-confirm-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border-radius: 50%;
    background: var(--lime);
    color: #1a1a1c;
}
.goto-cart-fab { color: #fff; }
.qty-box {
    gap: 0;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--card);
}
.cart-remove-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
}
.disc-toggle {
    display: flex;
    flex-shrink: 0;
    border: 1.5px solid var(--line);
    border-radius: var(--r-pill);
    padding: 3px;
    background: var(--input-bg);
}
.disc-type {
    min-width: 48px;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.discount-preview { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--green-dark); }
.customer-chosen {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 14px;
    border: 1.5px solid var(--blue);
    border-radius: var(--r-md);
    background: var(--blue-bg);
}
.new-customer { padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface, var(--bg)); }
@media (max-width: 360px) { .disc-type { min-width: 42px; padding: 0 8px; } }
/* (Products, continued: these must come after the rules above) */
.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    margin: 0;
    padding: 22px 16px;
    border: 1.5px dashed var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    color: var(--ink);
    font-weight: 400;
    cursor: pointer;
    transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.upload-zone-ico {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
    border: 1px solid var(--line);
    color: var(--brand-ink);
    margin-bottom: 4px;
}
.upload-zone-text { font-size: 14px; color: var(--ink-soft); }
.upload-zone-hint { font-size: 12.5px; color: var(--muted); }
.upload-file {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--card);
}
.upload-thumb {
    width: 56px;
    height: 56px;
    border-radius: var(--r-md);
    object-fit: cover;
    background: var(--surface);
    flex-shrink: 0;
}
.upload-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.upload-status { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.upload-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    height: 36px;
    padding: 0 14px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}
.upload-remove { width: 36px; padding: 0; justify-content: center; }
.restock-line {
    position: relative;
    padding: 12px 12px 10px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
}
.restock-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.restock-total {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    font-size: 14px;
}
.stock-readonly {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 12px 14px;
    border: 1.5px dashed var(--line);
    border-radius: var(--r-md);
}
.transfer-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    margin: 0;
}
@media (max-width: 420px) { .upload-action { width: 36px; padding: 0; justify-content: center; } }
/* (Reports, continued: these must come after the rules above) */
.pv-grid { display: grid; gap: 0 14px; grid-template-columns: minmax(0, 1fr); }
.pv-bar-row, .pv-bar-label { min-width: 0; }
.rf-periods, .pv-seg { background: var(--seg-track); border: 0; border-radius: var(--r-pill); }
.rf-range, body[data-theme="dark"] .rf-range { background: var(--brand-soft); color: var(--brand-ink); }
/* (App shell, continued: these must come after the rules above) */
@media (min-width: 1024px) {
    .bottom-nav.bottom-nav-scroll a, .bottom-nav a { color: var(--muted); border-radius: var(--r-md); font-weight: 500; }
    .bottom-nav a.active, body[data-theme="dark"] .bottom-nav a.active {
        background: var(--brand-soft);
        color: var(--brand-ink);
        font-weight: 600;
    }
}
@media (min-width: 1024px) { @media (hover: hover) and (pointer: fine) { .bottom-nav a:hover { background: var(--surface); color: var(--ink); } } }
@media (max-width: 1023px) {
    .bottom-nav a.nav-pos {
        position: relative;
        justify-content: flex-end;
        padding-bottom: 9px;
        color: var(--ink);
        font-weight: 600;
    }
}
@media (min-width: 1024px) { .bottom-nav a.sidebar-logout { margin-top: 4px; color: var(--red); } }
/* (Sign in, sign up and the other account pages, continued: these must come after the rules above) */
.lg-lang a.is-active { background: #fff; color: #1a1a1c; }
/* (Menus, continued: these must come after the rules above) */
a.notif-item.notif-notice {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-decoration: none;
    color: inherit;
    min-height: 44px;
}
/* (Sign in, sign up and the other account pages, continued: these must come after the rules above) */
.lg-biz-mark, body[data-theme="dark"] .lg-biz-mark {
    border-radius: 50%;
    background: var(--solid);
    color: var(--on-solid);
    font-weight: 600;
}
/* The brand logo on a white tile, like the top bar's logo (a business's initial keeps the dark circle). */
.lg-biz-mark.is-logo, body[data-theme="dark"] .lg-biz-mark.is-logo {
    border-radius: var(--r-md);
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--line);
}
.lg-biz-mark.is-logo img { display: block; width: 72%; height: 72%; object-fit: contain; }
/* (Dashboard, continued: these must come after the rules above) */
.db-scope a.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
body[data-theme="dark"] .sauti-card-ico { color: #0b1220; }
/* (Sales, continued: these must come after the rules above) */
td.stock-low .ui-ico { color: var(--warn); }
/* (Reports, continued: these must come after the rules above) */
.pv-bar-fill {
    display: block;
    height: 100%;
    border-radius: 0 4px 4px 0;
    transition: width .4s ease;
    background: var(--brand);
}
.pv-tooltip { background: #1a1a1c; border-radius: var(--r-md); }
.donut-legend-arrow { display: inline-flex; transition: transform var(--dur-fast) var(--ease-out); }
@media (max-width: 560px) {
    .rf-top { flex-direction: column; align-items: stretch; }
    .rf-clear { grid-column: 1 / -1; justify-content: center; min-height: 32px; }
}
@media (min-width: 900px) { .pv-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
/* (Customers and layaways, continued: these must come after the rules above) */
.layaway-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.layaway-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px 40px;
    gap: 8px;
    align-items: end;
    margin-bottom: 8px;
}
.layaway-filter a.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
/* (People, continued: these must come after the rules above) */
.role-picker { border: 0; margin: 14px 0 0; padding: 0; min-width: 0; }
.role-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 8px;
    padding: 12px;
    min-height: 48px;
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    background: var(--card);
    cursor: pointer;
    font-weight: 400;
}
.role-option-ico { color: var(--muted); margin-top: 1px; flex-shrink: 0; }
.role-option-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--r-pill);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    background: var(--surface);
    color: var(--ink);
}
/* (Settings, continued: these must come after the rules above) */
.settings-row-icon { border-radius: 50%; }
.settings-row-icon { color: var(--ink); }
.settings-logout {
    margin-top: 24px;
    color: var(--red);
    border-color: color-mix(in srgb, var(--red) 35%, var(--line));
    text-decoration: none;
}
/* (Base, continued: these must come after the rules above) */
.field-error { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--red-dark); }
/* (Building blocks, continued: these must come after the rules above) */
.badge-done { background: var(--input-bg); color: var(--muted); }
.alert-warn {
    background: var(--warn-bg);
    color: var(--warn-dark);
    border: 1px solid var(--warn);
    border-radius: var(--r-md);
    padding: 10px 12px;
    font-size: 13.5px;
    font-weight: 600;
}
/* (Dashboard, continued: these must come after the rules above) */
.db-greet {
    display: flex;
    justify-content: space-between;
    gap: 8px 14px;
    align-items: center;
    flex-wrap: nowrap;
    margin: 0 0 10px;
}
.db-greet-date { font-size: 12.5px; }
.db-note { margin: -4px 0 12px; }
.db-spark-empty { font-size: 12px; color: var(--hero-muted); padding: 4px 0 6px; }
.db-hero-minis {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 4px;
}
.db-qa-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    padding: 9px 6px;
    border-radius: var(--r-lg);
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    text-align: center;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink);
    -webkit-tap-highlight-color: transparent;
    transition: transform var(--dur-fast) var(--ease-out), scale var(--dur-press) var(--ease-out), box-shadow var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
/* Sauti ya Biashara: one card at a time on a phone, sliding right to left */
.sauti { margin-top: 12px; }
.sauti-title {
    line-height: 1.2;
    letter-spacing: -0.02em;
    display: block;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}
.sauti-pos {
    margin-left: auto;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.sauti-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sauti-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 -16px;
    padding: 0 16px 2px;
    scroll-padding: 0 16px;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}
.sauti-card-ico {
    width: 40px;
    height: 40px;
    border-radius: var(--r-md);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tone);
    color: #fff;
}
.sauti-card-kind {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--tone-ink);
}
.sauti-card-text {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--ink);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.sauti-card-detail {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* The whole card opens it; the round arrow shows where. */
.sauti-card-go {
    position: static;
    flex-shrink: 0;
    align-self: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
    color: var(--ink);
    box-shadow: 0 0 0 1px var(--line);
}
.sauti-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
}
.sauti-card-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
    padding: 0 12px;
    border-radius: var(--r-pill);
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    background: var(--ink);
    color: var(--card);
}
.sauti-note { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.sauti-dots {
    vertical-align: middle;
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 6px 0 0;
}
@media (max-width: 899px) and (max-height: 799px) {
    .db-greet { margin-bottom: 4px; }
    .db-qa-item { padding: 6px; gap: 5px; }
    .sauti { margin-top: 8px; }
    .sauti-dots { display: none; }
}
@media (max-width: 899px) and (min-height: 800px) {
    .db-greet { margin-bottom: 14px; }
    .db-qa-item { padding: 8px 6px; gap: 8px; font-size: 13px; }
    .sauti { margin-top: 16px; }
}
@media (min-width: 900px) {
    .db-greet { margin-bottom: 18px; }
    .db-greet-date { font-size: 13.5px; }
    .db-hero-minis { gap: 12px; }
    /* Each tile is plainly a button: raised, an arrow in the corner, lifts under the pointer, presses in. */
    .db-qa-item {
        align-items: flex-start;
        justify-content: space-between;
        gap: 14px;
        padding: 18px;
        border-radius: var(--r-lg);
        text-align: left;
        font-size: 15px;
        cursor: pointer;
        box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 14px -6px rgba(16, 24, 40, 0.14);
    }
    .db-qa-go {
        position: absolute;
        top: 14px;
        right: 14px;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--input-bg);
        border: 1px solid var(--line);
        color: var(--muted);
        transition: background var(--dur-fast) ease, color var(--dur-fast) ease, transform var(--dur-base) var(--ease-out);
    }
    .sauti { margin-top: 26px; }
    .sauti-title { font-size: 18px; }
    .sauti-track { margin: 0; padding: 2px 0 4px; gap: 16px; scroll-padding: 0; }
    .sauti-dots { display: none; }
}
/* (Sales, continued: these must come after the rules above) */
.customer-pick { margin-top: 12px; }
.customer-results {
    margin-top: 6px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--card);
    box-shadow: var(--shadow);
    overflow: hidden;
    max-height: 290px;
    overflow-y: auto;
}
.customer-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 8px 14px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.customer-add { justify-content: flex-start; color: var(--blue-dark); font-weight: 600; }
.customer-none { padding: 12px 14px; font-size: 13px; border-bottom: 1px solid var(--line); }
.customer-clear {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.customer-avatar {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--blue-bg);
    color: var(--blue-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}
.customer-name { font-size: 18px; font-weight: 800; }
.customer-note {
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    background: var(--warn-bg);
    font-size: 13px;
}
.customer-stats { margin-top: 14px; }
.paid-now { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); }
.customer-credit { margin-top: 6px; font-size: 13px; font-weight: 600; }
/* (Customers and layaways, continued: these must come after the rules above) */
.layaway-progress {
    height: 10px;
    border-radius: var(--r-pill);
    background: var(--input-bg);
    overflow: hidden;
    margin: 12px 0 6px;
}
.layaway-filter {
    display: flex;
    padding: 3px;
    margin: 0 0 12px;
    border-radius: var(--r-pill);
    background: var(--input-bg);
    border: 1px solid var(--line);
}
/* (Audit log, continued: these must come after the rules above) */
.audit-name { display: flex; align-items: center; gap: 8px; }
/* Audit log rows (V11): the icon's colour says what kind of event it is - removed or failed (red), a
   change to look at (amber), money in (green), added or set up (blue), routine sign-ins (grey, lighter
   text) - and the time sits on the right, so a day reads at a glance instead of as one uniform list. */
.audit-row { justify-content: flex-start; align-items: flex-start; gap: 12px; }
.audit-ico {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--blue-bg);
    color: var(--blue-dark);
}
.audit-row.tone-bad .audit-ico { background: var(--red-bg); color: var(--red); }
.audit-row.tone-warn .audit-ico { background: var(--warn-bg); color: var(--warn); }
.audit-row.tone-money .audit-ico { background: var(--green-bg); color: var(--green); }
.audit-row.tone-quiet .audit-ico { background: var(--surface); color: var(--muted); }
.audit-row.tone-quiet .name { font-weight: 500; }
.audit-body { flex: 1; min-width: 0; padding-top: 1px; }
.audit-side { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding-top: 2px; }
.audit-time { font-size: 12.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.audit-count { font-weight: 600; color: var(--muted); }
.day-header.audit-day .day-total { color: var(--muted); }
/* (Guide, continued: these must come after the rules above) */
.guide-steps li { margin-bottom: 3px; }
.guide-icon { border-radius: 50%; }
.guide-nav a { border: 1px solid var(--line); font-weight: 500; }
.guide-icon { color: var(--ink) !important; }

/* ================================================================
   Wide-screen forms (V6)
   A form no longer sits in a narrow column with the right half of the
   screen empty: Matumizi has today's expenses beside its form; the
   product and employee forms put their second part (the photo, the
   role) in a second column. Phones keep the single column, same order.
   ================================================================ */
@media (min-width: 1280px) {
    /* Side by side only where the list keeps readable columns; below this it stays under the form. */
    .form-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
    .form-split .card:has(> form) { max-width: none; }
    .form-split-side > .section-title:first-child { margin-top: 0; }
}
@media (min-width: 1024px) {
    .pf-grid, .pe-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-items: start; }
    /* Add / edit product: the fields on the left, the photo always in view beside them. */
    .pf-grid { grid-template-areas: "fields photo"; grid-template-columns: minmax(0, 1fr) 320px; }
    .pf-photo { grid-area: photo; position: sticky; top: 84px; }
    .pf-photo .upload-file { flex-wrap: wrap; }
    .pf-photo .upload-thumb { width: 100%; height: auto; aspect-ratio: 4 / 3; }
    .card:has(> form .pf-grid) input[type=text], .card:has(> form .pf-grid) input[type=number] { max-width: none; }
    .pf-fields { grid-area: fields; }
    .pf-photo .upload-zone { min-height: 200px; }
    .pe-roles .role-picker:first-child { margin-top: 10px; }
    .card:has(> form .pf-grid), .card:has(> form .pe-grid) { max-width: 1040px; }
    .card:has(> form .pe-grid) form > .btn { max-width: calc(50% - 14px); }
    .card:has(> form .pf-grid) form > .btn { max-width: calc(100% - 348px); }
}

/* ================================================================
   Sign-in pages: the brand panel (beside the form on wide screens, a
   band above it on phones). The product itself rather than a sales
   pitch: the motto, one quiet line of facts, and the app's dashboard in
   a phone rising out of the bottom edge, in the page's own theme.
   Phones show only the logo and the language switch: the form first.
   ================================================================ */
.lg-product, .lg-facts { display: none; }
@media (max-width: 899px) {
    .lg-brand .lg-hero { display: none; }
    .lg-brand { padding-bottom: 50px; }   /* the card overlaps the band by 30px */
}
@media (min-width: 900px) {
    .lg-brand { padding: 40px 56px 0; gap: 0; }
    .lg-hero { margin-top: 64px; max-width: 480px; }
    .lg-hero h1 { font-size: 42px; line-height: 1.06; letter-spacing: -0.035em; text-wrap: balance; }
    .lg-hero p { margin-top: 14px; font-size: 17px; }
    .lg-facts { display: block; order: 1; margin: 22px 0 0; font-size: 13px; font-weight: 500; color: var(--hero-muted); }
    .lg-product {
        order: 2;
        flex: 1;
        min-height: 0;
        position: relative;
        display: flex;
        align-items: flex-end;
        justify-content: flex-start;   /* on the same left edge as the motto: one line to read down */
        margin-top: 40px;
    }
    /* A soft light in the brand colour behind the phone, so it stands off the panel. */
    .lg-product::before {
        content: "";
        position: absolute;
        left: 136px;   /* the middle of the phone */
        bottom: -160px;
        width: 640px;
        height: 640px;
        transform: translateX(-50%);
        border-radius: 50%;
        background: radial-gradient(closest-side, rgba(134, 79, 254, .30), rgba(134, 79, 254, 0));
        pointer-events: none;
    }
    .lg-phone {
        position: relative;
        width: min(272px, calc((100vh - 360px) * .5));
        width: min(272px, calc((100svh - 360px) * .5));
        margin-bottom: -96px;   /* it rises out of the bottom edge */
        padding: 9px;
        border-radius: 44px;
        background: #0b0c0f;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 40px 80px -24px rgba(0, 0, 0, .7);
    }
    .lg-phone img { display: block; width: 100%; height: auto; border-radius: 35px; }
    .lg-phone .shot-dark { display: none; }
    body[data-theme="dark"] .lg-phone .shot-light { display: none; }
    body[data-theme="dark"] .lg-phone .shot-dark { display: block; }
    /* Pages without the picture (PIN, trial ended, the admin): the motto alone, in the middle. */
    .lg-brand:not(:has(.lg-product)) .lg-hero { margin: auto 0; padding-bottom: 64px; }
}

/* ---- Tap targets: at least 44 x 44 px for anything tapped often (UX_AUDIT S-10, N-7) ----
   Last in the file on purpose: it overrides the smaller sizes above, phones included. */
.qty-box .qty-btn { width: 44px; height: 44px; }
.qty-box input.qty-input { width: 44px; height: 44px; }
.cart-remove-btn { width: 44px; height: 44px; }
.settings-btn, .notif-bell, .theme-btn, .topbar .avatar { width: 44px; height: 44px; }
@media (max-width: 420px) { .settings-btn, .notif-bell, .theme-btn, .topbar .avatar { width: 44px; height: 44px; } }
.pay-btn, .amount-chip { min-height: 44px; }
.icon-btn { min-width: 44px; min-height: 44px; }
@media (max-width: 1023px) { .branch-btn { height: 44px; } }
.amount-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
label .muted { font-weight: 500; }
/* With the bigger quantity buttons the cart name has less room: wrap to two lines instead of cutting it. */
.cart-item-info .cart-item-name { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Settings > Njia za Malipo: the usual mobile money services as tick boxes (UX_AUDIT P-1). */
.pm-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 10px 0 4px; }
.pm-presets form { margin: 0; }
.pm-preset {
    width: 100%; min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: var(--r-md, 12px); background: var(--card); color: var(--ink);
    font: inherit; font-weight: 600; font-size: 14px; text-align: left; cursor: pointer;
}
.pm-preset .pm-tick {
    flex: 0 0 22px; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line);
    display: inline-flex; align-items: center; justify-content: center;
}
.pm-preset.is-on { border-color: var(--brand); background: var(--brand-soft); }
.pm-preset.is-on .pm-tick { border-color: var(--brand); background: var(--brand); color: #fff; }
.pm-preset:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Mauzo product picker (UX_AUDIT S-3): the page scrolls, not a 4-tile box inside it; tiles without a
   photo are text only; a list view (one product per row) for small phones. ---- */
.product-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.product-tools .search-field { flex: 1; min-width: 0; margin: 0; }
.pos-sort { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.pos-sort label { flex: 0 0 auto; margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.pos-sort select { flex: 0 1 240px; width: auto; min-width: 0; margin: 0; }
.view-toggle { display: flex; flex-shrink: 0; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card); }
.view-btn {
    width: 44px; height: 44px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--muted);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.view-btn[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-ink); }
.product-grid { max-height: none; overflow: visible; padding-right: 0; }
.product-tile { height: auto; min-height: 0; }
.product-tile .pname { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding-right: 30px; }
.product-tile .pstock .preserved { color: var(--warn-dark); white-space: nowrap; }
.product-tile .pstock .preserved .ui-ico { vertical-align: -2px; }
@media (min-width: 1024px) { .product-tile { height: auto; min-height: 0; } }
/* Tiles: every card the same shape. The picture fills the top edge to edge (a product without one gets its first
   letter there), then the name, with the price and stock lined up along the bottom of each row. */
.product-grid:not(.is-list) { align-items: stretch; }
.product-grid:not(.is-list) .product-tile { display: flex; flex-direction: column; padding: 0; }
.product-grid:not(.is-list) .ptile-photo {
    flex: none; width: 100%; height: auto; aspect-ratio: 4 / 3; margin: 0; border-radius: 0;
    object-fit: cover; background: var(--surface); box-shadow: inset 0 -1px 0 var(--line);
}
.product-grid:not(.is-list) .ptile-photo-placeholder { background: var(--brand-soft); color: var(--brand); font-size: 34px; font-weight: 700; }
.product-grid:not(.is-list) .product-tile .pname { margin: 8px 10px 0; padding-right: 0; line-height: 1.3; min-height: 2.6em; }
.product-grid:not(.is-list) .product-tile .pprice { margin: auto 10px 0; padding-top: 4px; }
.product-grid:not(.is-list) .product-tile .pstock { margin: 0 10px 10px; }
.product-grid:not(.is-list) .product-tile.out-of-stock .ptile-photo { filter: grayscale(.7); }
.product-tile .ptile-qty { box-shadow: 0 0 0 2px var(--card), 0 1px 4px rgba(0,0,0,.25); }
.product-grid.is-list .ptile-photo-placeholder { display: none; }

/* Invitation to install the website as an app (includes/install_app.php). */
.install-card:not([hidden]) { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 14px; position: relative; }
.install-card-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-md); background: var(--brand-soft); color: var(--brand); }
.install-card-text { flex: 1 1 180px; min-width: 0; padding-right: 26px; font-size: 13px; color: var(--muted); }
.install-card-text > b { display: block; font-size: 14px; color: var(--ink); }
.install-card-text > span { display: block; }
.install-card .install-card-go { width: auto; margin: 0; }
.install-card-close { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.install-steps { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-soft); }
.settings-item > .install-steps { padding: 0 12px 12px 48px; }
@media (min-width: 1024px) { .install-card-text { padding-right: 0; } .install-card:not([hidden]) { padding-right: 48px; } }

/* List view: name and stock on the left, price on the right; a small photo when there is one. */
.product-grid.is-list { grid-template-columns: 1fr; gap: 6px; }
.product-grid.is-list .product-tile {
    min-height: 56px; padding: 8px 12px;
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "photo name price" "photo stock price";
    column-gap: 10px; row-gap: 1px; align-items: center;
}
.product-grid.is-list .ptile-photo { grid-area: photo; width: 40px; height: 40px; margin: 0; }
.product-grid.is-list .pname { grid-area: name; margin: 0; padding-right: 0; -webkit-line-clamp: 1; font-size: 14px; }
.product-grid.is-list .pstock { grid-area: stock; }
.product-grid.is-list .pprice { grid-area: price; font-size: 14px; text-align: right; white-space: nowrap; }
.product-grid.is-list .ptile-qty { position: static; grid-area: price; justify-self: end; align-self: start; margin: -2px -4px 0 0; }
.product-grid.is-list .product-tile.selected .pprice { align-self: end; }
@media (min-width: 1024px) { .product-grid.is-list { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); } }

/* Mauzo: "Imerekodiwa · 7,200 TZS" at the foot of the screen after a sale (UX_AUDIT S-8). */
.sale-done-bar {
    position: fixed; left: 12px; right: 12px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 26;
    max-width: 560px; margin: 0 auto; padding: 12px 8px 12px 14px;
    display: flex; align-items: center; gap: 12px;
    background: #0b5e3c; color: #fff; border-radius: var(--r-lg, 16px);   /* the same dark green in both themes: white text stays readable */
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    animation: floatingCartIn .2s ease;
}
.sale-done-bar .sdb-ico { flex: 0 0 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.18); display: inline-flex; align-items: center; justify-content: center; }
.sale-done-bar .sdb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.sale-done-bar .sdb-text b { font-size: 16px; }
.sale-done-bar .sdb-text small { font-size: 13px; opacity: .9; }
.sale-done-bar .sdb-close { flex: 0 0 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: inherit; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
@media (min-width: 1024px) { .sale-done-bar { left: 220px; bottom: 24px; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* "Kikapu chako kimerudishwa" (UX_AUDIT S-9). */
.cart-restored { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 10px 12px; border-radius: var(--r-md, 12px); background: var(--brand-soft); color: var(--ink); font-size: 13px; font-weight: 600; }
.cart-restored[hidden] { display: none; }
.cart-restored .crn-text { flex: 1; min-width: 0; }
.cart-restored .crn-clear { flex-shrink: 0; min-height: 44px; padding: 0 10px; border: 0; background: transparent; color: var(--brand-ink); font: inherit; font-weight: 700; cursor: pointer; }
/* Njia za Malipo: what the last tap did, inside the panel; busy while saving. */
.pm-notice { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 10px; padding: 10px 12px; border-radius: var(--r-md, 12px); font-size: 13px; font-weight: 600; }
.pm-notice .ui-ico { flex-shrink: 0; margin-top: 1px; }
.pm-notice.is-ok { background: var(--green-bg, #e7f6ee); color: var(--green-dark); }
.pm-notice.is-error { background: var(--red-bg); color: var(--red-dark, var(--red)); }
#paymentMethodsPanel.is-busy { opacity: .6; pointer-events: none; }

/* ---- UX phase 3: selling at 0 stock, services, today's price, who did it, Tendua ---- */
.product-tile.out-of-stock { opacity: .8; cursor: pointer; }
.product-tile.out-of-stock.is-blocked { opacity: .5; cursor: not-allowed; }
.product-tile.out-of-stock .pstock { color: var(--warn-dark, #b45309); }
.product-tile.out-of-stock.is-blocked .pstock { color: var(--red, #c0392b); }
.product-tile.is-service .pstock { color: var(--brand-ink); font-weight: 600; }
.cart-row-wrap { border-bottom: 1px solid var(--line); }
.cart-row-wrap:last-child { border-bottom: 0; }
.cart-row-wrap .cart-row { border-bottom: 0; }
.cart-price { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.cart-price.is-changed { color: var(--brand-ink); font-weight: 700; }
.cart-price s { color: var(--muted); font-weight: 500; }
.price-edit { display: none; align-items: center; gap: 6px; flex-wrap: wrap; }
.cart-row.is-editing-price .cart-price { display: none; }
.cart-row.is-editing-price .price-edit { display: inline-flex; }
.price-input { width: 110px !important; height: 40px; padding: 6px 10px !important; font-size: 16px !important; }
.price-reset { min-height: 40px; padding: 0 8px; border: 0; background: none; color: var(--brand-ink); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.cart-note { display: flex; align-items: center; gap: 6px; margin: -2px 0 8px; font-size: 12px; font-weight: 600; color: var(--warn-dark, #b45309); }
.served-by { display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 0 0 10px; scrollbar-width: none; }
.served-by .sb-label { flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.sb-chip { flex-shrink: 0; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.sb-chip.is-on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.sale-done-bar .sdb-undo { margin: 0; flex-shrink: 0; }
.sdb-undo-btn { min-height: 44px; padding: 0 12px; border: 1px solid rgba(255,255,255,.5); border-radius: var(--r-pill); background: transparent; color: #fff; font: inherit; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.txn-undo { margin-top: 6px; font-weight: 500; }
.txn-undo summary { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; color: var(--brand-ink); font-size: 13px; font-weight: 700; cursor: pointer; list-style: none; }
.txn-undo summary::-webkit-details-marker { display: none; }
.txn-undo form { margin-top: 6px; }
.goods-only[hidden], .service-only[hidden] { display: none !important; }
.service-switch { align-items: flex-start; margin: 0 0 6px; }
.badge-service { background: var(--brand-soft); color: var(--brand-ink); }
.worker-row .worker-value { font-weight: 700; white-space: nowrap; }
.kind-filter { display: flex; gap: 6px; margin: 0 0 12px; }
.kind-filter a { min-height: 40px; padding: 0 16px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card); color: var(--ink); font-weight: 600; font-size: 14px; }
.kind-filter a.is-active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.cart-price { flex-wrap: wrap; column-gap: 4px; row-gap: 0; text-align: left; line-height: 1.3; }
.cart-price s, .cart-price .cp-now { white-space: nowrap; }
.served-by { flex-wrap: wrap; overflow: visible; }

/* ---- UX phase 4: stock and money in one place ---- */
.restock-paid-opt { display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.restock-paid-opt input { position: absolute; opacity: 0; pointer-events: none; }
.restock-paid-opt:has(input:checked) { border-color: var(--brand); background: var(--brand); color: #fff; }
.restock-paid-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.restock-line-tools { display: flex; flex-wrap: wrap; gap: 8px; }

/* Bidhaa list (UX_AUDIT R-2, R-3, R-4): one row per product - a card on a phone, a line on a wide screen. */
.stock-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.stock-summary b { color: var(--ink); }
.product-states { margin: 10px 0 0; flex-wrap: wrap; }
.prow-list { padding: 0; overflow: visible; }
.prow { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.prow:last-child { border-bottom: 0; }
.prow-main { display: flex; align-items: center; gap: 12px; }
.prow-photo { flex: 0 0 44px; width: 44px; height: 44px; border-radius: var(--r-sm); object-fit: cover; }
.prow-text { flex: 1; min-width: 0; }
.prow-name { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.prow-meta { font-size: 13px; color: var(--muted); }
.prow-warn { color: var(--warn-dark, #8a4a06); font-weight: 600; }
.prow-stock { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; text-align: right; }
.prow-stock b { font-size: 16px; }
.prow-reserved { font-size: 11.5px; }
.prow-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.prow-actions .btn-sm { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.prow-actions .is-urgent { border-color: var(--red); color: var(--red-dark); background: var(--red-bg); }
.prow-more { position: relative; }
.prow-more summary { list-style: none; min-width: 44px; justify-content: center; font-size: 18px; line-height: 1; cursor: pointer; }
.prow-more summary::-webkit-details-marker { display: none; }
.prow-more form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; margin: 0; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md, 12px); box-shadow: var(--shadow-lift, 0 8px 24px rgba(0,0,0,.12)); }
.prow-delete { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--red); font: inherit; font-weight: 700; white-space: nowrap; cursor: pointer; }
@media (min-width: 768px) {
    .prow { display: flex; align-items: center; gap: 16px; }
    .prow-main { flex: 1; min-width: 0; }
    .prow-actions { margin-top: 0; flex-wrap: nowrap; }
}
.pf-more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.pf-more summary { min-height: 44px; display: flex; align-items: center; gap: 6px; font-weight: 700; cursor: pointer; }
.pf-more summary .muted { font-weight: 500; font-size: 13px; }
.prow-actions { flex-wrap: nowrap; }
.prow-more { margin-left: auto; }
@media (max-width: 420px) {
    .prow-actions { gap: 6px; }
    .prow-actions .btn-sm { padding: 0 12px; }
    .prow-actions .btn-sm > .ui-ico { display: none; }   /* words only: four actions fit one line */
}
.pf-more summary { flex-direction: column; align-items: flex-start; gap: 0; padding: 6px 0; list-style: none; }
.pf-more summary::-webkit-details-marker { display: none; }
.pf-more-title { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pf-more[open] .pf-more-title .ui-ico { transform: rotate(180deg); }
.cashier-only[hidden] { display: none !important; }

/* ---- UX phase 5: the simpler staff form ---- */
.role-more { margin-top: 6px; }
.role-more summary { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 600; color: var(--brand-ink); cursor: pointer; list-style: none; }
.role-more summary::-webkit-details-marker { display: none; }
.role-more[open] summary .ui-ico { transform: rotate(180deg); }
.staff-more { margin-top: 10px; padding-top: 6px; }

/* ---- UX phase 6: Wanaodaiwa, receipts ---- */
.debtor { display: block; border-bottom: 1px solid var(--line); }
.debtor:last-child { border-bottom: 0; }
.debtor-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 60px; cursor: pointer; list-style: none; color: inherit; }
.debtor-head::-webkit-details-marker { display: none; }
.debtor-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.debtor-text b { font-size: 15px; overflow-wrap: anywhere; }
.debtor-text small { color: var(--muted); font-size: 12.5px; }
.debtor-owed { flex-shrink: 0; font-weight: 800; font-size: 16px; color: var(--warn-dark, #8a4a06); }
.debtor[open] { background: var(--surface, rgba(0,0,0,.02)); }
.debtor-pay { padding: 0 14px 14px; }
.debt-receipt-btn { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 12px; }
.sale-done-bar .sdb-receipt { flex-shrink: 0; text-decoration: none; }
@media (max-width: 420px) { .sale-done-bar { flex-wrap: wrap; } .sale-done-bar .sdb-text { flex-basis: calc(100% - 100px); } }
.db-pockets { position: relative; margin: 2px 0 0; font-size: 13px; font-weight: 600; opacity: .85; line-height: 1.4; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-summary-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; min-height: 44px; padding: 0 14px;
    border: 1px solid rgba(255,255,255,.35); border-radius: var(--r-pill); color: inherit; font-weight: 700; font-size: 14px; text-decoration: none; }
.db-hero-tools { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.db-hero-tools .db-summary-btn { margin: 0; min-height: 32px; padding: 0 10px; font-size: 12px; gap: 4px; }
@media (max-width: 560px) {
    table.cards-sm { min-width: 0 !important; width: 100%; }
    table.cards-sm thead { display: none; }
    table.cards-sm, table.cards-sm tbody, table.cards-sm tfoot { display: block; }
    table.cards-sm tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 4px 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
    table.cards-sm .pv-day:not(.is-open) .pv-tx-row { display: none; }
    table.cards-sm td { display: block; border: 0 !important; padding: 0 !important; height: auto; text-align: left !important; white-space: normal; }
    table.cards-sm td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
    table.cards-sm td.cards-title { grid-column: 1 / -1; font-weight: 700; }
    table.cards-sm td.cards-skip, table.cards-sm td:empty { display: none; }
}

/* Payment method logos (paymentMethodIcon): small tiles beside the method's name */
.pm-logo { display: inline-block; flex-shrink: 0; vertical-align: middle; border-radius: 4px; object-fit: contain; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
[data-theme="dark"] .pm-logo { box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.pay-btn .pm-logo { width: 27px; height: 18px; }
.pay-btn:has(.pm-logo) { gap: 6px; padding-left: 10px; padding-right: 10px; white-space: nowrap; }

/* ---- Maelekezo: the guided tour's popover (Driver.js, assets/js/tour.js) in the app's own look ----
   driver.css is loaded after this file, so every rule here carries .bs-tour to win. */
.driver-popover.bs-tour {
    font-family: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line);
    border-radius: 18px; padding: 18px 18px 14px; min-width: 260px; max-width: min(340px, calc(100vw - 24px));
    box-shadow: 0 18px 50px rgba(15, 18, 30, .28);
}
.driver-popover.bs-tour .driver-popover-title { font-size: 17px; font-weight: 800; line-height: 1.3; padding-right: 30px; }
.driver-popover.bs-tour .driver-popover-description { font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.driver-popover.bs-tour .driver-popover-close-btn { width: 40px; height: 40px; top: 6px; right: 6px; border-radius: 50%; font-size: 22px; color: var(--muted); }
.driver-popover.bs-tour .driver-popover-close-btn:hover,
.driver-popover.bs-tour .driver-popover-close-btn:focus-visible { color: var(--ink); background: var(--brand-soft); }
.driver-popover.bs-tour .driver-popover-footer { margin-top: 16px; gap: 8px; }
.driver-popover.bs-tour .driver-popover-progress-text { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.driver-popover.bs-tour .driver-popover-navigation-btns { gap: 8px; }
.driver-popover.bs-tour .driver-popover-navigation-btns button + button { margin-left: 0; }
.driver-popover.bs-tour .driver-popover-footer-btn {
    min-height: 44px; padding: 0 18px; border-radius: var(--r-pill, 999px); font: inherit; font-size: 14px; font-weight: 700;
    display: inline-flex; align-items: center; text-shadow: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.driver-popover.bs-tour .driver-popover-next-btn, .driver-popover.bs-tour .driver-popover-done-btn { background: var(--brand); border-color: var(--brand); color: #fff; }
.driver-popover.bs-tour .driver-popover-next-btn:hover, .driver-popover.bs-tour .driver-popover-next-btn:focus-visible { background: var(--brand-ink); }
.driver-popover.bs-tour .driver-popover-footer-btn:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: 2px; }
.driver-popover.bs-tour .driver-popover-arrow { border-color: var(--card); }
.driver-popover.bs-tour .driver-popover-arrow-side-left { border-top-color: transparent; border-bottom-color: transparent; border-right-color: transparent; }
.driver-popover.bs-tour .driver-popover-arrow-side-right { border-top-color: transparent; border-bottom-color: transparent; border-left-color: transparent; }
.driver-popover.bs-tour .driver-popover-arrow-side-top { border-bottom-color: transparent; border-left-color: transparent; border-right-color: transparent; }
.driver-popover.bs-tour .driver-popover-arrow-side-bottom { border-top-color: transparent; border-left-color: transparent; border-right-color: transparent; }

/* Manrope is wider than Inter Tight was: on phones the quick actions' labels wrap to two lines
   instead of ending in "...", and the page title is a step smaller, so "Wanaodaiwa" still fits. */
@media (max-width: 899px) {
    .db-qa-label { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-align: center; line-height: 1.2; }
}
@media (max-width: 380px) { .topbar:not(.is-home) h1 { font-size: 18px; } }
/* Multi-select dropdown (assets/js/fields.js, <select multiple>): a tick box per row, Clear / Apply below. */
.bs-multi .bs-select-option { justify-content: flex-start; }
.bs-multi .bs-select-option .bs-select-text { flex: 1; min-width: 0; }
.bs-multi-box {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--line);
    border-radius: 6px;
    background: var(--card);
    color: transparent;
}
.bs-multi-box svg { width: 14px; height: 14px; }
.bs-multi .bs-select-option[aria-selected="true"] .bs-multi-box { background: var(--brand); border-color: var(--brand); color: #fff; }
.bs-multi .bs-select-option[aria-selected="true"] { font-weight: 600; }
.bs-multi-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 8px 4px 2px;
    border-top: 1px solid var(--line);
}
.bs-multi-count { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-multi-foot .btn { width: auto; margin: 0; min-height: 36px; }
.bs-select-panel.is-sheet .bs-multi-foot { padding-top: 12px; }
.bs-select-panel.is-sheet .bs-multi-foot .btn { min-height: 44px; padding: 0 18px; }
/* Products page: what needs attention, under the tabs - one short line each, the detail folded away. */
.card.pnotices { padding: 4px 0; overflow: hidden; }
.pnotice {
    --tone: var(--blue); --tone-bg: var(--blue-bg); --tone-ink: var(--blue-dark);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
}
.pnotice + .pnotice { border-top: 1px solid var(--line); }
.pnotice.tone-bad { --tone: var(--red); --tone-bg: var(--red-bg); --tone-ink: var(--red-dark); }
.pnotice.tone-warn { --tone: var(--warn); --tone-bg: var(--warn-bg); --tone-ink: var(--warn-dark); }
.pnotice-ico {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--tone-bg);
    color: var(--tone-ink);
}
.pnotice-main { flex: 1; min-width: 0; padding-top: 1px; }
.pnotice-title { font-size: 14.5px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.pnotice-sub { margin-top: 2px; font-size: 13px; color: var(--muted); line-height: 1.4; overflow-wrap: anywhere; }
.pnotice.tone-info .pnotice-sub { margin-top: 8px; }
.pnotice-act { flex-shrink: 0; width: auto; margin: 2px 0 0; white-space: nowrap; }
.pnotice-more { margin-top: 6px; font-size: 13px; }
.pnotice-more > summary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--tone-ink);
}
.pnotice-more > summary::-webkit-details-marker { display: none; }
.pnotice-more > summary .ui-ico { transition: transform var(--dur-fast) ease; }
.pnotice-more[open] > summary .ui-ico { transform: rotate(180deg); }
.pnotice-more p { margin: 6px 0 0; color: var(--muted); line-height: 1.5; }
.pnotice-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.pnotice-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 10px;
    padding: 8px 10px;
    border-radius: var(--r-md);
    background: var(--surface);
}
.pnotice-list-name { font-weight: 600; color: var(--ink); }
.pnotice-list-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pnotice-list-links a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--card);
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}
@media (hover: hover) and (pointer: fine) { .pnotice-list-links a:hover { border-color: var(--brand); color: var(--brand-ink); } }
@media (max-width: 420px) {
    .pnotice { gap: 10px; padding: 12px 14px; }
    .pnotice-ico { width: 32px; height: 32px; border-radius: 10px; }
}
/* Products page: stock figures - three small tiles in a row. */
.stock-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.stock-strip.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stock-fig {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--card);
}
.stock-fig-label { font-size: 12px; font-weight: 500; color: var(--muted); line-height: 1.25; }
.stock-fig-value { font-size: 17px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
@media (max-width: 520px) {
    .stock-strip { gap: 6px; }
    .stock-fig { padding: 10px 10px; border-radius: var(--r-md); }
    .stock-fig-label { font-size: 11px; }
    .stock-fig-value { font-size: 14px; }
}
.stock-fig-unit { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }

/* ---- Subscription ended page (trial_ended.php) and, later, the billing page: plans, pay-to numbers, contact ---- */
.sub-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.sub-plan { position: relative; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; background: var(--surface); }
.sub-plan-name { font-size: 13px; font-weight: 700; color: var(--muted); }
.sub-plan-price { font-size: 20px; font-weight: 800; color: var(--ink); margin-top: 4px; font-variant-numeric: tabular-nums; }
.sub-plan-per { font-size: 12px; color: var(--muted); }
.sub-plan-save { position: absolute; top: -9px; right: 10px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--r-pill); background: var(--green-bg); color: var(--green-dark); }
.sub-payto { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.sub-payto-title { font-size: 13px; font-weight: 700; color: var(--muted); padding: 10px 14px 0; }
.sub-payto-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.sub-payto-row + .sub-payto-row { border-top: 1px solid var(--line-soft); }
.sub-payto-row .pm-logo { width: 36px; height: 24px; }
.sub-payto-main { flex: 1; min-width: 0; }
.sub-payto-num { font-size: 17px; font-weight: 800; color: var(--ink); letter-spacing: .02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sub-payto-sub { font-size: 12px; color: var(--muted); }
.sub-copy { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; flex-shrink: 0; }
.sub-contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.sub-contact-btn { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; min-height: 54px; font-weight: 700; margin: 0; }
/* Billing page (billing.php): status, steps, plan choice, "I have paid", history, receipt */
.sub-status { border-radius: var(--r-md); padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-left-width: 4px; }
.sub-status-ok { border-left-color: var(--green); }
.sub-status-warn { border-left-color: var(--warn); }
.sub-status-red { border-left-color: var(--red); }
.sub-status-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sub-status-plan { font-size: 18px; font-weight: 800; color: var(--ink); }
.sub-chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: var(--r-pill); background: var(--green-bg); color: var(--green-dark); white-space: nowrap; }
.sub-status-warn .sub-chip { background: var(--warn-bg); color: var(--warn-dark); }
.sub-status-red .sub-chip { background: var(--red-bg); color: var(--red-dark); }
.sub-status-line { font-size: 14px; color: var(--ink-soft); margin-top: 4px; }
.sub-status-note { font-size: 12px; color: var(--muted); margin-top: 6px; }
.sub-flow { display: flex; flex-direction: column; gap: 14px; }
.sub-step { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); margin-top: 6px; }
.sub-step-n { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; background: var(--brand-soft); color: var(--brand-ink); flex-shrink: 0; }
.sub-plans-pick .sub-plan { cursor: pointer; display: flex; flex-direction: column; transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease; }
.sub-plans-pick .sub-plan input { position: absolute; opacity: 0; pointer-events: none; }
.sub-plans-pick .sub-plan:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.sub-plans-pick .sub-plan:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.sub-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.sub-or::before, .sub-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sub-paid { display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; }
.sub-paid-title { font-weight: 800; color: var(--ink); }
.sub-claim { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; background: var(--surface); }
.sub-claim-title { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); }
.sub-claim-body { font-size: 14px; color: var(--ink-soft); margin-top: 8px; line-height: 1.6; }
.sub-claim-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.sub-claim-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.sub-link-btn { background: none; border: 0; padding: 8px 0; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; font-family: inherit; }
.sub-history { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.sub-history-title { font-size: 13px; font-weight: 700; color: var(--muted); padding: 10px 14px 4px; }
.sub-history-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; text-decoration: none; color: inherit; }
.sub-history-row + .sub-history-row { border-top: 1px solid var(--line-soft); }
.sub-history-main { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.sub-history-plan { font-weight: 700; color: var(--ink); font-size: 14px; }
.sub-history-amt { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sub-history-go { font-size: 12px; color: var(--brand-ink); white-space: nowrap; }
.receipt-page { background: var(--bg); padding: 24px 16px; }
.receipt { max-width: 480px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.receipt-head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px dashed var(--line); }
.receipt-head .lg-mark { width: 40px; height: 40px; }
.receipt-head .lg-mark img { width: 40px; height: 40px; border-radius: 10px; }
.receipt-brand { font-weight: 800; color: var(--ink); }
.receipt-paid { margin-left: auto; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: var(--r-pill); background: var(--green-bg); color: var(--green-dark); text-transform: uppercase; letter-spacing: .04em; }
.receipt-rows { margin: 0; }
.receipt-rows > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.receipt-rows dt { color: var(--muted); }
.receipt-rows dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.receipt-rows .receipt-total { border-bottom: 0; font-size: 18px; }
.receipt-rows .receipt-total dd { font-weight: 800; }
.receipt-actions { display: flex; gap: 10px; margin-top: 20px; }
.receipt-actions .btn { display: inline-flex; align-items: center; gap: 6px; width: auto; }
@media print {
  .receipt-page { background: #fff; padding: 0; }
  .receipt { border: 0; }
  .receipt-actions { display: none; }
}
/* The owner's one-line plan reminder at the top of the app pages (includes/header.php) */
.sub-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 0 0 14px; border-radius: var(--r-md); font-size: 14px; text-decoration: none;
  background: var(--brand-soft); color: var(--ink); border: 1px solid transparent; }
.sub-banner-warn { background: var(--warn-bg); color: var(--warn-dark); }
.sub-banner-text { flex: 1; min-width: 0; }
.sub-banner-cta { font-weight: 800; white-space: nowrap; color: var(--brand-ink); }
.sub-banner-warn .sub-banner-cta { color: inherit; }
.sub-renew > summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.sub-renew > summary::-webkit-details-marker { display: none; }
.sub-renew[open] > summary { margin-bottom: 14px; }
/* "By signing up, you agree to our Terms and Privacy Policy" (includes/legal.php legalAgreeLine()) */
.legal-agree { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); text-align: center; text-wrap: pretty; }
.legal-agree a { color: var(--brand-ink); font-weight: 600; text-underline-offset: 2px; }
.lg-foot a { color: inherit; text-underline-offset: 2px; }
/* One-time notice about new Terms / Privacy Policy (includes/header.php) */
.legal-notice { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: var(--ink); }
.legal-notice-text { flex: 1; min-width: 0; }
.legal-notice a { color: var(--brand-ink); font-weight: 700; }
.legal-notice .btn { flex-shrink: 0; width: auto; min-height: 40px; }
/* Super Admin sign-in code step (super-admin/index.php) */
.lg-check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); cursor: pointer; }
.lg-check input { width: 18px; height: 18px; accent-color: var(--brand); }
.lg-link-btn { background: none; border: 0; padding: 8px 0; font: inherit; font-size: 14px; font-weight: 700; color: var(--brand-ink); cursor: pointer; }
.lg-row-links { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lg-row-links form { margin: 0; }
