/* 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;
    /* The name in the logo's own blue (#2563EB, 2026-10-30), whatever the theme colour of a business. */
    color: #2563eb;
    text-decoration: none;
}
.brand:hover { text-decoration: none; }
/* Jumulo's symbol (2026-10-30): the official image in the brand blue, transparent background: no tile behind it. */
.brand-mark {
    display: block;
    flex: none;
    width: 2.4rem;
    height: 2.4rem;
    object-fit: contain;
}
.brand--logo { display: block; }
.brand-logo { display: block; width: 7rem; height: 7rem; object-fit: contain; }
.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: block; width: 2.2rem; height: 2.2rem; object-fit: contain; }
.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; }
/* Compact (2026-10-30): on a computer the whole home page, the four cards included, fits without scrolling. */
.home-hero { max-width: 62rem; margin: 0 auto; padding: 1.5rem 1rem 1rem; text-align: center; }
.home-hero h1 { margin: .75rem auto 0; max-width: 44rem; font-size: clamp(1.9rem, 4.2vw, 2.6rem); line-height: 1.12; color: var(--brand-900); }
.home-hero .lead { max-width: 40rem; margin: .6rem auto 1.1rem; font-size: 1.02rem; color: var(--ink-700); }
.home-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.home-features { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); max-width: 62rem; margin: .5rem auto 0; padding: 0 1rem 1.5rem; }
.home-feature { display: grid; align-content: start; gap: .4rem; padding: 1rem 1.1rem; 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 1.25rem; 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 { position: relative; padding: 0; overflow: hidden; display: flex; }
/* A page shown in the modal fades in once loaded; meanwhile « Chargement… » on its own colours, never a blank page. */
.page-modal-frame.is-loading { opacity: 0; }
.page-modal-frame { transition: opacity .18s ease; }
.page-modal-frame-loading { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; color: var(--ink-500); font-size: .92rem; background: var(--canvas); }
.page-modal-spinner { width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 3px solid rgba(100, 116, 139, .25); border-top-color: var(--brand-600); animation: page-modal-spin .8s linear infinite; }
@keyframes page-modal-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .page-modal-spinner { animation-duration: 2.4s; } }
.page-modal.is-frame-dark .page-modal-frame, .page-modal.is-frame-dark .page-modal-frame-loading { 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)); }
.page-modal.is-frame-dark .page-modal-frame-loading { color: rgba(255, 255, 255, .8); }
.page-modal.is-frame-dark .page-modal-spinner { border-color: rgba(255, 255, 255, .2); border-top-color: #fff; }
.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)); }
/* Super Admin home (2026-11-22): the counters take the size and layout of the « Gestion de la plateforme » cards —
   same grid, icon on the left, compact text. */
.adm-kpis.kpi-grid { grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); }
.adm-kpi { flex-direction: row; align-items: center; gap: .7rem; padding: .7rem .85rem; }
.adm-kpi .kpi-icon { flex: none; }
.adm-kpi-body { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.adm-kpi .kpi-label { font-size: .7rem; line-height: 1.25; }
.adm-kpi .kpi-value { font-size: 1.2rem; line-height: 1.15; }
.adm-kpi .kpi-detail { font-size: .8rem; line-height: 1.3; }
/* 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: block; width: 1.6rem; height: 1.6rem; margin-bottom: .2rem; object-fit: contain; }
.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; }

/* ===================================================================================================================
 * Responsive (2026-10-28): phone, tablet, computer. One place, after every other rule.
 * Measured at 320, 360, 375, 414, 600, 768, 1024 and 1280 px (browser probe): no page wider than the screen, no
 * button or field cut, tables either fitting or turned into cards on phones; compact spacing on small screens,
 * touch targets kept (2.25rem minimum).
 * =================================================================================================================== */

/* Nothing positioned inside a scrolling table can widen the page (the « Ouvrir » label of « Mes tickets » did). */
.table-wrap { position: relative; max-width: 100%; }

/* The store picker never widens the page: a long store name is cut in the select, not the screen. */
.store-picker { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.store-picker select { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
/* The POS columns may shrink to the screen (1fr kept the width of the cart, 362 px, on small phones). */
@media (max-width: 1099px) { .pos { grid-template-columns: minmax(0, 1fr); } .pos > * { min-width: 0; } }
/* A toolbar or a header block in a wrapping row may shrink to the screen (by default it kept its content width). */
.toolbar, .page-head.with-actions > *, .pos-head > * { min-width: 0; max-width: 100%; }
@media (max-width: 640px) { .pos-head > .toolbar { flex: 1 1 100%; } .pos-head .store-picker { flex: 1 1 100%; } .pos-head .store-picker select { flex: 1 1 0; width: 100%; } }

/* The POS checkout bar spans the page padding exactly (it went 2 px beyond each side). */
.page { --page-pad: .9rem; padding-left: var(--page-pad); padding-right: var(--page-pad); }
.pos-checkout-bar { margin-left: calc(-1 * var(--page-pad)); margin-right: calc(-1 * var(--page-pad)); }
@media (min-width: 1024px) { .page { --page-pad: 1.5rem; } .pos-checkout-bar { margin-left: calc(-1 * var(--page-pad)); margin-right: calc(-1 * var(--page-pad)); } }

/* Tabs stay on one line and scroll sideways inside their own bar on narrow screens (Stock, Caisses, Rapports…). */
@media (max-width: 640px) {
    .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .tabs::-webkit-scrollbar { display: none; }
    .tabs > * { flex: none; }
}

/* Phones and small tablets: compact spacing and sizes, same identity. */
@media (max-width: 640px) {
    .page { --page-pad: .7rem; padding-top: .75rem; padding-bottom: 1.5rem; }
    .topbar { gap: .45rem; padding: 0 .6rem; }
    .app-user { gap: .3rem; }
    .icon-btn, .menu-toggle { width: 2.25rem; height: 2.25rem; }
    h1 { font-size: 1.35rem; }
    .page-head { margin-bottom: .7rem; }
    .page-head p { font-size: .9rem; }
    .page-head.with-actions { gap: .6rem; }
    .page-head.with-actions > .toolbar, .page-head.with-actions > .page-head-actions { flex: 1 1 100%; }
    .alert { padding: .5rem .7rem; font-size: .84rem; margin-bottom: .6rem; }
    .panel { padding: .8rem .85rem; margin-bottom: .7rem; }
    .welcome { padding: .9rem 1rem; gap: .6rem; margin-bottom: .75rem; }
    .welcome h1 { font-size: 1.3rem; }
    .welcome p { font-size: .9rem; }
    .kpi-grid, .stk-kpis, .quick-grid { gap: .55rem; }
    .kpi { padding: .75rem .8rem; }
    .kpi-value { font-size: 1.4rem; }
    .kpi-icon { width: 2.15rem; height: 2.15rem; }
    .cat-grid, .pos-grid { gap: .55rem; }
    .pos-head { gap: .5rem; margin-bottom: .6rem; }
    .pos-search { padding: .45rem; }
    .pos-search input { min-height: 2.75rem; font-size: 1rem; }
    .toolbar { gap: .4rem; }
    /* Filter bars (sales, tickets, expenses, reports…): two fields per line, the search and the button on a full line;
     * a date or a choice no longer takes a whole screen height. */
    .filter-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .55rem; padding: .75rem; margin-bottom: .75rem; }
    .filter-bar .field, .filter-bar .field.narrow { min-width: 0; }
    .filter-bar .field.search-field, .filter-bar .field:only-of-type { grid-column: 1 / -1; }
    .filter-bar > .btn, .filter-bar > button { grid-column: 1 / -1; justify-content: center; }
    .filter-bar input, .filter-bar select { width: 100%; min-width: 0; }
    /* Summary cards (sales, expenses, cash, credits, purchases, reports): two compact cards per line. */
    .sales-kpis, .exp-kpis, .cash-kpis, .crd-kpis, .pur-kpis, .rpt-kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: .55rem; }
    .sales-kpi, .exp-kpi, .cash-kpi, .crd-kpi, .pur-kpi { padding: .7rem .75rem; gap: .55rem; align-items: flex-start; }
    .rpt-kpi { padding: .75rem .8rem; }
    .sales-kpi .kpi-icon, .exp-kpi .kpi-icon { width: 2.15rem; height: 2.15rem; }
    /* Status selectors (Toutes, Validées…): one line, scrolling sideways inside itself when long. */
    .sales-tabs, .exp-tabs, .cust-tabs, .cat-tabs { display: flex; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
    .sales-tabs a, .exp-tabs a, .cust-tabs a, .cat-tabs a { flex: none; padding: .4rem .75rem; }
    /* Sale page: total, items, payment side by side (two columns) instead of three full-width cards. */
    .sld-kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: .55rem; }
    .sld-kpi { padding: .7rem .75rem; gap: .55rem; }
}

/* Small phones (≤ 380 px): two columns kept for products when each card keeps ~9 rem, one column below. */
@media (max-width: 380px) {
    .page { --page-pad: .55rem; }
    h1 { font-size: 1.25rem; }
    .welcome-actions .btn { flex: 1 1 auto; justify-content: center; }
    /* Two product columns kept: the card foot (availability, « Modifier ») wraps instead of overflowing. */
    .cat-foot { flex-wrap: wrap; gap: .35rem; }
    .filter-bar input[type="date"] { font-size: .84rem; padding-left: .45rem; padding-right: .3rem; }
    .cat-foot .btn { flex: 1 1 100%; margin-left: 0; justify-content: center; }
    .page-head-actions .btn, .page-head.with-actions .toolbar .btn { flex: 1 1 auto; justify-content: center; }
}

/* « Mes tickets » and the Super Admin tickets: each row is a compact card on phones (title, then details, status
 * and action), no horizontal scroll; the table stays on tablets and computers. */
@media (max-width: 640px) {
    .tkt-table thead { display: none; }
    .tkt-table, .tkt-table tbody { display: block; }
    .tkt-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem .75rem; align-items: center; padding: .7rem .85rem; border-bottom: 1px solid var(--line); }
    .tkt-table tr:last-child { border-bottom: 0; }
    .tkt-table td { display: block; padding: 0; border: 0; min-width: 0; }
    .tkt-table td:first-child { grid-column: 1 / -1; }
    .tkt-table td[data-label] { font-size: .86rem; color: var(--ink-700); }
    .tkt-table td[data-label]::before { content: attr(data-label) " · "; color: var(--ink-500); font-weight: 600; }
    .tkt-table td.actions { justify-self: end; }
    .tkt-table td.tkt-col-status { justify-self: start; }
}

