:root {
    --ink: #1c1430;
    --muted: #6f657c;
    --line: #e5deD2;
    --paper: #f4f0e8;
    --card: #fffdf9;
    --sidebar: #161022;
    --sidebar-soft: #241833;
    --violet: #6d4aff;
    --violet-deep: #4c2fe0;
    --gold: #b8893d;
    --gold-soft: #f4e7cf;
    --good: #1d7a4d;
    --good-soft: #e5f5ec;
    --bad: #a33b4a;
    --bad-soft: #fbecee;
    --warn: #8d6410;
    --warn-soft: #fbf3df;
    --shadow: 0 18px 50px rgba(36, 20, 61, 0.08);
    --sans: "Outfit", "Segoe UI", sans-serif;
    --serif: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; color: var(--ink); font-family: var(--sans); background: var(--paper); }
body.app { height: 100%; overflow: hidden; }
body.guest { min-height: 100%; overflow-x: hidden; }
a { color: var(--violet-deep); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
button, .btn, summary { touch-action: manipulation; }
h1, h2, h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.03em; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: white; padding: 8px 12px; z-index: 5; }

.shell {
    --side: 268px;
    display: grid;
    grid-template-columns: var(--side) minmax(0, 1fr);
    height: 100%;
    height: 100dvh;
    overflow: hidden;
}
.sidebar {
    position: relative;
    background: radial-gradient(1200px 400px at -10% -10%, #3a2460, transparent 50%), var(--sidebar);
    color: #f4efe8;
    display: flex;
    flex-direction: column;
    padding: 22px 16px 16px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}
.brand-row { flex-shrink: 0; }
.brand { position: relative; display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; padding: 0 8px 12px; flex-shrink: 0; }
.brand img { width: 44px; height: 44px; }
.brand strong { display: block; font-family: var(--serif); font-size: 22px; letter-spacing: -0.04em; }
.brand em { display: block; font-style: normal; color: #d9c7a4; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.context { margin: 0 8px 12px; padding: 12px 12px 11px; border-radius: 14px; background: rgba(255,255,255,0.05); border: 1px solid rgba(231,192,138,0.25); flex-shrink: 0; }
.context b { display: block; font-size: 14px; }
.context span { display: block; margin-top: 3px; color: #cbbfde; font-size: 12px; line-height: 1.35; }
.nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.22) transparent;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 99px; }
.nav-label { margin: 12px 10px 4px; color: #9d91b4; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.nav a {
    position: relative;
    display: flex; align-items: center; gap: 10px;
    color: #efeaf8; text-decoration: none;
    padding: 8px 10px; border-radius: 12px; margin-bottom: 2px;
}
.nav a.on, .nav a:hover { background: rgba(124, 92, 255, 0.22); }
.nav a.on { box-shadow: inset 2px 0 0 var(--gold); }
.ico { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.who {
    flex-shrink: 0;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    padding: 14px 8px 4px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.who > div strong, .who > div span { display: block; }
.who > div span { color: #cbbfde; font-size: 12px; }
.who button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    color: #f4efe8;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 999px;
    padding: 6px 10px;
    cursor: pointer;
}
.who button .ico { display: none; width: 16px; height: 16px; }

.workspace {
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.content, .card, .card-b, .modal-card, .login-shell, .brand-panel, .login-panel { min-width: 0; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 22px 28px 0; }
.crumbs { display: flex; gap: 6px; align-items: center; margin: 0 0 4px; color: var(--muted); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.crumbs span { color: #c8bfb2; }
.topbar h1 { margin: 0; font-size: 34px; }
.top-tools { display: flex; gap: 10px; align-items: center; }
.store-switch label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.store-switch select, .store-lock { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.company-switch select { min-width: min(220px, 100%); max-width: 100%; font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--ink); }
.impersonate { margin: 14px 28px 0; padding: 10px 14px; border-radius: 14px; background: #f6f1ea; border: 1px solid rgba(109, 74, 255, 0.22); color: var(--ink); font-size: 14px; line-height: 1.45; }
.impersonate strong { color: var(--violet); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 99px; vertical-align: -1px; margin: 0; }
.store-lock { margin: 0; }
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: var(--card);
    border-radius: 999px;
    padding: 8px 14px;
    min-height: 40px;
    min-width: 44px;
    font-weight: 560;
    cursor: pointer;
}
.sidebar-collapse {
    position: absolute;
    top: 26px;
    right: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(231, 192, 138, 0.55);
    background: #2a1d3d;
    color: #f4efe8;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(16, 11, 24, 0.28);
}
.sidebar-collapse:hover { background: rgba(124, 92, 255, 0.38); border-color: rgba(231, 192, 138, 0.75); }
.sidebar-collapse:focus-visible { outline: 2px solid #e7c08a; outline-offset: 2px; }
.sidebar-collapse .ico { width: 16px; height: 16px; }
.sidebar-collapse .ico-chevron { transition: transform 0.2s ease; }
.sidebar-collapse .ico-close { display: none; }
.side-tip {
    position: fixed;
    z-index: 50;
    transform: translateY(-50%);
    padding: 6px 10px;
    border-radius: 10px;
    background: #241833;
    color: #f4efe8;
    border: 1px solid rgba(231, 192, 138, 0.45);
    box-shadow: 0 10px 30px rgba(16, 11, 24, 0.28);
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
}
@media (min-width: 1025px) {
    body.sidebar-collapsed .shell { --side: 80px; }
    body.sidebar-collapsed .sidebar { padding-left: 10px; padding-right: 10px; }
    body.sidebar-collapsed .brand-row { display: flex; flex-direction: column; align-items: center; }
    body.sidebar-collapsed .brand { justify-content: center; width: 100%; padding: 0 0 8px; }
    body.sidebar-collapsed .sidebar-collapse { position: static; margin: 0 auto 10px; }
    body.sidebar-collapsed .sidebar-collapse .ico-chevron { transform: rotate(180deg); }
    body.sidebar-collapsed .context,
    body.sidebar-collapsed .nav-label { display: none; }
    body.sidebar-collapsed .brand span,
    body.sidebar-collapsed .nav a span,
    body.sidebar-collapsed .who > div,
    body.sidebar-collapsed .signout-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
        pointer-events: none;
    }
    body.sidebar-collapsed .nav { padding-right: 0; }
    body.sidebar-collapsed .nav a { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
    body.sidebar-collapsed .who { justify-content: center; padding-left: 0; padding-right: 0; }
    body.sidebar-collapsed .who form { display: flex; justify-content: center; }
    body.sidebar-collapsed .who button { position: relative; padding: 8px; }
    body.sidebar-collapsed .who button .ico { display: block; }
}

.tabs { display: flex; gap: 6px; padding: 14px 28px 0; border-bottom: 1px solid var(--line); overflow-x: auto; flex-wrap: nowrap; }
.tabs a { text-decoration: none; color: var(--muted); padding: 10px 12px 12px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--violet); font-weight: 650; }
.content { padding: 18px 28px 48px; }
.content:has(.pos-shell) { padding-top: 12px; }
.content:has(.pos-shell) > .lede { display: none; }
.workspace:has(.pos-shell) { background: linear-gradient(180deg, #efeaf8 0%, var(--paper) 160px); }
.lede { margin: 0 0 16px; max-width: 760px; color: var(--muted); line-height: 1.5; }
.flash { padding: 12px 14px; border-radius: 14px; margin-bottom: 16px; }
.flash.success { background: var(--good-soft); color: var(--good); }
.flash.error { background: var(--bad-soft); color: var(--bad); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat, .card { background: var(--card); border: 1px solid rgba(36, 20, 61, 0.06); border-radius: 18px; box-shadow: var(--shadow); }
.stat { padding: 16px 16px 14px; }
.stat span, .stat em { display: block; color: var(--muted); font-style: normal; }
.stat span { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.stat strong { display: block; margin: 8px 0 4px; font-family: var(--serif); font-size: 28px; font-weight: 560; letter-spacing: -0.03em; }
.stat em { font-size: 13px; }
.card { margin-bottom: 16px; }
.card-h { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; padding: 16px 16px 0; }
.card-h h2 { margin: 0; font-size: 22px; }
.card-b { padding: 14px 16px 16px; }
.note { color: var(--muted); line-height: 1.5; margin-top: 0; }
.company-state { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); }
.company-state.bad { background: var(--bad-soft); color: var(--bad); }
.row-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    max-width: 100%;
}
.card-b > .row-actions { display: flex; flex-wrap: wrap; justify-content: flex-start; margin-top: 4px; }
.row-actions form { margin: 0; display: inline-flex; }
.row-actions .btn,
.row-actions select,
.more-form select {
    width: auto;
    min-width: 0;
    flex: none;
    height: 34px;
}
.more-form select {
    padding: 0 28px 0 10px;
    border-radius: 999px;
    font-size: 13px;
}
.split { display: grid; grid-template-columns: 1.35fr 0.8fr; gap: 16px; align-items: start; }
.modal { position: fixed; inset: 0; z-index: 40; display: none; align-items: flex-start; justify-content: center; padding: 48px 16px; background: rgba(16, 11, 24, 0.5); }
.modal.open { display: flex; }
.modal-card { width: min(560px, 100%); max-height: calc(100vh - 80px); overflow: auto; background: var(--card); border-radius: 22px; box-shadow: 0 24px 80px rgba(16, 11, 24, 0.28); }
.modal-card.wide { width: min(920px, 100%); }
.card-h .btn + .btn { margin-left: 8px; }
.stack { display: grid; gap: 14px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap:has(.dt-container) { overflow: visible; }
.family-cell { display: flex; gap: 10px; align-items: flex-start; min-width: 180px; white-space: normal; }
.family-cell .line-mark { margin-top: 3px; }
.family-cell strong { display: block; line-height: 1.2; }
.family-cell .note { margin: 3px 0 0; font-style: normal; }
table.grid td:has(.family-cell) { white-space: normal; font-weight: 400; }
table.grid td .chips { max-width: 260px; }
.dt-container { font-family: inherit; color: inherit; }
div.dt-container div.dt-layout-row { margin: 0 0 10px; flex-wrap: wrap; gap: 8px 12px; }
div.dt-container div.dt-layout-row:last-child { margin: 10px 0 0; }
div.dt-container div.dt-layout-cell { padding: 0; }
div.dt-container .dt-search input.dt-input,
div.dt-container .dt-length select.dt-input {
    width: auto;
    min-width: 160px;
    background: #fff;
    border: 1px solid #ddd4c8;
    border-radius: 12px;
    padding: 8px 12px;
}
div.dt-container .dt-search input.dt-input { min-width: min(220px, 100%); }
div.dt-container .dt-info { color: var(--muted); font-size: 13px; padding: 6px 0; }
div.dt-container .dt-paging .dt-paging-button {
    appearance: none;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    border-radius: 999px;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    margin: 0 2px;
    cursor: pointer;
}
div.dt-container .dt-paging .dt-paging-button:hover { border-color: #b7a6f4; }
div.dt-container .dt-paging .dt-paging-button.current {
    background: var(--violet);
    border-color: var(--violet);
    color: #fff;
}
div.dt-container .dt-paging .dt-paging-button.disabled { opacity: 0.4; cursor: default; }
div.dt-container .dt-scroll {
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}
div.dt-container .dt-scroll-body { max-height: 420px; }
div.dt-container table.dataTable { margin: 0; border-collapse: collapse; }
div.dt-container table.dataTable thead th { background: var(--card); }
div.dt-container table.dataTable > tbody > tr:hover > * { background: #faf7f2; box-shadow: none; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th { text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 560; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.grid td { padding: 10px; border-bottom: 1px solid #f0ebe3; vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid td.empty { color: var(--muted); text-align: center; padding: 28px 10px; }
table.grid td:first-child { font-weight: 560; white-space: nowrap; }
table.grid th.col-actions,
table.grid td.col-actions { width: 1%; white-space: nowrap; text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px; font-size: 12px; background: #efeaf8; color: #4d3d6e; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.neutral { background: #f3efe8; color: #6d6458; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); }
input, select, textarea { width: 100%; background: #fff; border: 1px solid #ddd4c8; border-radius: 12px; padding: 10px 12px; outline: none; }
.money-input { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #ddd4c8; border-radius: 12px; padding-left: 12px; }
.money-input b { font-size: 12px; letter-spacing: 0.04em; color: #8a6a32; font-weight: 650; }
.money-input input { border: 0; box-shadow: none; padding-left: 0; background: transparent; }
.money-input input::placeholder { color: #c3b7a8; }
.money-input:focus-within { border-color: #b7a6f4; box-shadow: 0 0 0 4px rgba(109, 74, 255, 0.12); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #b7a6f4; box-shadow: 0 0 0 4px rgba(109, 74, 255, 0.12); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wide { grid-column: 1 / -1; }
.form-block { margin: 4px 0 0; padding-top: 8px; border-top: 1px solid var(--line); }
.form-block:first-of-type { border-top: 0; padding-top: 0; }
.form-block h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}
.set-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.set-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 140px;
    min-width: min(140px, 100%);
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--card);
    border: 1px solid rgba(36, 20, 61, 0.06);
    box-shadow: var(--shadow);
}
.set-chip em { font-style: normal; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.set-chip b { font-weight: 650; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.set-grid .card { margin-bottom: 0; min-width: 0; }
.set-dl { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr); gap: 8px 14px; margin: 0; }
.set-dl dt { color: var(--muted); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; padding-top: 2px; }
.set-dl dd { margin: 0; overflow-wrap: anywhere; }
.switch-list { display: grid; gap: 0; }
.switch {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}
.switch:last-of-type { border-bottom: 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui {
    width: 44px;
    height: 26px;
    border-radius: 999px;
    background: #ddd4c8;
    position: relative;
    flex: none;
    transition: background 0.15s ease;
}
.switch-ui::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(16, 11, 24, 0.2);
    transition: transform 0.15s ease;
}
.switch input:checked + .switch-ui { background: var(--violet); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { box-shadow: 0 0 0 4px rgba(109, 74, 255, 0.18); }
.switch-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-copy b { font-weight: 650; }
.switch-copy em { font-style: normal; color: var(--muted); font-size: 13px; line-height: 1.4; }
.modal-card form > .form-block { grid-column: 1 / -1; }
.modal-card form.stack,
.modal-card form.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
    align-items: start;
}
.modal-card.wide form.stack,
.modal-card.wide form.form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.modal-card form > .switch-list,
.modal-card form > .wide,
.modal-card form > .note,
.modal-card form > .btn,
.modal-card form > .actions,
.modal-card form > .po-search,
.modal-card form > .table-wrap,
.modal-card form > .form-grid,
.modal-card form > .rev-meta,
.modal-card form > .rev-head,
.modal-card form > fieldset,
.modal-card form > p,
.modal-card form > .field:has(textarea),
.modal-card form > .field:has(input[name="memo"]),
.modal-card form > .field:has(input[name="description"]),
.modal-card form > .field:has(input[name="reason"]) {
    grid-column: 1 / -1;
}
.modal-card.wide form > .form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 14px;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.btn, button.btn {
    appearance: none; border: 0; cursor: pointer; text-decoration: none;
    background: var(--violet); color: white; border-radius: 999px; padding: 10px 16px; font-weight: 560;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn:hover { background: var(--violet-deep); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); }
.btn.small, .linkish { padding: 6px 10px; font-size: 13px; }
.swal2-popup.confirm-pop {
    width: min(20rem, calc(100vw - 32px)) !important;
    padding: 1.1rem 1.1rem 0.9rem !important;
    border-radius: 16px !important;
    font-size: 14px;
}
.swal2-popup.confirm-pop .swal2-icon { display: none; }
.swal2-popup.confirm-pop .swal2-title {
    font-family: var(--serif);
    font-size: 1.15em;
    font-weight: 560;
    padding: 0 0.15em;
    color: var(--ink);
}
.swal2-popup.confirm-pop .swal2-html-container {
    margin: 0;
    padding: 0.35em 0.15em 0.1em;
    font-size: 0.9em;
    line-height: 1.4;
    color: var(--muted);
}
.swal2-popup.confirm-pop .swal2-actions { margin: 0.75em auto 0; gap: 8px; }
.swal2-popup.confirm-pop .swal2-styled {
    margin: 0;
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 999px;
}
.filter { max-width: min(220px, 100%); padding: 8px 10px; }
.filter[hidden] { display: none !important; }
.check { display: flex; gap: 8px; align-items: center; }
.check input { width: auto; }
fieldset.checks {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}
fieldset.checks legend {
    font-size: 12px;
    color: var(--muted);
    padding: 0;
    margin: 0 0 4px;
    width: 100%;
}
fieldset.checks .check { margin: 0; }
.sell-pick { position: relative; }
.sell-drop { position: relative; }
.sell-trigger {
    appearance: none;
    display: block;
    width: 100%;
    text-align: left;
    font: inherit;
    background: #fff;
    border: 1px solid #ddd4c8;
    border-radius: 12px;
    padding: 10px 36px 10px 12px;
    cursor: pointer;
    min-height: 42px;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236f657c' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.sell-trigger:focus,
.sell-drop.open .sell-trigger {
    border-color: #b7a6f4;
    box-shadow: 0 0 0 4px rgba(109, 74, 255, 0.12);
}
.sell-drop.open .sell-trigger {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}
.sell-menu {
    margin-top: 4px;
    z-index: 8;
    max-height: 280px;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(16, 11, 24, 0.16);
    padding: 6px;
}
.sell-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
}
.sell-option:hover { background: #faf7f2; }
.sell-option:has(input:checked) { background: #efeaf8; }
.sell-option input { width: auto; margin-top: 3px; flex: none; }
.sell-option span { display: block; min-width: 0; }
.sell-option b { display: block; font-size: 14px; }
.sell-option em { display: block; color: var(--muted); font-style: normal; font-size: 12px; }
[data-apply-target][hidden] { display: none !important; }

.po-search { display: grid; gap: 8px; position: relative; }
.po-search > span { font-size: 12px; color: var(--muted); }
.po-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.po-chip {
    appearance: none;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    color: var(--ink);
}
.po-chip.on,
.po-chip:hover { background: #efeaf8; border-color: #cbbef0; }
.po-sug {
    z-index: 8;
    max-height: 280px;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(16, 11, 24, 0.16);
    padding: 6px;
}
.po-hit {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    color: inherit;
}
.po-hit:hover,
.po-hit.on {
    background: #e8defc;
    box-shadow: inset 0 0 0 1px #c9b8f4;
}
.po-hit b { display: block; font-size: 14px; }
.po-hit em { display: block; color: var(--muted); font-style: normal; font-size: 12px; }
.po-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; color: var(--muted); flex: none; }
.po-flag { font-style: normal; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.po-flag.out { color: var(--bad); }
.po-flag.low { color: var(--warn); }
.po-none { margin: 8px 10px; color: var(--muted); font-size: 13px; }
.po-picked { margin: 0; font-size: 14px; }
.po-sku { display: block; color: var(--muted); font-style: normal; font-size: 12px; font-weight: 400; }
.po-picked .po-sku { display: inline; }
.po-total { margin: 0; font-weight: 650; }
.po-lines td:first-child { white-space: normal; }
.po-lines td input { min-width: 72px; }
.po-lines .money-input { min-width: 0; }

.rx { display: grid; gap: 14px; }
.rx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; }
.rx-kpi {
    appearance: none;
    text-align: left;
    background: var(--card);
    border: 1px solid rgba(36, 20, 61, 0.06);
    border-radius: 16px;
    padding: 12px 14px 10px;
    box-shadow: var(--shadow);
    cursor: pointer;
    color: inherit;
    width: 100%;
}
.rx-kpi:hover, .rx-kpi.on { border-color: rgba(109, 74, 255, 0.35); transform: translateY(-1px); }
.rx-kpi .l { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.rx-kpi .v { display: block; font-family: var(--serif); font-size: 22px; font-weight: 560; margin-top: 4px; }
.rx-kpi em { display: block; color: var(--muted); font-style: normal; font-size: 12px; margin-top: 2px; }
.rx-kpi.warn .v { color: var(--warn); }
.rx-kpi.danger .v { color: var(--bad); }
.rx-kpi.ok .v { color: var(--good); }
.rx-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.7fr); gap: 14px; align-items: start; }
.rx-sheet, .rx-card {
    background: var(--card);
    border: 1px solid rgba(36, 20, 61, 0.06);
    border-radius: 18px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.rx-card { overflow: hidden; }
.rx-sheet-h { border-radius: 18px 18px 0 0; }
.rx-sheet-h, .rx-card-h {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}
.rx-sheet-h h2, .rx-card-h h2 { margin: 0; font-size: 18px; }
.rx-sheet-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.rx-sheet-h .pos-keys { margin-left: 0; }
.rx-sheet-h .btn { height: 38px; padding: 0 14px; flex: none; }
.rx-sheet-b { display: grid; gap: 12px; padding: 14px 16px 16px; }
.rx-card-b { padding: 12px 16px 14px; }
.rx-form-row {
    display: grid;
    grid-template-columns: minmax(140px, 1.15fr) minmax(90px, 0.55fr) minmax(180px, 1.35fr) auto;
    gap: 10px 12px;
    align-items: end;
}
.rx-form-row .field { margin: 0; min-width: 0; }
.rx-form-row select { text-overflow: ellipsis; }
.rx-supplier { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; min-width: 0; }
.rx-supplier .field { min-width: 0; }
.rx-supplier .btn { height: 42px; padding: 0 14px; }
.rx-focus-btns { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rx-focus-btns > span { font-size: 12px; color: var(--muted); }
.rx-focus-row { display: flex; gap: 6px; }
.rx-focus-row .btn { height: 42px; padding: 0 14px; }
.rx-btn { min-height: 42px; border-radius: 12px; white-space: nowrap; }
.rx-btn.on, .rx-focus-btns .btn.on { background: #efeaf8; border-color: #cbbef0; }
.btn.danger-outline { color: var(--bad); border-color: #e3c4c8; }
.btn.danger-outline.on { background: var(--bad-soft); border-color: #e3c4c8; }
.rx-pay-panel { background: #faf7f2; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.rx-pay-head { margin-bottom: 8px; }
.rx-pay-head strong { font-size: 13px; }
.rx-pay-grid { display: grid; grid-template-columns: 1.1fr 1fr 0.95fr 0.95fr; gap: 10px; align-items: end; }
.rx-pay-summary { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px 8px; min-width: 0; }
.rx-pay-summary .l { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.rx-pay-summary .v { font-family: var(--serif); font-size: 20px; font-weight: 560; color: var(--warn); }
.rx-pay-summary .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rx-search { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 0; margin: 0; }
.rx-search > span:not(.rx-search-ico) { display: none; }
.rx-search-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--violet); z-index: 2; pointer-events: none; }
.rx-search .ico { width: 18px; height: 18px; }
.rx-search [data-po-q] { height: 46px; border-radius: 12px 0 0 12px; border: 2px solid rgba(109, 74, 255, 0.18); font-size: 15px; padding-left: 42px; }
.rx-search-add { border-radius: 0 12px 12px 0; height: 46px; min-width: 46px; border: 2px solid rgba(109, 74, 255, 0.18); border-left: 0; font-size: 20px; }
.rx-search:not(:has(.rx-search-add)) [data-po-q] { border-radius: 12px; }
.rx-search .po-sug { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; }
.rx-line-box {
    display: grid;
    grid-template-columns: 2fr 0.7fr 1fr 1fr auto;
    gap: 8px;
    align-items: start;
    background: #faf7f2;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    margin: 0;
}
.rx-line-box[hidden] { display: none !important; }
.rx-line-box > div { display: flex; flex-direction: column; min-width: 0; }
.rx-line-box label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 650; margin-bottom: 4px; }
.rx-line-box .hint { min-height: 1rem; margin-top: 4px; font-size: 11px; color: var(--muted); }
.rx-add-wrap { justify-content: flex-start; padding-top: 1.3rem; }
.rx-add-wrap .rx-btn { height: 42px; min-width: 88px; }
.rx-lines { margin: 0; }
.rx-lines table { margin: 0; }
.rx-lines table thead th { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: #f3efe8; }
.rx-lines td.empty { padding: 16px 8px; }
.rx-total {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: linear-gradient(160deg, var(--violet), var(--violet-deep));
    color: #fff;
    padding: 14px 16px;
    border-radius: 0 0 18px 18px;
}
.rx-total .l { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.rx-total .v { font-family: var(--serif); font-size: 26px; font-weight: 560; }
.rx-total .s { font-size: 13px; opacity: 0.9; margin-top: 2px; }
.rx-total .btn.rx-save {
    background: #fff;
    color: var(--ink);
    height: 44px;
    min-width: 150px;
    border-radius: 12px;
    font-weight: 650;
}
.rx-total .btn.rx-save:hover { background: #f4efe8; }
.rx-side { display: grid; gap: 12px; }
.rx-actions { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.rx-actions li { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; margin: 0; }
.rx-actions li:hover { background: #faf7f2; }
.rx-actions .t { display: block; font-weight: 650; font-size: 13px; }
.rx-actions .b { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.rx-actions .tone-danger .t { color: var(--bad); }
.rx-actions .tone-warning .t { color: var(--warn); }
.rx-actions .tone-info .t { color: var(--violet-deep); }
.rx-reorder-item {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px dashed var(--line);
    background: transparent;
    padding: 8px 0;
    cursor: pointer;
    color: inherit;
}
.rx-reorder-item:hover { background: #faf7f2; }
.rx-reorder-item b { display: block; font-size: 13px; }
.rx-reorder-item em { display: block; color: var(--muted); font-style: normal; font-size: 12px; }
.rx-bill-code { display: block; font-weight: 650; }
.rx-bill-meta { display: block; font-size: 12px; color: var(--muted); }
.rx-method { font-size: 12px; color: var(--muted); margin-left: 6px; }

.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 180px 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.bar { height: 8px; background: #efeaf8; border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), #c4a15a); }

.tree-row { padding: 8px 0; border-bottom: 1px solid #f0ebe3; }
.tree-item { display: grid; grid-template-columns: 1fr 90px 160px 70px; gap: 8px; align-items: center; }
.tree-chrome { display: grid; grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1.4fr); gap: 8px; padding: 6px 0 2px; }
.kind { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }

.pos-shell { min-width: 0; }
.pos-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.pos-chip {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(109, 74, 255, 0.14);
    font-size: 13px;
    font-weight: 560;
    color: var(--ink);
    box-shadow: 0 2px 8px rgba(36, 20, 61, 0.04);
}
.pos-chip.ok { background: var(--good-soft); border-color: #b7e4c7; color: var(--good); }
.pos-chip.warn { background: var(--warn-soft); border-color: #ead9a8; color: var(--warn); }
.pos-chip.btnish { cursor: pointer; background: #fff; color: var(--ink); }
.pos-chip.btnish:hover { background: #efeaf8; border-color: #cbbef0; }
.pos-chip b { font-family: var(--serif); font-weight: 650; }
.pos-keys { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.pos-keys kbd {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 700;
    font-family: ui-monospace, Consolas, monospace;
    box-shadow: 0 1px 0 #e5ded2;
}
.pos-keys .sep { opacity: 0.45; }
.pos-gate {
    max-width: 520px;
    margin: 36px auto;
    background: #fff;
    border-radius: 18px;
    padding: 28px 28px 24px;
    border: 1px solid rgba(184, 137, 61, 0.22);
    box-shadow: var(--shadow);
    text-align: center;
}
.pos-gate h2 { margin: 0 0 8px; font-size: 28px; }
.pos-gate p { color: var(--muted); margin: 0 0 18px; }
.pos-gate .stack { text-align: left; max-width: 280px; margin: 0 auto; }
#pos-close form.stack { grid-template-columns: 1fr; }
.pos-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.78fr); gap: 14px; align-items: start; }
.pos-panel {
    background: var(--card);
    border-radius: 18px;
    border: 1px solid rgba(36, 20, 61, 0.06);
    box-shadow: var(--shadow);
    overflow: visible;
    min-width: 0;
}
.pos-panel-h {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0ebe3;
    font-weight: 650;
    font-size: 14px;
}
.pos-panel-h > #pos-item-count { color: var(--muted); font-weight: 480; }
.pos-panel-tools { display: flex; gap: 6px; }
.pos-panel-b { padding: 14px 16px 16px; }
.pos-check { position: sticky; top: 12px; overflow: hidden; }
.pos-scan { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 0 0 12px; }
.pos-scan-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--violet); z-index: 2; pointer-events: none; }
.pos-scan-ico .ico { width: 18px; height: 18px; }
.pos-scan input {
    height: 50px;
    padding: 0 14px 0 42px;
    font-size: 16px;
    font-weight: 560;
    border-radius: 12px;
    border: 2px solid rgba(109, 74, 255, 0.18);
    background: #fbfaf7;
}
.pos-scan input:focus { background: #fff; border-color: var(--violet); }
.pos-scan-btn {
    appearance: none;
    height: 50px;
    min-width: 72px;
    border: 0;
    border-radius: 12px;
    background: var(--violet);
    color: #fff;
    font-weight: 650;
    cursor: pointer;
}
.pos-scan-btn:hover { background: var(--violet-deep); }
.pos-sug { position: absolute; left: 0; right: 80px; top: calc(100% + 6px); z-index: 12; }
.pos-cart { max-height: min(52vh, 520px); overflow: auto; border: 1px solid #f0ebe3; border-radius: 12px; }
.pos-cart table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; margin: 0; }
.pos-cart thead th {
    position: sticky;
    top: 0;
    background: #f6f1ea;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 650;
    padding: 8px 8px;
    text-align: left;
    z-index: 1;
}
.pos-cart td { padding: 8px; vertical-align: middle; border-top: 1px solid #f0ebe3; }
.pos-cart tbody tr:first-child td { border-top: 0; }
.pos-cart tbody tr:hover { background: #faf7f2; }
.pos-pname { display: block; font-weight: 650; line-height: 1.3; }
.pos-meta { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.pos-stock { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos-line { font-family: var(--serif); font-weight: 650; white-space: nowrap; }
.pos-qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; height: 34px; }
.pos-qty button { appearance: none; width: 30px; height: 34px; border: 0; background: #f6f1ea; color: var(--violet); cursor: pointer; padding: 0; }
.pos-qty button:hover { background: #efeaf8; }
.pos-qty input { width: 44px; height: 34px; border: 0; border-left: 1px solid #f0ebe3; border-right: 1px solid #f0ebe3; text-align: center; font-weight: 650; padding: 0; border-radius: 0; }
.pos-empty { padding: 36px 12px; text-align: center; color: var(--muted); }
.pos-empty[hidden] { display: none !important; }
.pos-reorder { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); }
.pos-reorder h3 { margin: 0 0 4px; font-size: 16px; }
.pos-reorder .note { margin: 0 0 8px; font-size: 13px; }
.pos-reorder-item {
    appearance: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px dashed var(--line);
    background: transparent;
    padding: 8px 0;
    cursor: pointer;
    color: inherit;
}
.pos-reorder-item:hover:not(:disabled) { background: #faf7f2; }
.pos-reorder-item:disabled { opacity: 0.55; cursor: not-allowed; }
.pos-reorder-item b { display: block; font-size: 13px; }
.pos-reorder-item em { display: block; color: var(--muted); font-style: normal; font-size: 12px; }
.pos-due {
    background: linear-gradient(160deg, var(--violet) 0%, var(--violet-deep) 100%);
    color: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}
.pos-due::after {
    content: "";
    position: absolute;
    right: -20px;
    top: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}
.pos-due .l { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.pos-due .v { position: relative; font-family: var(--serif); font-size: 32px; font-weight: 650; letter-spacing: -0.03em; }
.pos-due .s { position: relative; font-size: 13px; opacity: 0.9; margin-top: 2px; }
.pos-check .field { margin: 0 0 10px; }
.pos-tenders { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 6px; margin: 4px 0 12px; }
.pos-tenders label { margin: 0; cursor: pointer; }
.pos-tenders input { display: none; }
.pos-tenders span {
    display: block;
    text-align: center;
    padding: 10px 4px;
    border-radius: 12px;
    border: 2px solid #e5ded2;
    font-weight: 650;
    font-size: 13px;
    color: var(--muted);
}
.pos-tenders input:checked + span {
    border-color: var(--violet);
    background: #efeaf8;
    color: var(--violet-deep);
    box-shadow: 0 0 0 3px rgba(109, 74, 255, 0.12);
}
.pos-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.pos-split {
    display: none;
    background: #faf7f2;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px 4px;
    margin: 0 0 10px;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
}
.pos-split:not([hidden]) { display: grid; }
.pos-split .hint { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin: 0 0 4px; }
.pos-split .field { margin: 0 0 8px; }
#cash-row[hidden], #split-row[hidden] { display: none !important; }
.pos-change {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--good-soft);
    border: 1px solid #b7e4c7;
    border-radius: 10px;
    padding: 8px 12px;
    margin: 4px 0 12px;
}
.pos-change .l { font-size: 11px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--good); }
.pos-change .v { font-size: 18px; font-weight: 700; color: var(--good); }
.pos-change.warn { background: var(--warn-soft); border-color: #ead9a8; }
.pos-change.warn .l, .pos-change.warn .v { color: var(--warn); }
.pos-change.muted { background: #f6f1ea; border-color: var(--line); }
.pos-change.muted .l, .pos-change.muted .v { color: var(--muted); }
.pos-cust { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.pos-cust .field:first-child { grid-column: 1 / -1; }
button.btn.pos-complete, button.btn.pos-open {
    width: 100%;
    height: 50px;
    margin-top: 4px;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(109, 74, 255, 0.24);
}
button.btn.pos-complete:disabled { opacity: 0.45; box-shadow: none; }
button.btn.pos-focus-pay { width: 100%; height: 40px; margin-top: 6px; border-radius: 10px; }

.family-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; margin-top: 12px; }
.family-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 16px 16px 14px 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
}
.family-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 5px;
    border-radius: 0 99px 99px 0;
    background: var(--family-color, var(--violet));
}
.family-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.family-card h3 { margin: 0; font-size: 22px; line-height: 1.15; }
.family-card .code, .line-hero .code {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.family-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip, .form-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f6f1ea;
    color: #4d3d6e;
    font-size: 12px;
    line-height: 1.3;
}
.chip.more { background: #efeaf8; }
.family-meta { color: var(--muted); font-size: 13px; }
.family-card .row-actions { margin-top: auto; justify-content: flex-start; }
.empty-family { grid-column: 1 / -1; color: var(--muted); margin: 8px 0 0; }

.line-hero { display: flex; gap: 14px; align-items: flex-start; }
.line-mark { width: 18px; height: 18px; border-radius: 6px; flex: none; margin-top: 2px; box-shadow: inset 0 0 0 1px rgba(16, 11, 24, 0.08); }
.starter { display: grid; gap: 12px; margin: 12px 0; }
.starter-cat { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: #fff; }
.starter-cat header { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 10px; }
.starter-cat header strong { font-size: 16px; }
.starter-cat header form { margin: 0; }
.form-pill { background: #efeaf8; }
.form-pill form { display: inline-flex; margin: 0; }
.pill-x {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    width: 18px;
    height: 18px;
    padding: 0;
    border-radius: 99px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}
.pill-x:hover { color: var(--bad); background: var(--bad-soft); }
.inline-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 12px; }
.inline-add .field { flex: 1; min-width: min(180px, 100%); margin: 0; }
.inline-add .btn { height: 42px; }
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type="color"] { width: 48px; height: 36px; padding: 4px; cursor: pointer; }
.color-field em { color: var(--muted); font-style: normal; font-size: 13px; }
.receipt { max-width: 360px; margin: 0 auto 8px; padding: 8px 8px 0; }
.receipt h3 { margin: 0 0 4px; text-align: center; }
.receipt p { display: flex; justify-content: space-between; gap: 16px; margin: 6px 0; }
.receipt p.muted { display: block; text-align: center; color: var(--muted); margin: 0 0 10px; }
.receipt .total { font-family: var(--serif); font-size: 20px; border-top: 1px solid var(--line); padding-top: 8px; }
.model-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.model { padding: 12px; border-radius: 14px; background: #faf7f2; border: 1px solid var(--line); }
.model b { display: block; margin-bottom: 4px; }
.rev-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 4px;
    padding: 12px 14px;
    background: #f6f1ea;
    border-radius: 14px;
}
.rev-meta small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.rev-meta b { font-size: 15px; }
.rev-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.rev-head .note { margin: 4px 0 0; }
.rev-sku { display: block; color: var(--muted); font-style: normal; font-size: 12px; }
.rev-table input[type="number"] { width: 88px; }
.rev-table tbody tr.off { opacity: 0.45; }
[data-rev-other][hidden] { display: none !important; }
.ticket-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.ticket-tools .btn + .btn { margin-left: 0; }
.ticket-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 10px 16px;
    margin: 0 0 14px;
    padding: 12px 14px;
    background: #f6f1ea;
    border-radius: 14px;
}
.ticket-facts small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.ticket-facts b {
    display: block;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.35;
    word-break: break-word;
}
.ticket-notes { margin: 0 0 12px; }
.ticket-notes .note { margin: 0 0 4px; }
.ticket-facts + .table-wrap table.grid th:not(:first-child),
.ticket-facts + .table-wrap table.grid td:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.workspace:has(.dash) { background: linear-gradient(180deg, #efeaf8 0%, var(--paper) 180px); }
.dash-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    margin: 0 0 16px;
}
.dash-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.dash-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
    text-decoration: none;
    font-size: 13px;
    font-weight: 560;
}
.dash-chip:hover { border-color: rgba(109, 74, 255, 0.45); }
.dash-chip.on { background: var(--violet); color: #fff; border-color: var(--violet); }
.dash-custom { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.dash-custom[hidden] { display: none !important; }
.dash-custom label { display: grid; gap: 3px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.dash-custom input[type="date"] {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 7px 10px;
    min-width: 148px;
}
.dash-live {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}
.dash-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--good);
    box-shadow: 0 0 0 4px rgba(29, 122, 77, 0.16);
}
.dash-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.dash-kpi {
    background: var(--card);
    border: 1px solid rgba(36, 20, 61, 0.06);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 14px 16px 12px;
    border-top: 3px solid var(--kpi, var(--violet));
    min-width: 0;
}
.dash-kpi > span, .dash-kpi em { display: block; color: var(--muted); font-style: normal; }
.dash-kpi > span { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.dash-kpi strong {
    display: block;
    margin: 8px 0 6px;
    font-family: var(--serif);
    font-size: 26px;
    font-weight: 560;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
}
.dash-kpi em { font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.dash-delta { font-style: normal; font-weight: 650; font-size: 12px; }
.dash-delta.up { color: var(--good); }
.dash-delta.down { color: var(--bad); }
.dash-tabs {
    display: flex;
    gap: 6px;
    margin: 0 0 14px;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
}
.dash-tabs button {
    appearance: none;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    padding: 10px 12px 12px;
    cursor: pointer;
    white-space: nowrap;
}
.dash-tabs button.on { color: var(--ink); border-color: var(--violet); font-weight: 650; }
.dash-pane[hidden] { display: none !important; }
.dash-split { display: grid; grid-template-columns: 1.35fr 0.8fr; gap: 16px; align-items: start; }
.dash-chart { position: relative; height: 240px; }
.dash-chart.sm { height: 220px; }
.dash-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.dash-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 560;
    background: #f6f1ea;
}
.dash-pill b { font-weight: 650; }
.dash-pill.bad { background: var(--bad-soft); color: var(--bad); }
.dash-pill.warn { background: var(--warn-soft); color: var(--warn); }
.dash-pill.good { background: var(--good-soft); color: var(--good); }
.dash-jump { margin: 0 0 16px; }

.shift-desk { min-width: 0; }
.shift-desk .dash-kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.shift-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    padding: 12px 16px;
    margin: 0 0 16px;
    border-radius: 16px;
    background: var(--good-soft);
    border: 1px solid #b7e4c7;
    color: var(--good);
    font-size: 14px;
}
.shift-banner.is-late {
    background: var(--warn-soft);
    border-color: #ead9a8;
    color: var(--warn);
}
.shift-banner > span { min-width: 0; }
.shift-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 650;
}
.shift-live i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(29, 122, 77, 0.16);
}
.shift-late { font-weight: 650; }
.shift-flow { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #faf7f2; }
.shift-flow-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    padding: 10px 14px;
    border-bottom: 1px solid #efe8dc;
    font-size: 14px;
}
.shift-flow-row:last-child { border-bottom: 0; }
.shift-flow-row span { color: var(--muted); }
.shift-flow-row b { font-variant-numeric: tabular-nums; font-weight: 650; }
.shift-flow-row b em { font-style: normal; margin-right: 2px; }
.shift-flow-row b.plus { color: var(--good); }
.shift-flow-row b.minus { color: var(--muted); }
.shift-flow-row.total { background: var(--good-soft); font-size: 15px; }
.shift-flow-row.total span { color: var(--good); font-weight: 650; }
.shift-flow .note { margin: 10px 14px 12px; }
.shift-tenders {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.shift-tender {
    padding: 12px 14px;
    border-radius: 14px;
    background: #faf7f2;
    border: 1px solid #efe8dc;
    min-width: 0;
}
.shift-tender span { display: block; color: var(--muted); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.shift-tender b { display: block; margin: 6px 0 2px; font-family: var(--serif); font-size: 22px; font-weight: 560; }
.shift-tender em { display: block; font-style: normal; color: var(--muted); font-size: 13px; }
.shift-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.shift-amt { font-variant-numeric: tabular-nums; }
.shift-amt.good { color: var(--good); font-weight: 650; }
.shift-amt.bad { color: var(--bad); font-weight: 650; }
.shift-var {
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px dashed var(--line);
    background: #faf7f2;
    font-size: 14px;
}
.shift-var.ok { background: var(--good-soft); border-color: #b7e4c7; color: var(--good); }
.shift-var.warn { background: var(--warn-soft); border-color: #ead9a8; color: var(--warn); }
.shift-var.bad { background: var(--bad-soft); border-color: #f0c4ca; color: var(--bad); }
.shift-close-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.shift-close-grid h3 { margin: 0 0 8px; font-size: 16px; }
.shift-gate { max-width: 360px; }
.shift-gate h2 { margin: 0 0 8px; font-size: 26px; }
.shift-gate p { color: var(--muted); margin: 0 0 16px; }
.shift-desk .actions { margin-top: 14px; }
.shift-banner.is-closed {
    background: #f6f1ea;
    border-color: var(--line);
    color: var(--ink);
}
.shift-banner.is-off {
    background: var(--bad-soft);
    border-color: #f0c4ca;
    color: var(--bad);
}
.shift-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.shift-filters .pos-chip.on { background: #efeaf8; border-color: #cbbef0; color: var(--ink); }
.shift-snapshot { margin-bottom: 8px; }
.shift-snapshot-h {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 12px;
}
.shift-snapshot-h h2 { margin: 0; font-size: 22px; }
.shift-snapshot-h .actions { margin: 0; }
.shift-snapshot .shift-var { margin: 0 0 16px; }
.pos-chip.on { font-weight: 650; }
@media (max-width: 1100px) {
    .dash-kpis { grid-template-columns: 1fr 1fr; }
    .dash-split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .dash-toolbar { align-items: stretch; }
    .dash-live { margin-left: 0; }
    .dash-kpis { grid-template-columns: 1fr 1fr; }
    .dash-kpi strong { font-size: 22px; }
    .set-grid, .shift-tenders { grid-template-columns: 1fr; }
    .set-dl { grid-template-columns: 1fr; gap: 2px; }
    .set-dl dt { padding-top: 8px; }
}

.guest { min-height: 100vh; background: #100b18; color: #f6f1e8; }
.login-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr); height: 100vh; height: 100dvh; }
.brand-panel {
    padding: 32px 56px 36px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    height: 100%;
}
.brand-copy { max-width: 540px; }
.brand-panel h1 { font-size: clamp(32px, 3.6vw, 56px); margin: 10px 0 0; line-height: 1; white-space: nowrap; }
.tag { letter-spacing: 0.16em; text-transform: uppercase; color: #e7c08a; font-size: 13px; margin: 0; }
.brand-panel .lead { max-width: 460px; margin: 16px 0 0; color: #d9d0e6; font-size: 18px; line-height: 1.5; }
.orbit-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}
.brand-foot { padding-top: 8px; }
.models-label { margin: 0 0 10px; color: #e7c08a; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.orbit {
    width: 220px; height: 220px; margin: 0;
    border-radius: 50%;
    border: 1px dashed rgba(231, 192, 138, 0.7);
    display: grid; place-items: center;
    position: relative;
    animation: spin 22s linear infinite;
}
.orbit img { width: 96px; height: 96px; animation: spin 22s linear infinite reverse; }
.orbit i {
    position: absolute; top: 14px; left: 50%; width: 10px; height: 10px; margin-left: -5px;
    background: #e7c08a; border-radius: 50%;
}
.models { display: grid; gap: 8px; max-width: 460px; padding: 0; margin: 0; list-style: none; }
.models li { color: #ddd4ea; padding-left: 14px; border-left: 2px solid rgba(231,192,138,0.8); }
.login-panel {
    background:
        radial-gradient(720px 320px at 100% 0%, rgba(109, 74, 255, 0.08), transparent 55%),
        var(--paper);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
}
.login-card {
    width: min(420px, 100%);
    background: var(--card);
    border: 1px solid rgba(36, 20, 61, 0.06);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 28px 28px 24px;
}
.login-mark { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.login-mark img { width: 48px; height: 48px; }
.login-kicker { margin: 2px 0 0; color: var(--muted); font-size: 13px; letter-spacing: 0.04em; }
.login-card h2 { font-size: 36px; margin: 0 0 8px; }
.login-card .note { margin-bottom: 18px; }
.login-card .flash { margin: 0 0 16px; }
.login-card .stack { gap: 14px; }
.login-card .field input { min-height: 48px; }
.login-card .btn { width: 100%; min-height: 48px; margin-top: 4px; }
.login-card .field > label { font-size: 12px; color: var(--muted); }
.pass-row { position: relative; display: block; color: var(--ink); font-size: 1rem; }
.pass-row input { padding-right: 72px; }
.pass-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--violet-deep);
    font-size: 13px;
    font-weight: 650;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 999px;
}
.pass-toggle:hover { background: #efeaf8; }
.install-wrap { max-width: 760px; margin: 0 auto; padding: 40px 16px; color: var(--ink); }
body.guest .install-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; }
body.guest .install-wrap .card,
body.guest .install-wrap .card-b { color: var(--ink); }
body.guest .install-wrap h1,
body.guest .install-wrap h2,
body.guest .install-wrap p { color: var(--ink); }
.mark-row { display: flex; gap: 12px; align-items: center; }
.mark-row img { width: 52px; height: 52px; }

@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .orbit, .orbit img { animation: none; }
    .sidebar-collapse .ico-chevron { transition: none; }
}
@media (max-width: 1100px) {
    .stats, .dash-kpis { grid-template-columns: 1fr 1fr; }
    .split, .dash-split, .pos-grid, .rx-grid, .shift-close-grid { grid-template-columns: 1fr; }
    .login-shell { display: flex; flex-direction: column; height: auto; min-height: 100dvh; }
    .login-panel { order: -1; }
    .brand-panel { height: auto; }
    .orbit-stage { flex: none; padding: 8px 0 20px; }
    .pos-check { position: static; }
    .rx-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .rx-form-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); }
    .rx-pay-grid { grid-template-columns: 1fr 1fr; }
    .rx-focus-btns { grid-column: 1 / -1; }
    .brand-panel { padding: 28px 24px 16px; }
    .brand-panel h1 { font-size: clamp(28px, 5vw, 40px); white-space: normal; }
    .orbit { width: 180px; height: 180px; }
    .orbit img { width: 84px; height: 84px; }
}
@media (max-width: 1024px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        z-index: 40;
        transform: translateX(-105%);
        width: min(86vw, 300px);
        height: 100%;
        height: 100dvh;
        overflow: hidden;
        transition: transform 0.2s ease;
        padding-top: max(18px, env(safe-area-inset-top));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    body.nav-open { overflow: hidden; }
    body.nav-open .sidebar { transform: none; }
    body.nav-open::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(16, 11, 24, 0.45);
        z-index: 35;
    }
    .nav-toggle { display: inline-flex; }
    .sidebar-collapse .ico-chevron { display: none; }
    .sidebar-collapse .ico-close { display: block; }
    .topbar {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 10px 12px;
        padding-top: max(14px, env(safe-area-inset-top));
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
    .top-title { min-width: 0; }
    .top-tools { grid-column: 1 / -1; width: 100%; }
    .content, .tabs, .impersonate {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
    .impersonate { margin-left: 16px; margin-right: 16px; }
    .topbar h1 { font-size: 28px; overflow-wrap: anywhere; }
    .company-switch, .store-switch { width: 100%; }
    .company-switch select, .store-switch select { min-width: 0; width: 100%; }
}
@media (max-width: 860px) {
    .form-grid, .model-grid, .bar-row, .tree-item, .tree-chrome,
    .modal-card form.stack, .modal-card form.form-grid,
    .modal-card.wide form.stack, .modal-card.wide form.form-grid,
    .modal-card.wide form > .form-grid, .set-grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr; }
    .rx-kpis { grid-template-columns: 1fr 1fr; }
    .rx-form-row { grid-template-columns: 1fr; }
    .rx-pay-grid, .rx-line-box { grid-template-columns: 1fr 1fr; }
    .rx-supplier, .rx-focus-btns { grid-column: auto; }
    .rx-focus-row { width: 100%; }
    .rx-focus-row .btn { flex: 1; }
    .family-grid { grid-template-columns: 1fr; }
    .inline-add { flex-direction: column; align-items: stretch; }
    .inline-add .btn { width: 100%; }
    .pos-keys { display: none; }
    .pos-tenders { grid-template-columns: 1fr 1fr; }
    .pos-cust, .pos-split:not([hidden]) { grid-template-columns: 1fr; }
    .pos-sug { right: 0; }
    .pos-due .v { font-size: 26px; }
    .pos-gate { margin: 12px 0; padding: 20px 16px; }
    .pos-cart { max-height: none; }
    .pos-cart thead { display: none; }
    .pos-cart tbody tr {
        display: grid;
        grid-template-columns: 1fr auto auto;
        gap: 6px 8px;
        padding: 10px 8px;
        border-bottom: 1px solid #f0ebe3;
        align-items: center;
    }
    .pos-cart td { border: 0; padding: 0; }
    .pos-cart td:first-child { grid-column: 1 / -1; white-space: normal; }
    .filter { max-width: none; width: 100%; margin-bottom: 10px; }
    .row-actions { flex-wrap: wrap; }
    .btn, button.btn, input, select, textarea { font-size: 16px; }
    .btn, button.btn { min-height: 44px; }
    .btn.small, .linkish { min-height: 36px; font-size: 14px; }
    table.grid td:first-child { white-space: normal; }
    table.grid:not(.dataTable) thead { display: none; }
    table.grid:not(.dataTable), table.grid:not(.dataTable) tbody { display: block; width: 100%; }
    table.grid:not(.dataTable) tr { display: block; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; padding: 6px 0; background: #fff; }
    table.grid:not(.dataTable) tr:last-child td { border-bottom: 0; }
    table.grid:not(.dataTable) td { display: grid; grid-template-columns: minmax(88px, 34%) minmax(0, 1fr); gap: 8px; align-items: start; justify-items: start; border-bottom: 0; padding: 8px 12px; white-space: normal; }
    table.grid:not(.dataTable) td::before { content: attr(data-label); color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 3px; }
    table.grid:not(.dataTable) td:not([data-label])::before { content: none; }
    table.grid:not(.dataTable) td.col-actions,
    table.grid:not(.dataTable) td.empty { display: flex; width: 100%; }
    table.grid:not(.dataTable) td.col-actions { justify-content: flex-end; padding-top: 4px; }
    table.grid:not(.dataTable) td.empty { justify-content: center; }
    .table-wrap, .table-wrap:has(.dt-container), div.dt-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    div.dt-container .dt-search input.dt-input,
    div.dt-container .dt-length select.dt-input { width: 100%; min-width: 0; }
    .modal {
        padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
        align-items: stretch;
    }
    .modal-card, .modal-card.wide {
        width: 100%;
        max-height: calc(100dvh - 24px);
        border-radius: 16px;
    }
    .rev-meta { grid-template-columns: 1fr; }
    .rev-head { flex-direction: column; }
    .rev-table input[type="number"] { width: 100%; max-width: 120px; }
    .ticket-facts { grid-template-columns: 1fr 1fr; }
    .ticket-tools { width: 100%; }
    .dash-toolbar { align-items: stretch; }
    .dash-live { margin-left: 0; }
    .dash-custom { width: 100%; }
    .dash-custom input[type="date"] { min-width: 0; width: 100%; }
    .dash-chart, .dash-chart.sm { height: 200px; }
    .login-shell { display: flex; flex-direction: column; min-height: 100dvh; }
    .login-panel {
        order: -1;
        padding: 28px 16px 20px;
        align-items: flex-start;
    }
    .login-card { width: 100%; padding: 22px 18px 18px; }
    .login-card h2 { font-size: 28px; }
    .login-card .btn { width: 100%; }
    .brand-panel { padding: 16px 16px 28px; }
    .brand-panel h1 { font-size: 28px; }
    .orbit { display: none; }
    .brand-panel .lead { font-size: 15px; }
    .install-wrap { margin: 16px auto; padding: 0 16px max(24px, env(safe-area-inset-bottom)); }
    .install-wrap .btn { width: 100%; }
    .content { padding-bottom: max(32px, env(safe-area-inset-bottom)); }
    .who { flex-wrap: nowrap; }
}
@media (max-width: 480px) {
    .dash-kpis, .stats, .rx-pay-grid, .rx-line-box, .ticket-facts { grid-template-columns: 1fr; }
    .dash-kpi strong, .stat strong { font-size: 22px; }
    .actions .btn, .rx-total .btn.rx-save { width: 100%; }
    .pos-tenders { grid-template-columns: 1fr 1fr; }
    .topbar h1 { font-size: 24px; }
    .card-h h2 { font-size: 18px; }
}
@media print {
    .sidebar, .topbar, .tabs, .impersonate, .no-print, .pos-shell { display: none !important; }
    html, body.app, .shell, .workspace { height: auto; overflow: visible; }
    .shell { display: block; }
    .content { padding: 0; }
    .card { box-shadow: none; }
}
