/* ==========================================================================
   Retail ERP + POS  -  application stylesheet
   --------------------------------------------------------------------------
   Self-contained: no web fonts, no icon fonts, no CDN. Everything the UI needs
   is in this file plus the inline SVG icon helper, so the system renders
   identically on an offline Windows / XAMPP shop machine.

   Sections
     1  Design tokens          8  Tables & lists
     2  Reset & base           9  POS terminal
     3  Layout shell          10  Print: thermal receipts
     4  Buttons               11  Print: A4 invoices
     5  Forms                 12  Print: barcode label sheets
     6  Badges & chips        13  Customer display
     7  Cards & dashboards    14  Print rules & utilities
   ========================================================================== */

/* ---------------------------------------------------------------- 1. TOKENS */
:root {
    --brand:        #15803d;
    --brand-dark:   #14532d;
    --brand-light:  #dcfce7;
    --brand-soft:   #f0fdf4;
    --accent:       #0369a1;
    --accent-light: #e0f2fe;

    --bg:           #f1f5f9;
    --surface:      #ffffff;
    --surface-2:    #f8fafc;
    --surface-3:    #f1f5f9;
    --border:       #e2e8f0;
    --border-strong:#cbd5e1;

    --text:         #0f172a;
    --text-2:       #475569;
    --text-3:       #94a3b8;

    --ok:           #16a34a;
    --ok-bg:        #dcfce7;
    --warn:         #d97706;
    --warn-bg:      #fef3c7;
    --bad:          #dc2626;
    --bad-bg:       #fee2e2;
    --info:         #0284c7;
    --info-bg:      #e0f2fe;
    --muted:        #64748b;
    --muted-bg:     #e2e8f0;
    /* =========================================================
       NEXIVOTEK BRAND PALETTE
       ========================================================= */

    --nexivo-maroon:        #A80000;
    --nexivo-maroon-dark:   #780000;
    --nexivo-maroon-light:  #C73333;

    --nexivo-gold:          #FFD200;
    --nexivo-gold-dark:     #C9A600;
    --nexivo-gold-light:    #FFE566;

    --nexivo-red:            #B51B22;
    --nexivo-red-dark:       #861318;
    --nexivo-red-light:      #D85A60;

    --nexivo-pink:           #F27A86;
    --nexivo-pink-dark:      #C84E5B;
    --nexivo-pink-light:     #F8AEB6;

    --nexivo-green:          #6FA33A;
    --nexivo-green-dark:     #4D7626;
    --nexivo-green-light:    #A5C87E;

    --nexivo-flower-gold:    #F5D000;
    --nexivo-flower-gold-dark: #C5A900;
    --nexivo-flower-gold-light: #FFE66A;

    --nexivo-elephant:       #999999;
    --nexivo-elephant-dark:  #707070;
    --nexivo-elephant-light: #B5B5B5;

    --nexivo-grey:           #D8D8D8;
    --nexivo-grey-dark:      #8E8E8E;
    --nexivo-grey-light:     #B5B5B5;

    --nexivo-outline:        #4A4A4A;
    --nexivo-outline-dark:   #292929;
    --nexivo-outline-light: #707070;

    --nexivo-white:          #FFFFFF;
    --nexivo-white-dark:     #E5E5E5;

    --nexivo-star-gold:      #F2C900;
    --nexivo-star-gold-light:#FFE16A;
    --nexivo-star-gold-dark: #C2A000;

    --nexivo-border-gold:    #E5B900;
    --nexivo-border-gold-light: #F2D46A;
    --nexivo-border-gold-dark:  #B38E00;

    --sidebar-w:    250px;
    --topbar-h:     60px;
    --radius:       10px;
    --radius-sm:    7px;
    --radius-lg:    14px;
    --shadow-sm:    0 1px 2px rgba(15, 23, 42, .06);
    --shadow:       0 2px 8px rgba(15, 23, 42, .08);
    --shadow-lg:    0 12px 34px rgba(15, 23, 42, .16);
    --font:         "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono:         ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
    --speed:        .16s;
}

[data-theme="dark"] {
    --bg:           #0b1220;
    --surface:      #111a2c;
    --surface-2:    #16213a;
    --surface-3:    #1c2942;
    --border:       #24334f;
    --border-strong:#33456a;
    --text:         #e6edf7;
    --text-2:       #a9b8d0;
    --text-3:       #7386a5;
    --brand-light:  #14532d;
    --brand-soft:   #0f2417;
    --shadow:       0 2px 10px rgba(0, 0, 0, .4);
    --shadow-lg:    0 14px 40px rgba(0, 0, 0, .55);
    --ok-bg:        #14351f; --warn-bg: #3a2a0c; --bad-bg: #3b1616;
    --info-bg:      #0d2b41; --muted-bg:#24334f;
}

