/* JUMULO design system: plain CSS, no build step.
   Palette: the business's colour (blue by default) for navigation and primary actions; green = positive, orange =
   alerts, red = errors and destructive actions, blue (--info-*) = information, violet = some indicators. The --brand-*
   and --nav-* variables are redefined per business (App\Support\Theme\BusinessTheme, partials/theme-style): always use
   them for the brand colour, never a written blue. Class names are shared by every page: refine, never rename. */
:root {
    /* Brand (blue) */
    --brand-950: #0b1736;
    --brand-900: #1e3a8a;
    --brand-700: #1d4ed8;
    --brand-600: #2563eb;
    --brand-500: #3b82f6;
    --brand-300: #93c5fd;
    --brand-100: #dbeafe;
    --brand-50: #eff6ff;
    --brand-rgb: 37, 99, 235; /* --brand-600 as r, g, b: rgba(var(--brand-rgb), .35) for shadows and focus rings */
    /* Second tone of the brand gradients and glows (violet with the blue; the business's lighter shade otherwise) */
    --brand-accent: #8b5cf6;
    --brand-accent-rgb: 139, 92, 246;

    /* Information (status colour: never follows the business's colour) */
    --info-900: #1e3a8a;
    --info-500: #3b82f6;
    --info-100: #dbeafe;
    --info-50: #eff6ff;

    /* Complementary colours */
    --accent: #f97316;
    --warn-700: #9a3412;
    --warn-500: #f97316;
    --warn-100: #ffedd5;
    --violet-700: #6d28d9;
    --violet-500: #8b5cf6;
    --violet-100: #ede9fe;
    --ok-700: #15803d;
    --ok-500: #22c55e;
    --ok-100: #dcfce7;
    --danger-700: #b91c1c;
    --danger-500: #ef4444;
    --danger-100: #fee2e2;

    /* Neutrals */
    --ink-900: #0f172a;
    --ink-700: #334155;
    --ink-500: #64748b;
    --ink-300: #cbd5e1;
    --line: #e2e8f0;
    --surface: #ffffff;
    --canvas: #f3f6fb;

    /* Navigation (dark blue sidebar) */
    --nav-bg: #0b1736;
    --nav-bg-2: #12224d;
    --nav-ink: #c7d2fe;
    --nav-ink-strong: #ffffff;
    --nav-muted: #7d8bb8;
    --nav-active: #2563eb;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .06);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, .12);
    --focus: 0 0 0 3px rgba(var(--brand-rgb), .35);
    --sidebar-width: 16rem;
    --topbar-height: 4rem;
    --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

/* The HTML hidden attribute always wins over a display set by a class. */
[hidden] { display: none !important; }

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink-900);
    background: var(--canvas);
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.015em; color: var(--ink-900); }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--ink-500); }
.small { font-size: .875rem; }

:focus-visible { outline: 3px solid rgba(var(--brand-rgb), .55); outline-offset: 2px; border-radius: 6px; }

.skip-link { position: absolute; left: .75rem; top: -3rem; z-index: 100; padding: .5rem .9rem; border-radius: var(--radius-sm); background: var(--brand-600); color: #fff; font-weight: 700; }
.skip-link:focus { top: .75rem; text-decoration: none; }

/* Brand */
.brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-weight: 800;
    letter-spacing: .08em;
    color: var(--brand-900);
    text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    font-weight: 800;
    letter-spacing: 0;
    box-shadow: 0 4px 12px rgba(var(--brand-rgb), .35);
}
.brand--light { color: var(--nav-ink-strong); }

/* Icons */
.icon { width: 1.25rem; height: 1.25rem; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 1.5rem; height: 1.5rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 2.5rem;
    padding: .5rem 1rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { color: #fff; background: var(--brand-600); box-shadow: 0 1px 2px rgba(var(--brand-rgb), .3); }
.btn-primary:hover { background: var(--brand-700); }
.btn-success { color: #fff; background: var(--ok-700); }
.btn-success:hover { background: #166534; }
.btn-ghost { color: var(--ink-700); background: var(--surface); border-color: var(--line); }
.btn-ghost:hover { background: var(--brand-50); border-color: var(--brand-500); color: var(--brand-900); }
.btn-block { width: 100%; }
.btn-sm { min-height: 2.1rem; padding: .3rem .75rem; font-size: .9rem; }

/* Forms */
.field { margin-bottom: .8rem; }
.field label { display: block; margin-bottom: .25rem; font-weight: 600; font-size: .92rem; color: var(--ink-700); }
.field .hint { display: block; margin-top: .25rem; font-size: .82rem; color: var(--ink-500); }
.field input, .field select, .field textarea {
    width: 100%;
    min-height: 2.5rem;
    padding: .45rem .75rem;
    font: inherit;
    color: var(--ink-900);
    background: #fff;
    border: 1px solid var(--ink-300);
    border-radius: 10px;
    transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 5rem; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #94a3b8; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: var(--focus);
}
.form-grid { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: span 2; } }
.form-actions { margin-top: 1rem; display: grid; gap: .75rem; }
.divider { height: 1px; background: var(--line); margin: 1rem 0; border: 0; }

/* Alerts */
.alert { display: block; padding: .6rem .9rem; border-radius: 10px; margin-bottom: .75rem; font-size: .93rem; border: 1px solid transparent; border-left-width: 4px; }
.alert ul { margin: 0; padding-left: 1.1rem; }
.alert a { font-weight: 700; color: inherit; text-decoration: underline; }
.alert-danger { color: var(--danger-700); background: var(--danger-100); border-color: #fecaca; border-left-color: var(--danger-500); }
.alert-success { color: var(--ok-700); background: var(--ok-100); border-color: #bbf7d0; border-left-color: var(--ok-500); }
.alert-warning { color: var(--warn-700); background: var(--warn-100); border-color: #fed7aa; border-left-color: var(--warn-500); }
.alert-info { color: var(--info-900); background: var(--info-50); border-color: var(--info-100); border-left-color: var(--info-500); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Guest pages */
.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 1rem;
    background:
        radial-gradient(900px 400px at 100% -10%, rgba(var(--brand-rgb), .16), transparent 60%),
        radial-gradient(700px 360px at -10% 110%, rgba(249, 115, 22, .10), transparent 60%),
        var(--canvas);
}
.auth-shell .brand { margin: .5rem 0 1rem; }
.auth-card { width: 100%; max-width: 26rem; padding: 1.4rem 1.5rem; }
.auth-card--wide { max-width: 40rem; }
.auth-card h1 { margin-bottom: .35rem; }
.auth-card .lead { color: var(--ink-500); margin-bottom: 1rem; }
.auth-links { margin-top: 1rem; text-align: center; font-size: .93rem; color: var(--ink-500); }
.auth-footer { margin-top: auto; padding-top: 1.25rem; font-size: .82rem; color: var(--ink-500); }

/* Landing */
.hero { max-width: 62rem; margin: 0 auto; padding: 3rem 1rem 2rem; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); color: var(--brand-900); }
.hero .lead { max-width: 40rem; margin: .75rem auto 1.75rem; font-size: 1.1rem; color: var(--ink-700); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.feature-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); max-width: 62rem; margin: 1rem auto 3rem; padding: 0 1rem; }
.feature { padding: 1.25rem; }
.feature h3 { font-size: 1.02rem; }
.feature p { margin: 0; color: var(--ink-500); font-size: .93rem; }
.site-bar { display: flex; align-items: center; justify-content: space-between; max-width: 62rem; margin: 0 auto; padding: 1rem; }

/* App shell: dark blue sidebar + top bar */
.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg-2) 100%);
    color: var(--nav-ink);
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; height: var(--topbar-height); padding: 0 1rem 0 1.1rem; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sidebar-close { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--nav-ink); cursor: pointer; }
.sidebar-close:hover { background: rgba(255, 255, 255, .08); color: var(--nav-ink-strong); }
.side-nav { flex: 1; overflow-y: auto; padding: .75rem .6rem 1rem; }
.side-group { margin-bottom: .75rem; }
.side-group-label { margin: .5rem .7rem .35rem; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--nav-muted); }
.side-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: .1rem 0;
    padding: .6rem .75rem;
    border-radius: 10px;
    color: var(--nav-ink);
    font-weight: 600;
    font-size: .93rem;
    transition: background .15s, color .15s;
}
.side-link:hover { background: rgba(255, 255, 255, .07); color: var(--nav-ink-strong); text-decoration: none; }
.side-link:focus-visible { outline: 2px solid var(--brand-300); outline-offset: 1px; }
.side-link[aria-current="page"] { background: var(--nav-active); color: var(--nav-ink-strong); box-shadow: 0 6px 16px rgba(var(--brand-rgb), .35); }
.side-link[aria-current="page"]::before { content: ""; position: absolute; left: -.6rem; top: .55rem; bottom: .55rem; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-300); }
.sidebar-foot { padding: .9rem 1.1rem; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .78rem; color: var(--nav-muted); }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(15, 23, 42, .5); }
.nav-open { overflow: hidden; }
.nav-open .sidebar { transform: translateX(0); }

.app-main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: .75rem;
    height: var(--topbar-height);
    padding: 0 1rem;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid var(--line);
}
.menu-toggle { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-700); cursor: pointer; }
.menu-toggle:hover { background: var(--brand-50); color: var(--brand-900); }
.topbar-title { min-width: 0; font-weight: 700; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-user { margin-left: auto; display: flex; align-items: center; gap: .5rem; flex-wrap: nowrap; }
.app-user .who { text-align: right; line-height: 1.2; }
.app-user .who strong { display: block; font-size: .9rem; }
.app-user .who span { font-size: .76rem; color: var(--ink-500); }
.app-user form { margin: 0; }
.avatar { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: linear-gradient(135deg, var(--brand-500), var(--brand-accent)); color: #fff; font-weight: 800; font-size: .95rem; flex: none; }
.icon-btn { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-700); cursor: pointer; }
.icon-btn:hover { background: var(--brand-50); color: var(--brand-900); }
.icon-btn.is-danger:hover { background: var(--danger-100); color: var(--danger-700); border-color: #fecaca; }

.page { width: 100%; max-width: 78rem; margin: 0 auto; padding: 1rem .9rem 2rem; }
.page-head { margin-bottom: 1rem; }
.page-head p { color: var(--ink-500); margin: 0; }

@media (min-width: 1024px) {
    .app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
    .sidebar { position: sticky; top: 0; height: 100vh; transform: none; box-shadow: none; }
    .sidebar-close, .menu-toggle, .sidebar-backdrop { display: none; }
    .nav-open { overflow: auto; }
    .topbar { padding: 0 1.75rem; }
    .page { padding: 1.25rem 1.5rem 2rem; }
}

@media (max-width: 640px) {
    .app-user .who { display: none; }
    .app-user .btn-label { display: none; }
}

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--brand-100); color: var(--brand-900); white-space: nowrap; }
.badge-ok { background: var(--ok-100); color: var(--ok-700); }
.badge-muted { background: #eef2f6; color: var(--ink-500); }
.badge-violet { background: var(--violet-100); color: var(--violet-700); }

.stat-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.stat { padding: 1rem; }
.stat .label { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); }
.stat .value { margin: .25rem 0 .5rem; font-size: 1.35rem; font-weight: 800; }
.stat dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; font-size: .92rem; }
.stat dt { color: var(--ink-500); }
.stat dd { margin: 0; font-weight: 600; }

.section { margin-top: 1.25rem; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.section-head h2 { margin: 0; }
.module-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.module { padding: 1rem; display: flex; flex-direction: column; gap: .35rem; opacity: .85; }
.module strong { font-size: .98rem; }

/* Dashboard */
.welcome {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1rem;
    padding: 1.1rem 1.35rem;
    margin-bottom: 1rem;
    border-radius: 16px;
    color: #fff;
    background:
        radial-gradient(600px 220px at 100% 0%, rgba(var(--brand-accent-rgb), .45), transparent 60%),
        linear-gradient(120deg, var(--brand-900) 0%, var(--brand-600) 100%);
    box-shadow: var(--shadow-lg);
}
.welcome h1 { margin: 0 0 .35rem; color: #fff; font-size: 1.55rem; }
.welcome p { margin: 0; color: var(--brand-100); }
.welcome-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.welcome-meta .tag { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .65rem; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; font-size: .8rem; font-weight: 600; }
.welcome .btn-ghost { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .35); color: #fff; }
.welcome .btn-ghost:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.welcome .btn-light { color: var(--brand-900); background: #fff; }
.welcome .btn-light:hover { background: var(--brand-50); }
.welcome-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.kpi-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr)); }
.kpi { position: relative; display: flex; flex-direction: column; gap: .3rem; padding: .95rem 1rem; overflow: hidden; }
.kpi::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--kpi-color, var(--brand-500)); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.kpi-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); }
.kpi-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 12px; background: var(--kpi-soft, var(--brand-50)); color: var(--kpi-color, var(--brand-600)); }
.kpi-value { font-size: 1.65rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-value.is-text { font-size: 1.3rem; }
.kpi-detail { font-size: .88rem; color: var(--ink-500); }
.kpi-detail a { font-weight: 600; }
.kpi-links { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }
.kpi-foot { margin-top: auto; padding-top: .5rem; }
.kpi--blue { --kpi-color: var(--brand-600); --kpi-soft: var(--brand-50); }
.kpi--green { --kpi-color: var(--ok-700); --kpi-soft: var(--ok-100); }
.kpi--orange { --kpi-color: var(--warn-500); --kpi-soft: var(--warn-100); }
.kpi--red { --kpi-color: var(--danger-500); --kpi-soft: var(--danger-100); }
.kpi--violet { --kpi-color: var(--violet-500); --kpi-soft: var(--violet-100); }

.context-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.context { padding: 1rem; }
.context-title { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.context-title .kpi-icon { width: 2.2rem; height: 2.2rem; border-radius: 10px; }
.context-title strong { display: block; font-size: 1.02rem; }
.context-title span { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); }

.quick-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); }
.quick-link { display: flex; align-items: center; gap: .7rem; padding: .7rem .85rem; color: var(--ink-900); transition: border-color .15s, box-shadow .15s, transform .15s; }
.quick-link:hover { text-decoration: none; border-color: var(--brand-500); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.quick-link:focus-visible { outline: none; box-shadow: var(--focus); }
.quick-link strong { display: block; font-size: .95rem; }
.quick-link small { display: block; font-size: .8rem; color: var(--ink-500); }
.quick-link .kpi-icon { flex: none; }
.tone-blue { --kpi-color: var(--brand-600); --kpi-soft: var(--brand-50); }
.tone-green { --kpi-color: var(--ok-700); --kpi-soft: var(--ok-100); }
.tone-orange { --kpi-color: #c2410c; --kpi-soft: var(--warn-100); }
.tone-red { --kpi-color: var(--danger-700); --kpi-soft: var(--danger-100); }
.tone-violet { --kpi-color: var(--violet-700); --kpi-soft: var(--violet-100); }

.cta-panel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding: .9rem 1.15rem; }
.cta-panel p { margin: 0; color: var(--ink-500); }
.cta-title { display: flex; align-items: center; gap: .8rem; }
.cta-title h2 { margin: 0; }

/* Onboarding stepper */
.stepper { display: flex; gap: .5rem; margin-bottom: 1.25rem; }
.step { flex: 1; height: .35rem; border-radius: 999px; background: var(--line); }
.step.is-done { background: var(--brand-500); }
.step-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-600); margin-bottom: .35rem; }

/* Lock screen */
.lock-avatar { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; margin: 0 auto 1rem; border-radius: 50%; background: var(--brand-100); color: var(--brand-700); font-size: 1.4rem; font-weight: 800; }
.lock-card { text-align: center; }
.lock-card form { text-align: left; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Data views */
.page-head.with-actions { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; padding: .55rem .85rem; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); border-bottom: 1px solid var(--line); background: #f8fafc; }
.table td { padding: .55rem .85rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f8fbff; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.table form { margin: 0; }
.empty { padding: 1.25rem 1rem; text-align: center; color: var(--ink-500); }
.badge-warn { background: var(--warn-100); color: var(--warn-700); }
.badge-danger { background: var(--danger-100); color: var(--danger-700); }
.btn-danger { color: var(--danger-700); background: #fff; border-color: #fecaca; }
.btn-danger:hover { background: var(--danger-100); border-color: var(--danger-500); }
.panel { padding: 1rem 1.1rem; margin-bottom: .85rem; }
.panel h2 { margin-bottom: .6rem; }
.meter { height: .5rem; border-radius: 999px; background: var(--line); overflow: hidden; margin: .35rem 0 .15rem; }
.meter > span { display: block; height: 100%; background: var(--brand-500); }
.meter.is-full > span { background: var(--accent); }
.check-grid { display: grid; gap: .4rem 1.25rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.check-group { margin-bottom: 1rem; }
.check-group h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); margin-bottom: .4rem; }
.check { display: flex; gap: .55rem; align-items: center; font-size: .93rem; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--brand-600); }
.check.is-disabled { color: var(--ink-300); }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.inline-form .field { margin: 0; flex: 1 1 14rem; }
.pager { display: flex; justify-content: space-between; margin-top: 1rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin: 0; font-size: .93rem; }
.kv dt { color: var(--ink-500); }
.kv dd { margin: 0; font-weight: 600; }
.two-col { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; } }
.nowrap { white-space: nowrap; }