/* Plan comparison: fits a phone without sideways scrolling (smaller cells). */
@media (max-width: 480px) {
    .plan-compare th, .plan-compare td { padding: .35rem .25rem; font-size: .76rem; }
    .plan-compare th .badge { display: block; width: max-content; margin-top: .15rem; }
}

/* POS on phones (2026-10-28): 3 small product cards per line, so that 9 to 12 products show at once
 * instead of 4 (2 under 300 px). Photo kept (cropped, never distorted), name on 2 lines at most, price in bold, stock badge and « + »
 * smaller; the whole card stays the button. Tablets and computers unchanged. */
@media (max-width: 640px) {
    .pos-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
    .pos-item { gap: .15rem; padding: 0 0 .4rem; border-radius: 10px; }
    .pos-item .name { padding: 0 .4rem; font-size: .76rem; line-height: 1.2; min-height: 1.85rem; }
    .pos-item .price { padding: 0 .4rem; font-size: .82rem; }
    .pos-ph { font-size: 1.25rem; }
    .stock-badge { left: .25rem; top: .25rem; padding: .05rem .35rem; font-size: .6rem; }
    .pos-add { right: .25rem; bottom: .25rem; width: 1.75rem; height: 1.75rem; font-size: 1.05rem; }
    .pos-status { margin: .2rem 0 .35rem; }
}
@media (max-width: 340px) { .pos-photo { aspect-ratio: 16 / 10; } .pos-item .name { min-height: 1.8rem; } }
@media (max-width: 299px) { .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* POS on phones (2026-10-28): the cart is a sheet sliding up from the bottom bar (« voir le panier »), over the
 * products, instead of a big block below them reached by scrolling. It stays in the page (only moved off screen when
 * closed: the payment window inside it must keep working). Tablets keep the cart below the catalogue (the bar
 * scrolls to it), computers keep it beside. */
.pos-bar-cart { display: flex; flex-direction: column; align-items: flex-start; gap: .05rem; min-width: 0; padding: .2rem .3rem; margin: -.2rem -.3rem; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pos-bar-cart:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.pos-bar-see { opacity: .85; }
.pos-cart-close, .pos-cart-backdrop { display: none; }
@media (max-width: 640px) {
    .pos-cart { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40; max-height: 82vh; overflow-y: auto; margin: 0; border-radius: 18px 18px 0 0; border-top-width: 4px; box-shadow: 0 -12px 32px rgba(15, 23, 42, .28); transform: translateY(110%); transition: transform .25s ease; padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
    body.pos-cart-open .pos-cart { transform: none; }
    .pos-cart .cart-head { position: sticky; top: -1rem; z-index: 1; margin: -1rem -1rem 0; padding: .9rem 1rem .6rem; background: var(--surface); }
    .pos-cart .cart-head::before { content: ""; position: absolute; left: 50%; top: .35rem; width: 2.5rem; height: .25rem; margin-left: -1.25rem; border-radius: 999px; background: var(--ink-300); }
    .pos-cart-close { display: inline-flex; }
    .pos-cart .cart-head h2 { margin-right: auto; }
    .pos-cart-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(15, 23, 42, .45); opacity: 0; pointer-events: none; transition: opacity .2s; display: block; }
    body.pos-cart-open .pos-cart-backdrop { opacity: 1; pointer-events: auto; }
    body.pos-cart-open { overflow: hidden; }
}
@media (min-width: 641px) { .pos-bar-see { display: none; } }
@media (prefers-reduced-motion: reduce) { .pos-cart, .pos-cart-backdrop { transition: none; } }

/* POS payment window on phones (2026-10-28): the methods take a third of the width (Espèces, Wave, Orange Money /
 * Virement, Chèque, Autre / Plusieurs moyens), lower buttons, the customer box tighter: the amount received and the
 * change are in sight without scrolling. Tablets and computers unchanged. */
.pm-short { display: none; }
@media (max-width: 640px) {
    .pos-pay-body { gap: .55rem; padding: .65rem .75rem; }
    .pos-section-label { margin-bottom: .25rem; font-size: .7rem; }
    .customer-box { padding: .55rem .6rem; }
    .customer-box .customer-input { min-height: 2.35rem; }
    .customer-create summary { margin-top: .35rem; }
    .pay-methods { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .3rem; }
    .pay-method { min-height: 2.4rem; padding: .3rem .35rem; align-items: center; text-align: center; font-size: .84rem; line-height: 1.15; overflow-wrap: anywhere; }
    .pay-method small { font-size: .62rem; line-height: 1.1; }
    .pay-method.pay-method-mixed { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: .35rem; min-height: 2.2rem; }
    .pm-long { display: none; }
    .pm-short { display: inline; }
    .quick-amounts .btn { min-height: 2.2rem; }
    .change-box { padding: .55rem .75rem; }
    .change-box strong { font-size: 1.35rem; }
    .pos-pay-foot { padding: .55rem .75rem calc(.55rem + env(safe-area-inset-bottom, 0px)); }
    /* The change right under the amount received, before the quick amounts. */
    .pos-pay-body > .change-box { order: 1; }
    .pos-pay-body > .quick-amounts { order: 2; }
}
@media (max-width: 640px) and (max-height: 700px) {
    .quick-amounts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .quick-amounts .btn { flex: none; }
    .received-input { min-height: 2.6rem; }
}

/* Workspace on phones (2026-10-28): indicators two per line in a compact form, « Mon contexte » as small dense
 * blocks, quick links as tiles three per line (their explanation hidden). Same information, tablets and computers
 * unchanged. */
@media (max-width: 640px) {
    .section { margin-top: .9rem; }
    .section-head h2 { font-size: 1.05rem; }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
    .kpi { padding: .6rem .65rem .65rem; gap: .2rem; }
    .kpi::after { height: 3px; }
    .kpi-label { font-size: .62rem; letter-spacing: .03em; line-height: 1.2; }
    .kpi-icon { width: 1.75rem; height: 1.75rem; border-radius: 9px; }
    .kpi-icon .icon { width: 1rem; height: 1rem; }
    .kpi-value { font-size: 1.15rem; }
    .kpi-value.is-text { font-size: 1rem; }
    .kpi-detail { font-size: .72rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .kpi-links { gap: .25rem; margin-top: .15rem; }
    .kpi .badge { font-size: .62rem; padding: .1rem .4rem; }
    .kpi-foot { padding-top: .3rem; }
    .kpi-foot .btn { min-height: 2rem; padding: .25rem .5rem; font-size: .74rem; width: 100%; justify-content: center; }

    .context-grid { grid-template-columns: minmax(0, 1fr); gap: .4rem; }
    .context { padding: .55rem .7rem; }
    .context-title { gap: .45rem; margin-bottom: .25rem; }
    .context-title .kpi-icon { width: 1.6rem; height: 1.6rem; border-radius: 8px; }
    .context-title strong { font-size: .9rem; }
    .context-title span { font-size: .6rem; }
    .context .kv { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .35rem; font-size: .76rem; }
    .context .kv dd + dt::before { content: "·"; margin-right: .35rem; color: var(--ink-300); }

    .quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
    .quick-link { flex-direction: column; justify-content: center; gap: .3rem; padding: .55rem .3rem; text-align: center; }
    .quick-link strong { font-size: .74rem; line-height: 1.2; }
    .quick-link small { display: none; }
    .quick-link .kpi-icon { width: 2rem; height: 2rem; }
}

/* Ma caisse on phones (2026-10-28): each sale of the session on one compact line (number and total, then the hour
 * and the payment in small) instead of four labelled rows; the cash tabs (and the other segmented tabs) on one line
 * scrolling sideways; amounts of the summary cards not cut in two. */
@media (max-width: 640px) {
    .cash-sales tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "ref total" "meta meta"; gap: .1rem .75rem; align-items: baseline; padding: .55rem .8rem; }
    .cash-sales td { display: block; padding: 0; text-align: left; }
    .cash-sales td::before { content: none; }
    .cash-sales td:first-child { grid-area: ref; }
    .cash-sales td.num { grid-area: total; text-align: right; font-weight: 800; }
    .cash-sales td.cash-sale-time, .cash-sales td.cash-sale-method { grid-row: 2; display: inline; font-size: .78rem; color: var(--ink-500); }
    .cash-sales td.cash-sale-time { grid-column: 1 / -1; }
    .cash-sales td.cash-sale-time::after { content: " · " attr(data-method); }
    .cash-sales td.cash-sale-method { display: none; }
    .cash-tabs, .pur-tabs, .stk-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: auto; }
    .cash-tabs a, .pur-tabs a, .stk-tabs a { flex: none; padding: .4rem .75rem; }
    .cash-kpi-value { font-size: 1.1rem; overflow-wrap: normal; white-space: nowrap; }
    .cash-kpi { padding: .65rem .7rem; gap: .5rem; }
}

/* Tabs on phones (2026-10-28, replaces the sideways scrolling above): every tab stays in sight. They shrink to fit
 * the width and, when there is really not enough room, go on a second line; never cut at the edge (« Ma » for
 * « Matériel »). Applies to the segmented tabs (Caisses, Ventes, Dépenses, Clients, Catalogue, Achats, Stock) and to
 * the underlined ones (Stock, Rapports…). */
@media (max-width: 640px) {
    .cash-tabs, .pur-tabs, .stk-tabs, .sales-tabs, .exp-tabs, .cust-tabs, .cat-tabs { display: flex; flex-wrap: wrap; overflow: visible; width: 100%; max-width: 100%; gap: .2rem; padding: .2rem; }
    .cash-tabs a, .pur-tabs a, .stk-tabs a, .sales-tabs a, .exp-tabs a, .cust-tabs a, .cat-tabs a { flex: 1 1 auto; text-align: center; padding: .38rem .45rem; font-size: .8rem; white-space: nowrap; }
    .tabs { flex-wrap: wrap; overflow: visible; gap: 0 .1rem; }
    .tabs > * { flex: 0 1 auto; }
    .tabs a { padding: .45rem .55rem; font-size: .84rem; white-space: nowrap; }
}
/* Report tabs on phones: the ten reports in a compact grid (two or three per line), all in sight, none cut. */
@media (max-width: 640px) {
    .rpt-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.6rem), 1fr)); gap: .2rem; padding: .2rem; overflow: visible; }
    .rpt-tabs a { padding: .38rem .4rem; font-size: .78rem; text-align: center; white-space: normal; line-height: 1.2; }
}