/* ------------------------------------------------------------ 2. RESET/BASE */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 650; line-height: 1.25; }
h1 { font-size: 20px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
h4 { font-size: 14px; }
p  { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

small { font-size: 12px; }
strong, b { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--border); margin: 10px 0; }

svg { vertical-align: middle; flex: none; }
img { max-width: 100%; }

code, kbd, pre { font-family: var(--mono); font-size: 12.5px; }
kbd {
    background: var(--surface-3); border: 1px solid var(--border-strong);
    border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; font-size: 11.5px;
}

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 999;
    background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.muted   { color: var(--text-3); }
.num     { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 13px; }
.nowrap  { white-space: nowrap; }
.ta-right  { text-align: right; }
.ta-center { text-align: center; }
.ta-left   { text-align: left; }
.text-ok   { color: var(--ok); }
.text-bad  { color: var(--bad); }
.text-warn { color: var(--warn); }
.mono    { font-family: var(--mono); }
.hidden  { display: none !important; }

/* ---------------------------------------------------------- 3. LAYOUT SHELL */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: none;
    background: linear-gradient(180deg, #14532d 0%, #0f3d21 100%);
    color: #dcfce7;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 60;
    transition: transform var(--speed) ease;
}

.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, .12);
    min-height: var(--topbar-h);
}
.brand-mark {
    width: 34px; height: 34px; border-radius: 9px; flex: none;
    background: rgba(255, 255, 255, .16); display: grid; place-items: center; color: #fff;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: rgba(220, 252, 231, .7); font-size: 11px; }
.sidebar-close { display: none; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0 16px; scrollbar-width: thin; }
.sidebar-nav::-webkit-scrollbar { width: 8px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 4px; }

.nav-group { margin-bottom: 4px; }
.nav-group-title {
    margin: 12px 16px 5px; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
    color: rgba(220, 252, 231, .5); font-weight: 700;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 16px; color: rgba(220, 252, 231, .88); font-size: 13.2px;
    border-left: 3px solid transparent; text-decoration: none;
}
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.nav-item.is-active {
    background: rgba(255, 255, 255, .14); color: #fff;
    border-left-color: #4ade80; font-weight: 600;
}
.nav-ico { display: grid; place-items: center; width: 18px; opacity: .9; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge {
    background: #f59e0b; color: #1f2937; font-size: 10.5px; font-weight: 700;
    padding: 1px 6px; border-radius: 20px;
}

.sidebar-foot { padding: 10px 14px 14px; border-top: 1px solid rgba(255, 255, 255, .12); }
.shift-chip {
    display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 8px;
    font-size: 12px; color: #dcfce7; background: rgba(255, 255, 255, .1); text-decoration: none;
}
.shift-chip strong { margin-left: auto; color: #fff; font-family: var(--mono); }
.shift-chip.is-open { background: rgba(74, 222, 128, .18); }
.shift-chip.is-closed { background: rgba(248, 113, 113, .18); }
.shift-chip:hover { text-decoration: none; background: rgba(255, 255, 255, .18); }
.version { margin: 9px 0 0; font-size: 10.5px; color: rgba(220, 252, 231, .45); text-align: center; }

.sidebar-backdrop { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: var(--topbar-h); flex: none;
    background: var(--surface); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 14px; padding: 0 18px;
    position: sticky; top: 0; z-index: 50;
}
.nav-toggle { display: none; }
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title p { margin: 0; font-size: 11.5px; color: var(--text-3); }

.topbar-search { position: relative; flex: 1; max-width: 420px; display: flex; align-items: center; gap: 7px; }
.topbar-search > svg { position: absolute; left: 10px; color: var(--text-3); pointer-events: none; }
.topbar-search input {
    width: 100%; padding: 7px 12px 7px 32px; border: 1px solid var(--border);
    border-radius: 20px; background: var(--surface-2); font: inherit; font-size: 13px; color: var(--text);
}
.topbar-search input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.search-results {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 70;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); max-height: 60vh; overflow-y: auto; padding: 4px;
}
.search-group-title { padding: 6px 9px 3px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); font-weight: 700; }
.search-row {
    display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 7px;
    color: var(--text); font-size: 13px; cursor: pointer;
}
.search-row:hover, .search-row.is-active { background: var(--brand-soft); text-decoration: none; }
.search-row .sr-main { flex: 1; min-width: 0; }
.search-row .sr-main strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-row .sr-main small { color: var(--text-3); font-size: 11.5px; }
.search-row .sr-side { font-family: var(--mono); font-size: 12px; color: var(--text-2); text-align: right; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pos-btn { white-space: nowrap; }
.topbar-alerts { display: flex; gap: 6px; }
.alert-pill {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px;
    border-radius: 20px; font-size: 11.5px; font-weight: 700; text-decoration: none;
}
.alert-pill:hover { text-decoration: none; filter: brightness(.96); }
.alert-pill.danger { background: var(--bad-bg); color: var(--bad); }
.alert-pill.warn   { background: var(--warn-bg); color: var(--warn); }
.alert-pill.info   { background: var(--info-bg); color: var(--info); }

.user-menu { position: relative; }
.user-btn {
    display: flex; align-items: center; gap: 8px; padding: 4px 9px 4px 4px;
    background: transparent; border: 1px solid transparent; border-radius: 22px; cursor: pointer;
    color: var(--text); font: inherit;
}
.user-btn:hover { background: var(--surface-2); border-color: var(--border); }
.avatar {
    width: 30px; height: 30px; border-radius: 50%; flex: none;
    background: var(--brand); color: #fff; display: grid; place-items: center;
    font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
}
.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.user-meta strong { font-size: 12.5px; }
.user-meta small { font-size: 10.5px; color: var(--text-3); }

.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 7px); z-index: 80; min-width: 208px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 5px;
}
.dropdown-menu a, .dropdown-btn {
    display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px;
    border-radius: 7px; color: var(--text); font: inherit; font-size: 13px;
    background: none; border: 0; cursor: pointer; text-align: left; text-decoration: none;
}
.dropdown-menu a:hover, .dropdown-btn:hover { background: var(--surface-3); text-decoration: none; }
.dropdown-menu hr { margin: 5px 0; }
.inline-form { display: inline; margin: 0; }

.content { flex: 1; padding: 18px; min-width: 0; }
.footer {
    flex: none; padding: 10px 18px; border-top: 1px solid var(--border);
    display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between;
    font-size: 11.5px; color: var(--text-3); background: var(--surface);
}

