/* =====================================================================================
   Dahrouj Management — interface layer (2026-10-27)
   A calm, dense, professional ERP look (Odoo-like usability, Dahrouj identity): light neutral
   surfaces, one restrained accent (Dahrouj teal), 6–8 px radii, thin borders, flat shadows,
   compact tables and forms. Loaded LAST (after the Vite bundle and erp.css): a static file,
   because the host has no Node to rebuild the bundle. Uses the existing class vocabulary
   (page-head, panel, table-wrap, primary/ghost, st-badge, kpi…) so every page follows at once.
   Logical properties (inline-start/end) keep Arabic (RTL) right.
   ===================================================================================== */

:root {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --surface-3: #f8fafc;
    --soft: #f3f6f6;
    --text: #1d2939;
    --text-2: #344054;
    --muted: #667085;
    --brand: #0f766e;
    --brand2: #115e59;
    --brand3: #14b8a6;
    --brand-soft: #e6f4f2;
    --border: #e4e7ec;
    --border-strong: #d0d5dd;
    --danger: #b42318;
    --warning: #b54708;
    --success: #067647;
    --info: #175cd3;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-soft: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-pop: 0 8px 24px rgba(16, 24, 40, .12);
    --sidebar: #ffffff;
    --radius: 8px;
    --radius-sm: 6px;
    --focus: 0 0 0 3px rgba(15, 118, 110, .18);
    --font: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Arabic", Tahoma, sans-serif;
}

.dark {
    --bg: #0f1419;
    --surface: #161c22;
    --surface-2: #161c22;
    --surface-3: #1b232b;
    --soft: #1b232b;
    --text: #e6e9ee;
    --text-2: #cbd2da;
    --muted: #98a2b3;
    --brand: #2dd4bf;
    --brand2: #14b8a6;
    --brand3: #5eead4;
    --brand-soft: rgba(45, 212, 191, .12);
    --border: #2a333d;
    --border-strong: #3a4552;
    --danger: #f97066;
    --warning: #fdb022;
    --success: #47cd89;
    --info: #84adff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, .25);
    --shadow-pop: 0 10px 28px rgba(0, 0, 0, .45);
    --sidebar: #12181e;
    --focus: 0 0 0 3px rgba(45, 212, 191, .25);
}