/* Lists on phones (2026-10-28): every table shown as cards (customers, cash sessions, sale lines, stock moves,
 * credits, purchases, reports) puts its details two per line, the label small above the value, the first column as
 * the title over the full width and the actions at the bottom. About half the height for the same information.
 * Editing tables (order lines) keep their layout. */
@media (max-width: 640px) {
    :is(.cust-table, .cash-table:not(.cash-sales), .sld-table, .stk-table, .crd-table, .pur-table:not(.pur-lines), .rpt-table) tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem .8rem; padding: .6rem .75rem; }
    :is(.cust-table, .cash-table:not(.cash-sales), .sld-table, .stk-table, .crd-table, .pur-table:not(.pur-lines), .rpt-table) tbody td { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: .05rem; min-width: 0; padding: 0; text-align: left; font-size: .86rem; }
    :is(.cust-table, .cash-table:not(.cash-sales), .sld-table, .stk-table, .crd-table, .pur-table:not(.pur-lines), .rpt-table) tbody td::before { font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
    :is(.cust-table, .cash-table:not(.cash-sales), .sld-table, .stk-table, .crd-table, .pur-table:not(.pur-lines), .rpt-table) tbody td:first-child { grid-column: 1 / -1; font-size: .92rem; }
    :is(.cust-table, .cash-table:not(.cash-sales), .sld-table, .stk-table, .crd-table, .pur-table:not(.pur-lines), .rpt-table) tbody td.actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: .4rem; padding-top: .15rem; }
    :is(.cust-table, .cash-table:not(.cash-sales), .sld-table, .stk-table, .crd-table, .pur-table:not(.pur-lines), .rpt-table) tbody td.actions .btn { width: auto; flex: 1 1 auto; min-height: 2.1rem; padding: .3rem .6rem; font-size: .8rem; justify-content: center; }
}
/* … the actions sit at the top right of the card, beside its title, instead of on a line of their own. */
@media (max-width: 640px) {
    :is(.cust-table, .cash-table:not(.cash-sales), .sld-table, .stk-table, .crd-table, .pur-table:not(.pur-lines), .rpt-table) tbody tr:has(> td.actions) > td:first-child { grid-column: 1; grid-row: 1; }
    :is(.cust-table, .cash-table:not(.cash-sales), .sld-table, .stk-table, .crd-table, .pur-table:not(.pur-lines), .rpt-table) tbody tr:has(> td.actions) > td.actions { grid-column: 2; grid-row: 1; justify-content: flex-end; align-self: start; padding-top: 0; }
    :is(.cust-table, .cash-table:not(.cash-sales), .sld-table, .stk-table, .crd-table, .pur-table:not(.pur-lines), .rpt-table) tbody tr:has(> td.actions) > td.actions .btn { flex: 0 1 auto; }
}

/* Card lists on phones (customers, suppliers, team, stores, recurring expenses, businesses, extensions, offline
 * anomalies): tighter cards, smaller gaps, the same content. */
@media (max-width: 640px) {
    :is(.cust-grid, .pur-grid, .team-grid, .shop-grid, .rec-grid, .biz-grid, .ext-grid, .ecat-grid) { gap: .45rem; margin-bottom: .7rem; }
    :is(.cust-card, .rec-card, .team-card, .shop-card, .biz-card, .ext-card, .pur-card, .snc-card) { padding: .7rem .75rem; gap: .45rem; }
    :is(.cust-card-foot, .pur-card-foot) { padding-top: .45rem; }
    :is(.cust-card, .rec-card, .team-card, .shop-card, .biz-card, .ext-card, .pur-card, .snc-card) .btn { min-height: 2.1rem; padding: .3rem .65rem; font-size: .8rem; }
    :is(.cust-card, .rec-card, .team-card, .shop-card, .biz-card, .ext-card, .pur-card, .snc-card) .kpi-icon { width: 2rem; height: 2rem; }
}
@media (max-width: 640px) {
    :is(.cust-table, .cash-table:not(.cash-sales), .sld-table, .stk-table, .crd-table, .pur-table:not(.pur-lines), .rpt-table) tbody td,
    :is(.cust-table, .cash-table:not(.cash-sales), .sld-table, .stk-table, .crd-table, .pur-table:not(.pur-lines), .rpt-table) tbody td::before { max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
}

/* Sales list on phones: a denser card. Line 1 number and status, line 2 date and hour then the total, line 3 customer,
 * seller and payment in small, the « Détail » / « Ticket » buttons small at the end of the line when there is room.
 * Summary amounts (2 000 XOF…) never cut in two; their notes shorter. */
@media (max-width: 640px) {
    .sales-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem; padding: .55rem .7rem; }
    .sales-table td:nth-child(1) { flex: 1 1 55%; min-width: 0; }
    .sales-table td.sales-col-status { margin-left: auto; }
    .sales-table td:nth-child(2) { flex: 1 1 55%; min-width: 0; }
    .sales-table td:nth-child(2) .sales-date, .sales-table td:nth-child(2) .sales-sub { display: inline; font-size: .8rem; }
    .sales-table td:nth-child(2) .sales-sub::before { content: " · "; }
    .sales-table td.sales-col-total { margin-left: auto; font-size: .95rem; }
    .sales-table .sales-col-customer, .sales-table .sales-col-seller, .sales-table td:nth-child(5) { grid-column: auto; flex: 0 1 auto; font-size: .76rem; }
    .sales-table .sales-label { font-size: .7rem; margin-right: .2rem; }
    .sales-table .sales-number { font-size: .92rem; }
    .sales-table .sales-sub { font-size: .74rem; }
    .sales-table td.actions { flex: 0 0 auto; margin-left: auto; display: flex; gap: .3rem; }
    .sales-table td.actions .btn { flex: 0 0 auto; min-height: 1.9rem; padding: .2rem .55rem; font-size: .74rem; }
    :is(.sales-kpi-value, .exp-kpi-value, .crd-kpi-value, .pur-kpi-value) { font-size: 1.1rem; white-space: nowrap; overflow-wrap: normal; }
    :is(.sales-kpi-note, .exp-kpi-note) { font-size: .7rem; }
    :is(.sales-kpi-label, .exp-kpi-label) { font-size: .76rem; }
}
/* … the other indicator grids too (customer page, stock of a product, stock page): two per line, compact. */
@media (max-width: 640px) {
    .cust-stats, .stock-kpis, .stk-kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: .45rem; }
    .cust-stat { padding: .65rem .7rem; gap: .5rem; }
    .cust-stat .kpi-icon { width: 2rem; height: 2rem; }
    .cust-stat strong { font-size: 1.05rem; white-space: nowrap; }
}

/* Team forms on phones: permission groups tighter (smaller boxes and rows). */
@media (max-width: 640px) {
    .perm-groups { gap: .4rem; }
    .perm-group { padding: .55rem .6rem; }
    .perm-group h3 { margin-bottom: .3rem; font-size: .68rem; }
    .perm-list { gap: .2rem; }
    .perm-list .check { padding: .3rem .45rem; font-size: .84rem; min-height: 2.1rem; }
}

