:root,
html[data-theme="sneat"] {
    --sidebar: #ffffff;
    --sidebar-text: #444050;
    --brand: #444050;
    --accent: #696cff;
    --accent-dark: #5f61e6;
    --line: #e6e6e8;
    --paper: #f5f5f9;
    --ink: #444050;
    --muted: #6d6b77;
    --surface: #ffffff;
    --head: #fafafb;
    --row-hover: #f8f7fa;
    --slate: #eaeaec;
    --slate-dark: #dedee0;
    --slate-ink: #444050;
    --code: #696cff;
    --code-bg: rgba(105, 108, 255, 0.12);
    --nav-hover: rgba(47, 43, 61, 0.06);
    --nav-active: #696cff;
    --nav-active-bg: rgba(105, 108, 255, 0.16);
    --radius-btn: 0.375rem;
    --radius-panel: 0.5rem;
    --shadow: 0 0.125rem 0.5rem rgba(47, 43, 61, 0.08);
    --login-bg: #f5f5f9;
}
html[data-theme="sneat-dark"] {
    --sidebar: #2f3349;
    --sidebar-text: #cfd3ec;
    --brand: #cfd3ec;
    --accent: #696cff;
    --accent-dark: #5f61e6;
    --line: #434968;
    --paper: #25293c;
    --ink: #cfd3ec;
    --muted: #acabc1;
    --surface: #2f3349;
    --head: #2b3048;
    --row-hover: rgba(234, 234, 255, 0.06);
    --slate: #3b3f5c;
    --slate-dark: #32364f;
    --slate-ink: #cfd3ec;
    --code: #b4b7ff;
    --code-bg: rgba(105, 108, 255, 0.16);
    --nav-hover: rgba(234, 234, 255, 0.06);
    --nav-active: #696cff;
    --nav-active-bg: rgba(105, 108, 255, 0.16);
    --radius-btn: 0.375rem;
    --radius-panel: 0.5rem;
    --shadow: 0 0.125rem 0.5rem rgba(19, 17, 32, 0.35);
    --login-bg: #25293c;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
    background: var(--paper);
    color: var(--ink);
    letter-spacing: -0.011em;
}

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: var(--sidebar);
    color: var(--sidebar-text);
    flex: none;
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    border-right: 1px solid var(--line);
}

