/* ============ Lead Accounting Web — design system ============ */
:root {
    --brand: #4f46e5;
    --brand-dark: #4338ca;
    --brand-soft: #eef2ff;
    --accent: #0d9488;
    --accent-soft: #f0fdfa;
    --bg: #f4f5fb;
    --surface: #ffffff;
    --ink: #1e2235;
    --ink-soft: #5a6072;
    --ink-faint: #9298ab;
    --line: #e6e8f0;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --success: #16a34a;
    --success-soft: #f0fdf4;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 3px rgba(30, 34, 53, .06), 0 8px 24px rgba(30, 34, 53, .05);
    --shadow-lg: 0 12px 40px rgba(30, 34, 53, .14);
    --sidebar-w: 264px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    /* 'Dirham-Sans' only supplies U+20C3 (new UAE dirham sign) via unicode-range */
    font-family: 'Inter', 'Dirham-Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.5;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.02em; }

a { color: var(--brand); text-decoration: none; }

/* ---------- boot ---------- */
.boot-screen {
    height: 100vh; display: flex; align-items: center; justify-content: center;
}
.spinner {
    width: 42px; height: 42px; border-radius: 50%;
    border: 4px solid var(--line); border-top-color: var(--brand);
    animation: spin .8s linear infinite;
}
.spinner.sm { width: 22px; height: 22px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- app shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: #171b2d;
    color: #c7cbe0;
    display: flex; flex-direction: column;
    position: fixed; inset: 0 auto 0 0;
    z-index: 50;
    transition: transform .25s ease;
}

.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 20px 16px;
}
.brand-badge {
    width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), #7c6cf0);
    color: #fff; font-weight: 800; font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(79, 70, 229, .45);
}
.brand-name { color: #fff; font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11.5px; color: #8b91ad; }

.sidebar-nav {
    flex: 1; overflow-y: auto; padding: 4px 12px 12px;
    scrollbar-width: none;           /* Firefox */
    -ms-overflow-style: none;        /* old Edge/IE */
}
.sidebar-nav::-webkit-scrollbar { display: none; }  /* WebKit */
.nav-section {
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em;
    color: #6d7390; margin: 18px 10px 6px; font-weight: 600;
}
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; margin: 2px 0;
    border-radius: 9px; color: #c7cbe0;
    font-size: 14px; font-weight: 500;
    cursor: pointer; border: none; background: none; width: 100%;
    font-family: inherit; text-align: left;
    transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active {
    background: var(--brand); color: #fff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, .4);
}
.nav-ico { width: 20px; text-align: center; font-size: 15px; flex: none; }

.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.logout-btn:hover { background: rgba(220, 38, 38, .18); color: #fca5a5; }

.sidebar-scrim { display: none; }

.main-column {
    flex: 1; min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex; flex-direction: column;
}

.topbar {
    height: 60px; background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 14px;
    padding: 0 22px;
    position: sticky; top: 0; z-index: 40;
}
.topbar-spacer { flex: 1; }
.topbar-link {
    display: flex; align-items: center; gap: 6px;
    color: var(--ink-soft); font-weight: 500; font-size: 14px;
    padding: 7px 12px; border-radius: 9px;
}
.topbar-link:hover { background: var(--brand-soft); color: var(--brand); }
.hamburger {
    display: none; background: none; border: none; font-size: 20px;
    cursor: pointer; color: var(--ink); padding: 6px;
}
.user-chip {
    display: flex; align-items: center; gap: 9px;
    font-weight: 600; font-size: 14px; color: var(--ink);
    background: var(--bg); padding: 6px 14px 6px 6px; border-radius: 999px;
    border: none; cursor: pointer; font-family: inherit;
    transition: box-shadow .15s;
}
.user-chip:hover { box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }

/* profile popover */
.profile-anchor { position: relative; }
.profile-scrim { position: fixed; inset: 0; z-index: 59; }
.profile-pop {
    position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
    width: 340px; max-width: calc(100vw - 32px);
    background: var(--surface); border-radius: 16px;
    box-shadow: var(--shadow-lg); border: 1px solid var(--line);
    animation: slideup .18s ease;
    max-height: min(560px, calc(100vh - 90px)); overflow-y: auto;
}
.profile-head { display: flex; gap: 13px; align-items: center; padding: 16px 16px 12px; }
.profile-meta {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px;
    padding: 4px 16px 12px; font-size: 13px;
}
.profile-meta b { display: block; color: var(--ink-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.profile-privs-title {
    padding: 10px 16px 4px; font-size: 11px; text-transform: uppercase;
    letter-spacing: .08em; color: var(--ink-faint); font-weight: 700;
    border-top: 1px solid var(--line);
}
.profile-privs { padding: 4px 16px 12px; }
.priv-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 5px 0; font-size: 13.5px;
}
.priv-badges { display: flex; gap: 5px; }
.priv-badges .badge { font-size: 10.5px; padding: 2px 8px; }
.avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #14b8a6);
    color: #fff; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

.page-content { padding: 26px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ---------- login ---------- */
.login-shell {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(1000px 600px at 80% -10%, #e0e7ff 0%, transparent 60%),
                radial-gradient(800px 500px at -10% 110%, #ccfbf1 0%, transparent 55%),
                var(--bg);
    padding: 24px;
}
.login-card {
    width: 100%; max-width: 420px;
    background: var(--surface); border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 38px 36px;
}
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 26px; }
.login-brand .brand-badge { width: 46px; height: 46px; font-size: 23px; }
.login-title { font-size: 21px; font-weight: 800; }
.login-sub { color: var(--ink-soft); font-size: 13.5px; }
.login-footer {
    margin-top: 22px; text-align: center; font-size: 13px; color: var(--ink-soft);
}

/* ---------- cards, panels ---------- */
.card {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 22px;
}
.card + .card { margin-top: 18px; }

.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    flex-wrap: wrap; gap: 14px; margin-bottom: 20px;
}
.page-head h1 { font-size: 23px; }
.page-head .sub { color: var(--ink-soft); font-size: 13.5px; margin-top: 3px; }

.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* stat card */
.stat-card {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 18px 20px;
    display: flex; flex-direction: column; gap: 4px;
}
.stat-label { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.stat-value.pos { color: var(--success); }
.stat-value.neg { color: var(--danger); }

/* ---------- forms ---------- */
.field { margin-bottom: 15px; }
.field label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--ink-soft); margin-bottom: 6px;
}
.input, .select, .textarea {
    width: 100%; padding: 10px 13px;
    border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    font-family: inherit; font-size: 14.5px; color: var(--ink);
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .13);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: var(--radius-sm);
    font-family: inherit; font-size: 14.5px; font-weight: 600;
    border: none; cursor: pointer; transition: all .15s;
    text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,.3); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover:not(:disabled) { background: #0f766e; }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1.5px solid var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.btn-danger-ghost { background: transparent; color: var(--danger); border: 1.5px solid #fecaca; }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.data {
    width: 100%; border-collapse: collapse; font-size: 14px;
    background: var(--surface);
}
table.data th {
    text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
    color: var(--ink-faint); font-weight: 600;
    padding: 11px 14px; border-bottom: 1.5px solid var(--line);
    white-space: nowrap;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: #f8f9fe; }
table.data tr.clickable { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- badges, pills ---------- */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600;
}
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-amber { background: var(--warning-soft); color: var(--warning); }
.badge-indigo { background: var(--brand-soft); color: var(--brand); }
.badge-gray { background: #f1f2f7; color: var(--ink-soft); }

/* tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tab {
    padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
    background: var(--surface); color: var(--ink-soft);
    border: 1.5px solid var(--line); cursor: pointer; font-family: inherit;
    transition: all .15s;
}
.tab:hover { border-color: var(--brand); color: var(--brand); }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- alerts / empty / toast ---------- */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.alert-error { background: var(--danger-soft); color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: var(--success-soft); color: #166534; border: 1px solid #bbf7d0; }

.empty-state {
    text-align: center; padding: 48px 20px; color: var(--ink-faint);
}
.empty-state .glyph { font-size: 40px; margin-bottom: 10px; }

.loading-row { display: flex; align-items: center; gap: 10px; padding: 24px; color: var(--ink-soft); justify-content: center; }

/* toast */
.toast {
    position: fixed; bottom: 26px; right: 26px; z-index: 100;
    background: #1e2235; color: #fff; padding: 14px 20px;
    border-radius: 12px; box-shadow: var(--shadow-lg);
    font-size: 14.5px; max-width: 380px;
    animation: slideup .25s ease;
}
.toast.success { background: #14532d; }
.toast.error { background: #7f1d1d; }
@keyframes slideup { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* pagination */
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 14px; font-size: 13.5px; color: var(--ink-soft); }

/* search dropdown */
.search-box { position: relative; }
.search-results {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
    background: var(--surface); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); border: 1px solid var(--line);
    max-height: 280px; overflow-y: auto;
}
.search-result-item { padding: 10px 14px; cursor: pointer; font-size: 14px; }
.search-result-item:hover { background: var(--brand-soft); }
.search-result-item .meta { font-size: 12px; color: var(--ink-faint); }

/* line-item editor */
.line-items-table .input { padding: 7px 10px; font-size: 13.5px; }

/* chart canvas */
.chart-box { position: relative; height: 300px; }
.chart-box.tall { height: 380px; }

/* invoice totals */
.totals-panel {
    background: var(--brand-soft); border-radius: var(--radius);
    padding: 18px 22px; display: flex; flex-direction: column; gap: 8px;
}
.totals-row { display: flex; justify-content: space-between; font-size: 14.5px; }
.totals-row.grand { font-size: 19px; font-weight: 800; border-top: 1.5px solid #c7d2fe; padding-top: 10px; margin-top: 4px; }

/* detail header block */
.doc-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 18px; }
.doc-head .kv { font-size: 14px; }
.doc-head .kv b { display: block; font-size: 12px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-bottom: 2px; }

/* report tiles */
.report-tile {
    display: flex; align-items: center; gap: 15px;
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px;
    cursor: pointer; transition: transform .15s, box-shadow .15s;
    border: none; font-family: inherit; text-align: left; width: 100%;
}
.report-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.report-tile .tile-ico {
    width: 46px; height: 46px; border-radius: 13px; flex: none;
    display: flex; align-items: center; justify-content: center; font-size: 21px;
}
.report-tile .tile-name { font-weight: 700; font-size: 15px; }
.report-tile .tile-sub { font-size: 12.5px; color: var(--ink-soft); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
    .sidebar { transform: translateX(-100%); }
    .app-shell.sidebar-open .sidebar { transform: none; }
    .app-shell.sidebar-open .sidebar-scrim {
        display: block; position: fixed; inset: 0; z-index: 45;
        background: rgba(15, 18, 34, .5);
    }
    .main-column { margin-left: 0; }
    .hamburger { display: block; }
    .grid.cols-4, .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
    .page-content { padding: 18px; }
    .hide-sm { display: none; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
}

/* ---------- centered narrow forms ---------- */
.form-page { display: grid; grid-template-columns: minmax(0, 680px); justify-content: center; }

/* ---------- modal / picker ---------- */
.modal-scrim {
    position: fixed; inset: 0; z-index: 80;
    background: rgba(15, 18, 34, .5);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: fadein .15s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: var(--surface); border-radius: 18px;
    box-shadow: var(--shadow-lg);
    width: 100%; max-width: 640px;
    max-height: calc(100vh - 60px);
    display: flex; flex-direction: column;
    animation: slideup .2s ease;
}
.modal.wide { max-width: 860px; }
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 16.5px; }
.modal-close {
    background: none; border: none; font-size: 19px; cursor: pointer;
    color: var(--ink-faint); padding: 4px 8px; border-radius: 8px;
}
.modal-close:hover { background: var(--bg); color: var(--ink); }
.modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* picker rows */
.pick-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 10px; cursor: pointer;
    transition: background .12s;
}
.pick-row:hover { background: var(--brand-soft); }
.pick-row .thumb {
    width: 42px; height: 42px; border-radius: 10px; flex: none;
    background: var(--bg); display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: var(--ink-faint); overflow: hidden;
}
.pick-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pick-row .pick-main { flex: 1; min-width: 0; }
.pick-row .pick-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-row .pick-sub { font-size: 12px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-row .pick-end { text-align: right; font-size: 13px; font-weight: 600; white-space: nowrap; }

/* ---------- item cards grid ---------- */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.item-card {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden; cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    border: none; text-align: left; font-family: inherit; padding: 0;
}
.item-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.item-card .item-img {
    height: 130px; background: linear-gradient(135deg, #f4f5fb, #e9ebf5);
    display: flex; align-items: center; justify-content: center;
    font-size: 34px; color: #c3c8da; overflow: hidden;
}
.item-card .item-img img { width: 100%; height: 100%; object-fit: cover; }
.item-card .item-body { padding: 13px 15px 15px; }
.item-card .item-name { font-weight: 700; font-size: 14.5px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-card .item-desc { font-size: 12px; color: var(--ink-faint); margin-bottom: 8px; height: 30px; overflow: hidden; }
.item-card .item-foot { display: flex; justify-content: space-between; align-items: center; }
.item-card .item-price { font-weight: 800; font-size: 15px; }

/* image gallery in detail */
.img-gallery { display: flex; gap: 10px; flex-wrap: wrap; }
.img-gallery img {
    width: 110px; height: 110px; object-fit: cover; border-radius: 12px;
    border: 1px solid var(--line);
}
.detail-hero {
    width: 100%; max-height: 260px; object-fit: contain; border-radius: 14px;
    background: var(--bg);
}

/* key-value grid for detail views */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 18px; }
.kv-grid b { display: block; font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-bottom: 2px; }
.kv-grid > div { font-size: 14px; }

/* drawer (right side) */
.drawer-scrim {
    position: fixed; inset: 0; z-index: 80; background: rgba(15, 18, 34, .45);
    animation: fadein .15s ease;
}
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 81;
    width: 420px; max-width: 94vw;
    background: var(--surface); box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column;
    animation: slidein .22s ease;
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 18px 20px; overflow-y: auto; flex: 1; }

/* ---------- print: clean invoice/receipt layout ---------- */
.print-only { display: none; }

@media print {
    @page { margin: 14mm 12mm; }

    body { background: #fff !important; font-size: 12px; color: #000; }

    /* strip the app chrome */
    .sidebar, .sidebar-scrim, .topbar, .expiry-banner, .page-head,
    .pager, .toast, .no-print, .hamburger { display: none !important; }
    .main-column { margin-left: 0 !important; }
    .page-content { padding: 0 !important; max-width: none !important; }

    /* flatten cards into plain sections */
    .card { box-shadow: none !important; border-radius: 0; padding: 8px 0 !important; margin: 0 !important; }
    .card + .card { margin-top: 8px !important; border-top: 1px solid #ddd; }
    .card h3 { font-size: 13px !important; }

    /* document header (company + doc type banner) */
    .print-only { display: block !important; }
    .print-doc-head { text-align: center; padding-bottom: 10px; }
    .print-doc-type {
        display: flex; justify-content: space-between; align-items: center;
        border-top: 2px solid #000; border-bottom: 2px solid #000;
        margin-top: 10px; padding: 6px 4px;
        font-size: 14px; font-weight: 700; text-transform: uppercase;
    }

    /* tables */
    table.data { font-size: 11.5px !important; }
    table.data th { color: #000 !important; border-bottom: 1.5px solid #000 !important; padding: 6px 8px !important; }
    table.data td { border-bottom: 1px solid #ccc !important; padding: 6px 8px !important; }
    table.data tbody tr:hover { background: none !important; }
    .badge { background: none !important; color: #000 !important; padding: 0 !important; font-weight: 600; }

    /* totals */
    .totals-panel {
        background: none !important; border: none;
        border-top: 2px solid #000; border-radius: 0 !important;
        padding: 8px 4px !important;
    }
    .totals-row.grand { border-top: 1.5px solid #000 !important; }

    /* links look like text */
    a { color: #000 !important; text-decoration: none !important; }

    /* ---- receipt / payment voucher template ---- */
    .voucher-print .card { display: none !important; }
    .voucher-kv { width: 100%; margin-top: 16px; font-size: 13px; border-collapse: collapse; }
    .voucher-kv td { padding: 9px 4px; vertical-align: top; border-bottom: 1px dotted #bbb; }
    .voucher-kv td:first-child { width: 170px; font-weight: 600; color: #333; }
    .voucher-amount {
        margin-top: 18px; padding: 12px 14px;
        border: 1.5px solid #000; font-size: 15px;
        display: flex; justify-content: space-between; align-items: center;
    }
    .voucher-amount b { font-size: 19px; }
    .voucher-sign {
        display: flex; justify-content: space-between;
        margin-top: 70px; font-size: 13px;
        padding-top: 8px;
    }
    .voucher-sign span:first-child { border-top: 1px solid #000; padding: 6px 30px 0 4px; }
    .voucher-sign span:last-child { text-align: right; }
}

/* subscription expiry banner */
.expiry-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    background: var(--warning-soft); color: #92400e;
    border-bottom: 1px solid #fde68a;
    padding: 10px 22px; font-size: 13.5px; flex-wrap: wrap;
}
.expiry-banner.critical { background: var(--danger-soft); color: #991b1b; border-bottom-color: #fecaca; }

/* report percent bars */
.share-bar { height: 7px; border-radius: 99px; background: var(--bg); overflow: hidden; min-width: 90px; }
.share-fill { height: 100%; border-radius: 99px; background: var(--brand); }

/* segmented control */
.seg { display: inline-flex; background: var(--bg); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button {
    border: none; background: transparent; padding: 7px 14px; border-radius: 9px;
    font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ink-soft);
    cursor: pointer; transition: all .13s;
}
.seg button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }

/* ---------- extra mobile polish ---------- */
@media (max-width: 960px) {
    .two-col-form { grid-template-columns: 1fr !important; }
    .modal { max-width: none; border-radius: 16px; }
    .sticky-side { position: static !important; }
    .page-head h1 { font-size: 20px; }
    .stat-value { font-size: 20px; }
    .chart-box { height: 240px; }
    .chart-box.tall { height: 300px; }
    table.data th, table.data td { padding: 9px 10px; font-size: 13px; }
    .item-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .item-card .item-img { height: 100px; }
}
@media (max-width: 560px) {
    .drawer { width: 100vw; max-width: 100vw; }
    .modal-scrim { padding: 10px; align-items: flex-end; }
    .modal { max-height: calc(100vh - 40px); }
    .pager { justify-content: center; }
    .page-content { padding: 14px; }
    .tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .tab { white-space: nowrap; flex: none; }
}

/* =====================================================================
   v2 — design system refresh (2026-09): tokens, dark theme, icons,
   refined shell, hero, KPI tiles, rows, chips, palette, tab bar
   ===================================================================== */
:root {
    --brand-2: #7c6cf0;
    --ink-inverse: #fff;
    --sidebar-bg: #151a2e;
    --sidebar-ink: #c7cbe0;
    --sidebar-muted: #6d7390;
    --topbar-bg: rgba(255,255,255,.86);
    --surface-2: #f8f9fe;
    --hover: #f4f5fb;
    --ring: rgba(79,70,229,.14);
    --shadow: 0 1px 2px rgba(30,34,53,.05), 0 6px 20px rgba(30,34,53,.05);
    --shadow-lg: 0 14px 44px rgba(30,34,53,.16);
}
:root[data-theme="dark"] {
    --bg: #0f1220;
    --surface: #171b2d;
    --surface-2: #1c2136;
    --hover: #202641;
    --ink: #e6e8f3;
    --ink-soft: #a9aec4;
    --ink-faint: #737a96;
    --line: #262c45;
    --brand-soft: #23264a;
    --accent-soft: #10302e;
    --danger-soft: #3a1c1c;
    --success-soft: #14301f;
    --warning-soft: #362a12;
    --sidebar-bg: #0b0e1a;
    --topbar-bg: rgba(23,27,45,.86);
    --ring: rgba(124,108,240,.28);
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 20px rgba(0,0,0,.25);
    --shadow-lg: 0 14px 44px rgba(0,0,0,.55);
}
:root[data-theme="dark"] table.data tbody tr:hover { background: var(--hover); }
:root[data-theme="dark"] .badge-gray { background: #262c45; }
:root[data-theme="dark"] .login-shell { background: radial-gradient(1000px 600px at 80% -10%, #23264a 0%, transparent 60%), var(--bg); }
:root[data-theme="dark"] .user-chip { background: var(--surface-2); }
:root[data-theme="dark"] .seg { background: var(--surface-2); }
:root[data-theme="dark"] .seg button.on { background: var(--surface); }
:root[data-theme="dark"] .item-card .item-img, :root[data-theme="dark"] .prod-card .p-img { background: var(--surface-2); }
:root[data-theme="dark"] .totals-panel { background: var(--brand-soft); }
:root[data-theme="dark"] .totals-row.grand { border-color: #3b3f6e; }
:root[data-theme="dark"] img.logo-light { display: none; }
:root:not([data-theme="dark"]) img.logo-dark-only { display: none; }

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }
::selection { background: rgba(79,70,229,.18); }

/* ---- icons ---- */
.ico { flex: none; vertical-align: -3px; }
.nav-ico { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; opacity: .9; }
.nav-item.active .nav-ico { opacity: 1; }

/* ---- shell ---- */
.sidebar { background: var(--sidebar-bg); box-shadow: inset -1px 0 0 rgba(255,255,255,.04); }
.sidebar-brand { padding: 20px 18px 8px; }
.brand-tag { font-size: 10px; letter-spacing: .22em; color: var(--sidebar-muted); font-weight: 700; }
.sidebar-nav { padding: 2px 10px 10px; }
.nav-section { margin: 16px 12px 4px; }
.nav-item { padding: 8px 11px; border-radius: 10px; font-size: 13.5px; gap: 10px; }
.nav-item.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.nav-item .nav-end { margin-left: auto; font-size: 10.5px; }
.sidebar-footer { padding: 10px; }
.topbar { background: var(--topbar-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); gap: 10px; }
.topbar-logo { height: 26px; display: none; }
.topbar-search {
    display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 12px; min-width: 260px;
    border: 1.5px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink-faint);
    font-family: inherit; font-size: 13.5px; cursor: text; text-align: left;
}
.topbar-search:hover { border-color: var(--brand); color: var(--ink-soft); }
.topbar-search kbd { margin-left: auto; font: 600 10.5px/1 Inter, system-ui; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--ink-faint); }
.btn-icon {
    position: relative; width: 38px; height: 38px; border-radius: 11px; border: 1.5px solid transparent;
    background: var(--surface-2); color: var(--ink); display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; text-decoration: none; font-family: inherit;
}
.btn-icon:hover { background: var(--brand-soft); color: var(--brand); }
.page-content { padding: 26px 28px 40px; max-width: 1360px; }

/* quick "+ New" menu */
.menu-anchor { position: relative; }
.menu-pop {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 240px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
    padding: 6px; animation: slideup .16s ease;
}
.menu-pop a, .menu-pop button {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px;
    color: var(--ink); font: 500 13.5px Inter, system-ui; text-decoration: none; border: none; background: none; cursor: pointer; text-align: left;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--brand-soft); color: var(--brand); }
.menu-pop .menu-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); font-weight: 700; padding: 8px 10px 4px; }
.menu-pop .m-ico { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; color: var(--brand); }

/* command palette */
.palette-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(15,18,34,.45); backdrop-filter: blur(2px); animation: fadein .12s ease; }
.palette {
    position: fixed; top: 12vh; left: 50%; transform: translateX(-50%); z-index: 91; width: min(640px, calc(100vw - 32px));
    background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
    overflow: hidden; animation: slideup .16s ease;
}
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--ink-faint); }
.palette-input input { flex: 1; border: none; outline: none; font: 500 16px Inter, system-ui; background: transparent; color: var(--ink); }
.palette-list { max-height: 60vh; overflow-y: auto; padding: 6px; }
.palette-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); font-weight: 700; padding: 10px 12px 4px; }
.palette-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer; color: var(--ink); }
.palette-row .p-ico { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; color: var(--brand); flex: none; }
.palette-row .p-name { font-weight: 600; font-size: 14px; }
.palette-row .p-sub { font-size: 12px; color: var(--ink-faint); }
.palette-row.on, .palette-row:hover { background: var(--brand-soft); }
.palette-row .p-end { margin-left: auto; font-size: 12px; color: var(--ink-faint); }
.palette-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-faint); }
.palette-foot kbd { font: 600 10px/1 Inter; padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; margin-right: 3px; }

/* ---- hero / KPI ---- */
.hero {
    background: linear-gradient(135deg, #1e1b4b 0%, var(--brand) 55%, var(--brand-2) 100%);
    color: #fff; border-radius: 22px; padding: 26px 28px; position: relative; overflow: hidden;
    box-shadow: 0 14px 34px rgba(79,70,229,.28);
}
.hero::before { content: ""; position: absolute; right: -80px; top: -90px; width: 280px; height: 280px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero::after { content: ""; position: absolute; right: 120px; bottom: -120px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.06); }
.hero > * { position: relative; }
.hero h1 { font-size: 24px; color: #fff; }
.hero .sub { color: rgba(255,255,255,.78); font-size: 13.5px; margin-top: 3px; }
.hero-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 20px; }
.hero-kpi { background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.14); border-radius: 15px; padding: 13px 15px; }
.hero-kpi .k { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.78); font-weight: 600; }
.hero-kpi .v { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.hero-kpi .d { font-size: 11.5px; color: rgba(255,255,255,.7); margin-top: 2px; }
.hero .btn-glass { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.22); }
.hero .btn-glass:hover { background: rgba(255,255,255,.26); }
.hero .btn-white { background: #fff; color: var(--brand); }

.kpi { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.kpi .k-ico { width: 44px; height: 44px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.kpi .k-label { font-size: 12px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi .k-value { font-size: 19px; white-space: nowrap; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12px; color: var(--ink-faint); }
.tint-indigo { background: var(--brand-soft); color: var(--brand); }
.tint-teal { background: var(--accent-soft); color: var(--accent); }
.tint-green { background: var(--success-soft); color: var(--success); }
.tint-amber { background: var(--warning-soft); color: var(--warning); }
.tint-red { background: var(--danger-soft); color: var(--danger); }
.tint-purple { background: #f5f3ff; color: #7c3aed; }
:root[data-theme="dark"] .tint-purple { background: #2b2350; }

/* quick actions */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.quick {
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
    background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 16px;
    border: 1px solid transparent; font-family: inherit; text-align: left; cursor: pointer; color: var(--ink);
    transition: transform .15s, box-shadow .15s, border-color .15s; text-decoration: none;
}
.quick:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--brand-soft); color: var(--ink); }
.quick .q-ico { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; }
.quick .q-name { font-weight: 700; font-size: 14px; }
.quick .q-sub { font-size: 12px; color: var(--ink-faint); }

/* ---- rows / chips / avatars ---- */
.rows { display: flex; flex-direction: column; }
.row-item {
    display: flex; align-items: center; gap: 13px; padding: 11px 8px; border-bottom: 1px solid var(--line);
    cursor: pointer; transition: background .12s; border-radius: 10px; text-decoration: none; color: inherit;
}
.row-item:last-child { border-bottom: none; }
.row-item:hover { background: var(--hover); color: inherit; }
.row-item .r-main { flex: 1; min-width: 0; }
.row-item .r-name { font-weight: 650; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .r-sub { font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.row-item .r-end { text-align: right; flex: none; }
.row-item .r-end .amt { font-weight: 800; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.row-item .r-end .meta { font-size: 11.5px; color: var(--ink-faint); }
.avatar.lg { width: 42px; height: 42px; font-size: 15px; border-radius: 13px; }
.avatar.indigo { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.avatar.amber { background: linear-gradient(135deg, #d97706, #fbbf24); }
.avatar.rose { background: linear-gradient(135deg, #e11d48, #fb7185); }
.avatar.gray { background: linear-gradient(135deg, #64748b, #94a3b8); }
.avatar.green { background: linear-gradient(135deg, #16a34a, #4ade80); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.chip-gray { background: var(--surface-2); color: var(--ink-soft); }
.chip-indigo { background: var(--brand-soft); color: var(--brand); }
.chip-green { background: var(--success-soft); color: var(--success); }
.chip-amber { background: var(--warning-soft); color: var(--warning); }
.chip-red { background: var(--danger-soft); color: var(--danger); }
.muted { color: var(--ink-faint); font-size: 12.5px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15.5px; }
.card h3 { font-size: 15.5px; }

/* notices */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 16px; }
.notice.info { background: var(--brand-soft); color: var(--brand); }
.notice.warn { background: var(--warning-soft); color: var(--warning); }
.notice.ok { background: var(--success-soft); color: var(--success); }
.notice.bad { background: var(--danger-soft); color: var(--danger); }
.notice .n-ico { display: inline-flex; margin-top: 1px; }

/* toolbar */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; }
.toolbar .grow { flex: 1; min-width: 180px; }

/* progress */
.progress { height: 9px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .4s ease; }
.progress.green > span { background: linear-gradient(90deg, #16a34a, #4ade80); }
.progress.amber > span { background: linear-gradient(90deg, #d97706, #fbbf24); }
.progress.red > span { background: linear-gradient(90deg, #dc2626, #f87171); }

/* skeleton */
.skel { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 8px; min-height: 14px; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: shimmer 1.3s infinite; }
:root[data-theme="dark"] .skel::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }

/* buttons */
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; }
.btn-lg { padding: 13px 22px; font-size: 15.5px; border-radius: 12px; }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover:not(:disabled) { background: #e0e4ff; }
.btn .ico { margin: 0 -2px; }

/* stepper */
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.stepper button { width: 34px; height: 34px; border: none; background: transparent; font-size: 18px; cursor: pointer; color: var(--brand); font-family: inherit; font-weight: 700; }
.stepper button:hover { background: var(--brand-soft); }
.stepper input { width: 52px; height: 34px; border: none; text-align: center; font-family: inherit; font-size: 14px; font-weight: 700; color: var(--ink); outline: none; background: transparent; }
.stepper.mini button { width: 28px; height: 28px; font-size: 16px; }
.stepper.mini input { width: 40px; height: 28px; font-size: 13px; }

/* inline "+" beside a select */
.field-with-add { display: flex; gap: 6px; align-items: stretch; }
.field-with-add .select, .field-with-add .input { flex: 1; }
.field-with-add .btn-add { width: 42px; border-radius: var(--radius-sm); border: 1.5px dashed var(--line); background: var(--surface-2); color: var(--brand); cursor: pointer; font-size: 18px; font-weight: 700; flex: none; }
.field-with-add .btn-add:hover { border-color: var(--brand); background: var(--brand-soft); }

/* statement table (P&L) */
.statement { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.statement .col { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.statement .col-head { padding: 12px 18px; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.statement .line { display: flex; justify-content: space-between; padding: 9px 18px; border-top: 1px solid var(--line); font-size: 14px; }
.statement .line.total { font-weight: 800; background: var(--surface-2); }

/* POS */
.pos-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 16px; align-items: start; }
.pos-shell > * { min-width: 0; }
@media (max-width: 1280px) { .pos-shell { grid-template-columns: minmax(0, 1fr) minmax(280px, 320px); gap: 12px; } .pos-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); } }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pos-tile { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 12px; cursor: pointer; border: 1.5px solid transparent; transition: transform .1s, border-color .1s; user-select: none; }
.pos-tile:hover { border-color: var(--brand); transform: translateY(-1px); }
.pos-tile:active { transform: scale(.98); }
.pos-tile .t-img { height: 74px; border-radius: 10px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--ink-faint); margin-bottom: 8px; }
.pos-tile .t-img img { width: 100%; height: 100%; object-fit: cover; }
.pos-tile .t-name { font-weight: 700; font-size: 13px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 33px; }
.pos-tile .t-price { font-weight: 800; font-size: 14px; margin-top: 4px; }
.pos-tile .t-meta { font-size: 11px; color: var(--ink-faint); }
.pos-cart { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); position: sticky; top: 76px; display: flex; flex-direction: column; max-height: calc(100vh - 100px); }
.pos-cart .c-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pos-cart .c-lines { flex: 1; overflow-y: auto; padding: 6px 10px; }
.pos-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 9px 6px; border-bottom: 1px solid var(--line); }
.pos-line .l-name { font-weight: 650; font-size: 13.5px; }
.pos-line .l-meta { font-size: 11.5px; color: var(--ink-faint); }
.pos-line .l-net { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.pos-cart .c-totals { padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.pos-cat { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; max-width: 100%; }
.pos-cat::-webkit-scrollbar { display: none; }
.pos-cat .tab { flex: none; }
.pay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.pay-btn { padding: 12px 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font: 700 13px Inter, system-ui; cursor: pointer; color: var(--ink); text-align: center; }
.pay-btn.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.big-total { font-size: 34px; font-weight: 900; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 14px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); box-shadow: 0 0 0 2px var(--brand-soft); }
.timeline .t { font-weight: 700; }
.timeline .s { color: var(--ink-faint); font-size: 12px; }

/* epc box */
.epc-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; min-height: 160px; }
.epc-pill { display: inline-block; font-family: ui-monospace, monospace; font-size: 11.5px; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); margin: 2px; }

/* tab bar (mobile) */
.tabbar { display: none; }

/* ---- mobile ---- */
@media (max-width: 960px) {
    .topbar-logo { display: block; }
    .topbar-search { min-width: 0; width: 38px; padding: 0; justify-content: center; }
    .topbar-search span, .topbar-search kbd { display: none; }
    .tabbar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
        background: var(--surface); border-top: 1px solid var(--line);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        box-shadow: 0 -6px 20px rgba(30,34,53,.08);
    }
    .tab-item {
        flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
        font-size: 10.5px; font-weight: 600; color: var(--ink-faint); text-decoration: none;
        border: none; background: none; font-family: inherit; padding: 4px 0; border-radius: 10px;
    }
    .tab-item.active { color: var(--brand); }
    .page-content { padding: 16px 14px calc(84px + env(safe-area-inset-bottom)); }
    .hero { padding: 20px 18px; border-radius: 18px; }
    .hero h1 { font-size: 19px; }
    .hero-kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .hero-kpi .v { font-size: 17px; }
    .pos-shell { grid-template-columns: 1fr; }
    .pos-cart { position: static; max-height: none; }
    .statement { grid-template-columns: 1fr; }
    .quick-grid { grid-template-columns: repeat(2, 1fr); }
    .toolbar .input, .toolbar .select { min-width: 0; flex: 1; }
    .sidebar { width: min(300px, 86vw); }
    .palette { top: 6vh; }
}
@media print { .tabbar, .topbar-search, .btn-icon, .palette, .palette-scrim { display: none !important; } }