/* Inventory count on phones: counted / expected / gap side by side under the product, « Compté par » on one small line. */
@media (max-width: 640px) {
    .stk-table tbody tr.stk-inv-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stk-table tbody tr.stk-inv-row > td:first-child { grid-column: 1 / -1; }
    .stk-table tbody tr.stk-inv-row > td.hide-sm { grid-column: 1 / -1; display: flex; flex-direction: row; flex-wrap: wrap; gap: .35rem; align-items: baseline; font-size: .78rem; }
    .stk-table tbody tr.stk-inv-row > td.hide-sm::before { margin: 0; }
    .stk-table tbody tr.stk-inv-row .stk-count { width: 100%; max-width: 5.5rem; min-height: 2.3rem; }
}
/* … three indicators (inventory) on one line, without their icons. */
@media (max-width: 640px) {
    .stk-kpis:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stk-kpis:has(> :nth-child(3):last-child) .stk-kpi { padding: .55rem .6rem; gap: .3rem; }
    .stk-kpis:has(> :nth-child(3):last-child) .stk-kpi .kpi-icon { display: none; }
}
/* Detail heads on phones (order, supplier…): the action buttons smaller, side by side. */
@media (max-width: 640px) {
    .pur-hero .toolbar { gap: .35rem; }
    .pur-hero .toolbar > form { display: contents; }
    .pur-hero .toolbar .btn { width: auto; flex: 1 1 auto; min-height: 2.2rem; padding: .35rem .7rem; font-size: .84rem; justify-content: center; }
}

/* Catalogue on phones: three products per line (two below 300 px), as at the POS: a smaller photo, name, code and
 * price, the availability on a small line and « Modifier » across the card. Tablets and computers unchanged. */