/* ---------- base ----------------------------------------------------------------------- */
html { font-size: 14px; }
body { font-family: var(--font); font-size: 1rem; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { letter-spacing: -.01em; color: var(--text); }
a { color: var(--brand); }
a:hover { color: var(--brand2); }
.muted { color: var(--muted); }
.page-transition { animation: none !important; }
.ico { flex: 0 0 auto; display: inline-block; vertical-align: -3px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }

/* ---------- application frame -------------------------------------------------------- */
.app-frame { background: var(--bg); }
.content-shell { max-width: 1640px; padding: 20px 24px 48px; }

/* ---------- sidebar --------------------------------------------------------------------- */
.sidebar {
    background: var(--sidebar) !important;
    color: var(--text-2);
    border-inline-end: 1px solid var(--border);
    box-shadow: none !important;
    padding: 14px 10px 12px;
    scrollbar-width: thin;
}
.sidebar .brand { color: var(--text); padding: 2px 6px 14px; gap: 10px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.sidebar .brand strong { font-size: .93rem; line-height: 1.2; color: var(--text); }
.sidebar .brand small { color: var(--muted); font-size: .78rem; }
.sidebar .brand-mark { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--border); box-shadow: none; }
.sidebar .brand-mark img { width: 32px; height: 32px; }
.sidebar .brand:hover .brand-mark { transform: none; }
.side-nav { display: grid; gap: 1px; }
.sidebar .side-nav a {
    color: var(--text-2);
    gap: 10px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: .93rem;
    min-height: 34px;
    transform: none !important;
    box-shadow: none !important;
}
.sidebar .side-nav a b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .side-nav a span { width: 22px; height: 22px; background: none !important; border-radius: 0; color: var(--muted); box-shadow: none !important; }
.sidebar .side-nav a:hover { background: var(--surface-3); color: var(--text); }
.sidebar .side-nav a:hover span { color: var(--text-2); }
.sidebar .side-nav a.active { background: var(--brand-soft) !important; color: var(--brand) !important; }
.sidebar .side-nav a.active b { font-weight: 600; }
.sidebar .side-nav a.active span { color: var(--brand) !important; }
.sidebar .side-nav a.active::before { content: ""; position: absolute; inset-inline-start: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); box-shadow: none; left: auto; }
.sidebar .workspace-label { display: none; }
.nav-group { margin-top: 6px; }
.nav-group-head {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px;
    padding: 6px 10px; border: 0; background: none; cursor: pointer;
    color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    border-radius: var(--radius-sm);
}
.nav-group-head:hover { color: var(--text-2); background: var(--surface-3); }
.nav-group-head .nav-chevron { transition: transform .15s ease; }
.nav-group.is-closed .nav-chevron { transform: rotate(-90deg); }
[dir="rtl"] .nav-group.is-closed .nav-chevron { transform: rotate(90deg); }
.nav-group-items { display: grid; gap: 1px; }
.nav-group.is-closed .nav-group-items { display: none; }
.sidebar .sidebar-card { margin-top: 12px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-3); border: 1px solid var(--border); font-size: .78rem; color: var(--muted); }
.sidebar .sidebar-card strong { font-size: .8rem; color: var(--text-2); font-weight: 600; }
.sidebar .sidebar-card small { color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #12b76a; flex: 0 0 auto; }

/* Collapsed sidebar (icons only): groups stay open, their titles hidden. */
.sidebar-collapsed .sidebar .nav-group-head { display: none; }
.sidebar-collapsed .sidebar .nav-group.is-closed .nav-group-items { display: grid; }
.sidebar-collapsed .sidebar .nav-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
.sidebar-collapsed .sidebar .side-nav a { justify-content: center; padding: 8px; }
.sidebar-collapsed .sidebar .brand { justify-content: center; }

/* ---------- top bar ----------------------------------------------------------------------- */
.app-topbar {
    height: 56px !important; min-height: 56px !important; padding: 0 20px !important; gap: 14px;
    background: var(--surface) !important; border-bottom: 1px solid var(--border); box-shadow: none !important; backdrop-filter: none !important;
}
.header-logo { width: 34px; height: 34px; border-radius: 6px; box-shadow: none; border: 1px solid var(--border); }
.header-logo img { width: 28px; height: 28px; }
.header-logo:hover { transform: none; box-shadow: none; }
.header-left { flex: 1 1 auto; min-width: 0; }
.topbar-crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: .95rem; white-space: nowrap; overflow: hidden; flex: 0 1 auto; }
.topbar-crumbs .crumb-group { flex: 0 0 auto; }
.topbar-crumbs .crumb-group { color: var(--muted); }
.topbar-crumbs .crumb-item { color: var(--text-2); text-decoration: none; }
.topbar-crumbs .crumb-item:hover { color: var(--brand); text-decoration: underline; }
.topbar-crumbs .crumb-sep { color: var(--border-strong); }
.topbar-crumbs .crumb-page { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.global-search {
    flex: 0 1 380px; min-width: 200px; max-width: 440px; margin-inline-start: 0; position: relative;
    display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px;
    background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted);
}
.global-search:focus-within { background: var(--surface); border-color: var(--brand); box-shadow: var(--focus); }
.global-search input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; height: 32px; color: var(--text); outline: 0; }
.global-search kbd { font: 600 .72rem var(--font); color: var(--muted); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; line-height: 1.4; }
.topbar-actions { margin-inline-start: 0 !important; gap: 6px !important; }
.icon-action, .menu-toggle {
    width: 34px !important; height: 34px !important; border-radius: var(--radius-sm) !important;
    border: 1px solid transparent !important; background: transparent !important; color: var(--text-2) !important;
    box-shadow: none !important; transform: none !important;
}
.icon-action:hover, .menu-toggle:hover { background: var(--surface-3) !important; border-color: var(--border) !important; color: var(--text) !important; }
.notif-badge { background: var(--danger); color: #fff; border-radius: 999px; font-size: .68rem; font-weight: 700; min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px; }
.quick-sale {
    display: inline-flex !important; align-items: center; gap: 6px; height: 34px; padding: 0 12px !important;
    border-radius: var(--radius-sm) !important; background: var(--brand) !important; color: #fff !important;
    font-weight: 600 !important; box-shadow: none !important; transform: none !important; text-decoration: none; white-space: nowrap; flex: 0 0 auto;
}
.quick-sale:hover { background: var(--brand2) !important; }
.topbar-actions > * { flex: 0 0 auto; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 2px 8px 2px 2px; border: 0; background: none; border-radius: var(--radius-sm); max-width: 190px; }
.user-chip > span { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .8rem; display: grid; place-items: center; flex: 0 0 auto; }
.user-chip div { min-width: 0; line-height: 1.15; }
.user-chip strong { display: block; font-size: .85rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip small { display: block; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-dropdown { border-radius: var(--radius) !important; box-shadow: var(--shadow-pop) !important; border: 1px solid var(--border) !important; background: var(--surface) !important; }

/* ---------- page header ------------------------------------------------------------------- */
.page-head, .premium-head { margin-bottom: 16px !important; padding: 0 !important; align-items: flex-end; gap: 16px; }
.page-head h1, .order-head h1 { font-size: 1.55rem !important; font-weight: 650; letter-spacing: -.015em !important; margin: 2px 0 2px !important; line-height: 1.2; }
.page-head > div > .muted, .page-head p.muted { margin: 4px 0 0; font-size: .92rem; max-width: 920px; }
.eyebrow { color: var(--muted) !important; font-size: .7rem !important; letter-spacing: .07em !important; font-weight: 700 !important; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* ---------- surfaces ------------------------------------------------------------------------ */
.hero, .panel, .card, .product-card, .table-wrap, .chart-card, .filters, .erp-section {
    background: var(--surface) !important; backdrop-filter: none !important;
    border: 1px solid var(--border) !important; border-radius: var(--radius) !important; box-shadow: var(--shadow) !important;
}
.panel { padding: 16px; margin-bottom: 14px; }
.card { padding: 14px; }
.panel-head { margin-bottom: 12px !important; gap: 10px; }
.panel-head h2, .panel h2, .erp-section h2 { font-size: 1.05rem; font-weight: 650; margin: 0; display: flex; align-items: center; gap: 8px; }
.panel h3 { font-size: .95rem; font-weight: 650; }
.panel:hover, .card:hover, .product-card:hover { transform: none !important; }
.hero::after, .dashboard-hero::after, .metric-card::after, .product-card::before { display: none !important; }
.dashboard-hero { min-height: 0 !important; background: var(--surface) !important; }

/* ---------- tables ----------------------------------------------------------------------------- */
.table-wrap { overflow: auto; padding: 0 !important; }
table { font-size: .93rem; }
th, td { padding: 9px 12px !important; border-bottom: 1px solid var(--border) !important; vertical-align: middle; text-align: start; }
th {
    background: var(--surface-3) !important; color: var(--text-2) !important; font-size: .76rem !important; font-weight: 650;
    text-transform: uppercase; letter-spacing: .04em !important; white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
tbody tr:hover { background: color-mix(in srgb, var(--brand) 4%, var(--surface)) !important; }
tbody tr:last-child td { border-bottom: 0 !important; }
.num, td.num, th.num { text-align: end !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-sub { color: var(--muted); font-size: .8rem; display: block; margin-top: 1px; }
.panel .table-wrap { box-shadow: none !important; }

/* ---------- buttons ------------------------------------------------------------------------- */
.primary, .ghost, .danger, .button, button.primary, a.primary, a.ghost, a.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 34px; padding: 6px 14px !important; border-radius: var(--radius-sm) !important;
    font-weight: 600 !important; font-size: .93rem; line-height: 1.2; text-decoration: none;
    box-shadow: none !important; transform: none !important; white-space: nowrap;
}
.primary { background: var(--brand) !important; color: #fff !important; border: 1px solid var(--brand) !important; }
.primary:hover { background: var(--brand2) !important; border-color: var(--brand2) !important; color: #fff !important; }
.ghost, .button { background: var(--surface) !important; color: var(--text-2) !important; border: 1px solid var(--border-strong) !important; }
.ghost:hover, .button:hover { background: var(--surface-3) !important; color: var(--text) !important; border-color: var(--border-strong) !important; }
.primary.button, a.primary.button, .button.primary { background: var(--brand) !important; color: #fff !important; border-color: var(--brand) !important; }
.primary.button:hover, a.primary.button:hover { background: var(--brand2) !important; border-color: var(--brand2) !important; color: #fff !important; }
.danger { background: var(--surface) !important; color: var(--danger) !important; border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--border)) !important; }
.danger:hover { background: color-mix(in srgb, var(--danger) 8%, var(--surface)) !important; }
.btn-sm, .primary.btn-sm, .ghost.btn-sm, .button.btn-sm { min-height: 28px !important; padding: 3px 10px !important; font-size: .85rem !important; }
button:disabled, .primary:disabled, .ghost:disabled, [aria-disabled="true"] { opacity: .5 !important; cursor: not-allowed !important; }
.shine-btn::after, .ripple { display: none !important; }
.link-danger { color: var(--danger); font-weight: 600; }
.action-link { font-weight: 600; text-decoration: none; }
.action-link:hover { text-decoration: underline; }

/* ---------- forms --------------------------------------------------------------------------- */
input, select, textarea, .filters input, .filters select {
    border: 1px solid var(--border-strong) !important; border-radius: var(--radius-sm) !important;
    background: var(--surface) !important; color: var(--text); padding: 6px 10px !important; min-height: 34px;
    font-size: .93rem; box-shadow: none;
}
input[type="checkbox"], input[type="radio"] { min-height: 0; padding: 0 !important; accent-color: var(--brand); width: 16px; height: 16px; }
input[type="file"] { padding: 4px 6px !important; background: var(--surface-3) !important; }
input:focus, select:focus, textarea:focus { border-color: var(--brand) !important; box-shadow: var(--focus) !important; background: var(--surface) !important; }
input[readonly], .readonly-price { background: var(--surface-3) !important; color: var(--muted); }
label { gap: 5px !important; font-weight: 600 !important; font-size: .88rem; color: var(--text-2) !important; }
label small, label .muted { font-weight: 400 !important; }
label.field-focused { color: var(--text-2) !important; }
.check, label.check { display: flex !important; align-items: center; gap: 8px !important; font-weight: 500 !important; }
textarea { min-height: 84px; }
.form-grid { gap: 14px 16px; }
.money-input, .input-suffix, .locked-field, .password-wrap {
    border: 1px solid var(--border-strong) !important; border-radius: var(--radius-sm) !important; background: var(--surface) !important; min-height: 34px;
}
.money-input:focus-within, .input-suffix:focus-within { border-color: var(--brand) !important; box-shadow: var(--focus); }
.money-input input, .input-suffix input, .locked-field input { border: 0 !important; box-shadow: none !important; min-height: 32px; }
.money-input > span, .input-suffix > span { color: var(--muted) !important; font-weight: 600 !important; font-size: .85rem; padding: 0 10px !important; background: var(--surface-3); align-self: stretch; display: flex; align-items: center; }
.price-main input { font-size: 1.15rem !important; font-weight: 700 !important; color: var(--text) !important; }
.field-error { color: var(--danger); font-size: .85rem; }
.form-section {
    background: none !important; border: 0 !important; border-bottom: 1px solid var(--border) !important; border-radius: 0 !important;
    padding: 6px 0 8px !important; margin-top: 8px;
}
.form-section strong { font-size: 1rem; font-weight: 650; }
.form-section small { font-size: .82rem; }
.section-icon { width: 28px !important; height: 28px !important; border-radius: var(--radius-sm) !important; background: var(--brand-soft) !important; color: var(--brand) !important; font-size: .9rem; }
.premium-check { border-radius: var(--radius-sm) !important; background: var(--surface-3) !important; padding: 9px 12px !important; }
.switch-track { background: var(--border-strong) !important; }
.pricing-switch input:checked + .switch-track { background: var(--brand) !important; }
.sticky-actions {
    border-radius: var(--radius) !important; background: var(--surface) !important; backdrop-filter: none !important;
    box-shadow: 0 -1px 0 var(--border), var(--shadow-pop) !important; padding: 10px 14px !important; bottom: 10px;
}
.save-hint > span { border-radius: 50% !important; background: var(--brand-soft) !important; color: var(--brand) !important; }
.smart-search { background: var(--surface) !important; border: 1px solid var(--border-strong) !important; border-radius: var(--radius-sm) !important; min-height: 34px; }
.smart-search:focus-within { box-shadow: var(--focus) !important; border-color: var(--brand) !important; }
.smart-search input { border: 0 !important; box-shadow: none !important; }
.filters { padding: 10px !important; gap: 8px !important; margin-bottom: 12px; }
.filters input { min-width: 220px; }
.inline-form { gap: 8px; }

/* ---------- badges & statuses ------------------------------------------------------------- */
.st-badge, .badge, .status-badge, .margin-badge, .count-pill {
    display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px !important; border-radius: 999px !important;
    font-size: .76rem !important; font-weight: 600 !important; line-height: 1.5; white-space: nowrap; border: 1px solid transparent;
}
.count-pill { background: var(--surface-3); color: var(--muted); border-color: var(--border); }
.tone-success { background: #ecfdf3 !important; color: #067647 !important; border-color: #abefc6 !important; }
.tone-info { background: #eff8ff !important; color: #175cd3 !important; border-color: #b2ddff !important; }
.tone-warning { background: #fffaeb !important; color: #b54708 !important; border-color: #fedf89 !important; }
.tone-danger { background: #fef3f2 !important; color: #b42318 !important; border-color: #fecdca !important; }
.tone-neutral { background: #f2f4f7 !important; color: #475467 !important; border-color: #e4e7ec !important; }
.dark .tone-success { background: rgba(71, 205, 137, .12) !important; color: #75e0a7 !important; border-color: rgba(71, 205, 137, .3) !important; }
.dark .tone-info { background: rgba(132, 173, 255, .12) !important; color: #a4c3ff !important; border-color: rgba(132, 173, 255, .3) !important; }
.dark .tone-warning { background: rgba(253, 176, 34, .12) !important; color: #fec84b !important; border-color: rgba(253, 176, 34, .3) !important; }
.dark .tone-danger { background: rgba(249, 112, 102, .12) !important; color: #fda29b !important; border-color: rgba(249, 112, 102, .3) !important; }
.dark .tone-neutral { background: rgba(152, 162, 179, .12) !important; color: #cbd2da !important; border-color: rgba(152, 162, 179, .25) !important; }
.text-good { color: var(--success) !important; }
.text-bad { color: var(--danger) !important; }
.text-warn { color: var(--warning) !important; }

/* ---------- KPIs & dashboard ---------------------------------------------------------------- */
.kpi-grid { gap: 10px !important; }
.kpi, .metric-card { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--radius) !important; box-shadow: var(--shadow) !important; padding: 12px 14px !important; }
.kpi small, .metric-card small { color: var(--muted) !important; font-size: .78rem !important; font-weight: 600; text-transform: none; letter-spacing: 0; }
.kpi strong, .metric-card strong { font-size: 1.35rem !important; font-weight: 700 !important; letter-spacing: -.01em; color: var(--text); }
a.kpi:hover { border-color: var(--brand) !important; transform: none !important; }
.metric-card { min-height: 0 !important; }
.metric-icon { width: 36px !important; height: 36px !important; border-radius: var(--radius-sm) !important; background: var(--brand-soft) !important; color: var(--brand) !important; font-size: 1rem !important; }
.quick-grid a, .quick-card { border-radius: var(--radius) !important; background: var(--surface) !important; transform: none !important; }
.todo-list li a { border-radius: var(--radius-sm) !important; }
.work-tab { border-radius: var(--radius-sm) !important; }
.work-tab.active { background: var(--brand-soft) !important; color: var(--brand) !important; border-color: color-mix(in srgb, var(--brand) 35%, var(--border)) !important; }

/* ---------- feedback ---------------------------------------------------------------------------- */
.toast-alert { top: 66px !important; border-radius: var(--radius) !important; box-shadow: var(--shadow-pop) !important; padding: 10px 12px !important; inset-inline-end: 20px; }
.toast-alert > span { width: 26px !important; height: 26px !important; border-radius: 50% !important; font-size: .85rem; }
.toast-alert strong { font-size: .92rem; }
.toast-alert p { font-size: .88rem; }
.hint-box, .attention-box, .void-banner, .estimate-note {
    border-radius: var(--radius-sm) !important; padding: 10px 12px !important; font-size: .9rem;
}
.hint-box { background: #eff8ff !important; border: 1px solid #b2ddff !important; color: #1849a9 !important; }
.attention-box { background: #fffaeb !important; border: 1px solid #fedf89 !important; color: #93370d !important; }
.dark .hint-box { background: rgba(132, 173, 255, .1) !important; border-color: rgba(132, 173, 255, .3) !important; color: #c3d7ff !important; }
.dark .attention-box { background: rgba(253, 176, 34, .1) !important; border-color: rgba(253, 176, 34, .3) !important; color: #fedf89 !important; }
.empty-state, .empty-panel { text-align: center; padding: 36px 20px !important; color: var(--muted); }
.empty-panel { display: grid; justify-items: center; gap: 6px; }
.empty-panel strong { color: var(--text); }
.empty-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); margin-bottom: 4px; }

/* ---------- lists, money, misc --------------------------------------------------------------- */
.mini-list li { border-radius: var(--radius-sm) !important; background: var(--surface-3) !important; padding: 8px 10px !important; }
.money-table td { padding: 7px 4px !important; }
.money-table tr.total td { font-weight: 700; }
.compact-pagination { gap: 4px !important; }
.page-control, .page-number { height: 30px !important; min-width: 30px !important; border-radius: var(--radius-sm) !important; box-shadow: none !important; font-weight: 600 !important; transform: none !important; }
.page-number.active { background: var(--brand) !important; color: #fff !important; border-color: var(--brand) !important; }
.modal-box, dialog.erp-dialog { border-radius: var(--radius) !important; box-shadow: var(--shadow-pop) !important; border: 1px solid var(--border) !important; }
.timeline .dot { box-shadow: none !important; }
details > summary { cursor: pointer; }

/* ---------- articles: list view, photos, stock -------------------------------------------- */
.product-grid { gap: 10px !important; }
.product-card { padding: 12px !important; display: flex; flex-direction: column; gap: 4px; }
.product-card h3 { font-size: .95rem !important; font-weight: 600; margin: 4px 0 2px; }
.product-thumb { width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); background: var(--surface-3); display: grid; place-items: center; overflow: hidden; color: var(--border-strong); margin-bottom: 6px; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.price { font-size: 1.05rem !important; font-weight: 700 !important; color: var(--text) !important; }
.view-switch { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.view-switch a { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: .85rem; background: var(--surface); }
.view-switch a + a { border-inline-start: 1px solid var(--border-strong); }
.view-switch a.active { background: var(--brand-soft); color: var(--brand); }
.list-thumb { width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--surface-3); display: grid; place-items: center; overflow: hidden; color: var(--border-strong); }
.list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.products-table td { padding-top: 6px !important; padding-bottom: 6px !important; }
.products-table .title-cell a { font-weight: 600; text-decoration: none; color: var(--text); }
.products-table .title-cell a:hover { color: var(--brand); }
.stock-pill { font-variant-numeric: tabular-nums; }
.results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 8px; }
.results-toolbar .result-meta { margin: 0 !important; }
.export-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.export-bar .ghost, .export-bar select { min-height: 30px !important; padding-top: 3px !important; padding-bottom: 3px !important; font-size: .85rem !important; }
.row-actions { display: inline-flex; gap: 4px; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
/* Action links of a table row stay on one line: a narrow screen scrolls the table, rows never get tall. */
.table-actions { display: flex !important; flex-wrap: nowrap !important; gap: 4px 10px !important; align-items: center; white-space: nowrap; }
.table-actions form { margin: 0; }
.row-actions form { margin: 0; }
.products-table tr.is-inactive td { color: var(--muted); }
.products-table tr:has(.product-select-checkbox:checked) { background: var(--brand-soft) !important; }
.product-card.is-selected { border-color: var(--brand) !important; box-shadow: var(--focus) !important; }
.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; }

/* ---------- article form: section bar --------------------------------------------------------- */
.form-tabs { position: sticky; top: 56px; z-index: 9; display: flex; gap: 2px; flex-wrap: wrap; padding: 6px; margin: -4px 0 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-tabs a { padding: 5px 10px; border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none; font-weight: 600; font-size: .86rem; }
.form-tabs a:hover { background: var(--surface-3); color: var(--text); }
#sec-identity, #photos, #variantsFeature, #sec-prices, #sec-pack, #priceHistory { scroll-margin-top: 112px; }

/* ---------- global search page ---------------------------------------------------------------- */
.search-page-form { display: flex; gap: 8px; align-items: center; padding: 10px !important; }
.search-page-form .smart-search { flex: 1; padding: 0 10px; gap: 8px; color: var(--muted); }
.search-results { list-style: none; margin: 0; padding: 0; display: grid; }
.search-results li + li { border-top: 1px solid var(--border); }
.search-results a { display: flex; align-items: center; gap: 12px; padding: 8px 4px; text-decoration: none; color: var(--text); border-radius: var(--radius-sm); }
.search-results a:hover { background: var(--surface-3); }
.search-results img, .search-thumb { width: 36px; height: 36px; border-radius: var(--radius-sm); object-fit: cover; flex: 0 0 auto; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); }
.search-text { display: grid; min-width: 0; flex: 1; }
.search-text strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-text small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-link { display: none !important; }

/* ---------- login ------------------------------------------------------------------------------ */
.login-page { background: var(--bg) !important; }
.login-decoration { display: none !important; }
.login-card { border-radius: 12px !important; box-shadow: var(--shadow-pop) !important; backdrop-filter: none !important; background: var(--surface) !important; border: 1px solid var(--border) !important; animation: none !important; }
.login-logo { border-radius: 12px !important; box-shadow: none !important; border: 1px solid var(--border); width: 80px !important; height: 80px !important; }
.login-logo img { width: 66px !important; }
.remember-row { border-radius: var(--radius-sm) !important; background: var(--surface-3) !important; }

/* ---------- dashboard (2026-10-29): today tiles, period, cards, charts, activity -------------- */
.dash-head { align-items: center; }
.dash-tiles-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; margin-bottom: 14px; }
.dash-tile {
    position: relative; display: grid; gap: 2px; align-content: start; padding: 12px 14px 12px 14px; min-height: 104px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    color: var(--text); text-decoration: none; transition: border-color .12s ease;
}
.dash-tile:hover { border-color: var(--brand); color: var(--text); }
.dash-tile-ico { width: 30px; height: 30px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--surface-3); color: var(--muted); margin-bottom: 4px; }
.dash-tile-label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.dash-tile strong { font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.dash-tile strong i { font-style: normal; font-size: .8rem; color: var(--muted); font-weight: 600; }
.dash-tile small { color: var(--muted); font-size: .8rem; }
/* the tone colours only the top edge and the icon: calm cards, the state readable at a glance */
.dash-tile.tone-good, .dash-tile.tone-info, .dash-tile.tone-warning, .dash-tile.tone-danger { background: var(--surface) !important; border-color: var(--border) !important; color: var(--text) !important; }
.dash-tile.tone-good { box-shadow: inset 0 3px 0 var(--success), var(--shadow) !important; }
.dash-tile.tone-info { box-shadow: inset 0 3px 0 var(--info), var(--shadow) !important; }
.dash-tile.tone-warning { box-shadow: inset 0 3px 0 var(--warning), var(--shadow) !important; }
.dash-tile.tone-danger { box-shadow: inset 0 3px 0 var(--danger), var(--shadow) !important; }
.dash-tile.tone-good .dash-tile-ico { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }
.dash-tile.tone-info .dash-tile-ico { background: color-mix(in srgb, var(--info) 12%, transparent); color: var(--info); }
.dash-tile.tone-warning .dash-tile-ico { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); }
.dash-tile:hover { border-color: var(--brand) !important; }

.dash-period { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 18px 0 12px; }
.seg-tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg-tabs a { padding: 6px 12px; font-weight: 600; font-size: .88rem; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.seg-tabs a + a { border-inline-start: 1px solid var(--border); }
.seg-tabs a:hover { background: var(--surface-3); color: var(--text); }
.seg-tabs a.active { background: var(--brand); color: #fff; }
.dash-period-custom { display: inline-flex; align-items: center; gap: 6px; }
.dash-period-custom input[type="date"] { min-height: 32px; padding: 4px 8px !important; }
.dash-period-custom .ghost.active { border-color: var(--brand) !important; color: var(--brand) !important; }
.dash-period-label { color: var(--muted); font-size: .88rem; margin-inline-start: auto; }

.kpi-grid.dash-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.kpi-grid.dash-kpis.compact .kpi strong { font-size: 1.2rem !important; }
.kpi { position: relative; display: grid; gap: 2px; align-content: start; text-decoration: none; color: var(--text); }
.kpi small { display: flex; align-items: center; gap: 6px; }
.kpi .kpi-ico { color: var(--muted); display: inline-flex; }
.kpi strong i { font-style: normal; font-size: .78rem; color: var(--muted); font-weight: 600; }
.kpi .sub { color: var(--muted); font-size: .8rem; }
.kpi .trend { font-size: .78rem; font-weight: 600; }
.kpi .trend.up { color: var(--success); }
.kpi .trend.down { color: var(--danger); }
.kpi .trend.flat { color: var(--muted); }
.kpi.good { box-shadow: inset 3px 0 0 var(--success), var(--shadow) !important; }
.kpi.bad { box-shadow: inset 3px 0 0 var(--danger), var(--shadow) !important; }
.kpi.warn { box-shadow: inset 3px 0 0 var(--warning), var(--shadow) !important; }
[dir="rtl"] .kpi.good { box-shadow: inset -3px 0 0 var(--success), var(--shadow) !important; }
[dir="rtl"] .kpi.bad { box-shadow: inset -3px 0 0 var(--danger), var(--shadow) !important; }
[dir="rtl"] .kpi.warn { box-shadow: inset -3px 0 0 var(--warning), var(--shadow) !important; }
a.kpi.kpi-link:hover { border-color: var(--brand) !important; color: var(--text); }
.kpi .estimate { font-size: .74rem; color: var(--warning); font-weight: 600; }
.dash-note { margin: 8px 0 0; font-size: .85rem; color: var(--warning); }

.dash-grid-charts { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 14px; }
.dash-grid-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 14px; }
.dash-grid-two > .panel { margin-bottom: 0; }
.chart-card { padding: 14px !important; min-width: 0; }
.chart-card-title { font-weight: 650; font-size: .95rem; margin-bottom: 10px; color: var(--text); }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 8px; font-size: .8rem; color: var(--muted); }
.chart-legend .sw { display: inline-block; width: 12px; height: 4px; border-radius: 2px; margin-inline-end: 6px; vertical-align: middle; }
.chart-legend .sw.dashed { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px); }
.chart-legend .trend.up { color: var(--success); font-weight: 600; }
.chart-legend .trend.down { color: var(--danger); font-weight: 600; }
.gbars { display: grid; gap: 12px; }
.gbar-row { display: grid; grid-template-columns: minmax(80px, 30%) 1fr auto; gap: 10px; align-items: center; }
.gbar-label { font-size: .85rem; font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gbar-tracks { display: grid; gap: 3px; }
.gbar { height: 10px; border-radius: 3px; min-width: 2px; }
.gbar.cur { background: var(--brand); }
.gbar.prev { background: color-mix(in srgb, var(--muted) 45%, transparent); height: 6px; }
.gbar-value { display: grid; text-align: end; font-variant-numeric: tabular-nums; font-size: .82rem; }
.gbar-value small { color: var(--muted); font-size: .74rem; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.stat-row > * { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-3); text-decoration: none; color: var(--text); }
.stat-row > a:hover { border-color: var(--brand); }
.stat-row small { color: var(--muted); font-size: .76rem; font-weight: 600; }
.stat-row strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.stat-row .is-bad strong { color: var(--danger); }
.stat-row .is-warn strong { color: var(--warning); }
.panel-sub { margin: 14px 0 8px; font-size: .88rem !important; color: var(--text-2); }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mini-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.activity-list { list-style: none; margin: 0; padding: 0; display: grid; }
.activity-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 2px; }
.activity-list li + li { border-top: 1px solid var(--border); }
.activity-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.activity-ico.tone-good { background: color-mix(in srgb, var(--success) 12%, transparent) !important; color: var(--success) !important; border: 0 !important; padding: 0 !important; }
.activity-ico.tone-info { background: color-mix(in srgb, var(--info) 12%, transparent) !important; color: var(--info) !important; border: 0 !important; padding: 0 !important; }
.activity-ico.tone-bad { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.activity-text { display: grid; min-width: 0; }
.activity-text a, .activity-text strong { font-weight: 600; color: var(--text); text-decoration: none; }
.activity-text a:hover { color: var(--brand); }
.activity-text small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-meta { display: grid; justify-items: end; font-variant-numeric: tabular-nums; }
.activity-meta small { color: var(--muted); font-size: .76rem; }
.dash-caisse { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-top: 14px; }
.dash-caisse-me, .dash-caisse-all { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); font-size: .8rem; color: var(--text-2); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .88rem; }
.status-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.status-pill.online i { background: #12b76a; }

/* ---------- inline confirmation (Receipts: confirm a courier closure) ------------------------ */
.confirm-pop { position: relative; display: inline-block; }
.confirm-pop > summary { list-style: none; }
.confirm-pop > summary::-webkit-details-marker { display: none; }
.confirm-pop-body {
    position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 30; width: 270px; display: grid; gap: 8px;
    padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); white-space: normal; text-align: start;
}
.confirm-pop-body label { display: grid; font-size: .82rem; }
.confirm-pop-amount { margin: 0; font-size: .9rem; }
.confirm-pop-amount strong { font-size: 1.1rem; }
.recette-card .confirm-pop-body { inset-inline-start: 0; inset-inline-end: auto; }
/* (an open confirmation is placed in the window by the layout script: never cut by a scrolling table) */
#ecarts { scroll-margin-top: 70px; }
.gap-head { margin-top: 14px; }

/* ---------- sortable tables, tool links, result lists (2026-10-29) ----------------------------- */
th.sortable a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
th.sortable a:hover { color: var(--brand); }
th.sortable .sort-ind { font-size: .7rem; color: var(--border-strong); }
th.sortable.is-sorted .sort-ind { color: var(--brand); }
th.sortable.num a { justify-content: flex-end; width: 100%; }
.tool-links { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.tool-links a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); text-decoration: none; font-weight: 600; font-size: .86rem; }
.tool-links a:hover { border-color: var(--brand); color: var(--brand); }
.pack-search-result.is-active, .customer-option.is-active { background: var(--brand-soft) !important; outline: 1px solid color-mix(in srgb, var(--brand) 40%, transparent); }
.result-meta { font-size: .85rem; }
/* formula explanations under money lines: hidden (the figures stay; the definitions are in the tooltips) */
.money-table .why { display: none !important; }
.more-fields > summary { font-weight: 600; color: var(--text-2); padding: 6px 0; }

/* ---------- sale documents form ------------------------------------------------------------- */
.doc-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.doc-form-grid > div:last-child { position: sticky; top: 72px; display: grid; gap: 0; }
.form-grid.one-col { grid-template-columns: 1fr !important; }
.doc-lines { width: 100%; }
.doc-lines td { vertical-align: top !important; }
.doc-lines input { width: 100%; }
.doc-lines .customer-combobox { position: relative; }
.doc-lines .customer-options { position: absolute; z-index: 20; inset-inline: 0; top: 100%; max-height: 260px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); }
.doc-lines-wrap { overflow: visible !important; }
.line-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; font-size: .78rem; }
.line-meta .details-toggle { color: var(--muted); text-decoration: none; }
.line-meta .details-toggle:hover { color: var(--brand); }
.details-input { margin-top: 6px; min-height: 52px !important; width: 100%; font-size: .88rem; }
.doc-totals .totals-box .row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.doc-totals .totals-box .row.grand { border-bottom: 0; font-size: 1.15rem; }
.doc-totals .totals-box .row.grand strong { font-size: 1.35rem; color: var(--brand); }
.submit-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.supplier-field { display: grid; gap: 6px; }

/* ---------- label printing options (POS-80 / PDF) ------------------------------------------------ */
.label-options { display: grid; gap: 10px; }
.label-options[hidden] { display: none !important; }
.label-options-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.label-options-row > label { min-width: 0; }
.label-options-row[hidden] { display: none !important; }
.label-options-row select, .label-options-row input { width: 100%; min-width: 0; text-overflow: ellipsis; }
.label-options-row > label[hidden] { display: none !important; }
.label-options-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.label-options-fit { margin: -4px 0 0; font-size: .82rem; }
.label-options-checks .check { font-weight: 500 !important; }

/* ---------- ticket logo preview (Company settings) ---------------------------------------------- */
.ticket-logo-preview { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.ticket-logo-paper { width: 80mm; max-width: 100%; display: grid; justify-items: center; gap: 4px; padding: 10px 8px; background: #fff; color: #000; border: 1px dashed var(--border-strong); border-radius: 4px; }
.ticket-logo-paper img { max-width: 100%; image-rendering: pixelated; }
.ticket-logo-paper strong { font-size: .95rem; }
.ticket-logo-paper small { color: #667085; font-size: .75rem; }

/* ---------- caisse additions ------------------------------------------------------------------ */
.pos-pay-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 10px 0 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand); }
.pos-pay-total span { font-weight: 600; font-size: .9rem; }
.pos-pay-total strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.pos-confirm-btn kbd { font: 600 .68rem var(--font); border: 1px solid rgba(255, 255, 255, .5); border-radius: 4px; padding: 0 4px; margin-inline-start: 6px; opacity: .85; }
.pos-recent { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; }
.pos-recent > summary { font-size: .86rem; color: var(--text-2); }
.pos-recent .mini-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.pos-recent .mini-list li small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-recent .mini-list li.is-voided { opacity: .55; text-decoration: line-through; }

/* ---------- responsive ------------------------------------------------------------------------ */
@media (max-width: 1100px) {
    .doc-form-grid { grid-template-columns: minmax(0, 1fr); }
    .doc-form-grid > div:last-child { position: static; }
}
@media (max-width: 700px) {
    .doc-lines thead { display: none; }
    .doc-lines, .doc-lines tbody, .doc-lines tr, .doc-lines td { display: block; width: 100%; }
    .doc-lines tr.doc-line { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--border); }
    .doc-lines tr.doc-line td { border: 0 !important; padding: 0 !important; }
    .doc-lines tr.doc-line td:first-child { grid-column: 1 / -1; }
}
@media (max-width: 1200px) {
    .dash-grid-charts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .dash-grid-charts > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 850px) {
    .dash-grid-charts, .dash-grid-two { grid-template-columns: minmax(0, 1fr); }
    .dash-period-label { margin-inline-start: 0; width: 100%; }
}
@media (max-width: 560px) {
    .dash-tiles-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-tile strong { font-size: 1.2rem; }
    .seg-tabs { width: 100%; overflow-x: auto; }
    .seg-tabs a { flex: 1 0 auto; text-align: center; }
    .dash-period-custom { width: 100%; }
    .dash-period-custom input[type="date"] { flex: 1; min-width: 0; }
    .kpi-grid.dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .confirm-pop-body { position: fixed; inset: auto 12px 12px 12px; width: auto; }
}
@media (max-width: 1600px) {
    .user-chip div { display: none; }
    .user-chip { padding: 2px; }
    .global-search { flex-basis: 300px; }
}
@media (max-width: 1200px) {
    .global-search { max-width: 260px; min-width: 160px; }
    .global-search kbd { display: none; }
}
@media (max-width: 1000px) {
    .header-logo { display: none !important; }
    .quick-sale span { display: none; }
    .quick-sale { padding: 0 9px !important; }
    .global-search { flex-basis: 220px; min-width: 140px; }
    .topbar-crumbs { min-width: 90px; }
}
@media (max-width: 850px) {
    .sidebar { box-shadow: var(--shadow-pop) !important; }
    .topbar-crumbs .crumb-group, .topbar-crumbs .crumb-group + .crumb-sep { display: none; }
    .content-shell { padding: 14px 12px 40px; }
}
@media (max-width: 700px) {
    .global-search { display: none; }
    .search-link { display: grid !important; }
    .header-logo { display: none; }
    .quick-sale span { display: none; }
    .quick-sale { padding: 0 9px !important; }
    .page-head h1 { font-size: 1.3rem !important; }
    .head-actions { justify-content: flex-start; }
    .form-tabs { top: 56px; overflow-x: auto; flex-wrap: nowrap; }
    .products-table .hide-sm { display: none; }
    .app-topbar { padding: 0 10px !important; gap: 6px; }
    .user-chip, #themeToggle, .topbar-crumbs .crumb-item, .topbar-crumbs .crumb-item + .crumb-sep { display: none !important; }
    .topbar-crumbs { flex: 1 1 auto; font-size: .9rem; }
    .topbar-actions { gap: 2px !important; }
    .filters { display: grid !important; grid-template-columns: 1fr 1fr; }
    .filters > .smart-search, .filters > input[type="search"], .filters > a, .filters > button { grid-column: 1 / -1; }
    .filters input, .filters select { min-width: 0 !important; width: 100%; }
    .results-toolbar { flex-wrap: wrap; }
}

/* ---------- print -------------------------------------------------------------------------------- */
@media print {
    .global-search, .user-chip, .topbar-crumbs, .form-tabs { display: none !important; }
    body { background: #fff; }
    .panel, .card, .table-wrap { box-shadow: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    .nav-group-head .nav-chevron { transition: none; }
}