.sidebar-brand {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    color: var(--brand, #fff);
    padding: 0.85rem 0.85rem 1.1rem;
    display: flex;
    gap: 0.65rem;
    align-items: center;
}
.sidebar-brand i { color: var(--accent); }

.nav-link-portal {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
    border-radius: 0.375rem;
    padding: 0.55rem 0.85rem;
    margin-bottom: 0.15rem;
    font-weight: 500;
}

.nav-link-portal:hover { background: var(--nav-hover); color: var(--sidebar-text); }
.nav-link-portal.active { background: var(--nav-active-bg); color: var(--nav-active); }
html[data-theme="sneat"] .btn-slate,
html[data-theme="sneat"] .btn-outline-secondary { color: var(--slate-ink); box-shadow: none; }
html[data-theme="sneat"] .btn-slate:hover,
html[data-theme="sneat"] .btn-outline-secondary:hover { color: var(--slate-ink); transform: none; }
html[data-theme="sneat"] .btn-portal,
html[data-theme="sneat-dark"] .btn-portal { box-shadow: 0 0.125rem 0.25rem rgba(105, 108, 255, 0.4); }
html[data-theme="sneat"] .btn-portal:hover,
html[data-theme="sneat-dark"] .btn-portal:hover { transform: none; box-shadow: 0 0.25rem 0.5rem rgba(105, 108, 255, 0.4); }
html[data-theme="sneat"] .panel .table thead th,
html[data-theme="sneat-dark"] .panel .table thead th { text-transform: none; letter-spacing: 0; font-size: 0.84rem; font-weight: 600; }
html[data-theme="sneat"] .panel .table-responsive > .table thead th,
html[data-theme="sneat-dark"] .panel .table-responsive > .table thead th { font-size: 0.95rem; font-weight: 700; color: #fff; }
html[data-theme="sneat"] .login-card,
html[data-theme="sneat-dark"] .login-card { box-shadow: var(--shadow); }
html[data-theme="sneat-dark"] .btn-slate,
html[data-theme="sneat-dark"] .btn-outline-secondary { color: var(--slate-ink); box-shadow: none; }
html[data-theme="sneat-dark"] .btn-slate:hover,
html[data-theme="sneat-dark"] .btn-outline-secondary:hover { color: var(--slate-ink); transform: none; }
html[data-theme="sneat-dark"] .dropdown-menu { background: var(--surface); color: var(--ink); border-color: var(--line); }
html[data-theme="sneat-dark"] .dropdown-item { color: var(--ink); }
html[data-theme="sneat-dark"] .dropdown-item:hover { background: var(--row-hover); color: var(--ink); }
.sidebar-children { padding-left: 0.85rem; display: none; }
.sidebar-group.open .sidebar-children { display: block; }
.sidebar-group.open .chevron { transform: rotate(180deg); }
.chevron { font-size: 0.75rem; }

.app-column { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.4rem;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    backdrop-filter: blur(10px);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.topbar-title { font-weight: 700; }
.topbar-crumb { color: var(--muted); font-size: 0.85rem; }
.icon-btn {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    border-radius: 0.6rem;
    width: 2.4rem;
    height: 2.4rem;
}
.user-chip {
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.user-meta { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.user-meta small { color: var(--muted); }
.user-chip { color: var(--ink); }
.avatar {
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 700;
}
.content { padding: 1.25rem; flex: 1; }
.app-footer {
    padding: 0.8rem 1.25rem;
    color: var(--muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--line);
    background: var(--surface);
}
.page-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1.15rem; flex-wrap: wrap; }
.visit-field { min-width: 12rem; margin-left: auto; }
.visit-field .form-control { background: var(--head); }
.page-title { font-size: 1.6rem; margin: 0; font-weight: 700; letter-spacing: -0.03em; }
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow);
    color: var(--ink);
}
.panel:has(.table) { overflow: hidden; }
.panel:has(> .table-responsive:first-child) { border-radius: 0.9rem; border-color: transparent; }
.filter-card {
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
    border-left: 4px solid var(--accent);
}
.doctor-banner {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1.15rem;
    padding: 1rem 1.25rem;
}
.doctor-banner .who, .doctor-banner .spec { display: flex; gap: .9rem; align-items: center; }
.doctor-banner .mark {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--accent) 14%, var(--surface));
    color: var(--accent);
    font-size: 1.25rem;
}
.doctor-banner .hello { color: var(--muted); font-weight: 700; }
.doctor-banner .name { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.doctor-banner .spec { text-align: right; }
.lab-out { color: #b91c1c !important; font-weight: 700; }
.lab-flag { color: #b91c1c; font-weight: 700; min-width: 1rem; }
.btn-portal { background: var(--accent); color: white; border: 0; }
.btn-portal:hover { background: var(--accent-dark); color: white; }
.module-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    padding: 1.1rem;
    text-decoration: none;
    color: inherit;
    min-height: 120px;
}
.module-card i { color: var(--accent); font-size: 1.4rem; }
.menu-order { list-style: none; padding: 0; margin: 0; }
.menu-slot { margin-bottom: 0.5rem; }
.menu-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-btn);
    color: var(--ink);
    padding: 0.55rem 0.75rem;
}
.panel .table-responsive > .table tbody tr.sale-head > * { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); font-weight: 700; }
.panel .table-responsive > .table tbody tr.sale-sub > * { font-weight: 700; }
.panel .table-responsive > .table tbody tr.sale-total > * { font-weight: 700; }
.menu-grip { cursor: grab; color: var(--muted); }
.menu-slot.is-dragging { opacity: 0.45; }
.menu-children { margin: 0.45rem 0 0 1.4rem; }
.login-body { min-height: 100vh; display: grid; place-items: center; background: var(--login-bg); }
.login-card { width: min(420px, calc(100% - 2rem)); background: white; border-radius: 1.15rem; padding: 1.7rem; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28); }
.login-brand { font-weight: 700; color: var(--accent); margin-bottom: 0.8rem; }
.sidebar-backdrop { display: none; }
.btn-portal, .btn-primary, .btn-info, .btn-success, .btn-warning, .btn-slate, .btn-danger, .btn-outline-secondary, .btn-outline-danger {
    border: 0;
    font-weight: 600;
    border-radius: var(--radius-btn);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 2px rgba(16, 24, 40, 0.08);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-portal, .btn-slate, .btn-danger { color: #fff; }
.btn-portal:hover, .btn-primary:hover, .btn-info:hover, .btn-success:hover, .btn-warning:hover, .btn-slate:hover, .btn-danger:hover,
.btn-outline-secondary:hover, .btn-outline-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.12);
}
.btn-slate, .btn-outline-secondary { background: var(--slate); color: var(--slate-ink, #fff); }
.btn-slate:hover, .btn-outline-secondary:hover { background: var(--slate-dark); color: var(--slate-ink, #fff); }
.btn-danger, .btn-outline-danger { background: #e11d48; color: #fff; }
.btn-danger:hover, .btn-outline-danger:hover { background: #be123c; color: #fff; }
.btn:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn:not(.btn-icon) > i:not(.me-1):not(.me-2):not(.me-3) { margin-inline-end: 0.25rem; }
.btn-icon {
    width: 2.05rem;
    height: 2.05rem;
    padding: 0;
    border-radius: calc(var(--radius-btn) - 0.05rem);
}
.quote-grid { table-layout: fixed; }
.quote-grid .quote-qty { width: 10.5rem; }
.quote-grid .quote-off { width: 7rem; }
.quote-grid .quote-total { width: 6.5rem; }
.quote-grid .quote-act { width: 2.75rem; }
.quote-grid .form-control, .quote-grid .input-group { min-width: 0; }
.quote-grid .input-group-text { padding-left: .4rem; padding-right: .4rem; }
.grid-actions { width: 1%; white-space: nowrap; }
.panel .table-responsive > .table thead th.col-check,
.panel .table-responsive > .table tbody td.col-check { width: 1%; white-space: nowrap; padding-left: 0.45rem; padding-right: 0.25rem; }
.panel .table .sale-toggle { width: 1.35rem; height: 1.35rem; }
.pos-ticket {
    box-sizing: content-box;
    width: 36ch;
    max-width: calc(100% - 1.7rem);
    margin: 1rem auto 0;
    padding: 0.75rem 0.85rem;
    background: #fff;
    color: #111;
    font-family: Consolas, "Courier New", ui-monospace, monospace;
    font-size: 13px;
    line-height: 1.25;
    white-space: pre-wrap;
    border: 1px dashed #d0d5dd;
}
.pos-ticket > div { min-height: 1.25em; white-space: pre-wrap; font-weight: 400; }
.pos-ticket-lg { font-weight: 700; line-height: 1.45; }
.grid-actions .btn { margin-right: 0.3rem; }
.lab-cmds { display: grid; grid-template-columns: repeat(4, max-content); gap: 0.3rem; width: max-content; }
.lab-cmds .btn { margin-right: 0; }
.panel .table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--row-hover);
    --bs-table-color: var(--ink);
    margin-bottom: 0;
}
.panel .table > :not(caption) > * > * { border-bottom-color: #eef2f6; }
.panel .table thead th {
    background: var(--head);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #e8edf3;
    white-space: nowrap;
}
.panel .table tbody td { padding: 0.82rem 1rem; color: var(--ink); }
.panel .table tbody tr:last-child > * { border-bottom: 0; }
.panel .table.table-hover > tbody > tr:hover > *,
.panel .table > tbody > tr:hover > * { background: var(--row-hover); }
.panel .table-responsive > .table > :not(caption) > * > * { border-bottom: 0; }
.panel .table-responsive > .table thead th {
    background: var(--accent);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    padding: 0.5rem 1.05rem;
}
.panel .table-responsive > .table tbody td { background: var(--surface); }
.panel .table-responsive > .table tbody tr:nth-child(even) > * { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.panel .table-responsive > .table > tbody > tr:nth-child(n):hover > * { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 0.65rem; padding: 0.8rem 1rem; background: var(--head); border-top: 1px solid var(--line); color: var(--ink); }
.form-switch .form-check-input { width: 2.75em; height: 1.4em; }
.form-switch-yes .form-check-label { display: none; }
.form-switch-yes .form-check-input:checked { background-color: #16a34a; border-color: #16a34a; }
.form-control, .form-select {
    border-radius: var(--radius-btn);
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
    min-height: 2.55rem;
}

.panel .table-responsive > .table thead th:first-child {
    border-top-left-radius: 10px;
}

.panel .table-responsive > .table thead th:last-child {
    border-top-right-radius: 10px;
}

tbody#quick-lines {
    border: 1px solid #ccc;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
    background: var(--surface);
    color: var(--ink);
}
.form-select-sm, .form-control-sm { min-height: 2.15rem; border-radius: 0.55rem; }
.panel .table code { color: var(--code); background: var(--code-bg); border-radius: 0.4rem; padding: 0.12rem 0.4rem; font-size: 0.86em; }
.modal-content { border: 0; border-radius: var(--radius-panel); box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2); background: var(--surface); color: var(--ink); }
.doc-preview { height: 90vh; display: flex; flex-direction: column; }
.doc-preview .modal-header { justify-content: flex-start; }
.doc-preview .modal-title { flex: 1; min-width: 0; text-align: left; }
.doc-preview-actions { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; margin-left: auto; }
.doc-preview .modal-header .btn-close { margin: 0; }
.doc-preview-frame { flex: 1; width: 100%; border: 0; background: #fff; }
.theme-picker { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); }
.theme-picker select { min-height: 2.15rem; width: 8.2rem; padding-right: 1.6rem; }
.modal-header, .modal-footer { border-color: #eef2f6; }
.pager-label { color: #64748b; font-size: 0.85rem; }
.btn.disabled { opacity: 0.45; pointer-events: none; }
.brand-logo { height: 2.4rem; width: auto; max-width: 100%; object-fit: contain; }
.org-logo { width: 2rem; height: 2rem; object-fit: contain; border-radius: 0.45rem; background: #fff; }
body.sidebar-collapsed .brand-logo { width: 2rem; height: 2rem; }
.org-name { display: inline-flex; align-items: center; gap: 0.55rem; }
.logo-field { display: flex; align-items: center; gap: 0.9rem; }
.org-logo-preview { width: 72px; height: 72px; object-fit: contain; border-radius: 0.7rem; border: 1px solid var(--line); background: #fff; }
.semaphore { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 600; }
.semaphore i { font-size: 0.72rem; }
.sem-low { color: #0284c7; }
.sem-mid { color: #d97706; }
.sem-high { color: #15803d; }
.sem-critical { color: #dc2626; }
.stock-ok { color: #15803d; }
.branch-swatch { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 999px; vertical-align: -1px; border: 1px solid rgba(15, 23, 42, 0.15); }
.stock-warn { color: #b45309; font-weight: 700; }
.stock-alert { color: #be123c; font-weight: 700; }
.lab-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .9rem 1.25rem; margin: 0 0 1.25rem; }
.lab-facts dt { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0; }
.lab-facts dd { margin: .2rem 0 0; font-weight: 650; }
.lab-facts-sub { display: block; margin-top: .15rem; font-weight: 500; color: var(--muted); font-size: .85rem; }
.appt-state-slot { justify-self: end; text-align: right; }
.appt-state { font-size: .95rem; padding: .45rem .8rem; }
.appt-clip { max-width: 14rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-allergy { text-transform: uppercase; font-weight: 700; color: #dc2626; }
.appt-title { display: flex; align-items: center; gap: .45rem; }
.appt-title i { color: var(--accent); }
.appt-tabs { gap: .35rem; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius-panel) var(--radius-panel) 0 0; padding: .55rem .55rem 0; }
.appt-tabs .nav-link { border: 0; border-radius: .4rem .4rem 0 0; color: var(--muted); font-weight: 700; padding: .7rem 1.05rem; }
.appt-tabs .nav-link:hover { color: var(--ink); background: var(--nav-hover); }
.appt-tabs .nav-link.active { color: var(--nav-active); background: var(--nav-active-bg); box-shadow: inset 0 -3px 0 var(--accent); }
.appt-sheet { border-top-left-radius: 0; border-top-right-radius: 0; margin-top: 0; }
.quick-note { background: #e0f2fe; border: 1px solid #7dd3fc; border-radius: .5rem; padding: .75rem 1rem; color: #0c4a6e; }
.appt-chart svg { width: 100%; height: 150px; display: block; }
.appt-chart polyline { fill: none; stroke: #0f766e; stroke-width: 2; }
.appt-chart circle { fill: #0f766e; }
.lab-gender-f { color: #ec4899; margin-left: .35rem; }
.lab-gender-m { color: #38bdf8; margin-left: .35rem; }
.lab-range { display: inline-block; background: #e0f2fe; color: #0369a1; border-radius: 999px; padding: .28rem .7rem; font-size: .82rem; font-weight: 650; white-space: nowrap; }
.lab-heart-col { width: 2.6rem; text-align: center; }
.lab-heart-urgent, .lab-heart-ok { font-size: 1.45rem; }
.lab-heart-urgent, .btn .lab-heart-urgent { color: #dc2626; }
.lab-heart-ok, .btn .lab-heart-ok { color: #16a34a; }
.lab-group td { background: var(--head); font-weight: 700; letter-spacing: .02em; }
.lab-suggest-host { position: relative; }
.lab-suggest { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% - .15rem); background: var(--surface); border: 1px solid var(--line); border-radius: .55rem; box-shadow: var(--shadow); max-height: 12rem; overflow: auto; }
.lab-suggest button { display: block; width: 100%; text-align: left; background: transparent; border: 0; padding: .45rem .75rem; color: var(--ink); }
.lab-suggest button:hover { background: var(--row-hover); }
.quick-combo { position: relative; }
.quick-combo-panel { position: absolute; z-index: 6; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); max-height: 16rem; overflow: auto; box-shadow: 0 .4rem 1rem rgba(0,0,0,.12); }
.quick-combo-panel thead th { position: sticky; top: 0; background: #f5b400; color: #1f2937; }
.quick-combo-panel tbody tr { cursor: pointer; }
.quick-combo-panel tbody tr:hover { background: #fff7ed; }
.quick-age { color: #fff; text-align: center; font-weight: 700; font-size: .8rem; padding: .35rem .2rem; }
.quick-age-0 { background: #16a34a; }
.quick-age-1 { background: #1d4ed8; }
.quick-age-2 { background: #f59e0b; color: #1f2937; }
.quick-age-3 { background: #dc2626; }
.quick-age-4 { background: #991b1b; }
.lab-pick { border: 1px solid var(--line); margin-bottom: .75rem; }
.lab-pick-head { display: flex; align-items: center; gap: .5rem; padding: .45rem .7rem; font-weight: 700; }
.lab-pick-head.promo { background: #7c3aed; color: #fff; }
.lab-pick-head.group { background: #f5b400; color: #1f2937; }
.lab-pick-head span { flex: 1; }
.lab-pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem 1rem; padding: .65rem .75rem; }
.sale-switcher, .sale-group-switcher { display: flex; flex-wrap: wrap; gap: .45rem; }
.sale-section-button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius-btn); padding: .35rem .75rem; font-weight: 650; }
.sale-section-button.active { background: var(--nav-active-bg); color: var(--accent); border-color: transparent; }
.sale-checklist { max-height: 16rem; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-btn); padding: .4rem .7rem; background: var(--head); }
.sale-check-item { display: flex; gap: .6rem; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.sale-check-item span { flex: 1; }
.sale-check-item small { display: block; color: var(--muted); }
.sale-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.sale-totals div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); box-shadow: var(--shadow); padding: .7rem .9rem; display: flex; flex-direction: column; }
.sale-totals .total-collect { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.payment-options { display: flex; flex-wrap: wrap; gap: .75rem 1rem; }
html[data-theme] .panel .table-responsive > .table.board-table thead th { background: var(--accent); color: #fff; font-size: .8rem; }
.panel .table-responsive > .table.board-table > thead > tr > th:first-child,
.panel .table-responsive > .table.board-table > tbody > tr > td:first-child { width: 1%; padding-right: 1.15rem; }
.panel .table-responsive > .table.board-table > thead > tr > th:nth-child(2),
.panel .table-responsive > .table.board-table > tbody > tr > td:nth-child(2) { width: 1%; white-space: nowrap; padding-left: .65rem; }
.panel .table-responsive > .table.board-table tbody td { background: var(--surface); }
.panel .table-responsive > .table.board-table tbody tr.board-alt > td { background: color-mix(in srgb, var(--head) 75%, var(--surface)); }
.panel .table-responsive > .table.board-table { width: 100%; }
.panel .table-responsive > .table.board-table tr.board-band > td { display: table-cell !important; color: #fff; font-weight: 700; letter-spacing: .02em; padding: .55rem 1rem !important; }
.board-band .tone-0 { background: #1d6ef5 !important; }
.board-band .tone-1 { background: #9b2fe8 !important; }
.board-band .tone-2 { background: #15803d !important; }
.board-band .tone-3 { background: #c2410c !important; }
.board-band .tone-4 { background: #be123c !important; }
.board-band .tone-5 { background: #0e7490 !important; }
.board-band .tone-6 { background: #b45309 !important; }
.board-band .tone-7 { background: #0f766e !important; }
.board-band .tone-8 { background: #4338ca !important; }
.board-band .tone-9 { background: #a21caf !important; }
.board-band td span { margin-right: 1.4rem; }
.board-band i { margin-right: .4rem; }
.board-spec { float: right; margin-right: 0; }
.board-actions { display: grid; grid-template-columns: repeat(4, 1.7rem); gap: .28rem .45rem; width: 8.2rem; }
.board-ico { border: 0; background: transparent; padding: 0; line-height: 1; font-size: 1.2rem; }
.board-ico.ico-blue { color: #1d6ef5; }
.board-ico.ico-green { color: #16a34a; }
.board-ico.ico-orange { color: #f59e0b; }
.board-ico.ico-red { color: #ef4444; }
.board-num { display: inline-grid; place-items: center; min-width: 1.7rem; height: 1.7rem; padding: 0 .35rem; border-radius: 999px; color: #fff; font-weight: 700; }
.board-num.tone-0, .board-time.tone-0, .board-patient .tone-0 { background: #1d6ef5; color: #fff; }
.board-num.tone-1, .board-time.tone-1, .board-patient .tone-1 { background: #9b2fe8; color: #fff; }
.board-num.tone-2, .board-time.tone-2, .board-patient .tone-2 { background: #15803d; color: #fff; }
.board-num.tone-3, .board-time.tone-3, .board-patient .tone-3 { background: #c2410c; color: #fff; }
.board-num.tone-4, .board-time.tone-4, .board-patient .tone-4 { background: #be123c; color: #fff; }
.board-num.tone-5, .board-time.tone-5, .board-patient .tone-5 { background: #0e7490; color: #fff; }
.board-num.tone-6, .board-time.tone-6, .board-patient .tone-6 { background: #b45309; color: #fff; }
.board-num.tone-7, .board-time.tone-7, .board-patient .tone-7 { background: #0f766e; color: #fff; }
.board-num.tone-8, .board-time.tone-8, .board-patient .tone-8 { background: #4338ca; color: #fff; }
.board-num.tone-9, .board-time.tone-9, .board-patient .tone-9 { background: #a21caf; color: #fff; }
.board-patient .tone-0 { background: transparent; color: #1d6ef5; }
.board-patient .tone-1 { background: transparent; color: #9b2fe8; }
.board-patient .tone-2 { background: transparent; color: #15803d; }
.board-patient .tone-3 { background: transparent; color: #c2410c; }
.board-patient .tone-4 { background: transparent; color: #be123c; }
.board-patient .tone-5 { background: transparent; color: #0e7490; }
.board-patient .tone-6 { background: transparent; color: #b45309; }
.board-patient .tone-7 { background: transparent; color: #0f766e; }
.board-patient .tone-8 { background: transparent; color: #4338ca; }
.board-patient .tone-9 { background: transparent; color: #a21caf; }
.board-slot { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; }
.board-time { display: inline-flex; align-items: center; gap: .35rem; border-radius: .35rem; padding: .12rem .45rem; font-weight: 700; font-size: .82rem; }
.board-patient { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; text-transform: uppercase; }
.board-products-head { background: #1d6ef5; color: #fff; }
.board-products-head .modal-title { font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
html[data-theme] .panel .table-responsive > .table.board-products thead th,
.board-products thead th { background: #f3f4f6; color: #374151; font-weight: 600; }
.board-products-foot { background: #fff5f5; }
.board-qty { width: 3.4rem; text-align: center; }
.board-lock { border: 0; background: #f5b400; color: #1f2937; width: 1.9rem; height: 1.9rem; border-radius: .25rem; }
.board-line-sub { display: block; color: var(--muted); font-size: .8rem; font-weight: 500; }
.board-pending { background: #dc2626; color: #fff; font-weight: 700; border-radius: .25rem; padding: .12rem .45rem; }
@media (max-width: 767.98px) { .sale-totals { grid-template-columns: 1fr; } }

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1040;
        transform: translateX(-105%);
        transition: transform 0.2s ease;
    }
    .sidebar.open { transform: none; }
    .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 1030; }
    .user-meta { display: none; }
}

.role-card-head { display: flex; align-items: center; gap: .5rem; padding: 1rem 1rem .35rem; flex-wrap: wrap; }
.role-pill { background: var(--accent); color: #fff; border-radius: 999px; padding: .28rem .8rem; font-weight: 700; }
.role-system { background: var(--line); color: var(--muted); border-radius: 999px; padding: .28rem .7rem; font-size: .8rem; }
.role-card-actions { margin-left: auto; display: flex; gap: .35rem; }
.role-scope { display: flex; justify-content: center; gap: .65rem; flex-wrap: wrap; }
.role-scope-opt { display: inline-flex; align-items: center; gap: .25rem; margin: 0; font-size: .82rem; white-space: nowrap; }

body.sidebar-collapsed .sidebar { width: 76px; }
body.sidebar-collapsed .sidebar-label, body.sidebar-collapsed .chevron { display: none; }
@media (max-width: 991.98px) {
    body.sidebar-collapsed .sidebar { width: 260px; }
    body.sidebar-collapsed .sidebar-label, body.sidebar-collapsed .chevron { display: inline; }
}