/* Catalogue */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; padding: 1rem; margin-bottom: 1rem; }
.filter-bar .field { margin: 0; flex: 1 1 12rem; }
.filter-bar .field.narrow { flex: 0 1 11rem; }
.thumb { width: 2.75rem; height: 2.75rem; border-radius: 8px; object-fit: cover; background: var(--brand-50); border: 1px solid var(--line); display: grid; place-items: center; color: var(--brand-700); font-weight: 800; font-size: .95rem; flex: none; }
.thumb-lg { width: 7rem; height: 7rem; font-size: 2rem; }
.product-cell { display: flex; align-items: center; gap: .75rem; min-width: 14rem; }
.product-cell .meta { font-size: .8rem; color: var(--ink-500); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.photo-field { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.limit-note { font-size: .88rem; color: var(--ink-500); }
.history { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.history li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.history li:last-child { border-bottom: 0; }
@media (max-width: 720px) { .hide-sm { display: none; } }

/* Catalogue: product cards, product form and categories (catalog/* views only). */
.cat-head-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; margin-top: .3rem; color: var(--ink-500); }
.cat-quota { display: inline-flex; align-items: center; gap: .55rem; font-size: .85rem; }
.cat-quota-bar { width: 6.5rem; height: .45rem; border-radius: 999px; background: var(--brand-100); overflow: hidden; }
.cat-quota-bar span { display: block; height: 100%; border-radius: inherit; background: var(--brand-600); }
.cat-quota.is-full .cat-quota-bar span { background: var(--danger-500); }
.cat-quota.is-near .cat-quota-bar span { background: var(--warn-500); }

.cat-tabs { display: inline-flex; gap: .25rem; padding: .25rem; margin-bottom: .75rem; border-radius: 12px; background: #e9eef6; }
.cat-tabs a { padding: .45rem 1rem; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--ink-700); }
.cat-tabs a:hover { text-decoration: none; background: rgba(255, 255, 255, .6); }
.cat-tabs a[aria-current="page"] { background: var(--surface); color: var(--brand-700); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

.cat-filters .search-field { position: relative; }
.cat-filters .search-field .icon { position: absolute; left: .8rem; bottom: .85rem; color: var(--ink-500); pointer-events: none; }
.cat-filters .search-field input { padding-left: 2.4rem; }
.cat-results { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 0 .75rem; font-size: .9rem; color: var(--ink-500); }

.cat-grid { list-style: none; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr)); margin-bottom: 1rem; }
@media (max-width: 480px) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; } }
.cat-card { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s, transform .15s; }
.cat-card:hover { border-color: #bfd3fb; box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.cat-card.is-archived .cat-media > img, .cat-card.is-archived .cat-ph { filter: grayscale(1); opacity: .6; }
.cat-media { position: relative; aspect-ratio: 16 / 11; background: var(--brand-50); overflow: hidden; }
.cat-media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cat-ph { display: grid; place-items: center; width: 100%; height: 100%; color: #fff; font-size: 2.1rem; font-weight: 800; letter-spacing: .03em; text-shadow: 0 1px 2px rgba(15, 23, 42, .25); }
.cat-media .cat-badges { position: absolute; left: .55rem; top: .55rem; right: .55rem; display: flex; flex-wrap: wrap; gap: .3rem; }
.cat-media .badge { background: rgba(255, 255, 255, .95); box-shadow: 0 1px 3px rgba(15, 23, 42, .15); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cat-media .badge-muted { color: var(--ink-700); }
.cat-body { display: flex; flex-direction: column; gap: .3rem; flex: 1; padding: .8rem .9rem .9rem; }
.cat-name { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.3; color: var(--ink-900); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-meta { display: flex; flex-wrap: wrap; gap: .15rem .6rem; font-size: .8rem; color: var(--ink-500); overflow-wrap: anywhere; }
.cat-price { margin-top: auto; padding-top: .35rem; font-size: 1.2rem; font-weight: 800; color: var(--brand-700); font-variant-numeric: tabular-nums; }
.cat-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .9rem; border-top: 1px solid var(--line); background: #fbfcfe; font-size: .82rem; color: var(--ink-500); }
.cat-foot .btn { margin-left: auto; }
@media (max-width: 480px) {
    .cat-body { padding: .65rem .7rem .75rem; }
    .cat-name { font-size: .92rem; }
    .cat-price { font-size: 1.05rem; }
    .cat-foot { padding: .5rem .7rem; }
}

/* Placeholder gradients, chosen from the product name so a product keeps its colour. */
.cat-ph-0 { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.cat-ph-1 { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.cat-ph-2 { background: linear-gradient(135deg, #22c55e, #15803d); }
.cat-ph-3 { background: linear-gradient(135deg, #fb923c, #c2410c); }
.cat-ph-4 { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.cat-ph-5 { background: linear-gradient(135deg, #ec4899, #be185d); }
.cat-ph-6 { background: linear-gradient(135deg, #6366f1, #4338ca); }
.cat-ph-7 { background: linear-gradient(135deg, #14b8a6, #0f766e); }

.cat-empty { display: grid; justify-items: center; gap: .6rem; padding: 1.5rem 1rem; text-align: center; color: var(--ink-500); }
.cat-empty .kpi-icon { width: 3.25rem; height: 3.25rem; border-radius: 16px; }
.cat-empty strong { color: var(--ink-900); font-size: 1.05rem; }
.cat-empty p { margin: 0; }

/* Product form */
.product-form { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) { .product-form { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.product-form .panel { margin-bottom: 0; }
.product-form .side { display: grid; gap: 1rem; }
.form-section-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 .9rem; font-size: 1.05rem; }
.form-section-title .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
.form-subtitle { margin: .4rem 0 .6rem; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); }
.form-subtitle:first-of-type { margin-top: 0; }
.field-error { display: block; margin-top: .3rem; font-size: .84rem; font-weight: 600; color: var(--danger-700); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--danger-500); background: #fffafa; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 4rem; }
.input-suffix span { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); font-size: .85rem; font-weight: 700; color: var(--ink-500); pointer-events: none; }
.photo-preview { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; max-height: 13rem; margin-bottom: .75rem; border-radius: 12px; overflow: hidden; background: var(--brand-50); border: 1px dashed var(--ink-300); color: var(--brand-700); }
.photo-preview > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-preview .cat-ph { font-size: 3rem; }
.photo-preview .photo-new { position: absolute; left: .6rem; top: .6rem; }
.photo-preview.is-removed > img, .photo-preview.is-removed .cat-ph { opacity: .25; filter: grayscale(1); }
.photo-empty { display: grid; justify-items: center; gap: .35rem; font-size: .88rem; font-weight: 600; text-align: center; }
.photo-empty .icon { width: 2rem; height: 2rem; }
.photo-input input[type="file"] { padding: .55rem; background: #fbfcfe; }
.store-toggles { display: grid; gap: .4rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); }
.store-toggle { display: flex; align-items: center; gap: .55rem; padding: .45rem .65rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; font-size: .93rem; }
.store-toggle:hover { border-color: var(--brand-500); }
.store-toggle:has(input:checked) { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-900); }
.store-toggle input { width: 1.1rem; height: 1.1rem; accent-color: var(--brand-600); }
.product-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: flex-end; margin-top: .75rem; padding: .65rem 1rem; }
.product-actions .btn { min-width: 9rem; }
@media (max-width: 640px) { .product-actions .btn { flex: 1 1 100%; } }
.product-extra { display: grid; gap: .75rem; grid-template-columns: 1fr; margin-top: .75rem; }
@media (min-width: 900px) { .product-extra { grid-template-columns: 1fr 1fr; } }
.product-extra .panel { margin-bottom: 0; }
.panel-danger { border-top: 3px solid var(--danger-500); }
.panel-ok { border-top: 3px solid var(--ok-500); }

/* Categories */
.cat-new { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-start; }
.cat-new .field { flex: 1 1 16rem; margin: 0; }
.cat-summary { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.cat-row-name { display: flex; align-items: center; gap: .65rem; }
.cat-dot { flex: none; width: .7rem; height: .7rem; border-radius: 50%; }
.cat-rename { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; flex: 1; min-width: 0; }
.cat-rename input { flex: 1 1 10rem; min-width: 0; min-height: 2.25rem; padding: 0 .6rem; font: inherit; border: 1px solid var(--ink-300); border-radius: 10px; background: #fff; }
.cat-rename input:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--focus); }
tr.is-inactive .cat-rename input, tr.is-inactive .cat-row-name > strong { color: var(--ink-500); }
.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; }

/* Stock */
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs a { padding: .55rem .9rem; font-weight: 600; font-size: .93rem; color: var(--ink-500); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; color: var(--ink-700); }
.tabs a[aria-current="page"] { color: var(--brand-700); border-bottom-color: var(--brand-600); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .88rem; font-weight: 600; color: var(--ink-700); }
.chip:hover { text-decoration: none; background: var(--brand-50); }
.chip[aria-current="page"] { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.chip .count { min-width: 1.4rem; padding: 0 .35rem; border-radius: 999px; background: #eef2f6; color: var(--ink-700); text-align: center; font-size: .78rem; }
.chip .count.warn { background: var(--warn-100); color: var(--warn-700); }
.chip .count.danger { background: var(--danger-100); color: var(--danger-700); }
.store-picker { display: flex; align-items: center; gap: .5rem; margin: 0; }
.store-picker select { min-height: 2.25rem; border: 1px solid var(--ink-300); border-radius: 10px; padding: 0 .6rem; background: var(--surface); }
.qty { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.delta-plus { color: var(--ok-700); font-weight: 700; }
.delta-minus { color: var(--danger-700); font-weight: 700; }
.count-input { width: 6.5rem; min-height: 2.25rem; border: 1px solid var(--ink-300); border-radius: 10px; padding: 0 .6rem; text-align: right; font-variant-numeric: tabular-nums; }

/* Stock levels page (stock/index only): filter cards, readable table, cards on phones. */
.stock-kpis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); margin-bottom: .75rem; }
@media (max-width: 480px) { .stock-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; } }
.stock-kpi { position: relative; display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink-700); transition: border-color .15s, box-shadow .15s, transform .15s; }
.stock-kpi:hover { text-decoration: none; border-color: var(--kpi-color, var(--brand-500)); transform: translateY(-1px); }
.stock-kpi:focus-visible { outline: none; box-shadow: var(--focus); }
.stock-kpi[aria-current="page"] { border-color: var(--kpi-color, var(--brand-600)); box-shadow: inset 0 0 0 1px var(--kpi-color, var(--brand-600)), var(--shadow); background: var(--kpi-soft, var(--brand-50)); }
.stock-kpi .kpi-icon { flex: none; }
.stock-kpi-label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-500); }
.stock-kpi-value { display: block; font-size: 1.55rem; font-weight: 800; line-height: 1.15; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.stock-kpi-value.is-muted { font-size: 1rem; font-weight: 700; color: var(--brand-700); }
.stock-kpi.is-zero .stock-kpi-value { color: var(--ink-500); }
@media (max-width: 480px) {
    .stock-kpi { padding: .7rem; gap: .55rem; }
    .stock-kpi .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
    .stock-kpi-value { font-size: 1.3rem; }
}

.stock-search .field { position: relative; }
.stock-search .field .icon { position: absolute; left: .8rem; bottom: .85rem; color: var(--ink-500); pointer-events: none; }
.stock-search .field input { padding-left: 2.4rem; }
.stock-results { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin: 0 0 .6rem; font-size: .9rem; color: var(--ink-500); }

.stock-table td:first-child { border-left: 3px solid transparent; }
.stock-table tr.is-out td:first-child { border-left-color: var(--danger-500); }
.stock-table tr.is-low td:first-child { border-left-color: var(--warn-500); }
.stock-thumb { position: relative; flex: none; display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 10px; overflow: hidden; background: var(--kpi-soft, var(--brand-50)); color: var(--kpi-color, var(--brand-700)); font-weight: 800; font-size: .9rem; }
.stock-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stock-name { font-weight: 700; color: var(--ink-900); overflow-wrap: anywhere; }
.stock-qty { display: inline-flex; align-items: baseline; gap: .25rem; padding: .2rem .65rem; border-radius: 999px; background: var(--ok-100); color: var(--ok-700); font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stock-qty.is-low { background: var(--warn-100); color: var(--warn-700); }
.stock-qty.is-out { background: var(--danger-100); color: var(--danger-700); }
.stock-threshold { color: var(--ink-500); font-variant-numeric: tabular-nums; }
.stock-cell-label { display: none; }

.stock-empty { display: grid; justify-items: center; gap: .55rem; padding: 1.5rem 1rem; text-align: center; color: var(--ink-500); }
.stock-empty .kpi-icon { width: 3.25rem; height: 3.25rem; border-radius: 16px; }
.stock-empty strong { color: var(--ink-900); font-size: 1.05rem; }
.stock-empty p { margin: 0; }

/* Phones: each row becomes a compact card, no horizontal scroll. */
@media (max-width: 640px) {
    .stock-table thead { display: none; }
    .stock-table, .stock-table tbody { display: block; }
    .stock-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem .75rem; align-items: center; padding: .8rem .9rem; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
    .stock-table tr.is-out { border-left-color: var(--danger-500); }
    .stock-table tr.is-low { border-left-color: var(--warn-500); }
    .stock-table tr:last-child { border-bottom: 0; }
    .stock-table td { display: block; padding: 0; border: 0; }
    .stock-table td:first-child { grid-column: 1 / -1; border-left: 0; }
    .stock-table .product-cell { min-width: 0; }
    .stock-table td.num { text-align: left; }
    .stock-table .stock-col-threshold { display: none; }
    .stock-table .stock-col-level { justify-self: end; }
    .stock-table td.actions { grid-column: 1 / -1; }
    .stock-table td.actions .btn { width: 100%; }
    .stock-cell-label { display: inline; margin-right: .35rem; font-size: .78rem; font-weight: 600; color: var(--ink-500); }
}

/* Sales list (sales/index only): summary cards, status tabs, readable rows, cards on phones. */
.sales-kpis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); margin-bottom: .75rem; }
.sales-kpi { display: flex; align-items: center; gap: .85rem; padding: 1rem 1.1rem; }
.sales-kpi .kpi-icon { flex: none; width: 2.75rem; height: 2.75rem; }
.sales-kpi-label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-500); }
.sales-kpi-value { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1.15; color: var(--ink-900); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sales-kpi-note { display: block; font-size: .78rem; color: var(--ink-500); }

.sales-tabs { display: inline-flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; margin-bottom: .75rem; border-radius: 12px; background: #e9eef6; }
.sales-tabs a { padding: .45rem 1rem; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--ink-700); }
.sales-tabs a:hover { text-decoration: none; background: rgba(255, 255, 255, .6); }
.sales-tabs a[aria-current="page"] { background: var(--surface); color: var(--brand-700); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

.sales-filters .field.sales-search { position: relative; }
.sales-filters .sales-search .icon { position: absolute; left: .8rem; bottom: .85rem; color: var(--ink-500); pointer-events: none; }
.sales-filters .sales-search input { padding-left: 2.4rem; }
.sales-results { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin: 0 0 .6rem; font-size: .9rem; color: var(--ink-500); }

.sales-table td:first-child { border-left: 3px solid var(--ok-500); }
.sales-table tr.is-cancelled td:first-child { border-left-color: var(--danger-500); }
.sales-table tr.is-cancelled .sales-total { color: var(--ink-500); text-decoration: line-through; }
.sales-number { font-weight: 800; color: var(--brand-900); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sales-sub { font-size: .8rem; color: var(--ink-500); }
.sales-date { white-space: nowrap; font-weight: 600; }
.sales-customer { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .45rem; }
.sales-customer .none { color: var(--ink-300); }
.sales-method { display: inline-flex; align-items: center; padding: .15rem .6rem; border-radius: 999px; background: #eef2f6; color: var(--ink-700); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.sales-total { font-size: 1rem; font-weight: 800; color: var(--ink-900); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sales-label { display: none; }

.sales-empty { display: grid; justify-items: center; gap: .55rem; padding: 1.5rem 1rem; text-align: center; color: var(--ink-500); }
.sales-empty .kpi-icon { width: 3.25rem; height: 3.25rem; border-radius: 16px; }
.sales-empty strong { color: var(--ink-900); font-size: 1.05rem; }
.sales-empty p { margin: 0; }

/* Phones: each sale becomes a compact card, no horizontal scroll. */
@media (max-width: 720px) {
    .sales-table thead { display: none; }
    .sales-table, .sales-table tbody { display: block; }
    .sales-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem .75rem; align-items: center; padding: .85rem .9rem; border-bottom: 1px solid var(--line); border-left: 3px solid var(--ok-500); }
    .sales-table tr.is-cancelled { border-left-color: var(--danger-500); }
    .sales-table tr:last-child { border-bottom: 0; }
    .sales-table td { display: block; padding: 0; border: 0; }
    .sales-table td:first-child { border-left: 0; }
    .sales-table td.hide-sm { display: block; }
    .sales-table .sales-col-status, .sales-table .sales-col-total { justify-self: end; text-align: right; }
    .sales-table .sales-col-customer, .sales-table .sales-col-seller { grid-column: 1 / -1; font-size: .88rem; }
    .sales-table td.actions { grid-column: 1 / -1; justify-content: stretch; }
    .sales-table td.actions .btn { flex: 1 1 0; }
    .sales-label { display: inline; margin-right: .35rem; font-size: .78rem; font-weight: 600; color: var(--ink-500); }
    /* Card order: number + status, date + total, then customer, seller, payment and actions. */
    .sales-table td:nth-child(1) { order: 1; }
    .sales-table td.sales-col-status { order: 2; }
    .sales-table td:nth-child(2) { order: 3; }
    .sales-table td.sales-col-total { order: 4; }
    .sales-table td.sales-col-customer { order: 5; }
    .sales-table td.sales-col-seller { order: 6; }
    .sales-table td:nth-child(5) { order: 7; }
    .sales-table td.actions { order: 8; }
}

/* Customers (customers/index, form and show only). */
.cust-tabs { display: inline-flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; margin-bottom: .75rem; border-radius: 12px; background: #e9eef6; }
.cust-tabs a { padding: .45rem 1rem; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--ink-700); }
.cust-tabs a:hover { text-decoration: none; background: rgba(255, 255, 255, .6); }
.cust-tabs a[aria-current="page"] { background: var(--surface); color: var(--brand-700); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.cust-filters .cust-search { position: relative; }
.cust-filters .cust-search .icon { position: absolute; left: .8rem; bottom: .85rem; color: var(--ink-500); pointer-events: none; }
.cust-filters .cust-search input { padding-left: 2.4rem; }
.cust-results { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin: 0 0 .6rem; font-size: .9rem; color: var(--ink-500); }

.cust-avatar { display: grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--kpi-soft, var(--brand-50)); color: var(--kpi-color, var(--brand-700)); font-weight: 800; font-size: .95rem; }
.cust-avatar.is-lg { width: 3.5rem; height: 3.5rem; font-size: 1.2rem; }

.cust-grid { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.cust-card { display: flex; flex-direction: column; gap: .75rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--brand-500); border-radius: var(--radius); box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.cust-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.cust-card.has-debt { border-top-color: var(--danger-500); }
.cust-card.is-inactive { border-top-color: var(--ink-300); background: #fbfcfe; }
.cust-card-head { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.cust-card-head > div { min-width: 0; }
.cust-name { margin: 0; font-size: 1rem; font-weight: 700; color: var(--ink-900); overflow-wrap: anywhere; }
.cust-contact { display: grid; gap: .15rem; font-size: .85rem; color: var(--ink-500); overflow-wrap: anywhere; }
.cust-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .7rem; border-top: 1px solid var(--line); }
.cust-debt { display: grid; }
.cust-debt small { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-500); }
.cust-debt strong { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.cust-debt .none { color: var(--ok-700); font-weight: 700; font-size: .92rem; }

.cust-empty { display: grid; justify-items: center; gap: .55rem; padding: 1.5rem 1rem; text-align: center; color: var(--ink-500); }
.cust-empty .kpi-icon { width: 3.25rem; height: 3.25rem; border-radius: 16px; }
.cust-empty strong { color: var(--ink-900); font-size: 1.05rem; }
.cust-empty p { margin: 0; }

/* Customer form */
.cust-form { max-width: 52rem; }
.cust-form .panel { margin-bottom: 1rem; }
.cust-section-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 .9rem; font-size: 1.05rem; }
.cust-section-title .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
.cust-field-error { display: block; margin-top: .3rem; font-size: .84rem; font-weight: 600; color: var(--danger-700); }
.cust-form .field [aria-invalid="true"], .cust-show .field [aria-invalid="true"] { border-color: var(--danger-500); background: #fffafa; }
.cust-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; padding: .85rem 1rem; }
.cust-actions .btn { min-width: 9rem; }
@media (max-width: 640px) { .cust-actions .btn { flex: 1 1 100%; } }

/* Customer detail */
.cust-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.cust-hero-id { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.cust-hero-id h1 { margin: 0; overflow-wrap: anywhere; }
.cust-hero-id p { margin: .2rem 0 0; color: var(--ink-500); }
.cust-hero .toolbar form { margin: 0; }
.cust-stats { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); margin-bottom: .75rem; }
.cust-stat { display: flex; align-items: center; gap: .75rem; padding: .95rem 1rem; }
.cust-stat .kpi-icon { flex: none; }
.cust-stat-label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-500); }
.cust-stat-value { display: block; font-size: 1.3rem; font-weight: 800; line-height: 1.2; color: var(--ink-900); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cust-stat-value.is-danger { color: var(--danger-700); }
.cust-stat-value.is-ok { color: var(--ok-700); }
.cust-columns { display: grid; gap: .75rem; grid-template-columns: 1fr; margin-bottom: .75rem; align-items: start; }
@media (min-width: 960px) { .cust-columns { grid-template-columns: 1fr 1fr; } }
.cust-columns .panel { margin-bottom: 0; }
.cust-dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; font-size: .93rem; }
.cust-dl dt { color: var(--ink-500); }
.cust-dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.cust-dl dd.is-muted { color: var(--ink-300); font-weight: 500; }
.cust-notes { margin: .9rem 0 0; padding: .75rem .9rem; border-radius: 10px; background: #fbfcfe; border: 1px solid var(--line); white-space: pre-line; font-size: .92rem; }
.cust-terms { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.cust-collect { border-top: 3px solid var(--ok-500); }
.cust-block { margin-bottom: .75rem; }
.cust-block-head { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem .25rem; }
.cust-block-head h2 { margin: 0; font-size: 1.05rem; }
.cust-block-head .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
.cust-sale-number { font-weight: 700; white-space: nowrap; }
.cust-refund { min-width: 16rem; margin-top: .5rem; text-align: left; }
.cust-refund .field { margin-bottom: .6rem; }

/* Phones: detail tables become labelled rows, no horizontal scroll. */
@media (max-width: 720px) {
    .cust-table thead { display: none; }
    .cust-table, .cust-table tbody, .cust-table tr { display: block; }
    .cust-table tr { padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
    .cust-table tr:last-child { border-bottom: 0; }
    .cust-table td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .2rem 0; border: 0; text-align: right; }
    .cust-table td.hide-sm { display: flex; }
    .cust-table td::before { content: attr(data-label); flex: none; font-size: .8rem; font-weight: 600; color: var(--ink-500); text-align: left; }
    .cust-table td:not([data-label])::before { content: none; }
    .cust-table td.actions { justify-content: flex-start; padding-top: .5rem; }
    .cust-refund { min-width: 0; }
}

/* Expenses (expenses/index, form and show only). */
.exp-kpis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); margin-bottom: .75rem; }
.exp-kpi { display: flex; align-items: center; gap: .85rem; padding: 1rem 1.1rem; }
.exp-kpi .kpi-icon { flex: none; width: 2.75rem; height: 2.75rem; }
.exp-kpi-label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-500); }
.exp-kpi-value { display: block; font-size: 1.45rem; font-weight: 800; line-height: 1.15; color: var(--ink-900); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.exp-kpi-note { display: block; font-size: .78rem; color: var(--ink-500); }

.exp-split { padding: 1rem 1.1rem; margin-bottom: 1rem; }
.exp-split h2 { margin: 0 0 .75rem; font-size: 1rem; }
.exp-split ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.exp-split li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .75rem; font-size: .9rem; }
.exp-split .name { font-weight: 600; overflow-wrap: anywhere; }
.exp-split .amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.exp-bar { grid-column: 1 / -1; height: .45rem; border-radius: 999px; background: var(--violet-100); overflow: hidden; }
.exp-bar span { display: block; height: 100%; border-radius: inherit; background: var(--violet-500); }

.exp-tabs { display: inline-flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; margin-bottom: .75rem; border-radius: 12px; background: #e9eef6; max-width: 100%; }
.exp-tabs a { padding: .45rem .9rem; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--ink-700); }
.exp-tabs a:hover { text-decoration: none; background: rgba(255, 255, 255, .6); }
.exp-tabs a[aria-current="page"] { background: var(--surface); color: var(--brand-700); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.exp-filters .exp-search { position: relative; }
.exp-filters .exp-search .icon { position: absolute; left: .8rem; bottom: .85rem; color: var(--ink-500); pointer-events: none; }
.exp-filters .exp-search input { padding-left: 2.4rem; }
.exp-results { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin: 0 0 .6rem; font-size: .9rem; color: var(--ink-500); }

.exp-table td:first-child { border-left: 3px solid var(--ink-300); }
.exp-table tr.is-pending td:first-child { border-left-color: var(--warn-500); }
.exp-table tr.is-validated td:first-child { border-left-color: var(--ok-500); }
.exp-table tr.is-rejected td:first-child { border-left-color: var(--danger-500); }
.exp-table tr.is-cancelled .exp-amount, .exp-table tr.is-rejected .exp-amount { color: var(--ink-500); text-decoration: line-through; }
.exp-label { font-weight: 700; color: var(--ink-900); overflow-wrap: anywhere; }
.exp-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .45rem; font-size: .8rem; color: var(--ink-500); }
.exp-category { display: inline-flex; align-items: center; padding: .15rem .6rem; border-radius: 999px; background: var(--violet-100); color: var(--violet-700); font-size: .8rem; font-weight: 600; }
.exp-amount { font-size: 1rem; font-weight: 800; color: var(--ink-900); white-space: nowrap; font-variant-numeric: tabular-nums; }
.exp-paid { display: block; margin-top: .2rem; font-size: .78rem; font-weight: 600; color: var(--ok-700); }
.exp-paid.is-partial { color: var(--warn-700); }
.tabs a.is-locked { opacity: .55; }
.quota-note { font-size: .85rem; color: var(--ink-500); }
.quota-note.is-full { color: var(--danger-700); font-weight: 600; }
.exp-balance-due { color: var(--warn-700); }
.exp-payments tfoot th { font-weight: 700; }
.exp-payments tr.is-reversed .exp-amount { color: var(--ink-500); text-decoration: line-through; }
.exp-payments tr.is-reversal .exp-amount { color: var(--danger-700); }
.exp-reverse { margin-top: .4rem; }
.exp-reverse summary { cursor: pointer; font-weight: 600; color: var(--danger-700); }
.exp-mixed { margin: .25rem 0 .75rem; }
.exp-mixed summary { cursor: pointer; font-weight: 600; }
.exp-mixed-grid { display: grid; gap: .5rem 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); margin-top: .5rem; }
.exp-mixed-grid .mixed-reference { margin-top: .3rem; }
.exp-mobile-label { display: none; }

.exp-empty { display: grid; justify-items: center; gap: .55rem; padding: 1.5rem 1rem; text-align: center; color: var(--ink-500); }
.exp-empty .kpi-icon { width: 3.25rem; height: 3.25rem; border-radius: 16px; }
.exp-empty strong { color: var(--ink-900); font-size: 1.05rem; }
.exp-empty p { margin: 0; }

@media (max-width: 720px) {
    .exp-table thead { display: none; }
    .exp-table, .exp-table tbody { display: block; }
    .exp-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem .75rem; align-items: center; padding: .85rem .9rem; border-bottom: 1px solid var(--line); border-left: 3px solid var(--ink-300); }
    .exp-table tr.is-pending { border-left-color: var(--warn-500); }
    .exp-table tr.is-validated { border-left-color: var(--ok-500); }
    .exp-table tr.is-rejected { border-left-color: var(--danger-500); }
    .exp-table tr:last-child { border-bottom: 0; }
    .exp-table td { display: block; padding: 0; border: 0; }
    .exp-table td:first-child { grid-column: 1 / -1; border-left: 0; }
    .exp-table td.hide-sm { display: block; }
    .exp-table td.num { text-align: right; }
    .exp-table td.exp-col-status { justify-self: end; text-align: right; }
    .exp-table td.actions { grid-column: 1 / -1; }
    .exp-table td.actions .btn { flex: 1 1 0; }
    .exp-mobile-label { display: inline; margin-right: .35rem; font-size: .78rem; font-weight: 600; color: var(--ink-500); }
}

/* Expense form */
.exp-form { max-width: 52rem; }
.exp-form .panel { margin-bottom: 1rem; }
.exp-section-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 .9rem; font-size: 1.05rem; }
.exp-section-title .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
.exp-field-error { display: block; margin-top: .3rem; font-size: .84rem; font-weight: 600; color: var(--danger-700); }
.exp-form .field [aria-invalid="true"] { border-color: var(--danger-500); background: #fffafa; }
.exp-input-suffix { position: relative; }
.exp-input-suffix input { padding-right: 4rem; }
.exp-input-suffix span { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); font-size: .85rem; font-weight: 700; color: var(--ink-500); pointer-events: none; }
.exp-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; padding: .85rem 1rem; }
.exp-actions .btn { min-width: 9rem; }
@media (max-width: 640px) { .exp-actions .btn { flex: 1 1 100%; } }

/* Expense detail */
.exp-hero { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.exp-hero h1 { margin: 0; overflow-wrap: anywhere; }
.exp-hero p { margin: .3rem 0 0; color: var(--ink-500); }
.exp-hero .badge { vertical-align: middle; }
.exp-overview { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 1rem; align-items: start; }
@media (min-width: 900px) { .exp-overview { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.exp-overview .panel { margin-bottom: 0; }
.exp-amount-card { border-top: 3px solid var(--violet-500); }
.exp-amount-big { margin: 0 0 .9rem; font-size: 2rem; font-weight: 800; color: var(--ink-900); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.exp-dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; font-size: .93rem; }
.exp-dl dt { color: var(--ink-500); }
.exp-dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.exp-description { margin: 0; white-space: pre-line; }
.exp-attachment { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.exp-steps { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); margin-bottom: 1rem; align-items: start; }
.exp-steps .panel { margin-bottom: 0; }
.exp-step-ok { border-top: 3px solid var(--ok-500); }
.exp-step-pay { border-top: 3px solid var(--brand-500); }
.exp-step-danger { border-top: 3px solid var(--danger-500); }
.exp-decision-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.exp-timeline { list-style: none; margin: 0; padding: 0; }
.exp-timeline li { position: relative; display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0 .5rem 1.4rem; border-bottom: 1px solid var(--line); font-size: .92rem; }
.exp-timeline li:last-child { border-bottom: 0; }
.exp-timeline li::before { content: ""; position: absolute; left: .2rem; top: .95rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
@media (max-width: 640px) { .exp-timeline li { flex-direction: column; gap: .1rem; } }

/* Recurring expenses and expense categories (expenses/templates, template-form, categories only). */
.rec-summary { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.rec-grid { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.rec-card { display: flex; flex-direction: column; gap: .7rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--violet-500); border-radius: var(--radius); box-shadow: var(--shadow); }
.rec-card.is-inactive { border-top-color: var(--ink-300); background: #fbfcfe; }
.rec-card.is-inactive .rec-amount, .rec-card.is-inactive .rec-title { color: var(--ink-500); }
.rec-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.rec-title { margin: 0; font-size: 1rem; font-weight: 700; color: var(--ink-900); overflow-wrap: anywhere; }
.rec-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; font-size: .82rem; color: var(--ink-500); }
.rec-amount { font-size: 1.35rem; font-weight: 800; color: var(--ink-900); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rec-facts { display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; margin: 0; font-size: .88rem; }
.rec-facts dt { color: var(--ink-500); }
.rec-facts dd { margin: 0; font-weight: 600; }
.rec-due-note { display: block; font-size: .78rem; font-weight: 500; color: var(--ink-500); }
.rec-due-note.is-now { color: var(--warn-700); font-weight: 700; }
.rec-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .7rem; border-top: 1px solid var(--line); }
.rec-actions form { margin: 0; }
.rec-empty { display: grid; justify-items: center; gap: .55rem; padding: 1.5rem 1rem; text-align: center; color: var(--ink-500); }
.rec-empty .kpi-icon { width: 3.25rem; height: 3.25rem; border-radius: 16px; }
.rec-empty strong { color: var(--ink-900); font-size: 1.05rem; }
.rec-empty p { margin: 0; }
@media (max-width: 640px) {
    .rec-actions .btn, .rec-actions form { flex: 1 1 0; }
    .rec-actions form .btn { width: 100%; }
}

/* Recurring template form */
.rec-form { max-width: 52rem; }
.rec-form .panel { margin-bottom: 1rem; }
.rec-section-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 .9rem; font-size: 1.05rem; }
.rec-section-title .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
.rec-field-error { display: block; margin-top: .3rem; font-size: .84rem; font-weight: 600; color: var(--danger-700); }
.rec-form .field [aria-invalid="true"], .ecat-new .field [aria-invalid="true"] { border-color: var(--danger-500); background: #fffafa; }
.rec-input-suffix { position: relative; }
.rec-input-suffix input { padding-right: 4rem; }
.rec-input-suffix span { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); font-size: .85rem; font-weight: 700; color: var(--ink-500); pointer-events: none; }
.rec-form-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; padding: .85rem 1rem; }
.rec-form-actions .btn { min-width: 9rem; }
@media (max-width: 640px) { .rec-form-actions .btn { flex: 1 1 100%; } }

/* Expense categories */
.ecat-new { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-start; }
.ecat-new .field { flex: 1 1 16rem; margin: 0; }
.ecat-group-title { display: flex; align-items: center; gap: .5rem; margin: 1.25rem 0 .6rem; font-size: 1rem; }
.ecat-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.ecat-card { display: flex; align-items: center; gap: .7rem; padding: .8rem .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.ecat-card.is-inactive { background: #fbfcfe; box-shadow: none; }
.ecat-card.is-inactive .ecat-name { color: var(--ink-500); }
.ecat-dot { flex: none; width: .75rem; height: .75rem; border-radius: 50%; }
.ecat-body { flex: 1; min-width: 0; }
.ecat-name { display: block; font-weight: 700; color: var(--ink-900); overflow-wrap: anywhere; }
.ecat-count { display: block; font-size: .8rem; color: var(--ink-500); }
.ecat-card form { margin: 0; flex: none; }

/* Team (team/index, create, edit and partials/permission-fields only). */
.team-summary { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.team-grid { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.team-card { display: flex; flex-direction: column; gap: .75rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--brand-500); border-radius: var(--radius); box-shadow: var(--shadow); }
.team-card.is-manager { border-top-color: var(--violet-500); }
.team-card.is-removed { border-top-color: var(--ink-300); background: #fbfcfe; }
.team-card-head { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.team-card-head > div { min-width: 0; }
.team-avatar { display: grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--kpi-soft, var(--brand-50)); color: var(--kpi-color, var(--brand-700)); font-weight: 800; font-size: .95rem; }
.team-avatar.is-lg { width: 3.5rem; height: 3.5rem; font-size: 1.2rem; }
.team-name { margin: 0; font-size: 1rem; font-weight: 700; color: var(--ink-900); overflow-wrap: anywhere; }
.team-email { display: block; font-size: .84rem; color: var(--ink-500); overflow-wrap: anywhere; }
.team-facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem .8rem; margin: 0; font-size: .88rem; }
.team-facts dt { color: var(--ink-500); }
.team-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.team-role { display: inline-flex; align-items: center; padding: .15rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--brand-100); color: var(--brand-900); white-space: nowrap; }
.team-role.is-manager { background: var(--violet-100); color: var(--violet-700); }
.team-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .7rem; border-top: 1px solid var(--line); }
.team-actions form { margin: 0; }
@media (max-width: 640px) { .team-actions .btn, .team-actions form { flex: 1 1 0; } .team-actions form .btn { width: 100%; } }
.team-quota { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .9rem 1rem; }
.team-quota-bar { flex: 1 1 8rem; max-width: 14rem; height: .5rem; border-radius: 999px; background: var(--violet-100); overflow: hidden; }
.team-quota-bar span { display: block; height: 100%; border-radius: inherit; background: var(--violet-500); }
.team-quota.is-full .team-quota-bar span { background: var(--danger-500); }
.team-empty { display: grid; justify-items: center; gap: .55rem; padding: 1.5rem 1rem; text-align: center; color: var(--ink-500); }
.team-empty .kpi-icon { width: 3.25rem; height: 3.25rem; border-radius: 16px; }
.team-empty strong { color: var(--ink-900); font-size: 1.05rem; }
.team-empty p { margin: 0; }

/* Team forms */
.team-form .panel { margin-bottom: 1rem; }
.team-section-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 .5rem; font-size: 1.05rem; }
.team-section-title .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
.team-section-intro { margin: 0 0 .9rem; font-size: .88rem; color: var(--ink-500); }
.team-field-error { display: block; margin-top: .3rem; font-size: .84rem; font-weight: 600; color: var(--danger-700); }
.team-form .field [aria-invalid="true"] { border-color: var(--danger-500); background: #fffafa; }
.team-form-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; padding: .85rem 1rem; }
.team-form-actions .btn { min-width: 9rem; }
@media (max-width: 640px) { .team-form-actions .btn { flex: 1 1 100%; } }
.team-hero { display: flex; align-items: center; gap: .9rem; margin-bottom: .85rem; min-width: 0; }
.team-hero h1 { margin: 0; overflow-wrap: anywhere; }
.team-hero p { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; margin: .3rem 0 0; color: var(--ink-500); }
.team-transfer { border-top: 3px solid var(--brand-500); }

/* Permission checklist (shared by the two team forms) */
.perm-groups { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.perm-group { padding: .85rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.perm-group h3 { margin: 0 0 .55rem; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--violet-700); }
.perm-list { display: grid; gap: .35rem; }
.perm-list .check { padding: .45rem .55rem; border: 1px solid transparent; border-radius: 9px; background: var(--surface); cursor: pointer; }
.perm-list .check:hover { border-color: var(--brand-100); }
.perm-list .check:has(input:checked) { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-900); }
.perm-list .check.is-disabled { cursor: not-allowed; background: transparent; }
.perm-list .check.is-disabled::after { content: "Interdit aux vendeurs"; margin-left: auto; font-size: .72rem; font-weight: 600; color: var(--ink-500); }

/* Stores (stores/index and stores/edit only). */
.shop-quota { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .4rem; }
.shop-quota-bar { width: 8rem; height: .5rem; border-radius: 999px; background: var(--brand-100); overflow: hidden; }
.shop-quota-bar span { display: block; height: 100%; border-radius: inherit; background: var(--brand-600); }
.shop-quota.is-full .shop-quota-bar span { background: var(--warn-500); }
.shop-grid { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.shop-card { display: flex; flex-direction: column; gap: .8rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--brand-500); border-radius: var(--radius); box-shadow: var(--shadow); }
.shop-card.is-main { border-top-color: var(--violet-500); }
.shop-card.is-inactive { border-top-color: var(--ink-300); background: #fbfcfe; }
.shop-card-head { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.shop-card-head > div { min-width: 0; }
.shop-card-head .kpi-icon { flex: none; }
.shop-name { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--ink-900); overflow-wrap: anywhere; }
.shop-badges { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .25rem; }
.shop-facts { display: grid; grid-template-columns: auto 1fr; gap: .45rem .8rem; margin: 0; font-size: .9rem; align-items: center; }
.shop-facts dt { color: var(--ink-500); }
.shop-facts dd { margin: 0; font-weight: 600; }
.shop-meter { display: flex; align-items: center; gap: .5rem; }
.shop-meter-bar { flex: 1; max-width: 6rem; height: .4rem; border-radius: 999px; background: var(--ok-100); overflow: hidden; }
.shop-meter-bar span { display: block; height: 100%; border-radius: inherit; background: var(--ok-500); }
.shop-meter.is-full .shop-meter-bar span { background: var(--warn-500); }
.shop-actions { display: flex; gap: .4rem; margin-top: auto; padding-top: .7rem; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .shop-actions .btn { flex: 1 1 auto; } }
.shop-new { border-top: 3px solid var(--ok-500); scroll-margin-top: calc(var(--topbar-height) + 1rem); }
.shop-new.is-locked { border-top-color: var(--warn-500); }
.shop-new-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.shop-new-form .field { flex: 1 1 16rem; margin: 0; }
.shop-section-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 .9rem; font-size: 1.05rem; }
.shop-section-title .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
.shop-field-error { display: block; margin-top: .3rem; font-size: .84rem; font-weight: 600; color: var(--danger-700); }
.shop-new .field [aria-invalid="true"], .shop-form .field [aria-invalid="true"] { border-color: var(--danger-500); background: #fffafa; }
.shop-form { max-width: 44rem; }
.shop-form .panel { margin-bottom: 1rem; }
.shop-form-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; padding: .85rem 1rem; }
.shop-form-actions .btn { min-width: 9rem; }
@media (max-width: 640px) { .shop-form-actions .btn { flex: 1 1 100%; } }
.shop-hero { display: flex; align-items: center; gap: .9rem; margin-bottom: .85rem; min-width: 0; }
.shop-hero h1 { margin: 0; overflow-wrap: anywhere; }
.shop-hero p { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; margin: .3rem 0 0; color: var(--ink-500); }

/* Platform accounts (admin/accounts only). */
.acct-search .field { position: relative; }
.acct-search .field .icon { position: absolute; left: .8rem; bottom: .85rem; color: var(--ink-500); pointer-events: none; }
.acct-search .field input { padding-left: 2.4rem; }
.acct-results { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin: 0 0 .6rem; font-size: .9rem; color: var(--ink-500); }
.acct-table td:first-child { border-left: 3px solid var(--ok-500); }
.acct-table tr.is-pending td:first-child { border-left-color: var(--warn-500); }
.acct-table tr.is-suspended td:first-child { border-left-color: var(--danger-500); }
.acct-table tr.is-admin td:first-child { border-left-color: var(--brand-900); }
.acct-id { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.acct-id > div { min-width: 0; }
.acct-avatar { display: grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--kpi-soft, var(--brand-50)); color: var(--kpi-color, var(--brand-700)); font-weight: 800; font-size: .88rem; }
.acct-name { font-weight: 700; color: var(--ink-900); overflow-wrap: anywhere; }
.acct-email { display: block; font-size: .82rem; color: var(--ink-500); overflow-wrap: anywhere; }
.acct-role { display: inline-flex; align-items: center; padding: .15rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 700; background: #eef2f6; color: var(--ink-700); white-space: nowrap; }
.acct-role.is-admin { background: var(--brand-950); color: #fff; }
.acct-role.is-owner { background: var(--violet-100); color: var(--violet-700); }
.acct-role.is-member { background: var(--brand-100); color: var(--brand-900); }
.acct-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.acct-locked { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--ink-500); white-space: nowrap; }
.acct-label { display: none; }
.acct-empty { display: grid; justify-items: center; gap: .55rem; padding: 1.5rem 1rem; text-align: center; color: var(--ink-500); }
.acct-empty .kpi-icon { width: 3.25rem; height: 3.25rem; border-radius: 16px; }
.acct-empty strong { color: var(--ink-900); font-size: 1.05rem; }
.acct-empty p { margin: 0; }

/* Platform dashboard (admin/dashboard only; reuses the workspace dashboard components). */
.adm-kpis { margin-bottom: .75rem; }
.adm-kpis .kpi { color: var(--ink-900); transition: border-color .15s, box-shadow .15s, transform .15s; }
.adm-kpis a.kpi:hover { text-decoration: none; border-color: var(--kpi-color, var(--brand-500)); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.adm-kpis a.kpi:focus-visible { outline: none; box-shadow: var(--focus); }
.adm-kpis .kpi.is-calm .kpi-value { color: var(--ink-500); }
.adm-group-title { margin: 0 0 .6rem; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); }
.adm-feed { list-style: none; margin: 0; padding: 0; }
.adm-feed li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .2rem .8rem; align-items: start; padding: .5rem 1rem; border-bottom: 1px solid var(--line); }
.adm-feed li:last-child { border-bottom: 0; }
.adm-feed-dot { width: .6rem; height: .6rem; margin-top: .4rem; border-radius: 50%; background: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
.adm-feed-main { min-width: 0; }
.adm-feed-main code { font-size: .82rem; padding: .1rem .4rem; border-radius: 6px; background: #eef2f6; color: var(--ink-700); overflow-wrap: anywhere; }
.adm-feed-who { display: block; margin-top: .2rem; font-size: .85rem; color: var(--ink-500); overflow-wrap: anywhere; }
.adm-feed-date { font-size: .8rem; color: var(--ink-500); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
    .adm-feed li { grid-template-columns: auto minmax(0, 1fr); }
    .adm-feed-date { grid-column: 2; }
}

/* Platform businesses (admin/businesses only). */
.biz-results { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin: 0 0 .6rem; font-size: .9rem; color: var(--ink-500); }
.biz-grid { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); }
.biz-card { display: flex; flex-direction: column; gap: .8rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--ok-500); border-radius: var(--radius); box-shadow: var(--shadow); }
.biz-card.is-expired { border-top-color: var(--warn-500); }
.biz-card.is-suspended { border-top-color: var(--danger-500); background: #fffafa; }
.biz-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.biz-id { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.biz-id > div { min-width: 0; }
.biz-id .kpi-icon { flex: none; }
.biz-name { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--ink-900); overflow-wrap: anywhere; }
.biz-locale { display: block; font-size: .8rem; color: var(--ink-500); }
.biz-facts { display: grid; grid-template-columns: auto 1fr; gap: .45rem .8rem; margin: 0; font-size: .9rem; align-items: center; }
.biz-facts dt { color: var(--ink-500); }
.biz-facts dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.biz-facts dd small { display: block; font-weight: 500; color: var(--ink-500); }
.biz-plan { display: inline-flex; align-items: center; padding: .15rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--brand-100); color: var(--brand-900); }
.biz-plan.is-pro { background: var(--violet-100); color: var(--violet-700); }
.biz-meter { display: flex; align-items: center; gap: .5rem; }
.biz-meter-bar { flex: 1; max-width: 6rem; height: .4rem; border-radius: 999px; background: var(--brand-100); overflow: hidden; }
.biz-meter-bar span { display: block; height: 100%; border-radius: inherit; background: var(--brand-600); }
.biz-meter.is-full .biz-meter-bar span { background: var(--warn-500); }
.biz-actions { display: grid; gap: .6rem; margin-top: auto; padding-top: .8rem; border-top: 1px solid var(--line); }
.biz-plan-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .4rem; margin: 0; }
.biz-plan-form .field { flex: 1 1 9rem; margin: 0; }
.biz-plan-form label { font-size: .8rem; }
.biz-plan-form select { min-height: 2.25rem; }
.biz-status-form { margin: 0; }
.biz-status-form .btn { width: 100%; }
.biz-empty { display: grid; justify-items: center; gap: .55rem; padding: 1.5rem 1rem; text-align: center; color: var(--ink-500); }
.biz-empty .kpi-icon { width: 3.25rem; height: 3.25rem; border-radius: 16px; }
.biz-empty strong { color: var(--ink-900); font-size: 1.05rem; }

/* Plan extension requests (admin/extensions only). */
.ext-summary { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.ext-section-title { display: flex; align-items: center; gap: .55rem; margin: 0 0 .75rem; font-size: 1.1rem; }
.ext-section-title .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
.ext-grid { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.ext-card { display: flex; flex-direction: column; gap: .8rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--warn-500); border-radius: var(--radius); box-shadow: var(--shadow); }
.ext-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.ext-business { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--ink-900); overflow-wrap: anywhere; }
.ext-meta { display: block; font-size: .82rem; color: var(--ink-500); overflow-wrap: anywhere; }
.ext-ask { display: flex; align-items: center; gap: .75rem; padding: .7rem .85rem; border-radius: 12px; background: var(--kpi-soft, var(--brand-50)); color: var(--kpi-color, var(--brand-700)); }
.ext-ask .kpi-icon { flex: none; background: var(--surface); }
.ext-qty { font-size: 1.6rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ext-kind { font-weight: 700; font-size: .92rem; }
.ext-message { margin: 0; padding: .65rem .85rem; border-left: 3px solid var(--ink-300); border-radius: 0 10px 10px 0; background: #f8fafc; font-size: .9rem; color: var(--ink-700); white-space: pre-line; overflow-wrap: anywhere; }
.ext-message.is-empty { color: var(--ink-500); font-style: italic; }
.ext-decision { display: grid; gap: .5rem; margin: 0; padding-top: .8rem; border-top: 1px solid var(--line); }
.ext-decision .field { margin: 0; }
.ext-decision label { font-size: .82rem; }
.ext-buttons { display: flex; flex-wrap: wrap; gap: .4rem; }
.ext-buttons .btn { flex: 1 1 8rem; }
.ext-history { list-style: none; margin: 0; padding: 0; }
.ext-history li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem .9rem; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--line); border-left: 3px solid var(--ok-500); }
.ext-history li.is-rejected { border-left-color: var(--danger-500); }
.ext-history li:last-child { border-bottom: 0; }
.ext-history .what { font-weight: 700; color: var(--ink-900); overflow-wrap: anywhere; }
.ext-history .detail { display: block; font-size: .84rem; font-weight: 500; color: var(--ink-500); }
.ext-history .result { display: grid; justify-items: end; gap: .2rem; font-size: .8rem; color: var(--ink-500); white-space: nowrap; }
.ext-history .note { grid-column: 1 / -1; margin: 0; font-size: .85rem; color: var(--ink-700); overflow-wrap: anywhere; }
.ext-empty { display: grid; justify-items: center; gap: .5rem; padding: 1.5rem 1rem; text-align: center; color: var(--ink-500); }
.ext-empty .kpi-icon { width: 3rem; height: 3rem; border-radius: 14px; }
.ext-empty strong { color: var(--ink-900); }
@media (max-width: 560px) {
    .ext-history li { grid-template-columns: 1fr; }
    .ext-history .result { justify-items: start; }
}

/* Audit log (admin/audit and its partial only). */
.audit-note { display: flex; align-items: center; gap: .6rem; }
.audit-results { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin: 0 0 .6rem; font-size: .9rem; color: var(--ink-500); }
.audit-list { list-style: none; margin: 0; padding: 0; }
.audit-item { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .35rem 1.1rem; padding: .6rem 1rem; border-bottom: 1px solid var(--line); border-left: 3px solid var(--audit-color, var(--ink-300)); }
.audit-item:last-child { border-bottom: 0; }
.audit-when { display: grid; align-content: start; gap: .1rem; font-variant-numeric: tabular-nums; }
.audit-when strong { font-size: .9rem; color: var(--ink-900); }
.audit-when span { font-size: .8rem; color: var(--ink-500); }
.audit-body { display: grid; gap: .4rem; min-width: 0; }
.audit-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; }
.audit-cat { display: inline-flex; align-items: center; padding: .15rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--audit-soft, #eef2f6); color: var(--audit-color, var(--ink-700)); white-space: nowrap; }
.audit-action { font-size: .92rem; font-weight: 700; color: var(--ink-900); overflow-wrap: anywhere; }
.audit-who { display: flex; flex-wrap: wrap; gap: .2rem .9rem; font-size: .86rem; color: var(--ink-700); }
.audit-who span { overflow-wrap: anywhere; }
.audit-who .label { color: var(--ink-500); }
.audit-who .none { color: var(--ink-300); }
.audit-meta { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0; padding: 0; list-style: none; }
.audit-meta li { padding: .12rem .5rem; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; font-size: .78rem; color: var(--ink-700); overflow-wrap: anywhere; max-width: 100%; }
.audit-meta li b { font-weight: 600; color: var(--ink-500); }
.audit-empty { display: grid; justify-items: center; gap: .5rem; padding: 1.5rem 1rem; text-align: center; color: var(--ink-500); }
.audit-empty .kpi-icon { width: 3.25rem; height: 3.25rem; border-radius: 16px; }
.audit-empty strong { color: var(--ink-900); font-size: 1.05rem; }
/* Category colours (from the action prefix). */
.audit-c-blue { --audit-color: var(--brand-700); --audit-soft: var(--brand-100); }
.audit-c-violet { --audit-color: var(--violet-700); --audit-soft: var(--violet-100); }
.audit-c-green { --audit-color: var(--ok-700); --audit-soft: var(--ok-100); }
.audit-c-orange { --audit-color: #c2410c; --audit-soft: var(--warn-100); }
.audit-c-red { --audit-color: var(--danger-700); --audit-soft: var(--danger-100); }
.audit-c-slate { --audit-color: var(--ink-700); --audit-soft: #eef2f6; }
@media (max-width: 640px) {
    .audit-item { grid-template-columns: 1fr; }
    .audit-when { grid-auto-flow: column; justify-content: start; gap: .5rem; }
}

/* Cash module (cash/* views and cash/partials only). The shared .change-box (POS) is left untouched. */
.cash-tabs { display: flex; flex-wrap: wrap; gap: .25rem; width: fit-content; max-width: 100%; padding: .25rem; margin-bottom: 1rem; border-radius: 12px; background: #e9eef6; }
.cash-tabs a { padding: .45rem .95rem; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--ink-700); }
.cash-tabs a:hover { text-decoration: none; background: rgba(255, 255, 255, .6); }
.cash-tabs a[aria-current="page"] { background: var(--surface); color: var(--brand-700); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

.cash-hero { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.cash-hero h1 { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; }
.cash-hero p { margin: .35rem 0 0; color: var(--ink-500); }
.cash-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.cash-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #eef2f6; color: var(--ink-700); }

.cash-kpis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); margin-bottom: .75rem; }
.cash-kpi { display: flex; align-items: center; gap: .8rem; padding: .95rem 1rem; }
.cash-kpi .kpi-icon { flex: none; }
.cash-kpi-label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-500); }
.cash-kpi-value { display: block; font-size: 1.35rem; font-weight: 800; line-height: 1.2; color: var(--ink-900); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cash-kpi-value.is-plus { color: var(--ok-700); }
.cash-kpi-value.is-minus { color: var(--danger-700); }
.cash-kpi.is-main { border-top: 3px solid var(--brand-600); }

.cash-columns { display: grid; gap: .75rem; grid-template-columns: 1fr; margin-bottom: .75rem; align-items: start; }
@media (min-width: 960px) { .cash-columns { grid-template-columns: 1fr 1fr; } }
.cash-columns .panel { margin-bottom: 0; }
.cash-panel-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 .9rem; font-size: 1.05rem; }
.cash-panel-title .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
.cash-intro { margin: 0 0 .9rem; font-size: .88rem; color: var(--ink-500); }
.cash-close-panel { border-top: 3px solid var(--brand-600); }
.cash-closed-panel { border-top: 3px solid var(--ink-300); }

/* Expected-cash ledger (summary partial) */
.cash-ledger { list-style: none; margin: 0; padding: 0; }
.cash-ledger li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); font-size: .93rem; }
.cash-ledger li:last-child { border-bottom: 0; }
.cash-ledger .amount { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cash-ledger .amount.is-plus { color: var(--ok-700); }
.cash-ledger .amount.is-minus { color: var(--danger-700); }
.cash-ledger .count { font-size: .8rem; color: var(--ink-500); }
.cash-ledger li.is-total { margin-top: .35rem; padding: .75rem .9rem; border: 0; border-radius: 12px; background: var(--brand-50); color: var(--brand-900); }
.cash-ledger li.is-total .amount { font-size: 1.35rem; font-weight: 800; }
.cash-electronic { margin: .75rem 0 0; padding: .6rem .8rem; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); font-size: .84rem; color: var(--ink-700); }

/* Close form (close-form partial) */
.cash-close .field { margin-bottom: .8rem; }
.cash-close .cash-diff { margin: 0 0 .8rem; }
.cash-field-error { display: block; margin-top: .3rem; font-size: .84rem; font-weight: 600; color: var(--danger-700); }
.cash-close .field [aria-invalid="true"], .cash-form .field [aria-invalid="true"] { border-color: var(--danger-500); background: #fffafa; }
.cash-input-suffix { position: relative; }
.cash-input-suffix input { padding-right: 4rem; }
.cash-input-suffix span { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); font-size: .85rem; font-weight: 700; color: var(--ink-500); pointer-events: none; }
.cash-input-big input { min-height: 3rem; font-size: 1.2rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* Lists: tables on desktop, labelled rows on phones */
.cash-block { margin-bottom: .75rem; }
.cash-block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem 1rem .4rem; }
.cash-block-head h2 { display: flex; align-items: center; gap: .55rem; margin: 0; font-size: 1.05rem; }
.cash-block-head .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
.cash-num { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cash-num.is-plus { color: var(--ok-700); }
.cash-num.is-minus { color: var(--danger-700); }
.cash-num.is-muted { color: var(--ink-500); font-weight: 500; }
.cash-sub { display: block; font-size: .8rem; color: var(--ink-500); overflow-wrap: anywhere; }
.cash-ref { font-weight: 700; white-space: nowrap; }
.cash-diff-badge { display: inline-flex; padding: .15rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; background: var(--ok-100); color: var(--ok-700); }
.cash-diff-badge.is-off { background: var(--danger-100); color: var(--danger-700); }
.cash-results { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin: 0 0 .6rem; font-size: .9rem; color: var(--ink-500); }
.cash-empty { display: grid; justify-items: center; gap: .5rem; padding: 1.5rem 1rem; text-align: center; color: var(--ink-500); }
.cash-empty .kpi-icon { width: 3rem; height: 3rem; border-radius: 14px; }
.cash-empty strong { color: var(--ink-900); }
@media (max-width: 720px) {
    .cash-table thead { display: none; }
    .cash-table, .cash-table tbody, .cash-table tr { display: block; }
    .cash-table tr { padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
    .cash-table tr:last-child { border-bottom: 0; }
    .cash-table td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .2rem 0; border: 0; text-align: right; }
    .cash-table td.hide-sm { display: flex; }
    .cash-table td::before { content: attr(data-label); flex: none; font-size: .8rem; font-weight: 600; color: var(--ink-500); text-align: left; }
    .cash-table td:not([data-label])::before { content: none; }
    .cash-table td.actions { justify-content: flex-start; padding-top: .5rem; }
    .cash-table td.actions .btn { width: 100%; }
}

/* Forms of the module */
.cash-form .panel { margin-bottom: 1rem; }
.cash-form-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.cash-note { margin: .6rem 0 0; font-size: .82rem; color: var(--ink-500); }
.cash-filters .cash-status-hidden { display: none; }

/* Open a session: register tiles */
.cash-open { max-width: 44rem; border-top: 3px solid var(--ok-500); }
.cash-registers-pick { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); margin: 0 0 1rem; padding: 0; border: 0; min-width: 0; }
.cash-registers-pick legend { margin-bottom: .45rem; font-size: .9rem; font-weight: 600; color: var(--ink-700); }
.cash-tile { position: relative; display: grid; gap: .3rem; padding: .75rem .85rem; border: 1px solid var(--ink-300); border-radius: 12px; background: var(--surface); cursor: pointer; }
.cash-tile:hover { border-color: var(--brand-500); }
.cash-tile:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-600); }
.cash-tile:has(input:focus-visible) { box-shadow: var(--focus); }
.cash-tile:has(input:disabled) { cursor: not-allowed; background: #f8fafc; color: var(--ink-500); }
.cash-tile input { position: absolute; opacity: 0; pointer-events: none; }
.cash-tile strong { font-size: .98rem; }

/* Registers page */
.cash-store { margin-bottom: 1rem; }
.cash-register-list { list-style: none; margin: 0 0 .9rem; padding: 0; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.cash-register { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem .8rem; border: 1px solid var(--line); border-left: 3px solid var(--brand-500); border-radius: 10px; background: #fbfcfe; }
.cash-register.is-open { border-left-color: var(--ok-500); }
.cash-register.is-inactive { border-left-color: var(--ink-300); color: var(--ink-500); }
.cash-register form { margin: 0; }
.cash-register-name { display: grid; gap: .25rem; min-width: 0; }
.cash-register-name strong { overflow-wrap: anywhere; }
.cash-add-register { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; padding-top: .8rem; border-top: 1px solid var(--line); }
.cash-add-register .field { flex: 1 1 12rem; margin: 0; }

/* Hardware page */
.cash-devices { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); margin-bottom: .75rem; }
.cash-device { display: flex; flex-direction: column; gap: .6rem; padding: 1rem; }
.cash-device-head { display: flex; align-items: center; gap: .65rem; }
.cash-device-head strong { font-size: .98rem; }
.cash-device .label { font-size: .84rem; color: var(--ink-500); min-height: 1.2rem; }
.cash-device .state { min-height: 1.5rem; }
.cash-device-action { margin-top: auto; }
.cash-device-action input { width: 100%; min-height: 2.4rem; padding: 0 .7rem; font: inherit; border: 1px solid var(--ink-300); border-radius: 10px; }
.cash-device-action .btn { width: 100%; }
.cash-serial-display { display: flex; flex-direction: column; gap: .45rem; padding-top: .7rem; border-top: 1px solid var(--ink-200, #e5e7eb); }
.cash-serial-display .cash-device-action { display: flex; flex-wrap: wrap; gap: .4rem; }
.cash-serial-display .cash-device-action .btn { width: auto; flex: 1 1 auto; }
.cash-serial-fields { display: flex; flex-wrap: wrap; gap: .5rem; }
.cash-serial-fields label { display: flex; flex-direction: column; gap: .2rem; flex: 1 1 8rem; }
.cash-serial-fields select { min-height: 2.2rem; font: inherit; border: 1px solid var(--ink-300); border-radius: 8px; padding: 0 .4rem; }
.cash-serial-display p { margin: 0; }
/* Scanner test: one line per read (pace, longest gap, suffix, verdict of the POS reader). */
/* Scanner diagnostic (Hardware page; POS with ?scanner-debug=1): one row per read. */
.scan-diag { margin: 0 0 .75rem; font-size: .78rem; }
.scan-diag-head { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; }
.scan-diag-expected { display: flex; flex-direction: column; gap: .2rem; font-weight: 600; color: var(--ink-700); }
.scan-diag-expected input { width: 16rem; max-width: 100%; }
.scan-diag-summary { margin: .5rem 0; color: var(--ink-700); }
.scan-diag-table { overflow-x: auto; border: 1px solid var(--line, #e2e8f0); border-radius: 8px; }
.scan-diag-table table { width: 100%; border-collapse: collapse; }
.scan-diag-table th, .scan-diag-table td { padding: .3rem .45rem; border-bottom: 1px solid var(--line, #e2e8f0); text-align: left; vertical-align: top; white-space: nowrap; }
.scan-diag-table td:nth-child(3), .scan-diag-table td:nth-child(5), .scan-diag-table td:nth-child(7), .scan-diag-table td:nth-child(9), .scan-diag-table td:nth-child(10), .scan-diag-table td:nth-child(11) { white-space: normal; min-width: 9rem; overflow-wrap: anywhere; }
.scan-diag-table td:nth-child(3) { font-family: ui-monospace, Consolas, monospace; }
.scan-diag-table tr.is-typing, .scan-diag-table tr.is-merged { color: var(--ink-500); }
.scan-diag-table tr.is-stuck, .scan-diag-table tr.tone-error { background: #fef2f2; }
.scan-diag-table tr.is-scan.tone-ok { background: #f0fdf4; }
.scan-diag-table tr.is-mismatch, .scan-diag-table tr.is-scan.tone-ok.is-mismatch { background: #fef2f2; }
.scan-diag-raw { margin-top: .5rem; }
.scan-diag-raw summary { cursor: pointer; color: var(--ink-700); }
.scan-diag-raw pre { max-height: 16rem; overflow: auto; margin: .4rem 0 0; padding: .5rem; background: var(--canvas); border-radius: 8px; font-size: .72rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.cash-message { min-height: 1.3rem; margin: 0 0 1rem; font-size: .9rem; font-weight: 600; color: var(--brand-900); }

/* Sale detail (sales/show), sale return (sales/return) and the on-screen controls of the ticket (sales/ticket, never printed). */
.sld-hero { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.sld-hero h1 { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; }
.sld-hero p { margin: .35rem 0 0; color: var(--ink-500); }
.sld-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.sld-chip { display: inline-flex; align-items: center; padding: .2rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #eef2f6; color: var(--ink-700); }
.sld-kpis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); margin-bottom: .75rem; }
.sld-kpi { display: flex; align-items: center; gap: .75rem; padding: .95rem 1rem; }
.sld-kpi .kpi-icon { flex: none; }
.sld-kpi-label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-500); }
.sld-kpi-value { display: block; font-size: 1.3rem; font-weight: 800; line-height: 1.2; color: var(--ink-900); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sld-kpi-value.is-text { font-size: 1.05rem; }
.sld-kpi.is-main { border-top: 3px solid var(--brand-600); }
.sld-kpi.is-cancelled .sld-kpi-value { color: var(--ink-500); text-decoration: line-through; }
.sld-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 .9rem; font-size: 1.05rem; }
.sld-title .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
.sld-block { margin-bottom: .75rem; }
.sld-block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem 1rem .4rem; }
.sld-block-head h2 { display: flex; align-items: center; gap: .55rem; margin: 0; font-size: 1.05rem; }
.sld-block-head .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
.sld-columns { display: grid; gap: .75rem; grid-template-columns: 1fr; margin-bottom: .75rem; align-items: start; }
@media (min-width: 900px) { .sld-columns { grid-template-columns: 1fr 1fr; } }
.sld-columns .panel { margin-bottom: 0; }
.sld-customer { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; border-left: 4px solid var(--violet-500); }
.sld-customer .who { display: grid; gap: .1rem; min-width: 0; }
.sld-customer .who strong { font-size: 1rem; overflow-wrap: anywhere; }
.sld-credit { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; padding: .5rem .8rem; border-radius: 10px; background: var(--violet-100); color: var(--violet-700); font-weight: 600; font-size: .9rem; }
.sld-lines tfoot td { padding-top: .9rem; border-top: 2px solid var(--line); font-size: 1.05rem; }
.sld-num { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sld-num.is-minus { color: var(--danger-700); }
.sld-num.is-muted { color: var(--ink-500); font-weight: 500; }
.sld-ledger { list-style: none; margin: 0; padding: 0; }
.sld-ledger li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.sld-ledger li:last-child { border-bottom: 0; }
.sld-ledger .sub { display: block; font-size: .8rem; color: var(--ink-500); }
.sld-received { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: .75rem 0 0; padding: .55rem .8rem; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); font-size: .86rem; color: var(--ink-700); }
.sld-cancel { border-top: 3px solid var(--danger-500); }
.sld-field-error { display: block; margin-top: .3rem; font-size: .84rem; font-weight: 600; color: var(--danger-700); }
.sld-form .field [aria-invalid="true"], .ret-form [aria-invalid="true"] { border-color: var(--danger-500); background: #fffafa; }
.sld-returns { display: grid; gap: .75rem; }
.sld-return { padding: .85rem 1rem; border: 1px solid var(--line); border-left: 3px solid var(--warn-500); border-radius: 10px; background: #fbfcfe; }
.sld-return-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .7rem; }
.sld-return-reason { margin: .35rem 0 .5rem; font-size: .9rem; color: var(--ink-700); overflow-wrap: anywhere; }
.sld-return-totals { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
@media (max-width: 720px) {
    .sld-table thead { display: none; }
    .sld-table, .sld-table tbody, .sld-table tfoot, .sld-table tr { display: block; }
    .sld-table tr { padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
    .sld-table td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .2rem 0; border: 0; text-align: right; }
    .sld-table td.hide-sm { display: flex; }
    .sld-table td::before { content: attr(data-label); flex: none; font-size: .8rem; font-weight: 600; color: var(--ink-500); text-align: left; }
    .sld-table td:not([data-label])::before { content: none; }
    .sld-table td:first-child { font-weight: 700; text-align: left; }
    .sld-table tfoot td.sld-foot-spacer { display: none; }
    .sld-lines tfoot td { border-top: 0; padding-top: .2rem; }
}

/* Sale return form */
.ret-intro { display: flex; gap: .6rem; align-items: flex-start; }
.ret-qty { width: 6rem; min-height: 2.6rem; padding: 0 .6rem; font: inherit; font-weight: 700; text-align: center; border: 1px solid var(--ink-300); border-radius: 10px; background: #fff; }
.ret-qty:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--focus); }
.ret-qty:disabled { background: #f1f5f9; color: var(--ink-300); }
.ret-returnable { display: inline-flex; margin-top: .2rem; padding: .1rem .5rem; border-radius: 999px; background: var(--ok-100); color: var(--ok-700); font-size: .76rem; font-weight: 700; }
.ret-returnable.is-none { background: #eef2f6; color: var(--ink-500); }
.ret-row.is-none td { color: var(--ink-500); }
.ret-summary { border-top: 3px solid var(--brand-600); }
.ret-summary li.is-cash { padding: .7rem .85rem; margin-top: .3rem; border: 0; border-radius: 12px; background: var(--danger-100); color: var(--danger-700); }
.ret-summary li.is-cash .sld-num { font-size: 1.25rem; }
.ret-submit { border-top: 3px solid var(--ok-500); }

/* Ticket: on-screen controls only (all inside .no-print) */
.tkt-banner { display: grid; justify-items: center; gap: .15rem; }
.tkt-banner .tkt-check { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; margin-bottom: .35rem; border-radius: 50%; background: var(--ok-700); color: #fff; }
.tkt-banner.is-credit { background: var(--violet-100); color: var(--violet-700); }
.tkt-actions { margin-top: .25rem; }
.tkt-actions .btn { width: 100%; }
.tkt-links { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.tkt-status { margin: .25rem 0 0; padding: .65rem .8rem; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); font-size: .84rem; color: var(--ink-700); }

/* Stock: product stock card, movements, inventories (stock/product, stock/movements, stock/inventories/*, stock/partials/movement-table). */
.stk-back { display: inline-flex; align-items: center; gap: .3rem; margin: -.4rem 0 1rem; font-size: .9rem; font-weight: 600; }
.stk-product { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 1rem; margin-bottom: 1rem; }
.stk-photo { position: relative; display: grid; place-items: center; flex: none; width: 4.5rem; height: 4.5rem; border-radius: 14px; overflow: hidden; background: var(--kpi-soft, var(--brand-50)); color: var(--kpi-color, var(--brand-700)); font-size: 1.35rem; font-weight: 800; }
.stk-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stk-product-id { flex: 1 1 14rem; min-width: 0; }
.stk-product-id h2 { margin: 0; font-size: 1.15rem; overflow-wrap: anywhere; }
.stk-product-meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.stk-chip { display: inline-flex; align-items: center; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eef2f6; color: var(--ink-700); overflow-wrap: anywhere; }
.stk-kpis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); margin-bottom: .75rem; }
.stk-kpi { display: flex; align-items: center; gap: .75rem; padding: .95rem 1rem; }
.stk-kpi .kpi-icon { flex: none; }
.stk-kpi-label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-500); }
.stk-kpi-value { display: block; font-size: 1.35rem; font-weight: 800; line-height: 1.2; color: var(--ink-900); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stk-kpi-value.is-big { font-size: 2rem; }
.stk-kpi-value.is-text { font-size: 1rem; }
.stk-kpi.is-out { border-top: 3px solid var(--danger-500); }
.stk-kpi.is-low { border-top: 3px solid var(--warn-500); }
.stk-kpi.is-ok { border-top: 3px solid var(--ok-500); }
.stk-columns { display: grid; gap: .75rem; grid-template-columns: 1fr; margin-bottom: .75rem; align-items: start; }
@media (min-width: 960px) { .stk-columns { grid-template-columns: 1fr 1fr; } }
.stk-columns .panel { margin-bottom: 0; }
.stk-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 .9rem; font-size: 1.05rem; }
.stk-title .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
.stk-intro { margin: 0 0 .9rem; font-size: .88rem; color: var(--ink-500); }
.stk-move { border-top: 3px solid var(--brand-600); }
.stk-threshold { border-top: 3px solid var(--warn-500); }
.stk-transfer { border-top: 3px solid #7c3aed; }
@media (min-width: 960px) { .stk-columns > .stk-transfer { grid-column: 1 / -1; } }
@media (min-width: 960px) { .stk-columns > .stk-move { grid-column: 1 / -1; } }
.stk-form-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.stk-after-create { margin: 0 0 .6rem; color: var(--ok-700, #166534); font-weight: 600; }
.stk-field-error { display: block; margin-top: .3rem; font-size: .84rem; font-weight: 600; color: var(--danger-700); }
.stk-form .field [aria-invalid="true"], .stk-count[aria-invalid="true"] { border-color: var(--danger-500); background: #fffafa; }
.stk-inline-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.stk-inline-form .field { flex: 1 1 12rem; margin: 0; }
.stk-note { margin: .75rem 0 0; font-size: .82rem; color: var(--ink-500); }
.stk-block { margin-bottom: .75rem; }
.stk-block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem 1rem .4rem; }
.stk-block-head h2 { display: flex; align-items: center; gap: .55rem; margin: 0; font-size: 1.05rem; }
.stk-block-head .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
.stk-results { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin: 0 0 .6rem; font-size: .9rem; color: var(--ink-500); }
.stk-tabs { display: flex; flex-wrap: wrap; gap: .25rem; width: fit-content; max-width: 100%; padding: .25rem; margin-bottom: .75rem; border-radius: 12px; background: #e9eef6; }
.stk-tabs a { padding: .45rem .9rem; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--ink-700); }
.stk-tabs a:hover { text-decoration: none; background: rgba(255, 255, 255, .6); }
.stk-tabs a[aria-current="page"] { background: var(--surface); color: var(--brand-700); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.stk-search .field { position: relative; }
.stk-search .field .icon { position: absolute; left: .8rem; bottom: .85rem; color: var(--ink-500); pointer-events: none; }
.stk-search .field input { padding-left: 2.4rem; }

/* Movement table (shared by the product card and the movements page) */
.stk-type { display: inline-flex; align-items: center; padding: .15rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.stk-type.is-entry { background: var(--ok-100); color: var(--ok-700); }
.stk-type.is-exit { background: var(--warn-100); color: var(--warn-700); }
.stk-type.is-adjustment { background: var(--violet-100); color: var(--violet-700); }
.stk-reason { font-weight: 600; color: var(--ink-900); }
.stk-sub { display: block; font-size: .8rem; color: var(--ink-500); overflow-wrap: anywhere; }
.stk-delta { display: inline-flex; padding: .15rem .55rem; border-radius: 999px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stk-delta.is-plus { background: var(--ok-100); color: var(--ok-700); }
.stk-delta.is-minus { background: var(--danger-100); color: var(--danger-700); }
.stk-delta.is-zero { background: #eef2f6; color: var(--ink-500); }
.stk-num { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stk-empty { display: grid; justify-items: center; gap: .5rem; padding: 1.5rem 1rem; text-align: center; color: var(--ink-500); }
.stk-empty strong { color: var(--ink-900); }

/* Inventories */
.stk-new { border-top: 3px solid var(--ok-500); }
.stk-progress { display: flex; align-items: center; gap: .5rem; }
.stk-progress-bar { flex: 1; min-width: 3rem; max-width: 7rem; height: .45rem; border-radius: 999px; background: var(--brand-100); overflow: hidden; }
.stk-progress-bar span { display: block; height: 100%; border-radius: inherit; background: var(--brand-600); }
.stk-progress.is-done .stk-progress-bar span { background: var(--ok-500); }
.stk-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: -.4rem 0 1rem; }
.stk-count { width: 6rem; min-height: 2.6rem; padding: 0 .6rem; font: inherit; font-weight: 700; text-align: center; border: 1px solid var(--ink-300); border-radius: 10px; background: #fff; }
.stk-count:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--focus); }
.stk-inv-row.is-gap td:first-child { box-shadow: inset 3px 0 0 var(--warn-500); }
.stk-inv-row.is-counted td:first-child { box-shadow: inset 3px 0 0 var(--ok-500); }
.stk-actions-bar { position: sticky; bottom: env(safe-area-inset-bottom, 0px); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .75rem; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, .96); box-shadow: 0 -4px 16px rgba(15, 23, 42, .08); }
.stk-validate { border-top: 3px solid var(--ok-500); }
.stk-cancel { border-top: 3px solid var(--danger-500); }

@media (max-width: 720px) {
    .stk-table thead { display: none; }
    .stk-table, .stk-table tbody, .stk-table tr { display: block; }
    .stk-table tr { padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
    .stk-table tr:last-child { border-bottom: 0; }
    .stk-table td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .2rem 0; border: 0; text-align: right; }
    .stk-table td.hide-sm { display: flex; }
    .stk-table td::before { content: attr(data-label); flex: none; font-size: .8rem; font-weight: 600; color: var(--ink-500); text-align: left; }
    .stk-table td:not([data-label])::before { content: none; }
    .stk-table td:first-child { text-align: left; }
    .stk-table td.actions { justify-content: flex-start; padding-top: .5rem; }
    .stk-table td.actions .btn { width: 100%; }
    .stk-inv-row.is-gap, .stk-inv-row.is-counted { box-shadow: none; }
    .stk-inv-row.is-gap { border-left: 3px solid var(--warn-500); }
    .stk-inv-row.is-counted { border-left: 3px solid var(--ok-500); }
    .stk-inv-row td:first-child { box-shadow: none !important; }
}

/* Customer credit (customers/receivables and customers/credit-settings only). */
.crd-kpis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); margin-bottom: .75rem; }
.crd-kpi { display: flex; align-items: center; gap: .8rem; padding: .95rem 1rem; }
.crd-kpi .kpi-icon { flex: none; }
.crd-kpi-label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-500); }
.crd-kpi-value { display: block; font-size: 1.4rem; font-weight: 800; line-height: 1.2; color: var(--ink-900); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.crd-kpi-value.is-danger { color: var(--danger-700); }
.crd-kpi.is-main { border-top: 3px solid var(--violet-500); }
.crd-block { margin-bottom: .75rem; }
.crd-block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem 1rem .4rem; }
.crd-block-head h2 { display: flex; align-items: center; gap: .55rem; margin: 0; font-size: 1.05rem; }
.crd-block-head .kpi-icon, .crd-title .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
.crd-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 .9rem; font-size: 1.05rem; }
.crd-row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger-500); }
.crd-customer { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.crd-avatar { display: grid; place-items: center; flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--kpi-soft, var(--brand-50)); color: var(--kpi-color, var(--brand-700)); font-weight: 800; font-size: .85rem; }
.crd-name { font-weight: 700; color: var(--ink-900); overflow-wrap: anywhere; }
.crd-sub { display: block; font-size: .8rem; color: var(--ink-500); }
.crd-num { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.crd-usage { display: grid; gap: .2rem; justify-items: end; }
.crd-usage-bar { width: 5.5rem; height: .4rem; border-radius: 999px; background: var(--violet-100); overflow: hidden; }
.crd-usage-bar span { display: block; height: 100%; border-radius: inherit; background: var(--violet-500); }
.crd-usage.is-over .crd-usage-bar span { background: var(--danger-500); }
.crd-empty { display: grid; justify-items: center; gap: .5rem; padding: 1.5rem 1rem; text-align: center; color: var(--ink-500); }
.crd-empty .kpi-icon { width: 3rem; height: 3rem; border-radius: 14px; }
.crd-empty strong { color: var(--ink-900); }
.crd-columns { display: grid; gap: .75rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) { .crd-columns { grid-template-columns: 1fr 1fr; } }
.crd-columns .panel { margin-bottom: 0; }
.crd-settings { border-top: 3px solid var(--violet-500); }
.crd-switch { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 0 0 1rem; padding: 0; border: 0; min-width: 0; }
.crd-switch legend { margin-bottom: .45rem; font-size: .9rem; font-weight: 600; color: var(--ink-700); }
.crd-option { position: relative; display: flex; align-items: center; gap: .5rem; padding: .7rem .85rem; border: 1px solid var(--ink-300); border-radius: 12px; background: var(--surface); cursor: pointer; font-weight: 700; }
.crd-option:hover { border-color: var(--brand-500); }
.crd-option:has(input:checked) { border-color: var(--violet-500); background: var(--violet-100); color: var(--violet-700); box-shadow: inset 0 0 0 1px var(--violet-500); }
.crd-option:has(input:focus-visible) { box-shadow: var(--focus); }
.crd-option input { accent-color: var(--violet-700); }
.crd-field-error { display: block; margin-top: .3rem; font-size: .84rem; font-weight: 600; color: var(--danger-700); }
.crd-settings .field [aria-invalid="true"] { border-color: var(--danger-500); background: #fffafa; }
.crd-input-suffix { position: relative; }
.crd-input-suffix input { padding-right: 4rem; }
.crd-input-suffix span { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); font-size: .85rem; font-weight: 700; color: var(--ink-500); pointer-events: none; }
.crd-rule { display: flex; gap: .55rem; align-items: flex-start; margin: .9rem 0 0; padding: .65rem .8rem; border-radius: 10px; background: var(--warn-100); color: var(--warn-700); font-size: .86rem; font-weight: 600; }
.crd-rule .icon { flex: none; margin-top: .1rem; }
.crd-members { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.crd-member { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem .8rem; border: 1px solid var(--line); border-left: 3px solid var(--ink-300); border-radius: 10px; background: #fbfcfe; }
.crd-member.is-allowed { border-left-color: var(--ok-500); }
.crd-member form { margin: 0; }
.crd-member-id { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.crd-member-id .crd-name { display: block; }
@media (max-width: 720px) {
    .crd-table thead { display: none; }
    .crd-table, .crd-table tbody, .crd-table tr { display: block; }
    .crd-table tr { padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
    .crd-table tr:last-child { border-bottom: 0; }
    .crd-table td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .2rem 0; border: 0; text-align: right; }
    .crd-table td.hide-sm { display: flex; }
    .crd-table td::before { content: attr(data-label); flex: none; font-size: .8rem; font-weight: 600; color: var(--ink-500); text-align: left; }
    .crd-table td:not([data-label])::before { content: none; }
    .crd-table td:first-child { text-align: left; }
    .crd-table td.actions { justify-content: flex-start; padding-top: .5rem; }
    .crd-table td.actions .btn { width: 100%; }
    .crd-row-overdue { border-left: 3px solid var(--danger-500); }
    .crd-row-overdue td:first-child { box-shadow: none; }
}

/* Purchasing (purchasing/* views and purchasing/partials only). */
.pur-tabs { display: flex; flex-wrap: wrap; gap: .25rem; width: fit-content; max-width: 100%; padding: .25rem; margin-bottom: 1rem; border-radius: 12px; background: #e9eef6; }
.pur-tabs a { padding: .45rem .95rem; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--ink-700); }
.pur-tabs a:hover { text-decoration: none; background: rgba(255, 255, 255, .6); }
.pur-tabs a[aria-current="page"] { background: var(--surface); color: var(--brand-700); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.pur-subtabs { margin-bottom: .75rem; }

.pur-hero { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.pur-hero h1 { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; overflow-wrap: anywhere; }
.pur-hero p { margin: .35rem 0 0; color: var(--ink-500); }
.pur-hero .toolbar form { margin: 0; }
.pur-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.pur-chip { display: inline-flex; align-items: center; padding: .2rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #eef2f6; color: var(--ink-700); overflow-wrap: anywhere; }

.pur-kpis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); margin-bottom: .75rem; }
.pur-kpi { display: flex; align-items: center; gap: .8rem; padding: .95rem 1rem; }
.pur-kpi .kpi-icon { flex: none; }
.pur-kpi-label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-500); }
.pur-kpi-value { display: block; font-size: 1.35rem; font-weight: 800; line-height: 1.2; color: var(--ink-900); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pur-kpi-value.is-danger { color: var(--danger-700); }
.pur-kpi-value.is-ok { color: var(--ok-700); }
.pur-kpi.is-main { border-top: 3px solid var(--brand-600); }

.pur-columns { display: grid; gap: .75rem; grid-template-columns: 1fr; margin-bottom: .75rem; align-items: start; }
@media (min-width: 960px) { .pur-columns { grid-template-columns: 1fr 1fr; } }
.pur-columns .panel { margin-bottom: 0; }
.pur-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 .9rem; font-size: 1.05rem; }
.pur-title .kpi-icon, .pur-block-head .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
.pur-block { margin-bottom: .75rem; }
.pur-block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem 1rem .4rem; }
.pur-block-head h2 { display: flex; align-items: center; gap: .55rem; margin: 0; font-size: 1.05rem; }
.pur-intro { margin: 0 0 .9rem; font-size: .88rem; color: var(--ink-500); }
.pur-dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; font-size: .92rem; }
.pur-dl dt { color: var(--ink-500); }
.pur-dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.pur-dl dd.is-muted { color: var(--ink-300); font-weight: 500; }
.pur-ref { font-weight: 700; white-space: nowrap; }
.pur-sub { display: block; font-size: .8rem; color: var(--ink-500); overflow-wrap: anywhere; }
.pur-num { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pur-num.is-due { color: var(--danger-700); }
.pur-num.is-credit { color: var(--ok-700); }
.pur-num.is-muted { color: var(--ink-500); font-weight: 500; }
.pur-surplus { display: inline-flex; margin-top: .2rem; padding: .1rem .5rem; border-radius: 999px; background: var(--warn-100); color: var(--warn-700); font-size: .75rem; font-weight: 700; }
.pur-progress { display: inline-flex; align-items: center; gap: .45rem; }
.pur-progress-bar { width: 4.5rem; height: .4rem; border-radius: 999px; background: var(--brand-100); overflow: hidden; }
.pur-progress-bar span { display: block; height: 100%; border-radius: inherit; background: var(--brand-600); }
.pur-progress.is-done .pur-progress-bar span { background: var(--ok-500); }
.pur-results { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin: 0 0 .6rem; font-size: .9rem; color: var(--ink-500); }
.pur-empty { display: grid; justify-items: center; gap: .5rem; padding: 1.5rem 1rem; text-align: center; color: var(--ink-500); }
.pur-empty .kpi-icon { width: 3rem; height: 3rem; border-radius: 14px; }
.pur-empty strong { color: var(--ink-900); }
.pur-empty p { margin: 0; }
.pur-search .field { position: relative; }
.pur-search .pur-search-field .icon { position: absolute; left: .8rem; bottom: .85rem; color: var(--ink-500); pointer-events: none; }
.pur-search .pur-search-field input { padding-left: 2.4rem; }

/* Supplier cards */
.pur-grid { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.pur-card { display: flex; flex-direction: column; gap: .7rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--brand-500); border-radius: var(--radius); box-shadow: var(--shadow); }
.pur-card.has-debt { border-top-color: var(--danger-500); }
.pur-card.is-inactive { border-top-color: var(--ink-300); background: #fbfcfe; }
.pur-card-head { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.pur-card-head > div { min-width: 0; }
.pur-avatar { display: grid; place-items: center; flex: none; width: 2.6rem; height: 2.6rem; border-radius: 12px; background: var(--kpi-soft, var(--brand-50)); color: var(--kpi-color, var(--brand-700)); font-weight: 800; font-size: .9rem; }
.pur-avatar.is-lg { width: 3.4rem; height: 3.4rem; font-size: 1.15rem; }
.pur-card-name { margin: 0; font-size: 1rem; font-weight: 700; color: var(--ink-900); overflow-wrap: anywhere; }
.pur-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .7rem; border-top: 1px solid var(--line); }
.pur-balance small { display: block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-500); }

/* Forms */
.pur-form .panel { margin-bottom: 1rem; }
.pur-narrow { max-width: 52rem; }
.pur-field-error { display: block; margin-top: .3rem; font-size: .84rem; font-weight: 600; color: var(--danger-700); }
.pur-errors { margin: 0 1rem .6rem; padding: .6rem .8rem; border-radius: 10px; background: var(--danger-100); color: var(--danger-700); font-size: .86rem; font-weight: 600; }
.pur-errors ul { margin: 0; padding-left: 1.1rem; }
.pur-form .field [aria-invalid="true"], .pur-input[aria-invalid="true"] { border-color: var(--danger-500); background: #fffafa; }
.pur-input { width: 100%; min-width: 0; min-height: 2.5rem; padding: 0 .6rem; font: inherit; border: 1px solid var(--ink-300); border-radius: 10px; background: #fff; }
.pur-input.is-num { max-width: 8rem; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.pur-input:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--focus); }
.pur-input:disabled { background: #f1f5f9; color: var(--ink-300); }
.pur-actions-bar { position: sticky; bottom: env(safe-area-inset-bottom, 0px); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .75rem; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, .96); box-shadow: 0 -4px 16px rgba(15, 23, 42, .08); }
.pur-actions-bar .pur-total { font-size: 1.05rem; }
.pur-pay { border-top: 3px solid var(--ok-500); }
.pur-entry { padding: .75rem .85rem; margin-bottom: .6rem; border: 1px solid var(--line); border-left: 3px solid var(--brand-500); border-radius: 10px; background: #fbfcfe; }
.pur-entry.is-return { border-left-color: var(--warn-500); }
.pur-entry-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; }
.pur-entry ul { list-style: none; margin: .45rem 0; padding: 0; }
.pur-entry li { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.pur-entry li:last-child { border-bottom: 0; }
.pur-entry-foot { display: flex; flex-wrap: wrap; gap: .35rem; }
.pur-supplier-group { margin-bottom: 1rem; border-left: 4px solid var(--danger-500); }
.pur-credits li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.pur-credits { list-style: none; margin: 0; padding: 0; }

@media (max-width: 720px) {
    .pur-table thead, .pur-table tfoot td.pur-foot-spacer { display: none; }
    .pur-table, .pur-table tbody, .pur-table tfoot, .pur-table tr { display: block; }
    .pur-table tr { padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
    .pur-table tr:last-child { border-bottom: 0; }
    .pur-table td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .2rem 0; border: 0; text-align: right; }
    .pur-table td.hide-sm { display: flex; }
    .pur-table td::before { content: attr(data-label); flex: none; font-size: .8rem; font-weight: 600; color: var(--ink-500); text-align: left; }
    .pur-table td:not([data-label])::before { content: none; }
    .pur-table td:first-child { text-align: left; }
    .pur-table td.actions { justify-content: flex-start; padding-top: .5rem; }
    .pur-table td.actions .btn { width: 100%; }
    .pur-table td .pur-input.is-num { max-width: 9rem; }
    .pur-lines td.pur-product-cell { display: block; }
    .pur-lines td.pur-product-cell select { width: 100%; }
}

/* Reports (reports/* views and reports/partials only). Shared .chart/.hbar/.report-note are left as they are. */
.rpt-hero { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.rpt-hero h1 { margin: 0; }
.rpt-period { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .45rem 0 0; padding: .25rem .75rem; border-radius: 999px; background: var(--brand-50); color: var(--brand-900); font-size: .86rem; font-weight: 600; }
.rpt-period .icon { width: 1rem; height: 1rem; }
.rpt-tabs { display: flex; gap: .25rem; max-width: 100%; padding: .25rem; margin-bottom: .9rem; border-radius: 12px; background: #e9eef6; overflow-x: auto; scrollbar-width: thin; }
.rpt-tabs a { flex: none; padding: .45rem .9rem; border-radius: 9px; font-weight: 600; font-size: .88rem; color: var(--ink-700); white-space: nowrap; }
.rpt-tabs a:hover { text-decoration: none; background: rgba(255, 255, 255, .6); }
.rpt-tabs a[aria-current="page"] { background: var(--surface); color: var(--brand-700); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.rpt-filters { margin-bottom: 1.25rem; }

.rpt-section-title { display: flex; align-items: center; gap: .55rem; margin: 1.5rem 0 .75rem; font-size: 1.1rem; }
.rpt-section-title:first-of-type { margin-top: .25rem; }
.rpt-section-title .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
.rpt-kpis { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); margin-bottom: .75rem; }
.rpt-kpi { position: relative; display: flex; flex-direction: column; gap: .3rem; padding: 1rem 1.1rem; overflow: hidden; }
.rpt-kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--brand-500); }
.rpt-kpi.is-negative::before { background: var(--danger-500); }
.rpt-kpi-label { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); }
.rpt-kpi-value { font-size: 1.55rem; font-weight: 800; line-height: 1.15; color: var(--ink-900); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rpt-kpi-value.is-negative { color: var(--danger-700); }
.rpt-kpi-value.is-missing { font-size: 1rem; font-weight: 600; color: var(--ink-500); }
.rpt-trend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .25rem; width: fit-content; max-width: 100%; padding: .15rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #eef2f6; color: var(--ink-700); }
.rpt-trend.is-up { background: var(--ok-100); color: var(--ok-700); }
.rpt-trend.is-down { background: var(--danger-100); color: var(--danger-700); }
.rpt-kpi-hint { margin: .15rem 0 0; font-size: .8rem; color: var(--ink-500); }

.rpt-block { margin-bottom: .75rem; }
.rpt-block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem 1rem .4rem; }
.rpt-block-head h2 { display: flex; align-items: center; gap: .55rem; margin: 0; font-size: 1.05rem; }
.rpt-block-head .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
.rpt-columns { display: grid; gap: .75rem; grid-template-columns: 1fr; margin-bottom: .75rem; align-items: start; }
@media (min-width: 960px) { .rpt-columns { grid-template-columns: 1fr 1fr; } }
.rpt-columns .card { margin-bottom: 0; }
.rpt-chart .chart-bar { fill: var(--brand-500); transition: fill .15s; }
.rpt-chart .chart-bar:hover { fill: var(--brand-700); }
.rpt-chart .chart-wrap { padding: .5rem 1rem 1rem; }
.rpt-bar { height: .6rem; border-radius: 999px; background: linear-gradient(90deg, var(--brand-500), var(--brand-accent)); min-width: 2px; }
.rpt-num { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rpt-num.is-minus { color: var(--danger-700); }
.rpt-num.is-plus { color: var(--ok-700); }
.rpt-num.is-muted { color: var(--ink-500); font-weight: 500; }
.rpt-sub { display: block; font-size: .8rem; color: var(--ink-500); overflow-wrap: anywhere; }
.rpt-note { display: flex; gap: .55rem; align-items: flex-start; margin: .5rem 0 1rem; padding: .65rem .85rem; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); font-size: .85rem; color: var(--ink-700); }
.rpt-note .icon { flex: none; margin-top: .1rem; color: var(--brand-600); }
.rpt-empty { display: grid; justify-items: center; gap: .4rem; padding: 1.5rem 1rem; text-align: center; color: var(--ink-500); }
.rpt-empty strong { color: var(--ink-900); font-weight: 600; }
.rpt-stat { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem; border-top: 3px solid var(--kpi-color, var(--brand-500)); }
.rpt-stat dl { margin: .25rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; font-size: .9rem; }
.rpt-stat dt { color: var(--ink-500); }
.rpt-stat dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.rpt-ledger { list-style: none; margin: 0; padding: 0; }
.rpt-ledger li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); font-size: .93rem; }
.rpt-ledger li.is-subtotal { border-bottom: 1px solid var(--line); font-weight: 700; }
.rpt-ledger li.is-total { margin-top: .35rem; padding: .8rem .9rem; border: 0; border-radius: 12px; background: var(--brand-50); color: var(--brand-900); font-weight: 800; }
.rpt-ledger li.is-total .rpt-num { font-size: 1.35rem; }
.rpt-ledger li.is-total.is-loss { background: var(--danger-100); color: var(--danger-700); }
.rpt-rules { margin: 0; padding-left: 1.1rem; display: grid; gap: .4rem; font-size: .88rem; color: var(--ink-700); }
.rpt-product-filters { margin-bottom: 1rem; }

@media (max-width: 720px) {
    .rpt-table thead { display: none; }
    .rpt-table, .rpt-table tbody, .rpt-table tr { display: block; }
    .rpt-table tr { padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
    .rpt-table tr:last-child { border-bottom: 0; }
    .rpt-table td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .2rem 0; border: 0; text-align: right; }
    .rpt-table td.hide-sm { display: flex; }
    .rpt-table td.rpt-bar-cell { display: none; }
    .rpt-table td::before { content: attr(data-label); flex: none; font-size: .8rem; font-weight: 600; color: var(--ink-500); text-align: left; }
    .rpt-table td:not([data-label])::before { content: none; }
    .rpt-table td:first-child { text-align: left; }
    .rpt-table td.actions { justify-content: flex-start; padding-top: .5rem; }
    .rpt-table td.actions .btn { width: 100%; }
}

/* Plan page (plan/show only). */
.pln-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.4rem 1.5rem; margin-bottom: .85rem; border-radius: 16px; color: #fff; background: radial-gradient(520px 200px at 100% 0%, rgba(var(--brand-accent-rgb), .45), transparent 60%), linear-gradient(120deg, var(--brand-900), var(--brand-600)); box-shadow: var(--shadow-lg); }
.pln-hero h1 { margin: 0; color: #fff; }
.pln-hero p { margin: .3rem 0 0; color: var(--brand-100); }
.pln-hero .badge { font-size: .85rem; padding: .3rem .8rem; }
.pln-columns { display: grid; gap: .75rem; grid-template-columns: 1fr; margin-bottom: .75rem; align-items: start; }
@media (min-width: 900px) { .pln-columns { grid-template-columns: 1fr 1fr; } }
.pln-columns .panel { margin-bottom: 0; }
.pln-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 .9rem; font-size: 1.05rem; }
.pln-title .kpi-icon { width: 2rem; height: 2rem; border-radius: 9px; }
.pln-usage { display: grid; gap: .5rem; }
.pln-usage-row { display: grid; gap: .2rem; }
.pln-usage-head { display: flex; justify-content: space-between; gap: .75rem; font-size: .9rem; }
.pln-usage-head strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pln-bar { height: .45rem; border-radius: 999px; background: var(--brand-100); overflow: hidden; }
.pln-bar span { display: block; height: 100%; border-radius: inherit; background: var(--brand-600); }
.pln-bar.is-full span { background: var(--warn-500); }
.pln-subtitle { margin: .4rem 0 0; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); }
.pln-extension { border-top: 3px solid var(--violet-500); }
.pln-field-error { display: block; margin-top: .3rem; font-size: .84rem; font-weight: 600; color: var(--danger-700); }
.pln-extension .field [aria-invalid="true"] { border-color: var(--danger-500); background: #fffafa; }
.pln-requests { list-style: none; margin: 0; padding: 0; }
.pln-requests li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .9rem; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--line); border-left: 3px solid var(--warn-500); }
.pln-requests li.is-approved { border-left-color: var(--ok-500); }
.pln-requests li.is-rejected { border-left-color: var(--danger-500); }
.pln-requests li:last-child { border-bottom: 0; }
.pln-requests .note { grid-column: 1 / -1; font-size: .84rem; color: var(--ink-500); }

/* Notifications page (notifications/index only; the shared .notif-* rules stay as they are). */
.ntf-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.ntf-filter { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .88rem; font-weight: 600; color: var(--ink-700); }
.ntf-filter:hover { text-decoration: none; background: var(--brand-50); border-color: var(--brand-100); }
.ntf-filter[aria-current="page"] { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.ntf-filter .count { min-width: 1.4rem; padding: 0 .35rem; border-radius: 999px; background: #eef2f6; color: var(--ink-700); text-align: center; font-size: .76rem; }
.ntf-filter .count.danger { background: var(--danger-100); color: var(--danger-700); }
.ntf-filter[aria-current="page"] .count { background: rgba(255, 255, 255, .25); color: #fff; }
.ntf-sep { width: 1px; align-self: stretch; margin: .2rem .25rem; background: var(--line); }
.ntf-list { list-style: none; margin: 0; padding: 0; }
.ntf-item { display: flex; gap: .85rem; align-items: flex-start; padding: .95rem 1rem; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.ntf-item:last-child { border-bottom: 0; }
.ntf-item.is-unread { background: #f5f9ff; border-left-color: var(--brand-500); }
.ntf-icon { display: grid; place-items: center; flex: none; width: 2.4rem; height: 2.4rem; border-radius: 12px; background: var(--brand-50); color: var(--brand-700); }
.ntf-icon.level-warning { background: var(--warn-100); color: var(--warn-700); }
.ntf-icon.level-danger { background: var(--danger-100); color: var(--danger-700); }
.ntf-body { flex: 1; min-width: 0; }
.ntf-body form { margin: 0; }
.ntf-title { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--ink-900); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.ntf-title:hover { color: var(--brand-700); text-decoration: underline; }
.ntf-text { margin: .2rem 0 0; font-size: .9rem; color: var(--ink-700); overflow-wrap: anywhere; }
.ntf-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; margin-top: .35rem; font-size: .8rem; color: var(--ink-500); }
.ntf-item > form { margin: 0; flex: none; }
.ntf-empty { display: grid; justify-items: center; gap: .5rem; padding: 1.5rem 1rem; text-align: center; color: var(--ink-500); }
.ntf-empty .kpi-icon { width: 3rem; height: 3rem; border-radius: 14px; }
.ntf-empty strong { color: var(--ink-900); }
@media (max-width: 560px) {
    .ntf-item { flex-wrap: wrap; }
    .ntf-item > form { width: 100%; padding-left: 3.25rem; }
}

/* Offline sync anomalies (sync/anomalies only). */
.snc-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.snc-list { display: grid; gap: .9rem; margin-bottom: 1rem; }
.snc-card { display: grid; gap: .75rem; padding: 1rem; border-left: 4px solid var(--danger-500); }
.snc-card.is-applied { border-left-color: var(--ok-500); }
.snc-card.is-regularized { border-left-color: var(--ink-300); }
.snc-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.snc-card-head h2 { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: 1rem; }
.snc-meta { display: grid; gap: .2rem; font-size: .84rem; color: var(--ink-500); }
.snc-reason { padding: .6rem .8rem; border-radius: 10px; background: var(--danger-100); color: var(--danger-700); font-size: .9rem; font-weight: 600; overflow-wrap: anywhere; }
.snc-reason small { display: block; margin-top: .15rem; font-weight: 500; opacity: .85; }
.snc-actions { display: grid; gap: .6rem; padding-top: .75rem; border-top: 1px solid var(--line); }
@media (min-width: 760px) { .snc-actions { grid-template-columns: auto minmax(0, 1fr); align-items: end; } }
.snc-actions form { margin: 0; }
.snc-regularize { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.snc-regularize .field { flex: 1 1 14rem; margin: 0; }
.snc-outcome { font-size: .9rem; color: var(--ink-700); }
.snc-empty { display: grid; justify-items: center; gap: .5rem; padding: 1.5rem 1rem; text-align: center; color: var(--ink-500); }
.snc-empty .kpi-icon { width: 3rem; height: 3rem; border-radius: 14px; }
.snc-empty strong { color: var(--ink-900); }

/* Customer display (sales/display, standalone page). hidden must win over the display rules below. */
body.cdsp-body { min-height: 100vh; margin: 0; display: flex; flex-direction: column; color: #fff; background: radial-gradient(900px 400px at 100% 0%, rgba(var(--brand-accent-rgb), .35), transparent 60%), linear-gradient(160deg, var(--brand-950), var(--brand-900)); }
.cdsp-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 2rem; font-size: 1.35rem; font-weight: 700; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.cdsp-brand { display: inline-flex; align-items: center; gap: .55rem; font-size: 1rem; letter-spacing: .04em; opacity: .9; }
.cdsp-brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 9px; background: var(--brand-500); color: #fff; font-weight: 800; }
.cdsp-welcome { flex: 1; display: grid; place-items: center; padding: 2rem; font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 700; text-align: center; opacity: .9; }
.cdsp-lines { flex: 1; margin: 0; padding: 1rem 2rem; list-style: none; overflow-y: auto; font-size: clamp(1.1rem, 2.5vw, 1.45rem); }
.cdsp-lines li { display: flex; justify-content: space-between; gap: 1.5rem; padding: .75rem 1rem; margin-bottom: .5rem; border-radius: 12px; background: rgba(255, 255, 255, .07); }
.cdsp-lines li span:last-child { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cdsp-total { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1.5rem 2rem; background: rgba(0, 0, 0, .25); font-size: 1.3rem; }
.cdsp-total strong { font-size: clamp(2.5rem, 8vw, 5rem); font-variant-numeric: tabular-nums; }
.cdsp-change { padding: 1rem 2rem 1.5rem; background: var(--ok-700); text-align: right; font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 800; }
.cdsp-welcome[hidden], .cdsp-lines[hidden], .cdsp-change[hidden] { display: none; }

/* Public home (home, standalone page). */
.home-shell { min-height: 100vh; background: radial-gradient(900px 420px at 100% -10%, rgba(139, 92, 246, .18), transparent 60%), radial-gradient(700px 360px at -10% 10%, rgba(59, 130, 246, .16), transparent 60%), var(--canvas); }
.home-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; max-width: 62rem; margin: 0 auto; padding: 1rem; }
.home-bar nav { display: flex; flex-wrap: wrap; gap: .5rem; }
.home-hero { max-width: 62rem; margin: 0 auto; padding: 3rem 1rem 2rem; text-align: center; }
.home-hero h1 { margin: 1rem auto 0; max-width: 46rem; font-size: clamp(2rem, 5vw, 3.1rem); color: var(--brand-900); }
.home-hero .lead { max-width: 40rem; margin: .75rem auto 1.75rem; font-size: 1.1rem; color: var(--ink-700); }
.home-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.home-features { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); max-width: 62rem; margin: 1rem auto 0; padding: 0 1rem 3rem; }
.home-feature { display: grid; gap: .5rem; padding: 1.25rem; transition: transform .15s, box-shadow .15s; }
.home-feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.home-feature h3 { margin: 0; font-size: 1.02rem; }
.home-feature p { margin: 0; color: var(--ink-500); font-size: .93rem; }
.home-footer { padding: 0 1rem 2rem; text-align: center; font-size: .85rem; color: var(--ink-500); }

@media (max-width: 720px) {
    .acct-table thead { display: none; }
    .acct-table, .acct-table tbody { display: block; }
    .acct-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem .75rem; align-items: center; padding: .85rem .9rem; border-bottom: 1px solid var(--line); border-left: 3px solid var(--ok-500); }
    .acct-table tr.is-pending { border-left-color: var(--warn-500); }
    .acct-table tr.is-suspended { border-left-color: var(--danger-500); }
    .acct-table tr.is-admin { border-left-color: var(--brand-900); }
    .acct-table tr:last-child { border-bottom: 0; }
    .acct-table td { display: block; padding: 0; border: 0; }
    .acct-table td:first-child { grid-column: 1 / -1; border-left: 0; }
    .acct-table td.acct-col-status { justify-self: end; }
    .acct-table td.acct-col-date { grid-column: 1 / -1; font-size: .85rem; }
    .acct-table td.actions { grid-column: 1 / -1; justify-content: flex-start; }
    .acct-table td.actions form, .acct-table td.actions .btn { width: 100%; }
    .acct-label { display: inline; margin-right: .35rem; font-size: .78rem; font-weight: 600; color: var(--ink-500); }
}
.big-number { font-size: 2.4rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.sticky-actions { position: sticky; bottom: env(safe-area-inset-bottom, 0px); background: var(--canvas); padding: .75rem 0; display: flex; flex-wrap: wrap; gap: .5rem; }

/* POS: visual till. Catalogue of product cards + sticky cart; checkout bar on small screens. */
.pos-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.pos-head h1 { margin: 0; }
.pos-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }
.pos-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #eef2f6; color: var(--ink-700); }
.pos-chip .dot { width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.pos-chip.is-open { background: var(--ok-100); color: var(--ok-700); }
.pos-chip.is-closed { background: var(--danger-100); color: var(--danger-700); }
.pos-chip.is-limit { background: var(--violet-100); color: var(--violet-700); }
.pos-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: .75rem; }

.pos { display: grid; gap: 1.25rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1100px) { .pos { grid-template-columns: minmax(0, 1fr) 23rem; } }
@media (min-width: 1400px) { .pos { grid-template-columns: minmax(0, 1fr) 26rem; } }

.pos-search { position: relative; display: flex; gap: .5rem; padding: .6rem; margin-bottom: .5rem; }
.pos-search .search-icon { position: absolute; left: 1.45rem; top: 50%; transform: translateY(-50%); color: var(--ink-500); pointer-events: none; }
.pos-search input { flex: 1; min-width: 0; min-height: 3.1rem; font: inherit; font-size: 1.05rem; border: 1px solid var(--ink-300); border-radius: 10px; padding: 0 .9rem 0 2.6rem; background: #fff; }
.pos-search input:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--focus); }
.pos-status { min-height: 1.4rem; margin: 0 0 .6rem; font-size: .88rem; color: var(--ink-500); }
.pos-status.is-error { color: var(--danger-700); font-weight: 600; }
.pos-status.is-ok { color: var(--ok-700); font-weight: 600; }

.pos-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); transition: opacity .15s; }
@media (max-width: 480px) { .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; } }
.pos-grid.is-loading { opacity: .5; pointer-events: none; }
.pos-empty { grid-column: 1 / -1; padding: 1.5rem 1rem; text-align: center; color: var(--ink-500); background: var(--surface); border: 1px dashed var(--ink-300); border-radius: var(--radius); }

.pos-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: 0 0 .75rem;
    overflow: hidden;
    text-align: left;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    font: inherit;
    color: inherit;
    transition: border-color .15s, box-shadow .15s, transform .1s;
}
.pos-item:hover:not(:disabled) { border-color: var(--brand-500); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.pos-item:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--brand-500); }
.pos-item:active:not(:disabled) { transform: scale(.98); }
.pos-item:disabled { cursor: not-allowed; }
.pos-item:disabled .pos-photo { filter: grayscale(1); opacity: .55; }
.pos-item.is-added { animation: pos-added .35s ease; }
@keyframes pos-added { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); } 100% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } }
.pos-photo { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; background: var(--brand-50); overflow: hidden; }
.pos-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pos-ph { display: grid; place-items: center; width: 100%; height: 100%; color: #fff; font-size: 2rem; font-weight: 800; letter-spacing: .02em; text-shadow: 0 1px 2px rgba(15, 23, 42, .25); }
.stock-badge { position: absolute; left: .5rem; top: .5rem; padding: .15rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 700; background: rgba(255, 255, 255, .95); color: var(--ok-700); box-shadow: 0 1px 3px rgba(15, 23, 42, .15); }
.stock-badge.is-out { color: #fff; background: var(--danger-500); }
.pos-add { position: absolute; right: .5rem; bottom: .5rem; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--brand-600); color: #fff; font-size: 1.35rem; font-weight: 700; line-height: 1; box-shadow: 0 4px 10px rgba(var(--brand-rgb), .4); }
.pos-item:disabled .pos-add { display: none; }
.pos-item .name { padding: 0 .75rem; font-weight: 600; font-size: .93rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.3rem; }
.pos-item .price { padding: 0 .75rem; font-weight: 800; font-size: 1.05rem; color: var(--brand-700); font-variant-numeric: tabular-nums; }
.pos-item .avail { padding: 0 .75rem; font-size: .78rem; color: var(--ink-500); }
.pos-item .avail.out { color: var(--danger-700); font-weight: 700; }
.pos-item .thumb { width: 100%; height: 4.5rem; }

.pos-cart { position: sticky; top: calc(var(--topbar-height) + .75rem); padding: 1rem; display: flex; flex-direction: column; gap: .8rem; border-top: 4px solid var(--brand-600); }
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.cart-head h2 { display: flex; align-items: center; gap: .5rem; margin: 0; }
.cart-count { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding: 0 .4rem; border-radius: 999px; background: var(--brand-600); color: #fff; font-size: .8rem; font-weight: 800; }
.cart-empty { margin: 0; padding: 1.25rem .5rem; text-align: center; color: var(--ink-500); border: 1px dashed var(--ink-300); border-radius: 10px; font-size: .9rem; }
.cart-lines { list-style: none; margin: 0; padding: 0; max-height: 38vh; overflow-y: auto; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem .6rem; align-items: center; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line .line-name { font-weight: 700; font-size: .93rem; line-height: 1.25; overflow-wrap: anywhere; }
.cart-line .line-meta { font-size: .8rem; color: var(--ink-500); }
.cart-line .line-total { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.cart-line .qty-controls { display: flex; align-items: center; gap: .3rem; }
.cart-line .qty-controls button { width: 2.5rem; height: 2.5rem; border-radius: 10px; border: 1px solid var(--ink-300); background: var(--surface); font-size: 1.15rem; font-weight: 700; color: var(--ink-700); cursor: pointer; }
.cart-line .qty-controls button:hover { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-900); }
.cart-line .qty-controls input { width: 3.5rem; height: 2.5rem; text-align: center; font: inherit; font-weight: 700; border: 1px solid var(--ink-300); border-radius: 10px; }
.cart-line .line-remove { justify-self: end; display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--danger-700); cursor: pointer; }
.cart-line .line-remove:hover { background: var(--danger-100); border-color: #fecaca; }
.cart-summary { padding: .85rem 1rem; border-radius: 12px; background: var(--brand-50); }
.cart-summary .row { display: flex; justify-content: space-between; font-size: .88rem; color: var(--ink-700); }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-top: .25rem; font-size: 1rem; font-weight: 700; color: var(--brand-900); }
.cart-total strong { font-size: 2rem; font-weight: 800; color: var(--brand-900); font-variant-numeric: tabular-nums; }
.pos-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.pos-section-label { margin: 0 0 .35rem; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .4rem; }
.pay-method { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 2.9rem; padding: .45rem .7rem; border: 1px solid var(--ink-300); border-radius: 10px; cursor: pointer; font-weight: 700; font-size: .9rem; background: var(--surface); }
.pay-method small { font-weight: 500; color: var(--ink-500); font-size: .74rem; }
/* Mixed payment (step 9, lot 2): one line per method; stacks on phones. */
.pos-mixed { display: grid; gap: .5rem; }
.pos-mixed-rows { display: grid; gap: .45rem; }
.pos-mixed-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: .4rem; align-items: center; padding: .5rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pos-mixed-row .mixed-reference { grid-column: 1 / 2; }
.pos-mixed-row .mixed-reference[hidden] + .btn { grid-column: 1 / -1; justify-self: end; }
.pos-mixed-row .btn { justify-self: end; }
.pos-mixed-status { margin: 0; font-weight: 600; font-size: .9rem; color: var(--ok-700); }
.pos-mixed-status.is-error { color: var(--danger-600, #b91c1c); }
@media (max-width: 420px) { .pos-mixed-row { grid-template-columns: 1fr; } .pos-mixed-row .mixed-reference { grid-column: auto; } }
.pay-method:has(input:checked) { border-color: var(--brand-600); background: var(--brand-50); color: var(--brand-900); box-shadow: inset 0 0 0 1px var(--brand-600); }
.pay-method:has(input:focus-visible) { box-shadow: var(--focus); }
.pay-method:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.pay-method input { position: absolute; opacity: 0; pointer-events: none; }
.received-input { width: 100%; min-height: 3rem; padding: 0 .9rem; font: inherit; font-size: 1.2rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; border: 1px solid var(--ink-300); border-radius: 10px; }
.received-input:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--focus); }
.quick-amounts { display: flex; flex-wrap: wrap; gap: .35rem; }
.quick-amounts .btn { min-height: 2.4rem; }
.change-box { padding: .75rem .9rem; border-radius: 10px; background: var(--ok-100); color: var(--ok-700); display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-weight: 700; }
.change-box strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.change-box.short { background: var(--danger-100); color: var(--danger-700); }
.btn-xl { min-height: 3.5rem; font-size: 1.15rem; width: 100%; }
.btn-checkout { color: #fff; background: var(--ok-700); box-shadow: 0 6px 16px rgba(21, 128, 61, .3); justify-content: space-between; padding: .6rem 1.25rem; }
.btn-checkout:hover { background: #166534; }
.btn-checkout:disabled { background: #94a3b8; box-shadow: none; opacity: 1; }
.btn-checkout .amount { font-variant-numeric: tabular-nums; }
.pos-note { margin: 0; font-size: .8rem; color: var(--ink-500); text-align: center; }
.pos-cart .btn-clear { color: var(--danger-700); }

/* POS customer */
.customer-box { padding: .75rem; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.customer-box .customer-input { width: 100%; min-height: 2.6rem; padding: 0 .8rem; font: inherit; border: 1px solid var(--ink-300); border-radius: 10px; background: #fff; }
.customer-box .customer-input:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--focus); }
.customer-selected { display: flex; justify-content: space-between; gap: .5rem; align-items: start; }
.customer-results { list-style: none; margin: .35rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; max-height: 12rem; overflow-y: auto; }
.customer-results .btn { width: 100%; justify-content: flex-start; }
.customer-create summary { margin-top: .5rem; cursor: pointer; font-weight: 600; color: var(--brand-700); }
.customer-create .form-grid { margin-top: .5rem; }
.customer-create .field { margin: 0; }
.customer-save { margin-top: .5rem; }
.customer-error { margin: .35rem 0 0; color: var(--danger-700); }
.credit-option { margin-top: .6rem; }

/* POS checkout bar (phones and tablets: the cart sits below the catalogue) */
.pos-checkout-bar { position: sticky; bottom: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 1rem -1rem -3rem; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom, 0px)); background: var(--brand-950); color: #fff; box-shadow: 0 -6px 20px rgba(15, 23, 42, .2); }
.pos-checkout-bar strong { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.pos-checkout-bar small { color: var(--nav-ink); }
.pos-checkout-bar .btn { background: var(--ok-700); color: #fff; }
@media (min-width: 1100px) { .pos-checkout-bar { display: none; } }
@media (min-width: 1024px) and (max-width: 1099px) { .pos-checkout-bar { margin: 1rem -1.75rem -3rem; } }

/* Reports */
.chart-wrap { padding: 1rem; }
.chart { width: 100%; height: 12rem; display: block; }
.chart-axis { stroke: var(--line); stroke-width: 1; }
.chart-bar { fill: var(--brand-500); }
.chart-bar-neg { fill: var(--danger-700); opacity: .7; }
.chart-labels { display: flex; justify-content: space-between; font-size: .78rem; color: var(--ink-500); margin-top: .25rem; }
.hbar { height: .6rem; border-radius: 999px; background: var(--brand-500); min-width: 2px; }
.report-note { font-size: .85rem; color: var(--ink-500); margin: .5rem 0 1rem; }

/* Notifications */
.notif-link { position: relative; display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 10px; color: var(--ink-700); border: 1px solid var(--line); background: var(--surface); }
.notif-link:hover, .notif-link[aria-current="page"] { background: var(--brand-50); color: var(--brand-900); text-decoration: none; }
.notif-count { position: absolute; top: -.35rem; right: -.35rem; min-width: 1.2rem; height: 1.2rem; padding: 0 .3rem; border-radius: 999px; background: var(--danger-500); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.notif-count[hidden] { display: none; }
/* Notifications panel under the bell (public/js/jumulo-notifications.js); a sheet the width of the screen on phones. */
.notif-wrap { position: relative; }
.notif-panel { position: absolute; top: calc(100% + .5rem); right: 0; z-index: 60; width: 24rem; max-width: calc(100vw - 2rem); display: flex; flex-direction: column; max-height: min(32rem, calc(100vh - 6rem)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px rgba(15, 23, 42, .18); overflow: hidden; }
.notif-panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; padding: .7rem .85rem; border-bottom: 1px solid var(--line); }
.notif-panel-head strong { font-size: .95rem; outline: none; }
.notif-panel-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem; }
.notif-tool { border: 0; background: none; padding: .25rem .45rem; border-radius: 6px; font: inherit; font-size: .75rem; font-weight: 600; color: var(--brand-700); cursor: pointer; }
.notif-tool:hover:not(:disabled) { background: var(--brand-50); }
.notif-tool:disabled { color: var(--ink-500); opacity: .55; cursor: default; }
.notif-tool.is-danger { color: var(--danger-700); }
.notif-tool.is-danger:hover:not(:disabled) { background: var(--danger-100); }
.notif-close { font-size: 1.1rem; line-height: 1; color: var(--ink-700); }
.notif-panel-state { margin: 0; padding: 1.4rem 1rem; text-align: center; font-size: .82rem; color: var(--ink-500); }
.notif-panel-state[hidden] { display: none; }
.notif-panel-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 1 auto; }
.notif-item { display: flex; gap: .55rem; padding: .7rem .85rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.notif-item.is-unread { background: var(--brand-50); }
.notif-dot { flex: 0 0 .5rem; height: .5rem; margin-top: .35rem; border-radius: 999px; background: transparent; }
.notif-item.is-unread .notif-dot { background: var(--brand-500); }
.notif-item.is-unread.is-warning .notif-dot { background: #f59e0b; }
.notif-item.is-unread.is-danger .notif-dot { background: var(--danger-500); }
.notif-text { min-width: 0; flex: 1 1 auto; }
.notif-text strong { display: block; font-size: .84rem; font-weight: 600; color: var(--ink-900, #0f172a); overflow-wrap: anywhere; }
.notif-item:not(.is-unread) .notif-text strong { font-weight: 500; color: var(--ink-700); }
.notif-text p { margin: .15rem 0 0; font-size: .78rem; color: var(--ink-700); overflow-wrap: anywhere; }
.notif-meta { display: block; margin-top: .2rem; font-size: .7rem; color: var(--ink-500); }
.notif-actions { display: flex; flex-wrap: wrap; gap: .1rem; margin: .25rem 0 0 -.45rem; }
.notif-panel-all { display: block; padding: .6rem .85rem; text-align: center; font-size: .8rem; font-weight: 600; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
    .notif-panel { position: fixed; top: 4rem; left: .5rem; right: .5rem; width: auto; max-width: none; max-height: calc(100vh - 5rem); }
}
/* Pending requests of the Super Admin, per platform menu (AdminRequestCounts): hidden at zero, like the bell. */
.side-count { margin-left: auto; min-width: 1.3rem; height: 1.3rem; padding: 0 .35rem; border-radius: 999px; background: var(--danger-500); color: #fff; font-size: .7rem; font-weight: 700; display: inline-grid; place-items: center; }
.side-count[hidden] { display: none; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: 0; }
.notif-item.is-unread { background: var(--brand-50); }
.notif-dot { width: .6rem; height: .6rem; border-radius: 50%; margin-top: .45rem; flex: none; background: var(--ink-300); }
.notif-dot.level-warning { background: var(--warn-500); }
.notif-dot.level-danger { background: var(--danger-500); }
.notif-dot.level-info { background: var(--info-500); }
.notif-body { flex: 1; min-width: 0; }
.notif-body form { margin: 0; display: inline; }
.notif-title { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--ink-900, inherit); text-align: left; cursor: pointer; }
.notif-title:hover { text-decoration: underline; }

/* Print: the navigation never prints. */
@media print {
    .sidebar, .sidebar-backdrop, .topbar, .skip-link { display: none !important; }
    .app-shell { display: block; }
    body { background: #fff; }
}

/* Confirmation modal (replaces the browser's native confirm()) */
.btn-danger-solid { color: #fff; background: var(--danger-700); box-shadow: 0 1px 2px rgba(185, 28, 28, .3); }
.btn-danger-solid:hover { background: #991b1b; }
.confirm-dialog { width: min(28rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink-900); box-shadow: var(--shadow-lg); }
.confirm-dialog::backdrop { background: rgba(15, 23, 42, .55); }
.confirm-dialog-box { display: grid; gap: .75rem; margin: 0; padding: 1.5rem; }
.confirm-dialog-title { margin: 0; font-size: 1.125rem; }
.confirm-dialog-message { margin: 0; color: var(--ink-700); line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.confirm-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }
@media (max-width: 30rem) {
    .confirm-dialog-actions { flex-direction: column-reverse; }
    .confirm-dialog-actions .btn { width: 100%; }
}

/* Form modal (public/js/jumulo-modal.js): create and edit pages shown over the current page */
.page-modal { width: min(60rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--canvas); color: var(--ink-900); box-shadow: var(--shadow-lg); overflow: hidden; }
.page-modal[open] { display: flex; flex-direction: column; }
.page-modal::backdrop { background: rgba(15, 23, 42, .55); }
.page-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.page-modal-title { margin: 0; font-size: 1.125rem; overflow-wrap: anywhere; }
.page-modal-close { flex: none; width: 2.5rem; height: 2.5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-700); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.page-modal-close:hover { background: var(--canvas); }
.page-modal-close:focus-visible { outline: none; box-shadow: var(--focus); }
.page-modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 1.25rem; outline: none; }
.page-modal-body > :first-child { margin-top: 0; }
/* Loading (a page or a form on its way) and the list refreshed under the modal. */
.page-modal-body.is-loading { opacity: .55; pointer-events: none; transition: opacity .15s; }
.btn.is-loading, a.is-loading { cursor: progress; opacity: .7; }
#main[aria-busy="true"] { opacity: .7; transition: opacity .15s; }
@media (max-width: 40rem) {
    .page-modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
    .page-modal-body { padding: 1rem; }
}
.page-modal-body [data-modal-source][data-modal-title] > h2:first-child { display: none; }
.page-modal-body [data-modal-source].card { margin: 0; }
.page-head-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Compact forms inside the form modal only (full pages keep their own spacing). */
.page-modal { width: min(52rem, calc(100vw - 2rem)); } /* medium by default: forms and details */
.page-modal.is-wide { width: min(64rem, calc(100vw - 2rem)); } /* product form, purchase order, customer and sale details */
@media (max-width: 40rem) { .page-modal.is-wide { width: 100vw; max-width: 100vw; } } /* full screen on a phone, like every page modal */
.page-modal-head { padding: .7rem 1rem; }
.page-modal-close { width: 2.25rem; height: 2.25rem; }
.page-modal-body { padding: .85rem 1rem 0; }
.page-modal-body .alert { margin-bottom: .6rem; padding: .55rem .8rem; font-size: .88rem; }
.page-modal-body .card { box-shadow: none; }
.page-modal-body .panel { padding: .75rem .9rem; margin-bottom: .6rem; }
.page-modal-body .panel h2,
.page-modal-body [class$="-section-title"] { margin: 0 0 .5rem; font-size: .95rem; gap: .45rem; }
.page-modal-body .panel h2 .kpi-icon,
.page-modal-body [class$="-section-title"] .kpi-icon { width: 1.6rem; height: 1.6rem; border-radius: 7px; }
.page-modal-body .panel h2 .kpi-icon .icon,
.page-modal-body [class$="-section-title"] .kpi-icon .icon { width: .95rem; height: .95rem; }
.page-modal-body [class$="-section-intro"], .page-modal-body .panel > p.muted { margin: 0 0 .5rem; font-size: .82rem; }
.page-modal-body .form-grid { gap: 0 .75rem; }
.page-modal-body .field { margin-bottom: .55rem; }
.page-modal-body .field label { margin-bottom: .15rem; font-size: .84rem; }
.page-modal-body .field .hint { margin-top: .1rem; font-size: .76rem; line-height: 1.3; }
.page-modal-body .field input,
.page-modal-body .field select,
.page-modal-body .field textarea { min-height: 2.25rem; padding: .35rem .6rem; font-size: .92rem; border-radius: 8px; }
.page-modal-body .field input[type="checkbox"], .page-modal-body .field input[type="radio"] { min-height: 0; }
.page-modal-body .field textarea { min-height: 3.75rem; }
.page-modal-body .btn { min-height: 2.35rem; padding: .4rem .9rem; }
.page-modal-body .perm-groups { gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.page-modal-body .perm-group { padding: .55rem .7rem; }
.page-modal-body .perm-group h3 { margin-bottom: .35rem; }
.page-modal-body .perm-list { gap: .2rem; }
.page-modal-body .check { font-size: .86rem; }
/* The actions bar ("Annuler" / "Enregistrer") stays visible at the bottom of the modal while the form scrolls. */
.page-modal-body form > [class*="actions"] { position: sticky !important; bottom: 0; z-index: 2; margin: .25rem -1rem 0; padding: .6rem 1rem; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: var(--surface); box-shadow: 0 -4px 12px rgba(15, 23, 42, .06); }
.page-modal-body > :last-child { margin-bottom: .85rem; }
.page-modal-body form:last-child > [class*="actions"]:last-child { margin-bottom: 0; }
@media (max-width: 40rem) {
    .page-modal-body { padding: .75rem .75rem 0; }
    .page-modal-body form > [class*="actions"] { margin-left: -.75rem; margin-right: -.75rem; padding: .55rem .75rem; }
}
.page-modal-body > form:last-child { margin-bottom: 0; }
.page-modal-body form, .page-modal-body form > *, .page-modal-body [data-modal-source] { max-width: none; }
@media (max-width: 40rem) {
    .page-modal { width: 100vw; max-width: 100vw; }
    .page-modal-body form > [class*="actions"] { display: flex; flex-wrap: nowrap; gap: .5rem; }
    .page-modal-body form > [class*="actions"] .btn { flex: 1 1 0; min-width: 0; }
}
@media (max-width: 40rem) {
    .page-modal-body form > [class*="actions"] .btn { white-space: nowrap; }
    .page-modal-body form > [class*="actions"] .btn-ghost { flex: 0 0 auto; }
}

/* Ticket shown as-is in the modal (data-modal-frame): its own layout, its print button prints the ticket only. */
.page-modal.is-frame .page-modal-body { padding: 0; overflow: hidden; display: flex; }
.page-modal-frame { flex: 1 1 auto; width: 100%; height: min(80vh, 52rem); min-height: 22rem; border: 0; background: var(--canvas); }
.page-modal.is-narrow { width: min(30rem, calc(100vw - 2rem)); }
@media (max-width: 40rem) {
    .page-modal.is-narrow { width: 100vw; }
    .page-modal-frame { height: 100%; }
}
/* Compact modal (one setting at a time): its own height, also on a phone, with the buttons always reachable. */
.page-modal.is-medium { width: min(34rem, calc(100vw - 2rem)); }
.page-modal.is-medium .page-modal-body { padding-bottom: 1rem; }
@media (max-width: 40rem) {
    .page-modal.is-medium { width: calc(100vw - 1rem); height: fit-content; max-height: calc(100dvh - 1rem); margin: auto; border: 1px solid var(--line); border-radius: var(--radius); }
}

/* POS: "Encaisser" opens the payment (customer, method, amount, change) in a modal over the cart. */
.pos-pay-dialog { width: min(34rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink-900); box-shadow: var(--shadow-lg); overflow: hidden; }
.pos-pay-dialog[open] { display: flex; flex-direction: column; }
.pos-pay-dialog::backdrop { background: rgba(15, 23, 42, .55); }
.pos-pay-head { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.pos-pay-head h2 { margin: 0; font-size: 1.05rem; }
.pos-pay-total { margin-left: auto; font-size: 1.25rem; font-variant-numeric: tabular-nums; color: var(--ok-700); }
.pos-pay-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; gap: .75rem; padding: .85rem 1rem; }
.pos-pay-body .alert { margin: 0; }
.pos-pay-foot { padding: .7rem 1rem; border-top: 1px solid var(--line); background: var(--surface); }
.pos-pay-foot .btn-checkout { width: 100%; }
@media (max-width: 40rem) {
    .pos-pay-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
    .pos-pay-foot { padding-bottom: calc(.7rem + env(safe-area-inset-bottom, 0px)); }
}
.pos-checkout-bar .btn:disabled { background: #475569; opacity: 1; }

/* Notification shown in the modal (notifications page). */
.ntf-detail { display: grid; gap: .75rem; }
.ntf-detail-level { display: inline-flex; align-items: center; gap: .4rem; justify-self: start; margin: 0; padding: .25rem .6rem; border-radius: 999px; font-size: .82rem; font-weight: 700; background: var(--brand-50); color: var(--brand-700); }
.ntf-detail-level .icon { width: 1rem; height: 1rem; }
.ntf-detail-level.level-danger { background: var(--danger-100); color: var(--danger-700); }
.ntf-detail-level.level-warning { background: var(--warn-100); color: var(--warn-700); }
.ntf-detail-text { margin: 0; font-size: 1rem; line-height: 1.55; color: var(--ink-900); white-space: pre-line; overflow-wrap: anywhere; }
.ntf-detail-meta { display: grid; gap: .35rem; margin: 0; padding: .65rem .8rem; border-radius: var(--radius-sm); background: var(--canvas); font-size: .88rem; }
.ntf-detail-meta div { display: flex; gap: .5rem; }
.ntf-detail-meta dt { min-width: 6rem; color: var(--ink-500); }
.ntf-detail-meta dd { margin: 0; font-weight: 600; }
.ntf-detail-actions { margin: 0; display: flex; justify-content: flex-end; }
.page-modal:has(.ntf-detail) { width: min(34rem, calc(100vw - 2rem)); }
@media (max-width: 40rem) { .page-modal:has(.ntf-detail) { width: 100vw; } .ntf-detail-actions .btn { width: 100%; } }

/* Team member history (team/history, opened in the modal from « Gérer »). */
.team-history-link { margin: .5rem 0 0; }
.team-history-intro { margin: 0 0 .75rem; }
.team-history-back { margin: 0 0 .5rem; font-size: .9rem; }
.team-history-empty { padding: 1.25rem; text-align: center; }
.team-history-empty p { margin: .35rem 0 0; }
.team-history { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.team-history-item { display: flex; gap: .75rem; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.team-history-dot { flex: none; width: .7rem; height: .7rem; margin-top: .35rem; border-radius: 50%; background: var(--kpi-color, var(--brand-600)); }
.team-history-body { min-width: 0; flex: 1; }
.team-history-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .75rem; }
.team-history-head time { color: var(--ink-500); font-size: .85rem; font-variant-numeric: tabular-nums; }
.team-history-body p { margin: .2rem 0 0; font-size: .9rem; overflow-wrap: anywhere; }

/* Read-only value shown in a form (currency determined by the country at registration and business creation). */
.field input.is-readonly:disabled { background: var(--canvas); color: var(--ink-500); border-color: var(--line); cursor: not-allowed; opacity: 1; -webkit-text-fill-color: var(--ink-500); }
.field .hint.is-error { color: var(--danger-700); font-weight: 600; }

/* Paramètres: four frames in a grid (2 columns on a computer, 1 on a phone); each change opens its own compact modal. */
.set-grid { display: grid; gap: .9rem; grid-template-columns: 1fr; align-items: stretch; }
@media (min-width: 56rem) { .set-grid { grid-template-columns: 1fr 1fr; } }
.set-section { margin: 0; padding: .85rem 1rem; container-type: inline-size; min-width: 0; }
.set-title { display: flex; align-items: center; gap: .5rem; margin: 0 0 .35rem; font-size: 1rem; }
.set-title .kpi-icon { width: 1.75rem; height: 1.75rem; border-radius: 8px; }
.set-title .kpi-icon .icon { width: 1rem; height: 1rem; }
.set-list { margin: 0; }
/* Narrow frame: label above the value; wide frame: label, value and action on one line. */
.set-row { display: grid; grid-template-columns: 1fr auto; gap: .1rem .75rem; align-items: center; padding: .45rem 0; border-top: 1px solid var(--line); }
.set-row:first-child { border-top: 0; }
.set-row dt { grid-column: 1 / -1; color: var(--ink-500); font-size: .78rem; }
.set-row dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: .92rem; }
@container (min-width: 30rem) {
    .set-row { grid-template-columns: 8.5rem 1fr auto; }
    .set-row dt { grid-column: auto; font-size: .86rem; }
}
.set-row .badge { margin-left: .3rem; vertical-align: middle; }
.set-meta { display: block; margin-top: .1rem; font-size: .78rem; line-height: 1.3; color: var(--ink-500); }
.set-action { justify-self: end; }
.set-action .btn[disabled], .set-store .btn[disabled] { opacity: .55; cursor: not-allowed; }
.set-note { margin: .4rem 0 0; font-size: .78rem; line-height: 1.35; color: var(--ink-500); }
.set-stores { margin: 0; padding: 0; list-style: none; max-height: 19rem; overflow-y: auto; }
.set-store { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.set-store:first-child { border-top: 0; }
.set-store-id { min-width: 0; overflow-wrap: anywhere; font-size: .92rem; }
.set-store-id .badge { margin-left: .25rem; vertical-align: middle; }
.set-store .btn { flex: none; }
.set-form .field { margin-bottom: .75rem; }
.set-warning { margin: 0 0 .9rem; font-size: .86rem; }
.set-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.set-choices { margin: 0 0 .75rem; padding: 0; border: 0; }
.set-choices legend { margin-bottom: .5rem; font-size: .9rem; color: var(--ink-700); }
.set-choice { display: flex; align-items: flex-start; gap: .6rem; padding: .6rem .75rem; margin-bottom: .45rem; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.set-choice input { margin-top: .2rem; }
.set-choice .hint { display: block; font-size: .82rem; color: var(--ink-500); }
.set-choice.is-disabled { cursor: not-allowed; opacity: .6; }
@media (max-width: 40rem) {
    .set-section { padding: .75rem .8rem; }
    .set-form-actions .btn { flex: 1 1 auto; }
    .set-stores { max-height: none; overflow: visible; } /* no scroll inside a scrolling page on a phone */
}

/* Element beyond the current plan (kept, readable, blocked): greyed card, text still readable, red badge kept. */
.is-plan-blocked { background: var(--canvas); border-color: var(--line); box-shadow: none; }
.is-plan-blocked :is(h2, strong, dd, .team-email, .cat-meta, .cat-price) { color: var(--ink-500); }
.is-plan-blocked :is(.kpi-icon, .team-avatar, .cat-ph, img) { filter: grayscale(1); opacity: .55; }
.is-plan-blocked .badge:not(.badge-danger) { filter: grayscale(1); opacity: .75; }
/* A fieldset used only to disable a whole form at once (element beyond the plan). */
.plain-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }

/* Density (2026-10-17): tighter spacing on a computer; on a phone, buttons and fields stay easy to touch. */
@media (max-width: 640px) {
    .btn { min-height: 2.75rem; }
    .btn-sm { min-height: 2.4rem; }
    .field input, .field select { min-height: 2.75rem; }
}
/* Few dashboard cards (Super Admin overview): keep their width instead of stretching across the page. */
.adm-kpis.kpi-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 14.5rem), 1fr)); }
/* Paramètres: a hint that belongs to the whole form (not to one field). */
.set-form-hint { margin: -.25rem 0 .8rem; }
/* Créances et échéances: a customer beyond the plan keeps its row (debt still collectable), marked and greyed. */
.crd-plan-badge { margin-left: .35rem; white-space: normal; vertical-align: middle; }
/* Two wide tables (Marge et bénéfice: by store, by seller): one after the other at full width, on every screen. With the
   page capped at 78rem, half a page is too narrow for six amount columns each. */
.rpt-columns.rpt-columns-wide { grid-template-columns: 1fr; }

/* Business colour (Paramètres → Couleur): choices and a preview drawn with the same variables as the interface. */
.theme-dot { display: inline-block; width: .8rem; height: .8rem; margin-right: .25rem; border-radius: 999px; vertical-align: -.05rem; box-shadow: 0 0 0 1px rgba(15, 23, 42, .15); }
.theme-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .5rem; margin: 0 0 .9rem; padding: 0; border: 0; }
.theme-choice { display: flex; align-items: center; gap: .5rem; min-width: 0; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; font-size: .88rem; }
.theme-choice:has(input:checked) { border-color: var(--ink-700); box-shadow: 0 0 0 2px var(--ink-300); }
.theme-swatch { width: 1.4rem; height: 1.4rem; border-radius: 6px; flex: 0 0 auto; }
.theme-swatch.is-custom { background: conic-gradient(#ef4444, #f97316, #eab308, #22c55e, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #ef4444); }
.theme-custom { margin: -.3rem 0 .9rem; }
.theme-custom label { display: block; margin-bottom: .3rem; font-weight: 600; font-size: .88rem; }
.theme-custom-row { display: flex; align-items: center; gap: .6rem; }
.theme-custom-row input[type="color"] { width: 3rem; height: 3rem; padding: .15rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.theme-custom-row input[type="text"] { width: 8rem; font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; }
.theme-preview-title { margin: 0 0 .35rem; font-size: .82rem; font-weight: 600; color: var(--ink-700); }
.theme-preview, .theme-preview * { pointer-events: none; cursor: default; user-select: none; }
.theme-preview-link-text { color: var(--brand-700); text-decoration: underline; }
.theme-preview { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.theme-preview-nav { display: flex; flex-direction: column; gap: .3rem; width: 7rem; padding: .6rem; background: linear-gradient(180deg, var(--nav-bg), var(--nav-bg-2)); }
.theme-preview-brand { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; margin-bottom: .2rem; border-radius: 7px; background: var(--brand-600); color: #fff; font-weight: 800; font-size: .8rem; }
.theme-preview-link { padding: .3rem .45rem; border-radius: 7px; color: var(--nav-ink); font-size: .78rem; font-weight: 600; }
.theme-preview-link.is-active { background: var(--nav-active); color: #fff; }
.theme-preview-main { flex: 1 1 auto; min-width: 0; padding: .7rem .8rem; }
.theme-preview-main p { margin: .5rem 0; font-size: .82rem; }
.theme-preview-tabs { display: flex; gap: .8rem; border-bottom: 1px solid var(--line); font-size: .8rem; font-weight: 600; color: var(--ink-500); }
.theme-preview-tabs span { padding-bottom: .3rem; }
.theme-preview-tabs .is-active { color: var(--brand-700); box-shadow: inset 0 -2px 0 var(--brand-600); }
.theme-preview-chip { padding: .1rem .45rem; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.theme-preview a { color: var(--brand-700); }

/* Connection banner (public/js/jumulo-connection.js): fixed at the top, above everything but the modals' backdrop. */
.net-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 70; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem 1rem; padding: .55rem 1rem calc(.55rem); padding-top: calc(.55rem + env(safe-area-inset-top, 0px)); color: #fff; font-size: .88rem; font-weight: 600; text-align: center; box-shadow: 0 4px 14px rgba(15, 23, 42, .18); animation: net-in .2s ease-out; }
.net-banner[hidden] { display: none; }
.net-banner.is-down { background: #c2410c; }
.net-banner.is-back { background: #15803d; }
.net-banner-text { display: flex; flex-direction: column; gap: .15rem; max-width: 60rem; }
.net-banner-note { font-weight: 500; font-size: .8rem; opacity: .95; }
.net-banner-retry { border: 1px solid rgba(255, 255, 255, .7); background: transparent; color: #fff; border-radius: 8px; padding: .25rem .7rem; font: inherit; font-size: .8rem; cursor: pointer; }
.net-banner-retry:hover { background: rgba(255, 255, 255, .15); }
.net-banner.is-back .net-banner-retry { display: none; }
@keyframes net-in { from { transform: translateY(-100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .net-banner { animation: none; } }
/* The banner pushes the page down by its height instead of covering the top bar and the menu. */
body { padding-top: var(--net-offset, 0px); }
.topbar { top: var(--net-offset, 0px); }
.sidebar { top: var(--net-offset, 0px); }
@media (min-width: 1024px) { .sidebar { height: calc(100vh - var(--net-offset, 0px)); } }

/* Product without a photo of its own: the logo (App\Support\Catalog\ProductPhoto), whole, on its light ground. */
img.is-fallback { object-fit: contain !important; background: #eef2ff; }
/* Product form: the logo stays under the photo; it shows when there is no photo or when "Supprimer la photo" is ticked. */
.photo-preview > .photo-fallback { opacity: 1; filter: none; }
.photo-preview.is-removed > .photo-fallback { opacity: 1; filter: none; }
.photo-preview.is-removed > #photo-current { opacity: 0; }

/* Business logo (Paramètres): shown whole, never stretched. */
.set-logo { display: inline-grid; place-items: center; width: 3.2rem; height: 3.2rem; margin-right: .6rem; vertical-align: middle; border: 1px solid var(--ink-200); border-radius: 10px; background: #fff; overflow: hidden; }
.set-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.set-logo-preview { position: relative; display: grid; place-items: center; height: 9rem; margin: .5rem 0 1rem; border: 1px dashed var(--ink-300); border-radius: 12px; background: #fff; }
.set-logo-preview img { max-width: 90%; max-height: 7.5rem; object-fit: contain; }
.set-logo-preview .badge { position: absolute; left: .6rem; top: .6rem; }
.set-logo-limit { margin: .25rem 0 .75rem; }

/* POS quick calculator (jumulo-calculator.js): compact, large keys for touch screens. */
.pos-calc-open .icon { width: 1rem; height: 1rem; }
.calc { display: grid; gap: .6rem; }
.calc-screen { display: grid; gap: .15rem; padding: .7rem .85rem; border-radius: 12px; background: var(--ink-900, #0f172a); color: #fff; text-align: right; }
.calc-history { min-height: 1.1rem; font-size: .85rem; color: #94a3b8; overflow-wrap: anywhere; }
.calc-input, .calc-result { width: 100%; border: 0; background: transparent; color: inherit; text-align: right; font-variant-numeric: tabular-nums; outline: none; padding: 0; }
.calc-input { font-size: 1.15rem; color: #cbd5e1; }
.calc-input:focus-visible { box-shadow: 0 1px 0 #60a5fa; }
.calc-result { font-size: 2rem; font-weight: 800; user-select: all; }
.calc-message { min-height: 1.2rem; margin: 0; font-size: .85rem; }
.calc-message.is-error { color: var(--danger-700, #b91c1c); }
.calc-message.is-ok { color: var(--ok-700, #15803d); }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; }
.calc-key { min-height: 3rem; border: 1px solid var(--ink-200, #e2e8f0); border-radius: 12px; background: #fff; color: var(--ink-900, #0f172a); font: inherit; font-size: 1.25rem; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.calc-key:hover { background: var(--brand-50); }
.calc-key:active { transform: translateY(1px); }
.calc-key:disabled { opacity: .5; cursor: default; }
.calc-key.is-op { color: var(--brand-700); background: var(--brand-50); }
.calc-key.is-muted { font-size: 1rem; color: var(--ink-700, #334155); background: var(--ink-50, #f8fafc); }
.calc-key.is-equals { color: #fff; background: var(--brand-600, #2563eb); border-color: var(--brand-600, #2563eb); }
.calc-scan { margin: 0; padding: .45rem .6rem; border-radius: 10px; font-size: .85rem; background: var(--brand-50); color: var(--brand-800, #1e40af); }
.calc-scan.is-error { background: #fef2f2; color: #b91c1c; }
.calc-hint { margin: 0; }

/* Customer display: received amount, change (or what is still to pay) after the total; thanks after a validated sale. */
.cdsp-pay { display: grid; }
.cdsp-pay[hidden], .cdsp-row[hidden], .cdsp-thanks[hidden] { display: none; }
.cdsp-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .8rem 2rem; font-size: 1.2rem; background: rgba(0, 0, 0, .15); }
.cdsp-row strong { font-size: clamp(1.6rem, 5vw, 2.6rem); font-variant-numeric: tabular-nums; }
.cdsp-row.cdsp-change { padding: 1rem 2rem 1.4rem; background: var(--ok-700); text-align: left; font-weight: 800; }
.cdsp-row.cdsp-change strong { font-size: clamp(2.4rem, 8vw, 4.5rem); }
.cdsp-row.cdsp-change.is-short { background: #c2410c; }
.cdsp-thanks { flex: 1; display: grid; place-items: center; padding: 1.5rem; font-size: clamp(1.5rem, 4vw, 2.4rem); font-weight: 700; text-align: center; }

/* Support tickets (support/*, admin/tickets/*). */
.tkt-table tr.is-unread td { background: var(--brand-50); }
.tkt-table tr.is-due-soon td:first-child { box-shadow: inset 3px 0 0 #c2410c; }
.tkt-due { color: #c2410c; font-weight: 600; }
.tkt-detail { display: grid; gap: .9rem; }
.tkt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; }
.tkt-note { margin: 0; padding: .55rem .75rem; border-radius: 10px; background: var(--brand-50); }
.tkt-note.is-due { background: #ffedd5; color: #9a3412; }
.tkt-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.tkt-msg { max-width: 46rem; padding: .65rem .85rem; border-radius: 12px; border: 1px solid var(--ink-200, #e2e8f0); background: #fff; }
.tkt-msg p { margin: .25rem 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.tkt-msg-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; font-size: .88rem; }
.tkt-msg.is-admin { justify-self: end; background: var(--brand-50); border-color: var(--brand-200, #bfdbfe); }
.tkt-msg.is-system { justify-self: center; text-align: center; font-size: .88rem; color: var(--ink-700, #334155); background: var(--ink-50, #f8fafc); }
.tkt-counter { float: right; font-weight: 500; font-size: .82rem; color: var(--ink-500, #64748b); font-variant-numeric: tabular-nums; }
.tkt-counter.is-full { color: #c2410c; }
.tkt-close { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.tkt-filters { flex-wrap: wrap; }
.tkt-close-box { padding: .6rem .75rem; border: 1px solid var(--ink-200, #e2e8f0); border-radius: 12px; background: var(--ink-50, #f8fafc); }
.tkt-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }

/* Notification shown in the panel itself (« Ouvrir »): no other page. */
.notif-detail { display: grid; gap: .45rem; padding: .75rem .9rem 1rem; overflow-y: auto; flex: 1 1 auto; }
.notif-detail[hidden], .notif-panel-list[hidden] { display: none; }
.notif-back { justify-self: start; margin-left: -.45rem; }
.notif-detail-title { margin: 0; font-size: 1rem; line-height: 1.35; outline: none; }
.notif-detail-body { margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.5; }
.notif-detail.is-danger .notif-detail-title { color: var(--danger-700, #b91c1c); }
.notif-detail.is-warning .notif-detail-title { color: #9a3412; }