@media (max-width: 640px) {
    .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
    .cat-card { border-radius: 11px; }
    .cat-media { aspect-ratio: 1 / 1; }
    .cat-ph { font-size: 1.3rem; }
    .cat-media .cat-badges { left: .25rem; top: .25rem; right: .25rem; gap: .15rem; }
    .cat-media .badge { padding: .05rem .35rem; font-size: .58rem; }
    .cat-body { gap: .1rem; padding: .4rem .45rem .45rem; }
    .cat-name { font-size: .78rem; line-height: 1.2; }
    .cat-meta { font-size: .62rem; gap: 0 .3rem; line-height: 1.25; }
    .cat-meta > span { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
    .cat-price { padding-top: .2rem; font-size: .84rem; }
    .cat-foot { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: .25rem; padding: .35rem .4rem .4rem; font-size: .62rem; line-height: 1.2; text-align: center; }
    .cat-foot .btn { flex: 0 0 auto; width: 100%; min-height: 1.9rem; margin-left: 0; padding: .2rem .3rem; font-size: .74rem; justify-content: center; }
}
@media (max-width: 299px) {
    .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Camera barcode reader (2026-10-28, public/js/jumulo-camera.js): a « Scanner » button beside the POS search and the
 * barcode field, shown on phones and tablets (touch screens); computers keep their USB reader and see no change. The
 * camera window fills a phone screen, a framed window on larger screens. */
.cam-btn { flex: 0 0 auto; gap: .35rem; }
.pos-search-go > .icon { display: none; width: 1.2rem; height: 1.2rem; }
.cam-btn .icon { width: 1.15rem; height: 1.15rem; }
@media (hover: hover) and (pointer: fine) { [data-camera-btn] { display: none; } }
.cam-field { display: flex; gap: .4rem; align-items: stretch; }
.cam-field input { flex: 1; min-width: 0; }
.cam-read { display: block; margin-top: .3rem; font-size: .82rem; color: var(--brand-700); }
.cam-dialog { width: min(34rem, calc(100vw - 2rem)); max-width: none; max-height: calc(100dvh - 2rem); padding: 0; border: 0; border-radius: 16px; background: #0f172a; color: #e2e8f0; overflow: hidden; display: flex; flex-direction: column; }
.cam-dialog:not([open]) { display: none; }
.cam-dialog::backdrop { background: rgba(15, 23, 42, .75); }
.cam-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .75rem; padding-top: calc(.6rem + env(safe-area-inset-top, 0px)); }
.cam-head strong { font-size: 1rem; color: #fff; }
.cam-dialog .btn-ghost { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; }
.cam-view { position: relative; flex: 1 1 auto; min-height: 14rem; aspect-ratio: 4 / 3; background: #000; overflow: hidden; }
.cam-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-frame { position: absolute; left: 10%; right: 10%; top: 28%; bottom: 28%; border: 3px solid rgba(255, 255, 255, .9); border-radius: 12px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); pointer-events: none; }
.cam-line { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #ef4444; box-shadow: 0 0 8px #ef4444; animation: cam-scan 1.8s ease-in-out infinite alternate; }
@keyframes cam-scan { from { transform: translateY(-1.6rem); } to { transform: translateY(1.6rem); } }
@media (prefers-reduced-motion: reduce) { .cam-line { animation: none; } }
.cam-wait { position: absolute; inset: auto 0 1rem; margin: 0; text-align: center; font-size: .9rem; color: #fff; }
.cam-status { min-height: 2.6rem; margin: 0; padding: .55rem .8rem; font-size: .88rem; line-height: 1.35; color: #e2e8f0; }
.cam-status.is-error { color: #fecaca; }
.cam-status.is-info { color: #e2e8f0; }
.cam-foot { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; padding: 0 .75rem .75rem; padding-bottom: calc(.75rem + env(safe-area-inset-bottom, 0px)); }
.cam-foot:not(:has(> :not([hidden]))) { padding-bottom: env(safe-area-inset-bottom, 0px); }
@media (max-width: 640px) {
    .cam-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
    .cam-view { aspect-ratio: auto; }
    .pos-search .cam-btn, .pos-search .btn-primary { padding-left: .65rem; padding-right: .65rem; }
    .pos-search-go > span { display: none; }
    .pos-search-go > .icon { display: inline-block; }
}
@media (max-width: 380px) {
    .cam-field .cam-btn span { display: none; }
}
@media (max-width: 340px) {
    .pos-search .cam-btn span { display: none; }
}

/* Product import from Excel (2026-10-29): rules list, summary, preview table (valid lines green, errors red). */
.imp-rules { margin: .5rem 0 0; padding-left: 1.1rem; }
.imp-rules li { margin: .2rem 0; }
.imp-summary { margin: .5rem 0 1rem; padding-left: 1.1rem; }
.imp-summary li { margin: .25rem 0; }
.imp-summary .is-ok { color: var(--brand-700); }
.imp-summary .is-error, .imp-error { color: var(--danger-600, #b91c1c); }
.imp-summary .is-warn { color: #b45309; }
.imp-confirm { display: flex; flex-wrap: wrap; gap: .5rem; }
.imp-table tr.is-error td { background: #fff7f7; }
@media (max-width: 640px) {
    .imp-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem .8rem; padding: .6rem .75rem; }
    .imp-table tbody td { display: flex; flex-direction: column; padding: 0; text-align: left; font-size: .86rem; overflow-wrap: anywhere; }
    .imp-table tbody td:last-child, .imp-table tbody td:nth-child(2) { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .imp-table thead { display: none; }
    .imp-table tbody td::before { content: attr(data-label); font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-500); }
}

/* Counting the drawer by notes and coins at closing (2026-10-29): optional, folded by default. */
.cash-denoms { margin-bottom: .8rem; border: 1px solid var(--line); border-radius: 10px; padding: .5rem .75rem; background: var(--surface); }
.cash-denoms summary { cursor: pointer; font-weight: 600; }
.cash-denoms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .4rem .6rem; margin-top: .6rem; }
.cash-denom { display: flex; align-items: center; justify-content: space-between; gap: .4rem; font-size: .88rem; }
.cash-denom-value { font-variant-numeric: tabular-nums; font-weight: 600; }
.cash-denom-value small { display: block; font-weight: 400; color: var(--ink-500); font-size: .7rem; }
.cash-denom input { width: 4.5rem; min-height: 2.2rem; text-align: right; font: inherit; border: 1px solid var(--ink-300); border-radius: 8px; padding: 0 .4rem; }
.cash-denoms-total { margin: .5rem 0 0; }
.cash-denoms-done { margin-top: .6rem; }
.cash-denoms-done summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
@media (max-width: 380px) { .cash-denoms-grid { grid-template-columns: 1fr; } }

/* Price labels (2026-10-29): choice of products, format and number of labels. */
.lbl-options { display: grid; gap: .6rem; }
.lbl-generate { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; }
.lbl-generate p { margin: 0; }
.lbl-formats { border: 0; margin: 0; padding: 0; display: grid; gap: .3rem; }
.lbl-formats legend { font-weight: 700; margin-bottom: .2rem; }
.lbl-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.lbl-qty { width: 5rem; min-height: 2.3rem; text-align: right; font: inherit; border: 1px solid var(--ink-300); border-radius: 8px; padding: 0 .45rem; }
@media (max-width: 640px) {
    .lbl-table thead { display: none; }
    .lbl-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .6rem; padding: .55rem .7rem; align-items: center; }
    .lbl-table tbody td { padding: 0; font-size: .86rem; text-align: left; overflow-wrap: anywhere; }
    .lbl-table tbody td:nth-child(1) { grid-column: 1; }
    .lbl-table tbody td:nth-child(4) { grid-column: 2; grid-row: 1 / span 3; }
    .lbl-table tbody td:nth-child(2), .lbl-table tbody td:nth-child(3) { grid-column: 1; color: var(--ink-500); font-size: .8rem; }
}

/* Categories on phones (2026-10-29): one card per category, nothing cut on the right; the name and « Renommer » on
 * one line, then the product count, the status and « Désactiver ». */
.ctg-unit { display: none; }
@media (max-width: 640px) {
    .ctg-table thead { display: none; }
    .ctg-table, .ctg-table tbody { display: block; width: 100%; min-width: 0; }
    .ctg-table tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .5rem; padding: .65rem .75rem; }
    .ctg-table tbody td { display: block; padding: 0; border: 0; }
    .ctg-table tbody td:first-child { flex: 1 1 100%; min-width: 0; }
    .ctg-table tbody td.actions { margin-left: auto; }
    .ctg-table .cat-row-name { display: flex; align-items: center; gap: .5rem; min-width: 0; }
    .ctg-table .cat-rename { display: flex; flex: 1; gap: .4rem; min-width: 0; flex-wrap: nowrap; }
    .ctg-table .cat-rename input[name="name"] { flex: 1; min-width: 0; width: auto; }
    .ctg-table .cat-rename .btn, .ctg-table td.actions .btn { min-height: 2.2rem; padding: .3rem .6rem; font-size: .8rem; white-space: nowrap; }
    .ctg-unit { display: inline; }
}

/* Reminder by WhatsApp on the customer detail (2026-10-29). */
.cust-remind { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; padding: .7rem .9rem; margin-bottom: .75rem; }
.btn-whatsapp { background: #25d366; border-color: #1fb457; color: #fff; }
.btn-whatsapp:hover { background: #1fb457; color: #fff; }

/* Phones (2026-10-29): stores list and stores comparison much more compact. */
@media (max-width: 640px) {
    /* Stores: name and badges on one line, the facts on one line, « Modifier » small on the right. */
    .shop-card { gap: .3rem; padding: .55rem .7rem; }
    .shop-card-head .kpi-icon { display: none; }
    .shop-card-head > div { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
    .shop-name { font-size: .98rem; }
    .shop-badges { margin-top: 0; gap: .25rem; }
    .shop-badges .badge { font-size: .66rem; padding: .05rem .4rem; }
    .shop-facts { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .35rem; font-size: .8rem; }
    .shop-facts dd { margin-right: .5rem; }
    .shop-facts dd:last-child { margin-right: 0; }
    .shop-meter-bar { width: 3rem; flex: none; }
    .shop-actions { padding-top: .25rem; border-top: 0; justify-content: flex-end; flex-wrap: wrap; }
    .shop-actions .btn { flex: 0 0 auto; width: auto; min-height: 1.9rem; padding: .2rem .7rem; font-size: .78rem; }
    /* Stores comparison: the name with its bar, then net sales, margin and profit side by side. */
    .rpt-compare tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .15rem .6rem; padding: .5rem .7rem; }
    .rpt-compare tbody td:first-child { grid-column: 1 / span 2; font-size: .9rem; }
    .rpt-compare tbody td.rpt-bar-cell { display: flex !important; grid-column: 3; align-items: center; }
    .rpt-compare tbody td.rpt-bar-cell .rpt-bar { height: .35rem; min-width: 2px; }
    .rpt-compare tbody td:not(:first-child):not(.rpt-bar-cell) { grid-row: 2; font-size: .82rem; }
    .rpt-compare tbody td::before { font-size: .58rem; }
}
/* … and the dashboard figures: smaller cards, figures, comparison chips and notes; « Situation actuelle » readable. */
@media (max-width: 640px) {
    .rpt-kpis { gap: .4rem; }
    .rpt-kpi, .rpt-stat { padding: .55rem .6rem; gap: .2rem; }
    .rpt-kpi-label { font-size: .6rem; letter-spacing: .03em; }
    .rpt-kpi-value { font-size: 1.05rem; overflow-wrap: normal; white-space: nowrap; }
    .rpt-kpi-value.is-missing { font-size: .85rem; }
    .rpt-kpi-delta, .rpt-delta { font-size: .64rem; padding: .05rem .35rem; }
    .rpt-kpi-hint { font-size: .68rem; line-height: 1.3; }
    .rpt-stat dl { grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .4rem; font-size: .74rem; }
    .rpt-stat dd { white-space: nowrap; }
    .rpt-section-title { font-size: .95rem; margin: .8rem 0 .4rem; }
}
@media (max-width: 640px) { .rpt-trend { font-size: .64rem; padding: .05rem .4rem; } }
/* Report tabs on computers and tablets: on two lines when needed, never a hidden tab to scroll to (2026-10-29). */
@media (min-width: 641px) { .rpt-tabs { flex-wrap: wrap; overflow-x: visible; } }

/* « Sur cet appareil » on the notifications page (2026-10-29): push notifications and installing the application. */
.push-panel { display: grid; gap: .5rem; padding: .8rem 1rem; margin-bottom: .9rem; }
.push-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .8rem; }
.push-title { margin: 0; font-size: 1rem; }
.push-status { margin: .15rem 0 0; font-size: .86rem; color: var(--ink-500); }
.push-status.is-ok { color: var(--ok-700); }
.push-status.is-error { color: var(--danger-700); }
.push-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.push-install { justify-content: flex-start; border-top: 1px solid var(--line); padding-top: .5rem; }
.push-install p { margin: 0; }

/* « Télécharger l'application » on the home page (2026-10-29). */
/* One line, centred on the page (2026-10-30): icon, text, button; shown on a computer's browser only (jumulo-push.js). */
.home-install { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; max-width: 48rem; margin: 1rem auto 0; padding: .7rem .9rem; text-align: left; }
.home-install .kpi-icon { flex: none; }
.home-install-text { flex: 1; min-width: 12rem; }
.home-install-text strong { font-size: .95rem; }
.home-install-text p { margin: .1rem 0 0; color: var(--ink-500); font-size: .85rem; }
.home-install .btn { flex: none; }
.home-install .home-install-hint { flex-basis: 100%; margin: .2rem 0 0; color: var(--ink-700); font-size: .85rem; }
/* A phone-sized screen never shows it, whatever the browser says it is (Chrome's mobile view included, 2026-10-30). */
@media (max-width: 820px) { [data-install-box] { display: none !important; } }


/* Owner PIN of the purchase prices (2026-10-29). */
.pur-pinbar { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; justify-content: space-between; margin: 0 0 1rem; padding: .55rem .9rem; border: 1px solid var(--line, #e5e7eb); border-radius: .6rem; background: var(--surface-2, #f8fafc); font-size: .9rem; color: var(--ink-700, #334155); }
.pur-pinbar.is-open { border-color: #bbf7d0; background: #f0fdf4; }
.pur-pinbar form { margin: 0; }
.price-masked { letter-spacing: .12em; color: var(--ink-500, #64748b); }
.pin-card { max-width: 30rem; }
.pin-card .field input { letter-spacing: .3em; font-size: 1.1rem; }
.pin-card details { margin-top: 1.1rem; }
.pin-card details summary { cursor: pointer; color: var(--brand-600, #2563eb); }

/* Language selector (2026-11-05, partials/locale-switcher): French or English, top right of every page. */
.lang-switch { position: relative; flex: none; }
.lang-switch > summary { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.4rem; padding: 0 .65rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-700); font-size: .85rem; font-weight: 600; cursor: pointer; list-style: none; user-select: none; }
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-switch > summary:hover, .lang-switch[open] > summary { background: var(--brand-50); color: var(--brand-900); }
.lang-switch > summary:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.lang-caret { width: .45rem; height: .45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .7; }
.lang-flag { width: 1.35rem; height: .9rem; border-radius: 2px; box-shadow: 0 0 0 1px rgba(15, 23, 42, .15); flex: none; }
.lang-menu { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 60; min-width: 10.5rem; margin: 0; padding: .3rem; display: grid; gap: .15rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.lang-menu button { display: flex; align-items: center; gap: .55rem; width: 100%; min-height: 2.4rem; padding: .35rem .6rem; border: 0; border-radius: 6px; background: none; color: var(--ink-700); font: inherit; font-size: .9rem; text-align: left; cursor: pointer; }
.lang-menu button:hover, .lang-menu button:focus-visible { background: var(--brand-50); color: var(--brand-900); outline: none; }
.lang-menu button[aria-current="true"] { font-weight: 700; color: var(--brand-900); }
.lang-menu button[aria-current="true"]::after { content: "\2713"; margin-left: auto; }
/* Pages without the application's top bar: the selector at the top right of the page. */
.auth-shell { position: relative; }
.lang-switch--corner { position: absolute; top: .9rem; right: 1rem; }
@media (max-width: 640px) {
    .topbar .lang-switch .lang-name { display: none; }
    .topbar .lang-switch > summary { padding: 0 .5rem; }
}

/* Offline foundation (phase 1, 2026-11-05): connection indicator, « new version » bar, offline page. */
.net-dot-wrap { display: inline-flex; align-items: center; gap: .35rem; flex: none; font-size: .78rem; font-weight: 600; color: var(--ink-500); }
.net-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); flex: none; }
.net-dot.is-weak { background: #ea580c; box-shadow: 0 0 0 3px rgba(234, 88, 12, .2); }
.net-dot.is-offline { background: #94a3b8; box-shadow: 0 0 0 3px rgba(148, 163, 184, .25); }
@media (max-width: 900px) { .net-dot-wrap .net-dot-label { display: none; } }
.pwa-update { position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 90; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem .75rem; width: max-content; max-width: calc(100% - 2rem); padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); font-size: .9rem; }
.offline-body { margin: 0; min-height: 100vh; background: var(--canvas); }
.offline-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 1.25rem 1rem; }
.offline-logo { width: 72px; height: 72px; }
.offline-card { width: 100%; max-width: 32rem; padding: 1.4rem 1.5rem; }
.offline-card h1 { margin: .35rem 0; }
.offline-badge { display: inline-flex; align-items: center; gap: .45rem; margin: 0; font-weight: 700; color: var(--ink-500); }
.offline-note { color: var(--ink-500); font-size: .9rem; }
.offline-sent { padding: .7rem .8rem; border-radius: var(--radius-sm); background: #fff7ed; color: #9a3412; }
.offline-state { color: var(--ink-500); font-size: .88rem; }
.offline-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Offline data, phase 2 (2026-11-05): state of the POS local vault (public/js/jumulo-vault.js). Never "up to date"
   unless the last comparison with the server was complete. */
.vault-chip { max-width: 100%; white-space: normal; }
.vault-chip[data-state="checking"], .vault-chip[data-state="syncing"], .vault-chip[data-state="none"] { background: var(--info-100); color: var(--info-900); }
.vault-chip[data-state="fresh"] { background: var(--ok-100); color: var(--ok-700); }
.vault-chip[data-state="stale"], .vault-chip[data-state="error"] { background: var(--warn-100); color: var(--warn-700); }
.vault-chip[data-state="refused"], .vault-chip[data-state="unsupported"] { background: #eef2f6; color: var(--ink-700); }
.vault-chip[data-state="syncing"] .dot { animation: vault-pulse 1s ease-in-out infinite; }
@keyframes vault-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .vault-chip[data-state="syncing"] .dot { animation: none; } }

/* Offline sales, phase 3 (2026-11-05): panel of the online POS, PIN dialog, offline cash register (/offline/pos). */
.offline-panel { margin-bottom: 1rem; padding: .75rem 1rem; }
.offline-panel > summary { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; cursor: pointer; }
.offline-panel[open] > summary { margin-bottom: .5rem; }
.offline-panel .toolbar { margin: .5rem 0; }
.offline-sales { display: grid; gap: .4rem; margin: .5rem 0; padding: 0; list-style: none; }
.offline-sale { display: grid; gap: .15rem; padding: .5rem .7rem; border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; background: #fff; font-size: .9rem; }
.offline-sale span { color: var(--ink-700); }
.offline-sale.is-pending { border-left-color: var(--warn-500, #f97316); }
.offline-sale.is-applied { border-left-color: var(--ok-700); }
.offline-sale.is-conflict, .offline-sale.is-rejected { border-left-color: var(--danger-700); }
.offline-sale.is-regularized { border-left-color: #94a3b8; }
.offline-pin-dialog { width: min(26rem, calc(100vw - 2rem)); padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.offline-pin-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.offline-pin-dialog form { display: grid; gap: .5rem; }
.offline-pin-dialog h2 { margin: 0; font-size: 1.15rem; }
.offline-pin-dialog input { font-size: 1.4rem; letter-spacing: .4em; text-align: center; }
[data-pin-error]:empty { display: none; }
[data-pin-error] { color: var(--danger-700); }

.opos-body { min-height: 100vh; background: var(--canvas); }
.opos-shell { width: min(72rem, 100%); margin: 0 auto; padding: 1rem; display: grid; gap: 1rem; }
.opos-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.opos-top h1 { margin: 0; font-size: 1.3rem; display: flex; align-items: center; gap: .5rem; }
.opos-top img { width: 36px; height: 36px; }
.opos-banner { padding: .6rem .9rem; border-radius: 10px; background: var(--warn-100); color: var(--warn-700); font-weight: 600; }
.opos-banner.is-ok { background: var(--info-100); color: var(--info-900); }
.opos-banner.is-danger { background: var(--danger-100); color: var(--danger-700); }
.opos-login { width: min(26rem, 100%); margin: 2rem auto; display: grid; gap: .6rem; }
.opos-login input { font-size: 1.05rem; }
.opos-grid { display: grid; gap: 1rem; }
@media (min-width: 900px) { .opos-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.opos-products { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); max-height: 60vh; overflow: auto; }
.opos-product { display: grid; gap: .2rem; padding: .6rem; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; }
.opos-product:hover, .opos-product:focus-visible { border-color: var(--brand-600, #2563eb); }
.opos-product[disabled] { opacity: .5; cursor: not-allowed; }
.opos-product small { color: var(--ink-700); }
.opos-cart { display: grid; gap: .6rem; }
.opos-cart ol { margin: 0; padding: 0; list-style: none; display: grid; gap: .4rem; }
.opos-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .4rem; align-items: center; }
.opos-line .qty { display: inline-flex; align-items: center; gap: .25rem; }
.opos-line .qty button { width: 2rem; height: 2rem; }
.opos-total { display: flex; justify-content: space-between; font-size: 1.3rem; font-weight: 700; }
.opos-check { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.opos-check input { width: auto; }
.opos-other { display: grid; gap: .6rem; }
.opos-other h2, .opos-op h3 { margin: 0; }
.opos-other-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); align-items: start; }
.opos-op { display: grid; gap: .45rem; padding: .8rem; border: 1px solid var(--line); border-radius: 10px; }
.opos-op[hidden] { display: none; }
.opos-ticket { font-family: ui-monospace, Menlo, Consolas, monospace; display: grid; gap: .3rem; }
.opos-ticket .provisional { padding: .5rem; border: 2px dashed var(--danger-700); color: var(--danger-700); font-weight: 700; text-align: center; }
.opos-ticket .row { display: flex; justify-content: space-between; gap: .5rem; }
@media print {
    body.opos-printing > *:not(.opos-print) { display: none !important; }
    body.opos-printing .opos-print { position: static; display: block !important; border: 0; box-shadow: none; }
    body.opos-printing .opos-print .toolbar { display: none !important; }
}

/* « Ventes et stock » report (2026-11-19): quick switch between all the stores and one store. */
.rpt-scope { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .8rem; }
.rpt-scope a { padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-700); font-weight: 600; font-size: .88rem; }
.rpt-scope a:hover { text-decoration: none; border-color: var(--brand-600, #2563eb); }
.rpt-scope a[aria-current="page"] { background: var(--brand-600, #2563eb); border-color: var(--brand-600, #2563eb); color: #fff; }

/* Working store selector (2026-11-19): same menu as the language, a long store name is shortened. */
.store-switch .lang-name { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-switch .lang-menu { min-width: 14rem; max-height: 60vh; overflow-y: auto; }
.store-switch .lang-menu small { color: var(--ink-500); font-weight: 400; }
.store-switch--inline { display: inline-block; margin-top: .6rem; }
.store-switch--inline .lang-menu { left: 0; right: auto; }
@media (max-width: 640px) {
    /* On a phone the store names need the width of the screen: the menu opens under the top bar, edge to edge. */
    .topbar .store-switch .lang-menu { position: fixed; top: calc(var(--topbar-height) + .25rem); left: 16px; right: 16px; min-width: 0; }
}

/* New product: the ticked stores, listed before creating; « Modifier » ticks them in the same window (2026-11-19). */
.stores-check { width: min(30rem, calc(100vw - 2rem)); }
.stores-check-step { display: grid; gap: .75rem; }
.stores-check-step[hidden] { display: none; }
.stores-check-list { margin: 0; padding: .6rem .75rem .6rem 1.9rem; max-height: 40vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--brand-50); color: var(--ink-900); font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.stores-check-list[hidden] { display: none; }
.stores-check-toggles { max-height: 45vh; overflow-y: auto; }

/* Cash session detail in the modal (2026-11-20): nearly the whole screen, its blocks one under the other (movements,
   then closing or correction) and the declared payments headers on two lines: read from top to bottom, no sideways scroll. */
.page-modal.is-full { width: min(80rem, calc(100vw - 2rem)); }
@media (max-width: 40rem) { .page-modal.is-full { width: 100vw; max-width: 100vw; } }
.page-modal-body .cash-columns { grid-template-columns: minmax(0, 1fr); }
.page-modal-body .cash-declared .table th { white-space: normal; letter-spacing: .03em; }
.page-modal-body .cash-kpis { min-width: 0; }
/* In the modal, the declared payments (6 columns) read as cards up to tablet width, like on a phone. */
@media (min-width: 721px) and (max-width: 960px) {
    .page-modal-body .cash-declared .cash-table thead { display: none; }
    .page-modal-body .cash-declared .cash-table, .page-modal-body .cash-declared .cash-table tbody, .page-modal-body .cash-declared .cash-table tr { display: block; }
    .page-modal-body .cash-declared .cash-table tr { padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
    .page-modal-body .cash-declared .cash-table tr:last-child { border-bottom: 0; }
    .page-modal-body .cash-declared .cash-table td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .2rem 0; border: 0; text-align: right; }
    .page-modal-body .cash-declared .cash-table td::before { content: attr(data-label); flex: none; font-size: .8rem; font-weight: 600; color: var(--ink-500); text-align: left; }
    .page-modal-body .cash-declared .cash-table td:not([data-label])::before { content: none; }
    .page-modal-body .cash-declared .cash-table td:not([data-label]) { font-weight: 700; }
}

/* Show / hide a password (public/js/jumulo-password.js, 2026-11-20): the eye sits inside the end of the field. */
.pw-reveal { position: relative; display: block; width: 100%; }
.pw-reveal > input { width: 100%; padding-right: 2.9rem; box-sizing: border-box; }
.pw-reveal-btn { position: absolute; top: 50%; right: .3rem; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 2.3rem; height: 2.3rem; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink-500); cursor: pointer; }
.pw-reveal-btn svg { width: 1.2rem; height: 1.2rem; }
.pw-reveal-btn:hover { color: var(--ink-900); background: var(--brand-50); }
.pw-reveal-btn:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 1px; }
.pw-reveal-btn:disabled { opacity: .4; cursor: default; }
.offline-pin-dialog .pw-reveal > input { padding-left: 2.9rem; } /* centred PIN: the same room on both sides */

/* Product name read on the packaging (public/js/jumulo-ocr.js, 2026-11-20): the photo, the name proposed and the other
   texts read, to check and correct before it fills the field. Full screen on a phone. */
.ocr-dialog { width: min(32rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink-900); box-shadow: var(--shadow-lg); }
.ocr-dialog::backdrop { background: rgba(15, 23, 42, .6); }
.ocr-box { display: flex; flex-direction: column; gap: .75rem; padding: 1rem 1.1rem 1.1rem; height: 100%; box-sizing: border-box; }
.ocr-live, .ocr-after { display: flex; flex-direction: column; gap: .75rem; flex: 1 1 auto; min-height: 0; }
.ocr-live[hidden], .ocr-after[hidden] { display: none; }
.ocr-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.ocr-head strong { font-size: 1.05rem; }
/* Live camera: the frame is moved and resized over the name; only its inside is read. */
.ocr-view { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #000; touch-action: none; user-select: none; -webkit-user-select: none; }
.ocr-view video, .ocr-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ocr-view video { object-fit: cover; }
.ocr-view canvas { object-fit: contain; }
.ocr-view [hidden] { display: none; }
.ocr-frame { position: absolute; border: 3px solid var(--brand-500, #3b82f6); outline: 1px solid rgba(255, 255, 255, .8); border-radius: 10px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); cursor: move; touch-action: none; }
.ocr-frame span { position: absolute; width: 2.4rem; height: 2.4rem; touch-action: none; }
.ocr-frame span::after { content: ""; position: absolute; width: 1.1rem; height: 1.1rem; border: 4px solid var(--brand-500, #3b82f6); }
.ocr-frame [data-corner=nw] { left: -1.2rem; top: -1.2rem; cursor: nwse-resize; }
.ocr-frame [data-corner=ne] { right: -1.2rem; top: -1.2rem; cursor: nesw-resize; }
.ocr-frame [data-corner=sw] { left: -1.2rem; bottom: -1.2rem; cursor: nesw-resize; }
.ocr-frame [data-corner=se] { right: -1.2rem; bottom: -1.2rem; cursor: nwse-resize; }
.ocr-frame [data-corner=nw]::after { left: 1rem; top: 1rem; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.ocr-frame [data-corner=ne]::after { right: 1rem; top: 1rem; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.ocr-frame [data-corner=sw]::after { left: 1rem; bottom: 1rem; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.ocr-frame [data-corner=se]::after { right: 1rem; bottom: 1rem; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.ocr-crop { display: flex; justify-content: center; border-radius: 10px; background: #0f172a; padding: .5rem; }
.ocr-crop canvas { display: block; max-width: 100%; max-height: 22vh; background: #fff; border-radius: 6px; }
.ocr-status { margin: 0; font-size: .92rem; line-height: 1.4; color: var(--ink-700); }
.ocr-status.is-error { color: var(--danger-600, #b91c1c); }
.ocr-status.is-ok { color: var(--ink-700); }
.ocr-progress { height: 6px; border-radius: 999px; background: var(--brand-50); overflow: hidden; }
.ocr-progress span { display: block; height: 100%; width: 5%; background: var(--brand-600); transition: width .2s; }
.ocr-result { display: grid; gap: .45rem; }
.ocr-label { font-weight: 600; font-size: .9rem; }
.ocr-input { width: 100%; min-height: 2.75rem; padding: .5rem .75rem; font: inherit; font-size: 1.05rem; font-weight: 600; border: 1px solid var(--ink-300); border-radius: 10px; box-sizing: border-box; }
.ocr-input:focus { outline: 2px solid var(--brand-500); outline-offset: 1px; border-color: var(--brand-500); }
.ocr-hint { margin: .2rem 0 0; font-size: .82rem; color: var(--ink-500); }
.ocr-hint[hidden] { display: none; }
.ocr-choices { display: flex; flex-wrap: wrap; gap: .4rem; }
.ocr-chip { display: inline-flex; align-items: stretch; max-width: 100%; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--canvas); }
.ocr-chip button { border: 0; background: none; font: inherit; font-size: .88rem; color: var(--ink-900); cursor: pointer; min-height: 2.2rem; }
.ocr-chip-take { padding: .25rem .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16rem; }
.ocr-chip-add { padding: .25rem .65rem; border-left: 1px solid var(--line) !important; font-weight: 700; color: var(--brand-700) !important; }
.ocr-chip button:hover { background: var(--brand-50); }
.ocr-foot { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
@media (max-width: 640px) {
    .ocr-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
    .ocr-box { padding-top: calc(1rem + env(safe-area-inset-top, 0px)); padding-bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px)); }
    .ocr-foot .btn { flex: 1 1 auto; }
    .ocr-view { flex: 1 1 auto; aspect-ratio: auto; min-height: 45vh; }
}

/* Catalogue (2026-11-20): the stores where each product is sold, under its price. Two names, the others behind « +N ». */
.cat-stores { display: flex; align-items: flex-start; flex-wrap: wrap; gap: .3rem .35rem; margin-top: .35rem; font-size: .78rem; color: var(--ink-700); min-width: 0; }
.cat-stores > .icon { flex: none; width: .95rem; height: .95rem; margin-top: .2rem; color: var(--ink-500); }
.cat-stores.is-none { color: var(--danger-600, #b91c1c); }
.cat-stores.is-none > .icon { color: currentColor; }
.cat-stores-all { flex-basis: calc(100% - 1.4rem); font-weight: 700; color: var(--brand-700); }
.cat-stores-names { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1 1 0; min-width: 0; }
.cat-store { max-width: 100%; padding: .05rem .45rem; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); line-height: 1.35; overflow-wrap: anywhere; } /* a long name wraps, never cut */
.cat-stores-more { flex: 1 1 0; min-width: 0; }
.cat-stores-more > summary { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; cursor: pointer; list-style: none; }
.cat-stores-more > summary .cat-stores-names { flex: 0 1 auto; }
.cat-stores-more > summary::-webkit-details-marker { display: none; }
.cat-store-count { padding: .05rem .45rem; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); font-weight: 700; }
.cat-stores-more > summary:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 6px; }
.cat-stores-more[open] > summary .cat-stores-names { display: none; }
.cat-stores-more[open] .cat-store-count::after { content: " ▴"; }
.cat-stores-list { margin: .3rem 0 0; padding: .4rem .55rem .4rem 1.3rem; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); line-height: 1.5; overflow-wrap: anywhere; }

/* Counting with the camera for a stock entry (public/js/jumulo-count.js, 2026-11-20): the picture with what was counted
   (boxes, or marks along the stack line), the number with − / +, the sensitivity. Full screen on a phone. */
.cnt-dialog { width: min(40rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink-900); box-shadow: var(--shadow-lg); }
.cnt-dialog::backdrop { background: rgba(15, 23, 42, .6); }
.cnt-box { display: flex; flex-direction: column; gap: .65rem; padding: 1rem 1.1rem 1.1rem; height: 100%; box-sizing: border-box; }
.cnt-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.cnt-head strong { font-size: 1.05rem; }
.cnt-modes { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; padding: .25rem; border-radius: 12px; background: var(--canvas); border: 1px solid var(--line); }
.cnt-modes button { min-height: 2.4rem; border: 0; border-radius: 9px; background: none; font: inherit; font-weight: 600; color: var(--ink-700); cursor: pointer; }
.cnt-modes button.is-on { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow); }
.cnt-view { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #000; touch-action: none; user-select: none; -webkit-user-select: none; }
.cnt-view video, .cnt-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cnt-view video { object-fit: cover; }
.cnt-view canvas { object-fit: contain; cursor: crosshair; touch-action: none; }
.cnt-view [hidden] { display: none; }
.cnt-status { margin: 0; font-size: .9rem; line-height: 1.4; color: var(--ink-700); }
.cnt-status.is-error { color: var(--danger-600, #b91c1c); }
.cnt-status.is-warn { color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: .45rem .6rem; }
.cnt-result { display: grid; gap: .5rem; }
.cnt-result[hidden] { display: none; }
.cnt-number { display: flex; align-items: center; justify-content: center; gap: .75rem; }
.cnt-number output { min-width: 4ch; text-align: center; font-size: 2rem; font-weight: 800; color: var(--brand-700); font-variant-numeric: tabular-nums; }
.cnt-number .btn { min-width: 2.75rem; font-size: 1.3rem; }
.cnt-sensitivity { display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: var(--ink-700); }
.cnt-sensitivity[hidden] { display: none; }
.cnt-sensitivity input { flex: 1; accent-color: var(--brand-600); }
.cnt-foot { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
.cnt-foot [hidden] { display: none; }
@media (max-width: 640px) {
    .cnt-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
    .cnt-box { padding-top: calc(1rem + env(safe-area-inset-top, 0px)); padding-bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px)); }
    .cnt-view { flex: 1 1 auto; aspect-ratio: auto; min-height: 40vh; }
    .cnt-foot .btn { flex: 1 1 auto; }
}

/* Technical documentation, Super Admin (2026-11-21): search, families, article with its menu, code blocks with
   « Copier », warning boxes for deletion, database and deployment. One column on a phone. */
.doc-search { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; padding: .4rem .5rem .4rem .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.doc-search > .icon { flex: none; width: 1.15rem; height: 1.15rem; color: var(--ink-500); }
.doc-search input { flex: 1; min-width: 0; min-height: 2.5rem; border: 0; background: none; font: inherit; color: var(--ink-900); outline: none; }
.doc-intro { margin-bottom: 1rem; }
.doc-families { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); align-items: start; }
.doc-family h2 { margin: 0 0 .25rem; font-size: 1.05rem; }
.doc-article-list, .doc-result-list { margin: .5rem 0 0; padding: 0; list-style: none; display: grid; gap: .35rem; }
.doc-article-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; line-height: 1.35; }
.doc-result-list li { padding: .65rem 0; border-bottom: 1px solid var(--line); }
.doc-result-list li:last-child { border-bottom: 0; }
.doc-result-list p { margin: .3rem 0 0; font-size: .88rem; color: var(--ink-700); }
.doc-result-family { margin-left: .4rem; font-size: .8rem; color: var(--ink-500); }
.doc-results { margin-bottom: 1rem; }
.doc-results h2 { margin: 0; font-size: 1.05rem; }
.doc-badge { font-size: .72rem; }
.doc-badge-suppression { background: #fee2e2; color: #991b1b; }
.doc-badge-base { background: #fef3c7; color: #92400e; }
.doc-badge-deploiement { background: #e0e7ff; color: #3730a3; }
.doc-layout { display: grid; gap: 1rem; grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr); align-items: start; }
.doc-nav { position: sticky; top: calc(var(--topbar-height) + .75rem); max-height: calc(100vh - var(--topbar-height) - 1.5rem); overflow-y: auto; padding: .6rem; font-size: .88rem; }
.doc-nav-fold > summary { padding: .3rem .5rem; font-weight: 700; cursor: pointer; color: var(--ink-500); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.doc-nav-family > summary { padding: .45rem .5rem; font-weight: 700; cursor: pointer; border-radius: 8px; }
.doc-nav-family > summary:hover { background: var(--brand-50); }
.doc-nav ul { margin: 0 0 .35rem; padding: 0 0 0 .4rem; list-style: none; }
.doc-nav li a { display: block; padding: .3rem .5rem; border-radius: 6px; color: var(--ink-700); text-decoration: none; line-height: 1.3; }
.doc-nav li a:hover { background: var(--brand-50); color: var(--brand-900); }
.doc-nav li a[aria-current="page"] { background: var(--brand-600); color: #fff; font-weight: 600; }
.doc-article { min-width: 0; }
.doc-sensitive { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: 1rem; }
.doc-summary { margin: 0 0 1rem; font-size: 1.02rem; color: var(--ink-700); }
.doc-toc { margin: 0 0 1.25rem; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); font-size: .9rem; }
.doc-toc ol { margin: .4rem 0 0; padding-left: 1.2rem; display: grid; gap: .2rem; }
.doc-body { line-height: 1.6; color: var(--ink-900); overflow-wrap: anywhere; }
.doc-body h2 { margin: 1.75rem 0 .6rem; padding-top: .4rem; border-top: 1px solid var(--line); font-size: 1.2rem; scroll-margin-top: calc(var(--topbar-height) + 1rem); }
.doc-body h2:first-child { margin-top: 0; border-top: 0; }
.doc-body h3 { margin: 1.25rem 0 .4rem; font-size: 1.02rem; scroll-margin-top: calc(var(--topbar-height) + 1rem); }
.doc-body p, .doc-body ul, .doc-body ol { margin: 0 0 .75rem; }
.doc-body li { margin-bottom: .25rem; }
.doc-body code { padding: .08rem .35rem; border-radius: 5px; background: #eef2f7; font-size: .86em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.doc-code { position: relative; margin: 0 0 1rem; }
.doc-body pre { margin: 0; padding: .85rem 1rem; padding-right: 5.5rem; border-radius: 10px; background: #0f172a; color: #e2e8f0; overflow-x: auto; font-size: .85rem; line-height: 1.5; }
.doc-body pre code { padding: 0; background: none; color: inherit; font-size: inherit; white-space: pre; }
.doc-copy { position: absolute; top: .45rem; right: .45rem; background: rgba(255, 255, 255, .12) !important; border-color: rgba(255, 255, 255, .3) !important; color: #fff !important; }
.doc-body blockquote { margin: 0 0 1rem; padding: .7rem .9rem; border-left: 4px solid var(--brand-500); border-radius: 8px; background: var(--brand-50); }
.doc-body blockquote p:last-child { margin-bottom: 0; }
.doc-body blockquote.doc-warning { border-left-color: #d97706; background: #fffbeb; }
.doc-body blockquote.doc-danger { border-left-color: #dc2626; background: #fef2f2; }
.doc-table { overflow-x: auto; margin: 0 0 1rem; }
.doc-body table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.doc-body th, .doc-body td { padding: .45rem .6rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc-body th { background: var(--canvas); }
.doc-pager { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.doc-pager .btn { white-space: normal; text-align: left; }
@media (max-width: 960px) {
    .doc-layout { grid-template-columns: minmax(0, 1fr); }
    .doc-nav { position: static; max-height: none; }
}
@media (max-width: 640px) {
    .doc-search { flex-wrap: wrap; }
    .doc-search .btn { flex: 1 1 100%; }
    .doc-body pre { padding-right: 1rem; padding-top: 2.6rem; }
}

/* Santé de la plateforme (Super Admin, 2026-11-21). */
.hl-expiring { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); margin-top: .75rem; }
.hl-expiring-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.1rem; }
.hl-expiring-card.is-warn { border-left: 4px solid var(--warn-500); }
.hl-expiring-card h3 { margin: 0 0 .25rem; font-size: .95rem; }
.hl-expiring-card p { margin: 0; }
.hl-big { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hl-table td, .hl-table th { vertical-align: top; }
.hl-nowrap { white-space: nowrap; }
.hl-msg { word-break: break-word; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .82rem; }
.hl-periods { display: flex; flex-wrap: wrap; gap: .35rem; }
.hl-sub { margin: 1.1rem 0 .6rem; font-size: 1rem; }
.hl-charts { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.hl-chart { margin: 0; padding: .85rem 1rem .7rem; }
.hl-chart figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-size: .85rem; font-weight: 600; color: var(--ink-500); }
.hl-chart figcaption strong { font-size: 1.15rem; color: var(--ink-900, #0f172a); font-variant-numeric: tabular-nums; }
.hl-bars { display: flex; align-items: flex-end; gap: 2px; height: 4.5rem; margin-top: .6rem; border-bottom: 1px solid var(--line); }
.hl-bar { flex: 1 1 0; min-width: 2px; background: var(--brand-500); border-radius: 3px 3px 0 0; }
.hl-bar.is-zero { background: var(--line); }
.hl-bar:hover { background: var(--brand-700, #1d4ed8); }
.hl-axis { display: flex; justify-content: space-between; margin-top: .25rem; font-size: .72rem; color: var(--ink-500); }
.hl-two { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); }
.hl-diag { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.hl-diag-card { padding: .9rem 1rem; }
.hl-diag-card h3 { margin: 0 0 .5rem; font-size: .95rem; }
.hl-diag-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .55rem; }
.hl-diag-card li { display: grid; grid-template-columns: 1fr auto; gap: .15rem .5rem; align-items: center; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.hl-diag-card li:last-child { padding-bottom: 0; border-bottom: 0; }
.hl-diag-label { font-weight: 600; font-size: .9rem; }
.hl-diag-detail { grid-column: 1 / -1; font-size: .82rem; color: var(--ink-500); word-break: break-word; }
.hl-pager { margin-top: .75rem; }
@media (max-width: 720px) {
    .hl-table thead { display: none; }
    .hl-table, .hl-table tbody, .hl-table tr { display: block; }
    .hl-table tr { padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
    .hl-table tr:last-child { border-bottom: 0; }
    .hl-table td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .2rem 0; border: 0; text-align: right; }
    .hl-table td::before { content: attr(data-label); flex: none; font-size: .8rem; font-weight: 600; color: var(--ink-500); text-align: left; }
    .hl-table td:not([data-label])::before { content: none; }
    .hl-nowrap { white-space: normal; }
    .page-head form, .page-head form .btn { width: 100%; }
}
.hl-stores { display: block; }
.hl-sub .muted { font-weight: 400; }
/* Super Admin home on a phone: two counters per row (the management cards go by three, with their title only). */
@media (max-width: 640px) {
    .adm-kpis.kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
    .adm-kpi { gap: .5rem; padding: .55rem .6rem; }
    .adm-kpi .kpi-icon { width: 1.9rem; height: 1.9rem; }
    .adm-kpi .kpi-label { font-size: .64rem; letter-spacing: .03em; }
    .adm-kpi .kpi-detail { font-size: .72rem; }
}