/* --------------------------------------------------------------- 4. BUTTONS */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
    text-decoration: none; white-space: nowrap; background: var(--surface-3); color: var(--text);
    transition: background var(--speed), border-color var(--speed), transform var(--speed);
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); filter: none; }
.btn-accent  { background: var(--accent); color: #fff; }
.btn-danger  { background: var(--bad); color: #fff; }
.btn-warn    { background: var(--warn); color: #fff; }
.btn-ghost   { background: var(--surface); border-color: var(--border-strong); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-soft    { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand-light); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text-2); }

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-icon { padding: 7px; }

.icon-btn {
    display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0;
    border: 1px solid transparent; border-radius: 7px; background: transparent;
    color: var(--text-2); cursor: pointer; font-size: 17px; line-height: 1;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.danger:hover { background: var(--bad-bg); color: var(--bad); }

.row-actions { display: inline-flex; gap: 3px; align-items: center; justify-content: flex-end; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group .btn.is-active { background: var(--brand); color: #fff; border-color: var(--brand); z-index: 1; }

/* ----------------------------------------------------------------- 5. FORMS */
.input, select.input, textarea.input {
    width: 100%; padding: 7px 10px; border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
    font: inherit; font-size: 13px; transition: border-color var(--speed), box-shadow var(--speed);
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.input::placeholder { color: var(--text-3); }
.input:disabled, .input[readonly] { background: var(--surface-3); color: var(--text-2); cursor: not-allowed; }
textarea.input { resize: vertical; min-height: 68px; line-height: 1.5; }
select.input { cursor: pointer; padding-right: 26px; }
.input-file { padding: 5px; font-size: 12px; }
.input-file::file-selector-button {
    font: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; margin-right: 9px;
    border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface-2);
    color: var(--text-2); cursor: pointer;
}

.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 0; flex: 1; min-width: 0; }
.input-group .input:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .input:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-prefix, .input-suffix {
    display: flex; align-items: center; padding: 0 10px; font-size: 12.5px;
    background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text-2); white-space: nowrap;
}
.input-prefix { border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-suffix { border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-left: -1px; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field-label .req { color: var(--bad); }
.field-hint { font-size: 11.5px; color: var(--text-3); line-height: 1.45; }
.field-error { font-size: 11.5px; color: var(--bad); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.field-static { margin: 0; padding: 7px 0; font-size: 13px; font-weight: 600; }
.field.has-error .input, .field.has-error select.input, .field.has-error textarea.input {
    border-color: var(--bad); background: #fff7f7;
}
.field.has-error .input:focus { box-shadow: 0 0 0 3px var(--bad-bg); }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: 1 / -1; }
.form-section-title { margin: 22px 0 12px; padding-bottom: 7px; border-bottom: 1px solid var(--border); }
.form-section-title:first-child { margin-top: 0; }
.form-section-title h3 { font-size: 13.5px; color: var(--brand-dark); text-transform: uppercase; letter-spacing: .05em; }

.check { display: inline-flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 13px; }
.check input[type="checkbox"], .check input[type="radio"] {
    width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--brand); cursor: pointer; flex: none;
}
.check-sm { font-size: 12px; }
.field-inline { justify-content: center; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider {
    width: 38px; height: 21px; border-radius: 21px; background: var(--border-strong);
    position: relative; transition: background var(--speed); flex: none;
}
.switch .slider::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
    border-radius: 50%; background: #fff; transition: transform var(--speed); box-shadow: var(--shadow-sm);
}
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::after { transform: translateX(17px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-text { font-size: 13px; }

.image-field { display: flex; gap: 10px; align-items: flex-start; }
.image-thumb {
    width: 62px; height: 62px; border-radius: var(--radius-sm); object-fit: cover; flex: none;
    border: 1px solid var(--border); background: var(--surface-2);
}
.image-thumb.is-empty { display: grid; place-items: center; color: var(--text-3); }
.image-controls { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }

.form-actions {
    display: flex; align-items: center; gap: 10px; margin-top: 20px;
    padding-top: 16px; border-top: 1px solid var(--border);
}
.form-actions-right { margin-left: auto; display: flex; gap: 8px; }
.form-card { padding: 20px; }

.toolbar {
    display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
    padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2);
    border-radius: var(--radius) var(--radius) 0 0;
}
.toolbar-search { position: relative; display: flex; align-items: center; flex: 1; min-width: 200px; max-width: 340px; }
.toolbar-search > svg { position: absolute; left: 10px; color: var(--text-3); pointer-events: none; }
.toolbar-search .input { padding-left: 32px; }
.toolbar .input, .toolbar select.input { width: auto; min-width: 130px; }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.toolbar-label { font-size: 12px; color: var(--text-3); font-weight: 600; }

.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head-text { min-width: 0; flex: 1; }
.page-head-text h2 { font-size: 19px; }
.page-head-text p { margin: 3px 0 0; font-size: 12.5px; color: var(--text-3); }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* -------------------------------------------------------- 6. BADGES & CHIPS */
.badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
    border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap;
    background: var(--muted-bg); color: var(--muted); line-height: 1.5;
}
.badge-ok    { background: var(--ok-bg); color: var(--ok); }
.badge-warn  { background: var(--warn-bg); color: var(--warn); }
.badge-bad   { background: var(--bad-bg); color: var(--bad); }
.badge-info  { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--muted-bg); color: var(--muted); }
.badge-brand { background: var(--brand-light); color: var(--brand-dark); }
.badge-soft  { background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); }
.badge-lg { font-size: 12.5px; padding: 4px 11px; }

.chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
    border-radius: 7px; background: var(--surface-3); border: 1px solid var(--border);
    font-size: 12px; color: var(--text-2);
}

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot-ok { background: var(--ok); } .dot-bad { background: var(--bad); }
.dot-warn { background: var(--warn); } .dot-muted { background: var(--text-3); }

/* ------------------------------------------------------ 7. CARDS & DASHBOARD */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.card > .card:last-child { margin-bottom: 0; }
.card-head {
    display: flex; align-items: center; gap: 10px; padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 14px; flex: 1; min-width: 0; }
.card-head .card-head-actions { display: flex; gap: 7px; align-items: center; }
.card-body { padding: 15px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 10px 15px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 12px; color: var(--text-3); }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.kpi {
    display: flex; flex-direction: column; gap: 3px; padding: 14px 15px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.kpi.kpi-info::before { background: var(--info); }
.kpi.kpi-warn::before { background: var(--warn); }
.kpi.kpi-bad::before  { background: var(--bad); }
.kpi.kpi-accent::before { background: var(--accent); }
.kpi-label { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; letter-spacing: -.01em; }
.kpi-sub { font-size: 11.5px; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.kpi-sub .up { color: var(--ok); font-weight: 700; }
.kpi-sub .down { color: var(--bad); font-weight: 700; }

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li {
    display: flex; align-items: center; gap: 10px; padding: 8px 0;
    border-bottom: 1px dashed var(--border); font-size: 13px;
}
.mini-list li:last-child { border-bottom: 0; }
.mini-list .ml-main { flex: 1; min-width: 0; }
.mini-list .ml-main strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list .ml-main small { color: var(--text-3); font-size: 11.5px; }
.mini-list .ml-side { font-family: var(--mono); font-size: 12.5px; text-align: right; white-space: nowrap; }

.empty-state { padding: 42px 20px; text-align: center; color: var(--text-2); }
.empty-ico {
    width: 62px; height: 62px; margin: 0 auto 12px; border-radius: 50%;
    background: var(--surface-3); color: var(--text-3); display: grid; place-items: center;
}
.empty-state h3 { margin-bottom: 5px; color: var(--text); }
.empty-state p { max-width: 430px; margin: 0 auto 14px; font-size: 13px; color: var(--text-3); }

.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--border); padding: 0 12px; overflow-x: auto; }
.tab {
    padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--text-2);
    border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none;
}
.tab:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12.5px; }
.bar-row .bar-label { width: 120px; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bar-track { flex: 1; height: 9px; background: var(--surface-3); border-radius: 5px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: var(--brand); border-radius: 5px; min-width: 2px; }
.bar-row .bar-fill.info { background: var(--info); }
.bar-row .bar-fill.warn { background: var(--warn); }
.bar-row .bar-fill.bad { background: var(--bad); }
.bar-row .bar-value { width: 92px; flex: none; text-align: right; font-family: var(--mono); font-size: 12px; }

.spark { display: flex; align-items: flex-end; gap: 3px; height: 46px; }
.spark span { flex: 1; background: var(--brand-light); border-radius: 3px 3px 0 0; min-height: 3px; position: relative; }
.spark span:hover { background: var(--brand); }
.spark span[title] { cursor: help; }

.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg .grid-line { stroke: var(--border); stroke-width: 1; }
.chart-svg .axis-text { font-size: 10px; fill: var(--text-3); font-family: var(--font); }
.chart-svg .line-sales { fill: none; stroke: var(--brand); stroke-width: 2.2; stroke-linejoin: round; }
.chart-svg .area-sales { fill: var(--brand); opacity: .13; }
.chart-svg .bar { fill: var(--accent); opacity: .82; }
.chart-svg .bar:hover { opacity: 1; }

/* --------------------------------------------------------- 8. TABLES & LIST */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 8px 11px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table thead th {
    background: var(--surface-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-3); font-weight: 700; white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.table tbody tr:hover { background: var(--brand-soft); }
.table tbody tr.is-inactive { opacity: .58; }
.table tbody tr.is-inactive:hover { opacity: .8; }
.table tbody tr.row-selected { background: var(--brand-light); }
.table tfoot td { background: var(--surface-2); font-weight: 700; border-top: 2px solid var(--border-strong); }
.table-sm th, .table-sm td { padding: 5px 8px; font-size: 12.2px; }
.table-hover tbody tr { cursor: default; }
.table .col-actions { width: 1%; white-space: nowrap; }
.table .cell-link { font-weight: 600; color: var(--text); }
.table .cell-link:hover { color: var(--brand); }
.table .cell-thumb { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); }
.table .cell-sub { display: block; font-size: 11px; color: var(--text-3); }
.table-plain thead th { position: static; }
.table tr.group-row td { background: var(--surface-3); font-weight: 700; font-size: 12px; color: var(--text-2); }

.pagination {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 11px 15px; border-top: 1px solid var(--border); background: var(--surface-2);
    border-radius: 0 0 var(--radius) var(--radius);
}
.pagination-info { margin: 0; font-size: 12.2px; color: var(--text-3); }
.pagination-controls { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.per-page { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.per-page select { padding: 3px 6px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--surface); font: inherit; font-size: 12px; color: var(--text); }
.page-btns { display: flex; gap: 3px; }
.page-btn {
    min-width: 29px; height: 29px; padding: 0 7px; display: inline-grid; place-items: center;
    border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
    color: var(--text-2); font-size: 12.2px; font-weight: 600; text-decoration: none;
}
.page-btn:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.page-btn.is-current { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-btn.is-disabled { opacity: .4; pointer-events: none; }
.page-gap { padding: 0 4px; color: var(--text-3); align-self: center; }

/* -------------------------------------------------------------- FLASH/TOAST */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.flash {
    display: flex; align-items: center; gap: 10px; padding: 11px 14px;
    border-radius: var(--radius-sm); font-size: 13px; border-left: 4px solid;
    background: var(--surface); box-shadow: var(--shadow-sm);
}
.flash-ico { display: grid; place-items: center; flex: none; }
.flash-close { margin-left: auto; background: none; border: 0; font-size: 19px; line-height: 1; cursor: pointer; color: inherit; opacity: .55; padding: 0 2px; }
.flash-close:hover { opacity: 1; }
.flash-success { border-left-color: var(--ok); background: var(--ok-bg); color: #14532d; }
.flash-error   { border-left-color: var(--bad); background: var(--bad-bg); color: #7f1d1d; }
.flash-warning { border-left-color: var(--warn); background: var(--warn-bg); color: #78350f; }
.flash-info    { border-left-color: var(--info); background: var(--info-bg); color: #0c4a6e; }
[data-theme="dark"] .flash-success { color: #bbf7d0; }
[data-theme="dark"] .flash-error { color: #fecaca; }
[data-theme="dark"] .flash-warning { color: #fde68a; }
[data-theme="dark"] .flash-info { color: #bae6fd; }

.toast-root { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 340px; }
.toast {
    display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: var(--radius-sm);
    background: #0f172a; color: #f8fafc; font-size: 13px; box-shadow: var(--shadow-lg);
    animation: toast-in .18s ease-out;
}
.toast.ok { background: #14532d; } .toast.bad { background: #7f1d1d; } .toast.warn { background: #78350f; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ MODALS */
.modal-root { position: fixed; inset: 0; z-index: 150; pointer-events: none; }
.modal-backdrop {
    position: absolute; inset: 0; background: rgba(15, 23, 42, .55);
    pointer-events: auto; animation: fade-in .14s ease-out;
    display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    width: 100%; max-width: 560px; pointer-events: auto; animation: modal-in .17s ease-out;
    display: flex; flex-direction: column; max-height: calc(100vh - 80px);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(-12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal.modal-lg { max-width: 860px; }
.modal.modal-xl { max-width: 1140px; }
.modal.modal-sm { max-width: 400px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { flex: 1; font-size: 15.5px; }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; gap: 9px; justify-content: flex-end; padding: 13px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.modal-foot .left { margin-right: auto; display: flex; gap: 8px; }

.dropdown-backdrop { position: fixed; inset: 0; z-index: 75; }

/* ----------------------------------------------------------- 9. POS SCREEN */
body.pos-body { overflow: hidden; }
.pos {
    display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-template-rows: 100vh;
    height: 100vh; background: var(--bg);
}
.pos-left { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border); }
.pos-right { display: flex; flex-direction: column; min-width: 0; background: var(--surface); }

.pos-top {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    background: var(--surface); border-bottom: 1px solid var(--border); flex: none;
}
.pos-top .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--brand-dark); white-space: nowrap; }
.pos-top .brand small { display: block; font-weight: 500; font-size: 10.5px; color: var(--text-3); }
.pos-scan { flex: 1; position: relative; display: flex; align-items: center; }
.pos-scan > svg { position: absolute; left: 12px; color: var(--brand); pointer-events: none; }
.pos-scan input {
    width: 100%; padding: 10px 12px 10px 38px; font: inherit; font-size: 15px; font-weight: 600;
    border: 2px solid var(--brand); border-radius: var(--radius); background: var(--surface); color: var(--text);
}
.pos-scan input:focus { outline: none; box-shadow: 0 0 0 4px var(--brand-light); }
.pos-scan .search-results { top: calc(100% + 4px); max-height: 55vh; }
.pos-top-meta { display: flex; gap: 6px; align-items: center; }
.pos-clock { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); white-space: nowrap; }

.pos-lines { flex: 1; overflow-y: auto; background: var(--surface); }
.pos-lines table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pos-lines th { position: sticky; top: 0; background: var(--surface-2); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); padding: 7px 9px; text-align: left; border-bottom: 1px solid var(--border); z-index: 1; }
.pos-lines td { padding: 6px 9px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pos-lines tr.is-current td { background: var(--brand-soft); }
.pos-lines tr.is-free td { background: var(--warn-bg); }
.pos-lines .ln-name strong { display: block; font-weight: 600; font-size: 13px; }
.pos-lines .ln-name small { color: var(--text-3); font-size: 11px; font-family: var(--mono); }
.pos-lines .ln-promo { display: inline-flex; align-items: center; gap: 3px; margin-top: 2px; font-size: 10.5px; color: var(--warn); font-weight: 700; }
.pos-lines .ln-batch { font-size: 10.5px; color: var(--info); }
.pos-lines input.qty, .pos-lines input.rate, .pos-lines input.disc {
    width: 78px; padding: 5px 7px; text-align: right; font: inherit; font-size: 13px; font-family: var(--mono);
    border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text);
}
.pos-lines input.qty { width: 72px; }
.pos-lines input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-light); }
.pos-lines input:disabled { background: var(--surface-3); color: var(--text-3); }
.pos-lines .ln-amt { font-family: var(--mono); font-weight: 700; text-align: right; white-space: nowrap; }
.pos-lines .ln-mrp { font-size: 10.5px; color: var(--text-3); display: block; text-align: right; font-family: var(--mono); }
.pos-lines .ln-rm { color: var(--text-3); }
.pos-lines .ln-rm:hover { color: var(--bad); }
.pos-empty { padding: 60px 20px; text-align: center; color: var(--text-3); }
.pos-empty svg { margin-bottom: 8px; color: var(--border-strong); }
.pos-empty kbd { margin: 0 2px; }

.pos-bottom {
    display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px; background: var(--surface);
    border-top: 1px solid var(--border); flex: none;
}
.pos-bottom .btn { flex: 1; min-width: 108px; flex-direction: column; gap: 1px; padding: 7px 8px; line-height: 1.2; }
.pos-bottom .btn kbd { font-size: 10px; padding: 0 4px; background: rgba(255,255,255,.7); border-color: transparent; }
.pos-bottom .btn-primary kbd, .pos-bottom .btn-danger kbd, .pos-bottom .btn-accent kbd { background: rgba(255,255,255,.25); color: #fff; }

.pos-cust { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.pos-cust-row { display: flex; align-items: center; gap: 8px; }
.pos-cust-row .input { flex: 1; }
.pos-cust-info { display: flex; gap: 8px; margin-top: 7px; flex-wrap: wrap; align-items: center; }
.pos-cust-info strong { font-size: 13px; }
.pos-cust-info .badge { font-size: 10.5px; }
.pos-cust-info .cust-bal { font-family: var(--mono); font-size: 12px; margin-left: auto; }

.pos-totals { padding: 10px 14px; border-bottom: 1px solid var(--border); flex: none; }
.pos-totals .row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; font-size: 13px; color: var(--text-2); }
.pos-totals .row strong { font-family: var(--mono); color: var(--text); font-size: 13px; }
.pos-totals .row.save { color: var(--ok); }
.pos-totals .row.save strong { color: var(--ok); }
.pos-totals .row.disc-row .input { width: 90px; padding: 3px 7px; text-align: right; font-family: var(--mono); font-size: 12.5px; }
.pos-totals .grand {
    display: flex; justify-content: space-between; align-items: baseline; margin-top: 7px; padding: 10px 12px;
    background: var(--brand-dark); color: #fff; border-radius: var(--radius);
}
.pos-totals .grand span { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; opacity: .85; }
.pos-totals .grand strong { font-family: var(--mono); font-size: 27px; letter-spacing: -.01em; }
.pos-tax { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 6px; font-family: var(--mono); }

.pos-pay { padding: 10px 12px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pay-methods .btn { padding: 8px 6px; font-size: 12.5px; flex-direction: column; gap: 2px; }
.pay-methods .btn kbd { font-size: 9.5px; padding: 0 4px; }
.pay-methods .btn.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pay-lines { display: flex; flex-direction: column; gap: 5px; }
.pay-line { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.pay-line .pl-name { flex: 1; font-weight: 600; }
.pay-line .input { width: 120px; text-align: right; font-family: var(--mono); padding: 5px 8px; }
.pay-line .input.ref { width: 110px; text-align: left; font-family: var(--font); font-size: 12px; }
.pay-summary { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px dashed var(--border-strong); }
.pay-summary div { text-align: center; flex: 1; }
.pay-summary small { display: block; color: var(--text-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.pay-summary strong { font-family: var(--mono); font-size: 15px; }
.pay-summary .due strong { color: var(--bad); }
.pay-summary .change strong { color: var(--ok); }
.pay-summary .paid strong { color: var(--text); }
.quick-cash { display: flex; gap: 5px; flex-wrap: wrap; }
.quick-cash .btn { flex: 1; min-width: 56px; padding: 6px 4px; font-family: var(--mono); font-size: 12.5px; }
.pos-notes .input { font-size: 12px; }

.pos-actions { padding: 10px 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex: none; }
.pos-actions .btn-lg { flex: 1; font-size: 16px; padding: 14px; flex-direction: column; gap: 1px; }
.pos-actions .btn-lg small { font-size: 10.5px; font-weight: 500; opacity: .8; }

.pos-status {
    display: flex; gap: 12px; padding: 5px 12px; font-size: 11px; color: var(--text-3);
    background: var(--surface-2); border-top: 1px solid var(--border); flex: none; flex-wrap: wrap;
}
.pos-status span { display: inline-flex; align-items: center; gap: 4px; }
.pos-status .dot { width: 7px; height: 7px; }
.pos-status .spacer { flex: 1; }

.pos-cats { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; background: var(--surface); border-bottom: 1px solid var(--border); flex: none; scrollbar-width: thin; }
.pos-cats .btn { flex: none; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; padding: 10px 12px; overflow-y: auto; }
.pos-tile {
    display: flex; flex-direction: column; gap: 3px; padding: 9px 10px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: var(--text);
    min-height: 74px; position: relative;
}
.pos-tile:hover { border-color: var(--brand); background: var(--brand-soft); }
.pos-tile strong { font-size: 12.5px; line-height: 1.25; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pos-tile .tile-price { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--brand-dark); margin-top: auto; }
.pos-tile .tile-stock { font-size: 10.5px; color: var(--text-3); }
.pos-tile.is-low .tile-stock { color: var(--warn); }
.pos-tile.is-out { opacity: .5; }
.pos-tile .tile-offer { position: absolute; top: 5px; right: 5px; background: var(--warn); color: #fff; font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 4px; text-transform: uppercase; }

.shortcut-help { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; font-size: 13px; }
.shortcut-help div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--border); }

.held-list .held-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.held-list .held-row strong { font-family: var(--mono); }
.held-list .held-row .hb-meta { flex: 1; min-width: 0; font-size: 12px; color: var(--text-2); }

.batch-pick td { font-size: 12.5px; }
.batch-pick tr.is-fefo td { background: var(--brand-soft); }
.batch-pick tr.is-expired td { background: var(--bad-bg); color: var(--bad); }
.batch-pick tr.is-near td { background: var(--warn-bg); }

.weight-hint { font-size: 11.5px; color: var(--info); display: flex; align-items: center; gap: 4px; }

.numpad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.numpad .btn { padding: 11px 0; font-size: 16px; font-family: var(--mono); }
.numpad .btn.wide { grid-column: span 2; }

/* ---------------------------------------------------- 10. THERMAL RECEIPTS */
.receipt {
    font-family: "Courier New", Courier, ui-monospace, monospace; color: #000; background: #fff;
    margin: 0 auto; padding: 4px 3px; line-height: 1.28; font-size: 11.5px; -webkit-print-color-adjust: exact;
}
.receipt.w58 { width: 48mm; font-size: 10px; }
.receipt.w80 { width: 72mm; font-size: 11.5px; }
.receipt .c { text-align: center; }
.receipt .r { text-align: right; }
.receipt .b { font-weight: 700; }
.receipt .lg { font-size: 1.28em; }
.receipt .xl { font-size: 1.55em; }
.receipt .sm { font-size: .9em; }
.receipt .hr { border-top: 1px dashed #000; margin: 3px 0; }
.receipt .hr2 { border-top: 2px solid #000; margin: 3px 0; }
.receipt .logo { max-height: 42px; max-width: 80%; margin: 0 auto 3px; display: block; filter: grayscale(1); }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td, .receipt th { padding: 1px 0; vertical-align: top; font-size: inherit; font-weight: inherit; text-align: left; }
.receipt th { border-bottom: 1px dashed #000; }
.receipt .items td.n { width: 100%; word-break: break-word; }
.receipt .items td.q, .receipt .items td.p, .receipt .items td.a { white-space: nowrap; text-align: right; padding-left: 5px; }
.receipt .items .sub { font-size: .9em; color: #222; }
.receipt .tot td { padding: 1px 0; }
.receipt .tot td.l { text-align: left; }
.receipt .tot td.v { text-align: right; white-space: nowrap; }
.receipt .tot tr.grand td { font-size: 1.32em; font-weight: 700; border-top: 1px solid #000; border-bottom: 1px solid #000; padding: 2px 0; }
.receipt .gst td { font-size: .88em; }
.receipt .foot { margin-top: 5px; text-align: center; font-size: .92em; white-space: pre-line; }
.receipt .barcode-wrap { margin: 5px auto 0; text-align: center; }
.receipt .barcode-wrap svg { max-width: 100%; height: 34px; }
.receipt .cust { font-size: .92em; }
.receipt .cancel-stamp { border: 2px solid #000; padding: 3px; margin: 4px 0; font-weight: 700; text-align: center; letter-spacing: .12em; }
.receipt-toolbar {
    max-width: 420px; margin: 14px auto; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
    background: var(--surface); padding: 12px; border-radius: var(--radius); border: 1px solid var(--border);
}
body.print-body { background: #e5e7eb; padding: 12px; }
body.print-body .receipt { box-shadow: 0 2px 12px rgba(0,0,0,.18); padding: 12px 8px; }

/* -------------------------------------------------------- 11. A4 INVOICES */
.a4 {
    width: 210mm; min-height: 297mm; margin: 0 auto; padding: 12mm 12mm 14mm; background: #fff; color: #111;
    font-family: Arial, Helvetica, "Segoe UI", sans-serif; font-size: 11.5px; line-height: 1.4; position: relative;
}
.a4.landscape { width: 297mm; min-height: 210mm; }
body.print-body .a4 { box-shadow: 0 2px 16px rgba(0,0,0,.18); margin-bottom: 14px; }
.a4 h1 { font-size: 20px; }
.a4 .inv-head { display: flex; justify-content: space-between; gap: 14px; border-bottom: 2px solid #111; padding-bottom: 8px; margin-bottom: 8px; }
.a4 .inv-head .co { display: flex; gap: 12px; align-items: flex-start; }
.a4 .inv-head .co img { max-height: 58px; max-width: 120px; }
.a4 .inv-head .co h1 { margin-bottom: 2px; }
.a4 .inv-head .co p { margin: 0; font-size: 11px; color: #333; }
.a4 .inv-head .doc { text-align: right; }
.a4 .inv-head .doc h2 { font-size: 17px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.a4 .inv-head .doc table { margin-left: auto; font-size: 11.5px; }
.a4 .inv-head .doc td { padding: 1px 0 1px 12px; }
.a4 .inv-head .doc td:first-child { color: #555; }
.a4 .parties { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.a4 .party { border: 1px solid #bbb; border-radius: 4px; padding: 7px 9px; }
.a4 .party h4 { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: #555; margin-bottom: 3px; }
.a4 .party p { margin: 0; }
.a4 table.items { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.a4 table.items th { background: #f0f0f0; border: 1px solid #999; padding: 5px 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; text-align: left; }
.a4 table.items td { border: 1px solid #bbb; padding: 4px 6px; vertical-align: top; }
.a4 table.items td.r, .a4 table.items th.r { text-align: right; white-space: nowrap; }
.a4 table.items td.c, .a4 table.items th.c { text-align: center; }
.a4 table.items td small { color: #555; font-size: 10px; display: block; }
.a4 table.items tfoot td { font-weight: 700; background: #fafafa; }
.a4 .inv-foot { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
.a4 .gst-summary { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.a4 .gst-summary th, .a4 .gst-summary td { border: 1px solid #bbb; padding: 3px 5px; text-align: right; }
.a4 .gst-summary th { background: #f0f0f0; text-align: center; }
.a4 .gst-summary td:first-child, .a4 .gst-summary th:first-child { text-align: left; }
.a4 .totals { width: 100%; border-collapse: collapse; }
.a4 .totals td { padding: 3px 6px; border-bottom: 1px solid #ddd; }
.a4 .totals td:last-child { text-align: right; font-family: "Courier New", monospace; white-space: nowrap; font-weight: 600; }
.a4 .totals tr.grand td { font-size: 14.5px; font-weight: 700; border-top: 2px solid #111; border-bottom: 2px solid #111; background: #f7f7f7; }
.a4 .words { margin: 8px 0; padding: 6px 9px; background: #f7f7f7; border-left: 3px solid #111; font-size: 11px; }
.a4 .words strong { text-transform: capitalize; }
.a4 .terms { font-size: 10px; color: #444; white-space: pre-line; margin-top: 8px; }
.a4 .sign { display: flex; justify-content: space-between; margin-top: 34px; font-size: 11px; }
.a4 .sign div { text-align: center; min-width: 150px; border-top: 1px solid #333; padding-top: 4px; }
.a4 .stamp {
    position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-22deg);
    border: 4px solid #c00; color: #c00; font-size: 42px; font-weight: 800; letter-spacing: .2em;
    padding: 6px 24px; opacity: .3; pointer-events: none; text-transform: uppercase;
}
.a4 .page-no { position: absolute; bottom: 6mm; right: 12mm; font-size: 10px; color: #666; }
.a4 .stmt th { background: #f0f0f0; }
.a4 .report-title { text-align: center; margin-bottom: 8px; }
.a4 .report-title h2 { font-size: 16px; }
.a4 .report-title p { font-size: 11px; color: #555; }

/* ---------------------------------------------- 12. BARCODE LABEL SHEETS */
.label-sheet { background: #fff; color: #000; margin: 0 auto; box-sizing: border-box; overflow: hidden; }
.label-sheet.preview { box-shadow: 0 2px 16px rgba(0,0,0,.18); margin-bottom: 14px; }
.label-grid { display: grid; align-content: start; }
.label {
    box-sizing: border-box; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
    padding: 1mm 1.2mm; font-family: Arial, Helvetica, sans-serif; line-height: 1.15; page-break-inside: avoid; break-inside: avoid;
    background: #fff; color: #000;
}
.label.bordered { border: .2mm dashed #999; }
.label .lb-shop { font-weight: 700; text-align: center; font-size: .85em; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label .lb-logo { max-height: 5mm; max-width: 60%; display: block; margin: 0 auto .3mm; }
.label .lb-name { font-weight: 700; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.label .lb-sub { font-size: .78em; text-align: center; color: #222; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label .lb-code { text-align: center; display: flex; flex-direction: column; align-items: center; }
.label .lb-code svg { width: 96%; display: block; }
.label .lb-code .lb-num { font-family: "Courier New", monospace; font-size: .88em; letter-spacing: .12em; margin-top: .2mm; }
.label .lb-row { display: flex; justify-content: space-between; gap: 1mm; font-size: .84em; white-space: nowrap; }
.label .lb-mrp { font-weight: 800; font-size: 1.25em; }
.label .lb-mrp small { font-weight: 500; font-size: .6em; }
.label .lb-price { font-weight: 700; }
.label .lb-strike { text-decoration: line-through; color: #444; font-weight: 400; }
.label .lb-tiny { font-size: .7em; color: #333; }
.label.shelf { flex-direction: row; align-items: center; gap: 2mm; }
.label.shelf .shelf-l { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.label.shelf .shelf-r { flex: none; text-align: right; }
.label.shelf .lb-mrp { font-size: 1.9em; line-height: 1; }
.label.price .lb-mrp { font-size: 1.5em; text-align: center; }
.label.price .lb-name { font-size: .9em; }

.label-preview-wrap { background: #e5e7eb; padding: 16px; border-radius: var(--radius); overflow: auto; max-height: 72vh; }
.label-queue td .input { width: 64px; padding: 3px 6px; text-align: center; }

/* ---------------------------------------------------- 13. CUSTOMER DISPLAY */
body.cd-body {
    margin: 0; height: 100vh; overflow: hidden; background: #0b1220; color: #fff; font-family: var(--font);
}
.cd { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); height: 100vh; }
.cd-left { display: flex; flex-direction: column; padding: 26px 30px; min-width: 0; }
.cd-right { background: linear-gradient(160deg, #14532d, #052e16); display: flex; flex-direction: column; justify-content: center; padding: 30px; }
.cd-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.cd-head h1 { font-size: 28px; font-weight: 700; }
.cd-head .cd-time { font-family: var(--mono); font-size: 20px; opacity: .7; }
.cd-items { flex: 1; overflow: hidden; }
.cd-items table { width: 100%; border-collapse: collapse; font-size: 20px; }
.cd-items th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; opacity: .55; padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,.15); }
.cd-items td { padding: 10px 4px; border-bottom: 1px solid rgba(255,255,255,.08); }
.cd-items td.r { text-align: right; font-family: var(--mono); white-space: nowrap; }
.cd-items tr.is-last td { background: rgba(74, 222, 128, .14); }
.cd-items .cd-more { font-size: 14px; opacity: .55; text-align: center; padding: 10px; }
.cd-total-label { font-size: 16px; text-transform: uppercase; letter-spacing: .14em; opacity: .75; }
.cd-total { font-size: 68px; font-weight: 800; font-family: var(--mono); letter-spacing: -.02em; line-height: 1.1; }
.cd-sub { display: flex; justify-content: space-between; font-size: 18px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.18); }
.cd-sub strong { font-family: var(--mono); }
.cd-save { margin-top: 14px; font-size: 22px; color: #86efac; font-weight: 700; }
.cd-thanks { font-size: 48px; font-weight: 700; text-align: center; }
.cd-thanks small { display: block; font-size: 20px; opacity: .7; margin-top: 10px; font-weight: 400; }
.cd-idle { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; }
.cd-idle h2 { font-size: 40px; margin-bottom: 8px; }
.cd-idle p { font-size: 20px; opacity: .65; }
.cd-offers { margin-top: auto; padding-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.cd-offers span { background: rgba(245, 158, 11, .2); color: #fcd34d; padding: 5px 12px; border-radius: 20px; font-size: 14px; font-weight: 600; }
.cd-change { margin-top: 10px; font-size: 20px; }
.cd-change strong { font-family: var(--mono); color: #86efac; font-size: 28px; }

/* ------------------------------------------------- 14. PRINT & UTILITIES */
.login-body {min-height: 100vh;display: flex;align-items: center;justify-content: right;padding: 20px;
background-image:linear-gradient(90deg,rgba(0, 0, 0, .38) 0%,rgba(0, 0, 0, .15) 38%,rgba(0, 0, 0, .05) 68%,rgba(0, 0, 0, .15) 100%
),url("../images/login-bg.jpg");background-size: cover;background-position: center center;background-repeat: no-repeat;}
.login-card {width: 100%; max-width: 400px; background: var(--surface); border-radius: var(--radius-lg);
box-shadow: var(--shadow-lg); padding: 30px 28px;}
.login-card .brand-mark {width: 150px;height: auto;min-height: 120px;margin: 0 auto 18px;display: flex;align-items: center;
justify-content: center;background: transparent;}
.login-card .login-logo {display: block;width: 150px;max-width: 150px;height: auto;max-height: 120px;object-fit: contain;}
.login-card h1 {text-align: center;font-size: 22px;font-weight: 700;letter-spacing: -.2px;color: #292929;margin-bottom: 4px;}
.login-card .sub {text-align: center;color: #707070;font-size: 13px;margin-bottom: 24px;}
.login-card .field { margin-bottom: 14px; }
.login-foot {margin-top: 24px;padding-top: 17px;border-top: 1px solid var(--nexivo-grey);text-align: center;}
.login-business-info {display: flex;justify-content: center;align-items: center;gap: 7px;font-size: 11px;font-weight: 600;color: var(--nexivo-outline);}
.login-dot {color: var(--nexivo-gold-dark);font-size: 10px;}
.login-help {margin-top: 7px;font-size: 10.5px;line-height: 1.5;color: var(--nexivo-elephant-dark);}
.login-help em {color: var(--nexivo-maroon);font-style: normal;font-weight: 600;}
.login-copyright {display: flex;align-items: center;justify-content: center;gap: 8px;margin-top: 15px;font-size: 9.5px;color: var(--nexivo-elephant);}
.login-copyright strong {color: var(--nexivo-maroon);font-weight: 600;}
.login-copyright-line {width: 18px;height: 1px;background: var(--nexivo-border-gold);opacity: .8;}

.login-brand-side {color: #fff;width: 460px;max-width: 460px;padding: 28px 32px;background: rgba(0, 0, 0, .38);
border-radius: 16px;box-shadow: 0 10px 30px rgba(0, 0, 0, .18);backdrop-filter: blur(2px);-webkit-backdrop-filter: blur(2px);}
.login-company {display: flex;align-items: center;gap: 9px;margin-bottom: 12px;font-size: 10px;font-weight: 700;
letter-spacing: 1.8px;color: #FFE16A;}
.login-company-line {width: 26px;height: 2px;background: #F2C900;border-radius: 2px;}
.login-brand-side h2 {margin: 0 0 12px;font-size: 34px;line-height: 1.15;font-weight: 700;color: var(--nexivo-white-dark);letter-spacing: -.4px;}
.login-brand-desc {max-width: 410px;margin: 0 0 24px;font-size: 14px;line-height: 1.65;color: rgba(255, 255, 255, .82);}
.login-feature-list {display: grid;gap: 12px;}
.login-feature {display: flex;align-items: center;gap: 12px;}
.login-feature-icon {flex: 0 0 38px;width: 38px;height: 38px;display: grid;place-items: center;border: 1px solid rgba(255, 210, 0, .35);
border-radius: 10px;background: rgba(255, 255, 255, .10);color: #FFE16A;}
.login-feature strong {display: block;margin-bottom: 2px;font-size: 13px;font-weight: 600;color: #fff;}
.login-feature span {display: block;font-size: 11.5px;line-height: 1.45;color: rgba(255, 255, 255, .68);}
.login-offline {display: inline-flex;align-items: center;gap: 7px;margin-top: 24px;padding: 7px 11px;border: 1px solid rgba(255, 255, 255, .18);
border-radius: 20px;background: rgba(0, 0, 0, .16);font-size: 10.5px;color: rgba(255, 255, 255, .78);}
.login-offline svg {color: #FFE16A;}
.login-wrap { display: flex; align-items: center; gap: 50px; }
.login-brand-side h2 {text-shadow: 0 2px 8px rgba(0, 0, 0, .45);}
.login-brand-desc {text-shadow: 0 1px 5px rgba(0, 0, 0, .55);}
.login-feature strong {text-shadow: 0 1px 4px rgba(0, 0, 0, .35);}
.login-feature span {text-shadow: 0 1px 4px rgba(0, 0, 0, .30);}
.login-company {text-shadow: 0 1px 5px rgba(0, 0, 0, .35);}
.login-offline {text-shadow: 0 1px 4px rgba(0, 0, 0, .30);}
.login-card .input {border-color: var(--nexivo-grey);background: var(--nexivo-white);color: var(--nexivo-outline);}
.login-card .input::placeholder {color: var(--nexivo-elephant);}
.login-card .input:hover {border-color: var(--nexivo-grey-dark);}
.login-card .input:focus,.login-card select.input:focus,.login-card textarea.input:focus {
border-color: var(--nexivo-maroon);box-shadow: 0 0 0 3px rgba(168, 0, 0, .10);outline: none;}
.login-card .field-label {color: var(--nexivo-outline);font-weight: 600;}
.login-card .input-group .btn-ghost {color: var(--nexivo-elephant-dark);background: transparent;}
.login-card .input-group .btn-ghost:hover {color: var(--nexivo-maroon);background: var(--nexivo-star-gold-light);}
.login-card .btn-primary {background: var(--nexivo-maroon);border-color: var(--nexivo-maroon);color: var(--nexivo-white);box-shadow: 0 4px 10px rgba(168, 0, 0, .18);}
.login-card .btn-primary:hover {background: var(--nexivo-maroon-dark);border-color: var(--nexivo-maroon-dark);color: var(--nexivo-white);
box-shadow: 0 6px 14px rgba(120, 0, 0, .22);}
.login-card .btn-primary:active {background: var(--nexivo-maroon-dark);border-color: var(--nexivo-maroon-dark);}

.install-body { background: var(--bg); padding: 30px 16px; }
.install-card { max-width: 720px; margin: 0 auto; }
.install-steps { display: flex; gap: 6px; margin-bottom: 18px; }
.install-steps span { flex: 1; text-align: center; padding: 8px; border-radius: 7px; background: var(--surface-3); font-size: 12px; font-weight: 600; color: var(--text-3); }
.install-steps span.is-active { background: var(--brand); color: #fff; }
.install-steps span.is-done { background: var(--brand-light); color: var(--brand-dark); }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.check-list li:last-child { border-bottom: 0; }
.check-list .ok { color: var(--ok); } .check-list .bad { color: var(--bad); } .check-list .warn { color: var(--warn); }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; margin: 0; }
.dl dt { color: var(--text-3); font-weight: 600; }
.dl dd { margin: 0; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 14px 14px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); }
.timeline li.bad::before { background: var(--bad); }
.timeline li.warn::before { background: var(--warn); }
.timeline li small { display: block; color: var(--text-3); font-size: 11.5px; }

.diff-table td.old { background: var(--bad-bg); }
.diff-table td.new { background: var(--ok-bg); }

.perm-matrix th { writing-mode: vertical-rl; transform: rotate(180deg); text-align: left; padding: 8px 4px; font-size: 10.5px; white-space: nowrap; }
.perm-matrix th:first-child { writing-mode: horizontal-tb; transform: none; text-align: left; }
.perm-matrix td { text-align: center; padding: 3px; }
.perm-matrix td:first-child { text-align: left; font-weight: 600; white-space: nowrap; }
.perm-matrix input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.perm-matrix tr.mod-row:hover td { background: var(--brand-soft); }
.perm-matrix td.na { background: var(--surface-3); }

.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--topbar-h) + 18px); }
.settings-nav a { padding: 8px 12px; border-radius: 7px; color: var(--text-2); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 9px; text-decoration: none; }
.settings-nav a:hover { background: var(--surface-3); text-decoration: none; }
.settings-nav a.is-active { background: var(--brand-soft); color: var(--brand-dark); }
.settings-section { scroll-margin-top: calc(var(--topbar-h) + 14px); }

.progress { height: 8px; background: var(--surface-3); border-radius: 5px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 5px; }
.progress.warn > span { background: var(--warn); }
.progress.bad > span { background: var(--bad); }

.stock-cell { display: flex; flex-direction: column; align-items: flex-end; }
.stock-cell .progress { width: 70px; margin-top: 3px; }

.sticky-actions { position: sticky; bottom: 0; background: var(--surface); padding: 12px 15px; border-top: 1px solid var(--border); display: flex; gap: 9px; align-items: center; z-index: 5; box-shadow: 0 -4px 12px rgba(15,23,42,.06); border-radius: 0 0 var(--radius) var(--radius); }
.sticky-actions .spacer { flex: 1; }
.sticky-actions .grand { font-family: var(--mono); font-size: 18px; font-weight: 700; }

.entry-table td { padding: 4px 5px; }
.entry-table .input { padding: 5px 7px; font-size: 12.5px; }
.entry-table .input.num { text-align: right; font-family: var(--mono); }
.entry-table .prod-cell { min-width: 220px; position: relative; }
.entry-table .prod-cell .search-results { top: 100%; left: 0; min-width: 380px; }
.entry-table .prod-cell strong { display: block; font-size: 12.5px; }
.entry-table .prod-cell small { color: var(--text-3); font-size: 11px; font-family: var(--mono); }
.entry-table tfoot td { font-weight: 700; font-family: var(--mono); background: var(--surface-2); }
.entry-table .ln-total { font-family: var(--mono); font-weight: 700; text-align: right; white-space: nowrap; }

.report-filters { display: flex; gap: 9px; flex-wrap: wrap; align-items: flex-end; }
.report-filters .field { min-width: 140px; }
.report-filters .field .input { width: 100%; }
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.report-card { display: flex; gap: 11px; padding: 12px 13px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.report-card:hover { border-color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.report-card .rc-ico { width: 36px; height: 36px; border-radius: 9px; background: var(--brand-light); color: var(--brand-dark); display: grid; place-items: center; flex: none; }
.report-card strong { display: block; font-size: 13px; margin-bottom: 1px; }
.report-card small { color: var(--text-3); font-size: 11.5px; line-height: 1.35; display: block; }

.help-box { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--info-bg); color: #0c4a6e; font-size: 12.5px; display: flex; gap: 9px; align-items: flex-start; }
.help-box.warn { background: var(--warn-bg); color: #78350f; }
.help-box.bad { background: var(--bad-bg); color: #7f1d1d; }
.help-box.ok { background: var(--ok-bg); color: #14532d; }
.help-box svg { flex: none; margin-top: 1px; }

.stack { display: flex; flex-direction: column; gap: 10px; }
.cluster { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }
.w-100 { width: 100%; } .w-auto { width: auto !important; }
.fs-sm { font-size: 12px; } .fs-xs { font-size: 11px; } .fs-lg { font-size: 16px; }
.fw-6 { font-weight: 600; } .fw-7 { font-weight: 700; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .gap-1 { gap: 6px; } .gap-2 { gap: 12px; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.print-only { display: none; }
.pre-line { white-space: pre-line; }

/* Loading state for async buttons */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
    content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn-ghost.is-loading::after { border-color: rgba(0,0,0,.2); border-top-color: var(--text-2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------- RESPONSIVE */
@media (max-width: 1280px) {
    .grid-4, .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pos { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 1024px) {
    .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 55; }
    .sidebar-close { display: grid; margin-left: auto; color: #fff; }
    .nav-toggle { display: grid; }
    .topbar-search { max-width: none; }
    .user-meta { display: none; }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid .span-2, .form-grid .span-3 { grid-column: 1 / -1; }
    .grid-sidebar { grid-template-columns: 1fr; }
    .grid-3, .grid-4, .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pos { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; }
    body.pos-body { overflow: auto; }
    .pos-left { border-right: 0; min-height: 60vh; }
    .pos-lines { max-height: 50vh; }
    .cd { grid-template-columns: 1fr; }
    .cd-right { padding: 20px; }
    .cd-total { font-size: 48px; }
}
@media (max-width: 640px) {
    .content { padding: 12px; }
    .topbar { padding: 0 12px; gap: 8px; }
    .topbar-title p, .topbar-alerts, .pos-btn span { display: none; }
    .topbar-search { display: none; }
    .form-grid, .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
    .page-head { flex-direction: column; }
    .page-head-actions { width: 100%; }
    .page-head-actions .btn { flex: 1; }
    .pagination-controls { margin-left: 0; width: 100%; justify-content: space-between; }
    .kpi-value { font-size: 19px; }
    .pay-methods { grid-template-columns: repeat(2, 1fr); }
    .modal-backdrop { padding: 12px; }
    .footer { flex-direction: column; gap: 3px; }
}

/* ------------------------------------------------------------------- PRINT */
@media print {
    @page { margin: 0; }
    html, body { background: #fff !important; color: #000 !important; height: auto; }
    body { padding: 0 !important; margin: 0 !important; font-size: 12px; }
    .sidebar, .sidebar-backdrop, .topbar, .footer, .toolbar, .pagination, .page-head-actions,
    .row-actions, .col-actions, .no-print, .receipt-toolbar, .flash-stack, .toast-root, .modal-root,
    .form-actions, .sticky-actions, .btn, .tabs, .settings-nav, .topbar-actions { display: none !important; }
    .print-only { display: block; }
    .shell, .main, .content { display: block; padding: 0; margin: 0; min-height: 0; }
    .card { border: 0; box-shadow: none; margin: 0; page-break-inside: avoid; }
    .card-body { padding: 0; }
    .table th, .table td { padding: 4px 6px; font-size: 11px; border-color: #999; }
    .table thead th { position: static; background: #eee !important; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .table tbody tr:hover { background: transparent; }
    .badge { border: 1px solid #999; background: transparent !important; color: #000 !important; }
    .table-wrap { overflow: visible; }
    a { color: inherit; text-decoration: none; }
    .kpi { border: 1px solid #999; box-shadow: none; }

    body.print-body .receipt, body.print-body .a4 { box-shadow: none; margin: 0; }
    .receipt { padding: 0; }
    .receipt.w58 { width: 58mm; }
    .receipt.w80 { width: 80mm; }
    .a4 { width: 100%; min-height: 0; padding: 10mm 10mm 12mm; }
    .a4 .stamp { opacity: .25; }
    .a4 + .a4 { page-break-before: always; }
    .label-sheet { box-shadow: none; margin: 0; }
    .label-sheet + .label-sheet { page-break-before: always; }
    .label.bordered { border-color: #ccc; }
    .label.no-border-print { border: 0; }
    .page-break { page-break-after: always; }
    .cd-body { display: none; }
}


