/* Light palette. Also re-applied inside .invx so invoices/notes stay paper-white in dark mode. */
:root,
html[data-theme="dark"] .invx,
html[data-theme="dark"] .pdf-paper {
    color-scheme: light;
    --bg: #f0f3f6;
    --bg-soft: #e6ebf0;
    --page-top: #f7f9fb;
    --page-bottom: #eef2f6;
    --surface: #ffffff;
    --surface-2: #f7fafc;
    --surface-3: #e8eef3;
    --ink: #132033;
    --ink-2: #44546a;
    --muted: #5d6b7c;
    --muted-2: #8a97a8;
    --line: #d5dde6;
    --line-soft: #e3e9ef;
    --brand: #0b6e4f;
    --brand-dark: #085541;
    --brand-ink: #085541;
    --brand-soft: #d9f0e7;
    --brand-tint: #f1faf6;
    --accent: #c45c26;
    --accent-tint: #fbf6f2;
    --danger: #c0392b;
    --danger-soft: #fde2e0;
    --danger-tint: #fff8f7;
    --warning: #d68910;
    --warning-soft: #fff1d6;
    --warning-tint: #fbf8f0;
    --warning-ink: #9a6400;
    --info: #1a6f9a;
    --info-soft: #dceff8;
    --info-tint: #f3f8fb;
    --success: #1e7a4d;
    --success-soft: #d9f5e7;
    --primary-soft: #dce8ff;
    --primary-ink: #274b9b;
    --neutral-soft: #e8edf2;
    --neutral-ink: #526274;
    --sidebar: #0f2438;
    --sidebar-ink: #d7e2ee;
    --shadow: 0 10px 30px rgba(15, 36, 56, 0.08);
    --radius: 14px;
    --font-display: "Sora", "Segoe UI", sans-serif;
    --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0c141e;
    --bg-soft: #111b27;
    --page-top: #0f1924;
    --page-bottom: #0a1119;
    --surface: #142030;
    --surface-2: #1a283a;
    --surface-3: #25364b;
    --ink: #e7edf4;
    --ink-2: #c4cfdc;
    --muted: #97a6b8;
    --muted-2: #8394a8;
    --line: #2b3c51;
    --line-soft: #223246;
    --brand: #1b9a70;
    --brand-dark: #15845f;
    --brand-ink: #5fd3a8;
    --brand-soft: rgba(27, 154, 112, 0.18);
    --brand-tint: rgba(27, 154, 112, 0.09);
    --accent: #c4672f;
    --accent-tint: rgba(224, 129, 75, 0.09);
    --danger: #f06b5b;
    --danger-soft: rgba(240, 107, 91, 0.16);
    --danger-tint: rgba(240, 107, 91, 0.08);
    --warning: #e8a53c;
    --warning-soft: rgba(232, 165, 60, 0.16);
    --warning-tint: rgba(232, 165, 60, 0.08);
    --warning-ink: #f2bd62;
    --info: #55acd9;
    --info-soft: rgba(85, 172, 217, 0.16);
    --info-tint: rgba(85, 172, 217, 0.08);
    --success: #45c487;
    --success-soft: rgba(69, 196, 135, 0.16);
    --primary-soft: rgba(126, 160, 255, 0.16);
    --primary-ink: #a7bfff;
    --neutral-soft: rgba(151, 166, 184, 0.16);
    --neutral-ink: #b8c5d3;
    --sidebar: #0a121c;
    --sidebar-ink: #d7e2ee;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-body);
    color: var(--ink);
    background:
        radial-gradient(circle at top right, rgba(11, 110, 79, 0.08), transparent 28%),
        linear-gradient(180deg, var(--page-top) 0%, var(--bg) 40%, var(--page-bottom) 100%);
    min-height: 100vh;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); }

.app-shell {
    display: grid;
    grid-template-columns: 270px 1fr;
    min-height: 100vh;
}

.sidebar {
    background:
        linear-gradient(180deg, rgba(11, 110, 79, 0.18), transparent 30%),
        var(--sidebar);
    color: var(--sidebar-ink);
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand-block {
    position: relative;
    margin: -22px -16px 18px;
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid rgba(15, 35, 48, 0.08);
}

.brand-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.brand-logo {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 100px;
    object-fit: contain;
    object-position: center;
}

.nav-close {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--ink);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.nav-backdrop {
    display: none;
}

.nav-toggle {
    display: none;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
    cursor: pointer;
    padding: 0;
    align-items: center;
    justify-content: center;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    position: relative;
    transition: 0.2s ease;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
}
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
body.nav-open .nav-toggle-bars { background: transparent; }
body.nav-open .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
body.nav-open .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

.nav-section {
    margin: 18px 0 8px;
    padding: 0 10px;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7f94a9;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    color: var(--sidebar-ink);
    margin-bottom: 4px;
    transition: 0.18s ease;
    font-weight: 500;
}

.nav-ico {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: currentColor;
    opacity: 0.75;
}

.nav-link span { min-width: 0; line-height: 1.2; }

.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.nav-link:hover .nav-ico,
.nav-link.active .nav-ico {
    opacity: 1;
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(11,110,79,0.55), rgba(11,110,79,0.18));
    box-shadow: inset 3px 0 0 #2ecc9a;
}

.main {
    padding: 22px 28px 40px;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--surface);
    margin: -22px -28px 22px;
    padding: 16px 28px;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(15, 36, 56, 0.04);
}

.topbar .page-title {
    flex: 1;
    min-width: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Mobile-only context strip — always visible under 1100px */
.mobile-context {
    display: none;
}

.notif-wrap {
    position: relative;
}

.notif-bell {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
}
.notif-bell:hover { border-color: var(--brand); color: var(--brand); }

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    display: grid;
    place-items: center;
    border: 2px solid var(--surface);
}

.notif-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: min(360px, 92vw);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(16, 24, 40, 0.14);
    z-index: 50;
    overflow: hidden;
}
.notif-dropdown[hidden] { display: none !important; }

.notif-dropdown-head,
.notif-dropdown-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
}
.notif-dropdown-foot {
    border-bottom: 0;
    border-top: 1px solid var(--line);
    justify-content: center;
}
.notif-dropdown-head a,
.notif-dropdown-foot a {
    font-size: 0.82rem;
    font-weight: 600;
}

.notif-dropdown-body {
    max-height: 360px;
    overflow-y: auto;
}

.notif-item,
.notif-row {
    display: block;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
    color: inherit;
}
.notif-item:hover,
.notif-row:hover { background: var(--surface-2); }
.notif-item.is-unread,
.notif-row.is-unread { background: var(--brand-tint); }
.notif-item-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 2px;
}
.notif-item-msg,
.notif-row-main span {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.35;
}
.notif-item-time {
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--muted-2);
}
.notif-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--muted);
}
.notif-list { display: flex; flex-direction: column; }
.notif-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}
.notif-row-main strong { display: block; margin-bottom: 2px; }
.notif-row small { color: var(--muted-2); white-space: nowrap; }

.page-title h2 {
    font-family: var(--font-display);
    margin: 0 0 4px;
    font-size: 1.65rem;
    letter-spacing: -0.03em;
}

.page-title p {
    margin: 0;
    color: var(--muted);
}
.page-title .branch-scope-note {
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--brand-ink);
}
.page-title .branch-scope-note strong { color: var(--brand); }

.user-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px 8px 8px;
    box-shadow: var(--shadow);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-ink);
    display: grid;
    place-items: center;
    font-weight: 700;
}

.user-meta { line-height: 1.25; }
.user-meta strong { display: block; font-size: 0.92rem; }
.user-meta span { font-size: 0.78rem; color: var(--muted); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}
.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }

.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--brand);
}
.stat-card.tone-brand::before { background: var(--brand); }
.stat-card.tone-danger::before { background: var(--danger); }
.stat-card.tone-info::before { background: var(--info); }
.stat-card.tone-accent::before { background: var(--accent); }
.stat-card.tone-warn::before { background: var(--warning); }

.stat-card::after {
    content: "";
    position: absolute;
    inset: auto -20px -20px auto;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(11,110,79,0.08);
}
.stat-card.tone-danger::after { background: rgba(192,57,43,0.08); }
.stat-card.tone-info::after { background: rgba(26,111,154,0.08); }
.stat-card.tone-accent::after { background: rgba(196,92,38,0.1); }

.stat-card .label {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.stat-card .value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}
.stat-card .value-split {
    font-size: 1.1rem;
    color: var(--muted);
    font-weight: 600;
}

.stat-card .hint {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--brand);
}

/* Role dashboards */
.dash-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.dash-search {
    display: flex;
    gap: 8px;
    flex: 1 1 240px;
    max-width: 420px;
    align-items: center;
}
.dash-search .form-control { height: 40px; }
.dash-cat-wrap {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 18px;
    align-items: center;
}
.dash-donut {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
    box-shadow: inset 0 0 0 18px var(--surface);
    background-color: var(--surface-3);
}
.dash-donut::after {
    content: "";
    position: absolute;
    inset: 22px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--line);
}
.dash-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
@media (max-width: 720px) {
    .dash-cat-wrap { grid-template-columns: 1fr; }
}
.dash-hero-title {
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}
.dash-hero-sub {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}
.dash-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-mid { margin-bottom: 18px; }

.dash-bars { display: flex; flex-direction: column; gap: 12px; }
.dash-bar-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
    font-size: 0.88rem;
}
.dash-bar-meta span { color: var(--muted); font-weight: 600; }
.dash-bar-track {
    height: 8px;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
}
.dash-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), #1aa37a);
}

.dash-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dash-action {
    display: block;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink);
    transition: border-color 0.15s, background 0.15s;
}
.dash-action:hover {
    border-color: rgba(11, 110, 79, 0.35);
    background: var(--brand-soft);
    color: var(--ink);
}
.dash-action strong {
    display: block;
    font-family: var(--font-display);
    font-size: 0.98rem;
    margin-bottom: 2px;
}
.dash-action span {
    font-size: 0.82rem;
    color: var(--muted);
}
.dash-action.tone-brand { border-left: 4px solid var(--brand); }
.dash-action.tone-info { border-left: 4px solid var(--info); background: var(--info-tint); }
.dash-action.tone-accent { border-left: 4px solid var(--accent); background: var(--accent-tint); }
.dash-action.tone-warn { border-left: 4px solid var(--warning); background: var(--warning-tint); }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    min-width: 0;
    /* visible so .table-wrap can scroll horizontally on mobile */
    overflow: visible;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.panel-header h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.panel-body { padding: 18px; }

.grid-2 {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 18px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    white-space: nowrap;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.92rem;
    transition: 0.15s ease;
}

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-secondary { background: var(--bg-soft); color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-whatsapp { background: #1a9e4f; color: #fff; }
.btn-whatsapp:hover { background: #158642; color: #fff; }
.btn-sm { padding: 7px 11px; font-size: 0.82rem; }
.btn-block { width: 100%; }

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin: 0 -2px;
    padding: 0 2px;
}
.table-wrap table.data {
    min-width: 720px;
}
table.data {
    width: 100%;
    border-collapse: collapse;
}
table.data th, table.data td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    font-size: 0.92rem;
}
table.data th {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}
table.data tr:hover td { background: var(--surface-2); }

/* Invoice records page */
.records-page { display: grid; gap: 16px; }

.records-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.records-toolbar-search {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.records-toolbar-search .form-control {
    min-width: 160px;
    flex: 1;
}
.records-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.records-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.records-stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 4px 14px rgba(15, 36, 56, 0.04);
}
.records-stat span {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}
.records-stat strong {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.records-stat small {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--muted);
}
.records-stat.is-due strong { color: var(--danger); }

.records-panel { overflow: hidden; }
.records-panel-head {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}
.records-panel-head h3 {
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.records-panel-head p {
    margin: 0;
    font-size: 0.86rem;
    color: var(--muted);
}

.records-list { display: block; }
.records-split {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 16px;
    align-items: start;
}
.records-split > .records-panel { min-width: 0; }

.record-row {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 20px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    border-left: 3px solid transparent;
    background: var(--surface);
    transition: background 0.15s ease;
}
.record-row:last-child { border-bottom: 0; }
.record-row:hover { background: var(--surface-2); }
.record-row.is-partial { border-left-color: var(--warning); }
.record-row.is-unpaid { border-left-color: var(--danger); }
.record-row.is-paid { border-left-color: var(--success); }

.record-main {
    display: grid;
    grid-template-columns: minmax(150px, 1.1fr) minmax(160px, 1.2fr) minmax(140px, 1fr);
    gap: 18px;
    min-width: 0;
    align-items: start;
}
.record-main-2 {
    grid-template-columns: minmax(160px, 1.2fr) minmax(150px, 1fr) minmax(120px, 0.9fr);
}
.record-inv {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--ink);
}
a.record-inv:hover { color: var(--brand); }
.record-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.record-meta time,
.record-code {
    font-size: 0.8rem;
    color: var(--muted);
}
.record-code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-weight: 600;
}
.record-meta .badge {
    border-radius: 7px;
    font-size: 0.68rem;
}

.record-party-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}
.record-party-to {
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--ink);
    line-height: 1.3;
}
.record-party-from,
.record-party-phone {
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--muted);
}
.record-kpi {
    margin-bottom: 8px;
}
.record-kpi span {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 3px;
}
.record-kpi strong {
    font-size: 0.95rem;
    color: var(--ink);
}

.record-prod {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--ink);
    padding: 2px 0;
}
.record-prod em {
    font-style: normal;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--brand-ink);
    background: var(--brand-soft);
    padding: 2px 8px;
    border-radius: 6px;
}
.record-units {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--muted);
}
.record-muted { color: var(--muted); font-size: 0.88rem; }

.record-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    text-align: right;
}
.record-amount span {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2px;
}
.record-amount strong {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.record-amount.is-due strong { color: var(--danger); }
.record-payline {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 12px;
    font-size: 0.78rem;
    color: var(--muted);
}
.record-due {
    color: var(--danger);
    font-weight: 700;
}
.record-settle {
    max-width: 220px;
    font-size: 0.74rem;
    line-height: 1.35;
    color: var(--muted);
}
.record-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.record-status.is-paid { background: var(--success-soft); color: var(--success); }
.record-status.is-partial { background: var(--warning-soft); color: var(--warning-ink); }
.record-status.is-unpaid { background: var(--danger-soft); color: var(--danger); }
.record-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    align-items: center;
}
.record-open {
    display: inline-block;
    margin-top: 2px;
    padding: 8px 14px;
    border-radius: 9px;
    background: var(--brand);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 700;
}
.record-open:hover { background: var(--brand-dark); color: #fff; }

.badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning-ink); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-primary { background: var(--primary-soft); color: var(--primary-ink); }
.badge-secondary { background: var(--neutral-soft); color: var(--neutral-ink); }
.badge-dark { background: #2c3e50; color: #fff; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group[hidden] { display: none; }
.req-lines { display: flex; flex-direction: column; gap: 8px; }
.req-line { display: grid; grid-template-columns: minmax(0, 1fr) 90px 34px; gap: 8px; align-items: center; }
.req-line .req-line-remove { padding: 6px 0; font-size: 18px; line-height: 1; }
.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
}
.form-control, select.form-control, textarea.form-control {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}
.form-control:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(11,110,79,0.12);
}
textarea.form-control { min-height: 100px; resize: vertical; }

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert-success { background: #e8f8ef; color: #146c43; border-color: #b7ebc9; }
.alert-danger { background: #fdecea; color: #922b21; border-color: #f5c6cb; }
.alert-warning { background: #fff8e6; color: #8a6d1d; border-color: #ffe08a; }
.alert-info { background: #eaf5fb; color: #1a5276; border-color: #b8daf0; }

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(15,36,56,0.92), rgba(11,110,79,0.78)),
        url('../img/login-bg.svg') center/cover;
}

.login-card {
    width: min(440px, 100%);
    background: var(--surface);
    border-radius: 20px;
    padding: 34px 28px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.28);
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
    margin: 0 0 10px;
    padding: 12px 8px 4px;
}

.login-logo {
    display: block;
    width: 100%;
    max-width: 280px;
    height: auto;
    max-height: 110px;
    object-fit: contain;
}

.login-card h1 {
    font-family: var(--font-display);
    margin: 0 0 6px;
    font-size: 1.8rem;
    text-align: center;
}
.login-card .sub,
.login-sub {
    color: var(--muted);
    margin: 0 0 22px;
    text-align: center;
    font-size: 0.95rem;
}
.login-card .btn-block {
    width: 100%;
    min-height: 46px;
    font-weight: 700;
}
.login-card .form-control {
    min-height: 44px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    align-items: center;
}
.filters .form-control {
    min-width: 160px;
    flex: 1 1 160px;
}
.filters .btn { flex: 0 0 auto; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
    padding: 14px 4px 4px;
    border-top: 1px solid var(--line);
}
.pager-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}
.pager-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
a.pager-btn,
span.pager-btn {
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    margin: 0 2px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink) !important;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1;
    text-decoration: none !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
a.pager-btn:hover {
    border-color: var(--brand);
    color: var(--brand) !important;
    background: var(--brand-tint);
}
a.pager-btn.is-active,
span.pager-btn.is-active {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    color: #fff !important;
}
span.pager-btn.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--surface-2);
}
.pager-gap {
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
    color: var(--muted);
    font-weight: 700;
}

/* —— POS terminal (retail register) —— */
body.pos-mode .main {
    padding: 14px 18px 24px;
}
body.pos-mode .topbar {
    margin: -14px -18px 12px;
    padding: 10px 18px;
}
body.pos-mode .topbar .page-title h2 { font-size: 1.2rem; }
/* Desktop POS: hide long subtitle only — never hide branch scope on small screens */
@media (min-width: 1101px) {
    body.pos-mode .topbar .page-subtitle { display: none; }
}

.pos-terminal {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.9fr);
    gap: 12px;
    align-items: start;
}

.pos-terminal-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.pos-scan-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0;
    margin: 0;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.pos-scan-input {
    flex: 1.5;
    min-width: 180px;
    height: 38px;
    font-size: 0.92rem;
    font-family: ui-monospace, Consolas, monospace;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.pos-scan-input:focus {
    border-color: var(--brand);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(11, 110, 79, 0.12);
}

.pos-filter-input,
.pos-branch-select {
    flex: 1;
    min-width: 120px;
    height: 38px;
    border-radius: 8px;
}
.pos-scan-bar .btn {
    height: 38px;
    padding: 0 12px;
}

.pos-floor {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 36, 56, 0.04);
}

.pos-floor-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    flex-shrink: 0;
}

.pos-floor-head strong {
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink);
}

.pos-floor-head span {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 3px 9px;
    border-radius: 999px;
}

.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    padding: 10px;
    align-content: start;
    background: var(--surface-2);
}

.pos-tile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.pos-tile:hover {
    border-color: rgba(11, 110, 79, 0.35);
    box-shadow: 0 6px 16px rgba(15, 36, 56, 0.06);
}

.pos-tile.is-active {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(11, 110, 79, 0.12);
}

.pos-tile-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.pos-tile-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--ink);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.pos-tile-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pos-tile-color {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand-ink);
    background: var(--brand-soft);
    padding: 3px 8px;
    border-radius: 6px;
}

.pos-tile-stock {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
}

.pos-tile-price {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--ink);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.pos-tile-actions {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 8px;
    margin-top: auto;
}

.pos-qty-input {
    height: 38px;
    text-align: center;
    font-weight: 700;
    border-radius: 8px;
    padding: 0 6px;
}

.pos-sell-btn {
    height: 38px;
    border-radius: 8px;
    font-weight: 700;
}

.pos-in-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

.pos-empty-floor {
    padding: 48px 16px;
    text-align: center;
    color: var(--muted);
}

.pos-register {
    position: sticky;
    top: 12px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 36, 56, 0.06);
}

.pos-register-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding: 8px 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.pos-register-who {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.pos-register-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.pos-register-label {
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.pos-register-cashier {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--ink);
    margin-top: 2px;
}

.pos-register-branch {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 5px 9px;
    border-radius: 6px;
    background: var(--brand-soft);
    border: 1px solid rgba(11, 110, 79, 0.15);
    color: var(--brand-ink);
    white-space: nowrap;
}

.pos-register-form {
    display: flex;
    flex-direction: column;
}

.pos-register-body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--surface-2);
    flex: 1 1 auto;
    min-height: 0;
}

.pos-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
}

.pos-card-customer,
.pos-card-bill {
    display: block;
    visibility: visible;
}

.pos-card-customer {
    order: 0;
}

.pos-card-bill {
    order: 1;
}

.pos-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    margin: 0 0 6px;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--brand);
}

.pos-card-head .pos-line-clear {
    border: 0;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
    padding: 0;
}

.pos-card-head .pos-line-clear:hover { color: var(--danger); }

.pos-billto {
    display: inline-flex;
    gap: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text, inherit);
}

.pos-billto label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.pos-fields[hidden] { display: none; }
.pos-fields label.full { grid-column: 1 / -1; }

.pos-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.pos-fields-cust { grid-template-columns: 1.2fr 1fr 1fr; }
.pos-fields-cust label.full { grid-column: 1 / -1; }

.pos-fields label,
.pos-paid-label,
.pos-cart-price {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    margin: 0;
}

.pos-fields label > span,
.pos-paid-label > span,
.pos-cart-price > span {
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.pos-fields label.full,
.pos-paid-label { grid-column: 1 / -1; }

.pos-fields .form-control,
.pos-paid-label .form-control,
.pos-cart-price .form-control {
    height: 34px;
    border-radius: 7px;
    font-weight: 600;
    padding: 0 8px;
    font-size: 0.88rem;
}

.pos-cart-lines {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pos-cart-empty {
    padding: 14px 10px;
    text-align: center;
    color: var(--muted);
    font-size: 0.86rem;
}

.pos-cart-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 88px 28px;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}

.dist-cart-line {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 42%) 28px;
    align-items: start;
}

.dist-price-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    min-width: 0;
}

.dist-price-pair label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    min-width: 0;
}

.dist-price-pair label > span {
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.dist-price-pair .form-control {
    height: 32px;
    padding: 0 6px;
    font-weight: 700;
    font-size: 0.85rem;
    text-align: right;
    border-radius: 6px;
}

.pos-line-info { min-width: 0; }

.pos-line-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-line-meta {
    margin-top: 2px;
    font-size: 0.76rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-cart-line .pos-line-price {
    height: 34px;
    padding: 0 8px;
    font-weight: 700;
    font-size: 0.9rem;
    text-align: right;
    border-radius: 6px;
}

.pos-line-x {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 28px;
    height: 28px;
}

.pos-line-x:hover { color: var(--danger); }

.dist-qty {
    display: inline-flex;
    align-items: stretch;
    margin-top: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
    height: 30px;
}
.dist-qty-btn {
    width: 30px;
    border: 0;
    background: var(--surface-2);
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.dist-qty-btn:hover { background: var(--brand-soft); color: var(--brand-ink); }
.dist-qty-btn[data-step="-1"]:hover { background: var(--danger-soft); color: var(--danger); }
.dist-qty-input {
    width: 54px;
    border: 0;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    text-align: center;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--ink);
    -moz-appearance: textfield;
}
.dist-qty-input::-webkit-outer-spin-button,
.dist-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dist-qty-input:focus { outline: none; background: var(--brand-tint); }

.dist-paid-quick { display: flex; gap: 6px; margin: 6px 0 8px; }
.dist-paid-chip {
    flex: 1;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
}
.dist-paid-chip:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }

.pos-cart-line.dist-cart-line {
    display: block;
    padding: 12px 14px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.pos-cart-line.dist-cart-line + .pos-cart-line.dist-cart-line { margin-top: 4px; }
.dist-line-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.dist-line-head .pos-line-info { flex: 1; min-width: 0; }
.dist-line-head .pos-line-name { font-size: 0.98rem; }
.dist-line-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.dist-tag {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--ink-2);
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    padding: 1px 8px;
}
.dist-tag.is-sn { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--brand-ink); background: var(--brand-soft); border-color: transparent; }
.dist-line-total { text-align: right; white-space: nowrap; }
.dist-line-total span {
    display: block;
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}
.dist-line-total strong {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.dist-line-head .pos-line-x {
    margin: -2px -6px 0 0;
    border-radius: 6px;
}
.dist-line-head .pos-line-x:hover { background: var(--danger-soft); }
.dist-line-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--line-soft);
}
.dist-f { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; }
.dist-f > span {
    font-size: 0.6rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}
.dist-f .form-control {
    height: 36px;
    padding: 0 10px;
    font-weight: 700;
    font-size: 0.9rem;
    text-align: right;
    border-radius: 8px;
    min-width: 0;
    font-variant-numeric: tabular-nums;
}
.dist-f .form-control.is-missing { border-color: #e8a59d; background: var(--danger-tint); }
.dist-f .form-control::placeholder { color: var(--danger); opacity: 0.55; font-weight: 600; font-size: 0.8rem; }
.dist-f .dist-qty { margin-top: 0; height: 36px; width: 100%; }
.dist-f .dist-qty-btn { width: 34px; flex: 0 0 34px; }
.dist-f .dist-qty-input { flex: 1; width: auto; min-width: 0; }
.dist-qty-fixed {
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
    font-weight: 700;
}
.dist-qty-fixed small { color: var(--muted); font-weight: 600; margin-left: 4px; }
@media (max-width: 420px) {
    .dist-line-fields { grid-template-columns: 1fr 1fr; }
    .dist-line-fields .dist-f:first-child { grid-column: 1 / -1; }
}

.pos-line-qty {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pos-qty-step {
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.pos-qty-step:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pos-qty-step:disabled { opacity: 0.4; cursor: not-allowed; }

.pos-qty-num {
    min-width: 22px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.pos-fields-price {
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 6px;
    margin-bottom: 8px;
}

.pos-fields-price .pos-paid-label {
    grid-column: auto;
}

.pos-register-foot {
    flex: 0 0 auto;
    padding: 8px 10px 10px;
    background: var(--surface);
    border-top: 1px solid var(--line);
}

.pos-pay-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-bottom: 8px;
}

.pos-pay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--muted);
    position: relative;
}

.pos-pay input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pos-pay:has(input:checked) {
    border-color: rgba(11, 110, 79, 0.4);
    background: var(--brand-soft);
    color: var(--brand-ink);
}

.pos-sum {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 10px;
    margin-bottom: 6px;
    font-size: 0.78rem;
}

.pos-sum > div {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
}

.pos-sum strong {
    color: var(--ink);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pos-sum-balance strong { color: var(--brand); }

.pos-due {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--brand-soft);
    border: 1px solid rgba(11, 110, 79, 0.14);
}

.pos-due span {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--brand-ink);
}

.pos-due strong {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--brand-ink);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.pos-pay-btn {
    width: 100%;
    border: 0;
    border-radius: 9px;
    padding: 11px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
}

.pos-pay-btn:hover { background: var(--brand-dark); }
.pos-pay-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pos-register-foot.is-idle .pos-due {
    background: var(--surface-2);
    border-color: var(--line);
}
.pos-register-foot.is-idle .pos-due strong,
.pos-register-foot.is-idle .pos-due span { color: var(--muted); }

.pos-toast {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 5;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--brand-dark);
    color: #fff;
    font-size: 0.86rem;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    pointer-events: none;
}
.pos-toast.is-err { background: var(--danger); }

.cart-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cart-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: var(--surface-2);
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.note-box {
    background: var(--brand-soft);
    border-left: 4px solid var(--brand);
    padding: 12px 14px;
    border-radius: 0 10px 10px 0;
    color: var(--brand-ink);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* —— Responsive: tablet —— */
@media (max-width: 1100px) {
    .app-shell { grid-template-columns: 1fr; }

    .nav-toggle { display: inline-flex; }

    /* Compact topbar on tablet/phone — details live in .mobile-context */
    .topbar .page-title,
    .topbar .user-chip {
        display: none !important;
    }
    .topbar {
        align-items: center;
        gap: 10px;
        padding: 10px 14px;
        margin: -22px -28px 0;
        position: sticky;
        top: 0;
        z-index: 40;
    }
    .topbar-right {
        margin-left: auto;
    }

    .mobile-context {
        display: block !important;
        visibility: visible !important;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 14px;
        padding: 14px 16px;
        margin: 12px 0 16px;
        box-shadow: var(--shadow);
        position: relative;
        z-index: 1;
    }

    .records-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .records-split {
        grid-template-columns: 1fr;
    }
    .record-row {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 16px;
    }
    .record-main,
    .record-main-2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .record-side {
        align-items: stretch;
        text-align: left;
        padding-top: 12px;
        border-top: 1px solid var(--line);
    }
    .record-payline,
    .record-actions { justify-content: flex-start; }
    .record-settle { max-width: none; }
    .record-open {
        text-align: center;
    }
    .record-actions .record-open,
    .record-actions .btn {
        flex: 1;
        text-align: center;
        justify-content: center;
    }
    .mobile-context-title {
        font-family: var(--font-display);
        font-size: 1.35rem;
        font-weight: 700;
        color: var(--ink);
        letter-spacing: -0.02em;
        margin: 0 0 4px;
    }
    .mobile-context-sub {
        color: var(--muted);
        font-size: 0.92rem;
        margin: 0 0 6px;
    }
    .mobile-context-branch {
        color: var(--brand-ink);
        font-size: 0.86rem;
        margin: 0 0 12px;
        line-height: 1.4;
    }
    .mobile-context-branch strong { color: var(--brand); }
    .mobile-context-user {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 999px;
        border: 1px solid var(--line);
        background: var(--surface-2);
    }
    .mobile-context-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: var(--brand-soft);
        color: var(--brand-ink);
        display: grid;
        place-items: center;
        font-weight: 700;
        flex-shrink: 0;
    }
    .mobile-context-user strong {
        display: block;
        font-size: 0.92rem;
    }
    .mobile-context-user small {
        display: block;
        color: var(--muted);
        font-size: 0.78rem;
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 36, 56, 0.45);
        z-index: 90;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    .nav-backdrop[hidden] { display: none; }
    body.nav-open .nav-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 100;
        width: min(300px, 88vw);
        height: 100vh;
        height: 100dvh;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        box-shadow: 16px 0 40px rgba(0, 0, 0, 0.2);
        padding-bottom: 32px;
    }
    body.nav-open .sidebar { transform: translateX(0); }

    .nav-close { display: grid; place-items: center; }

    .brand-block { margin: -22px -16px 18px; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }

    .pos-terminal {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .pos-terminal-main {
        order: 0;
    }
    .pos-register {
        position: static;
        order: 1;
        overflow: visible;
    }
    .pos-register-form {
        overflow: visible;
    }
    .pos-register-body {
        display: flex !important;
        visibility: visible !important;
        overflow: visible;
    }
    .pos-card-customer {
        display: block !important;
        visibility: visible !important;
        order: -1; /* customer above bill on narrow screens */
    }
    .pos-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .nav-link {
        min-height: 44px;
        padding: 12px 14px;
    }
}

/* —— Responsive: phone —— */
@media (max-width: 720px) {
    .main { padding: 14px 14px 32px; }

    .topbar {
        margin: -14px -14px 0;
        padding: 10px 14px;
    }
    .mobile-context {
        margin: 12px 0 16px;
    }

    .stats-grid,
    .stats-grid-3,
    .kpi-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .stat-card { padding: 14px; }
    .stat-card .value { font-size: 1.35rem; }

    .form-grid { grid-template-columns: 1fr; }
    .filters .form-control {
        min-width: 100%;
        flex: 1 1 100%;
    }
    .filters .btn,
    .actions .btn,
    .dash-hero-actions .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }
    .actions { width: 100%; }
    .dash-hero {
        align-items: stretch;
    }
    .dash-hero-actions { width: 100%; }
    .dash-search {
        max-width: none;
        flex: 1 1 100%;
    }

    .panel-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    .panel-body.table-wrap {
        padding: 12px;
    }
    .table-wrap table.data {
        min-width: 640px;
    }
    .filters {
        margin-top: 4px;
    }
    .records-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .records-toolbar-search,
    .records-toolbar-actions {
        width: 100%;
    }
    .records-toolbar-actions .btn {
        flex: 1;
        justify-content: center;
    }
    .records-summary {
        grid-template-columns: 1fr 1fr;
    }

    .notif-dropdown {
        position: fixed;
        left: 12px;
        right: 12px;
        top: 72px;
        width: auto;
        max-height: calc(100vh - 96px);
    }

    body.pos-mode .main { padding: 12px 12px 28px; }
    body.pos-mode .topbar {
        margin: -12px -12px 10px;
        padding: 10px 12px;
    }

    .pos-fields-cust {
        grid-template-columns: 1fr 1fr !important;
    }
    .pos-fields-cust label.full {
        grid-column: 1 / -1;
    }
    .pos-fields-price { grid-template-columns: 1fr 1fr; }
    .pos-fields-price .pos-paid-label { grid-column: 1 / -1; }
    .pos-sum { grid-template-columns: 1fr; }
    .pos-scan-bar { gap: 8px; }
    .pos-scan-input,
    .pos-filter-input,
    .pos-branch-select {
        min-width: 100%;
        flex: 1 1 100%;
    }
    .pos-scan-bar .btn {
        width: 100%;
        min-height: 44px;
    }
    .pos-product-grid {
        grid-template-columns: 1fr;
        padding: 8px;
    }
    /* Sticky foot was covering Customer name/phone on phone */
    .pos-register-foot {
        position: static;
        background: var(--surface);
        box-shadow: none;
    }
    .pos-pay-btn {
        min-height: 48px;
        width: 100%;
    }
    .dist-price-pair {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .login-page { padding: 16px; }
    .login-card {
        width: 100%;
        padding: 24px 18px;
        border-radius: 16px;
    }
    .login-logo { max-width: 220px; max-height: 84px; }
    .btn { min-height: 42px; }
}

@media (max-width: 420px) {
    .pos-fields-price { grid-template-columns: 1fr; }
}


/* ── INVEX-style print invoice ── */
.inv-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 auto 18px;
    max-width: 820px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
}
.inv-toolbar strong { display: block; font-family: var(--font-display); }
.inv-toolbar span { font-size: 0.84rem; color: var(--muted); }
.inv-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.invx {
    position: relative;
    max-width: 820px;
    margin: 0 auto 48px;
    padding: 0 36px 36px;
    background: #fff;
    border: 1px solid #e2e8ef;
    box-shadow: 0 16px 40px rgba(15, 36, 56, 0.08);
    color: #1a2330;
    overflow: hidden;
}

.invx-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 12px;
    align-items: start;
    margin: 0 -36px 4px;
    min-height: 148px;
}
.invx-hero-wave {
    position: relative;
    min-height: 148px;
    color: #fff;
    background: linear-gradient(145deg, #04170f 0%, #0a3d2c 45%, #0b6e4f 100%);
    clip-path: polygon(0 0, 86% 0, 100% 100%, 0 100%);
}
.invx-hero-inner {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 26px 34px 36px 28px;
}
.invx-logo {
    width: 62px;
    height: 62px;
    object-fit: contain;
    background: #fff;
    border-radius: 10px;
    padding: 6px;
    flex-shrink: 0;
}
.invx-company {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.invx-tagline {
    margin-top: 6px;
    font-size: 0.6rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    opacity: 0.9;
    max-width: 250px;
    line-height: 1.45;
}
.invx-wave { display: none; }

.invx-meta {
    margin: 26px 36px 0 0;
    display: grid;
    gap: 8px;
    justify-items: end;
    text-align: right;
}
.invx-meta > div {
    display: grid;
    grid-template-columns: auto auto;
    gap: 8px 14px;
    align-items: baseline;
}
.invx-meta dt {
    margin: 0;
    font-size: 0.8rem;
    color: #6b7785;
    font-weight: 500;
}
.invx-meta dd {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: #152033;
    text-align: left;
    min-width: 150px;
}

.invx-title { padding: 10px 0 16px; }
.invx-title h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #111927;
}
.invx-title p {
    margin: 3px 0 0;
    color: #667788;
    font-size: 0.95rem;
}
.invx-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.invx-stamp {
    display: inline-block;
    padding: 6px 14px;
    border: 2px solid currentColor;
    border-radius: 8px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transform: rotate(-4deg);
    white-space: nowrap;
}
.invx-stamp.is-paid { color: #0b6e4f; background: #eef9f4; }
.invx-stamp.is-partial { color: #b9770e; background: #fef8ec; }
.invx-stamp.is-unpaid { color: #c0392b; background: #fdf0ee; }
.invx-st.is-paid { color: #0b6e4f; }
.invx-st.is-partial { color: #b9770e; }
.invx-st.is-unpaid { color: #c0392b; }
.invx-paydetails { margin-top: 16px; }
.invx-paydetails:first-child { margin-top: 0; }
.invx-paydetails .invx-cust span { min-width: 68px; }
.invx-paydetails small { color: #7a8796; }
.invx-paidline { margin-top: 8px; }
.invx-paidline b { color: #0b6e4f; }
.invx-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px dashed;
}
.invx-balance span { font-size: 0.88rem; font-weight: 700; }
.invx-balance strong { font-family: var(--font-display); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.invx-balance.is-due { color: #c0392b; border-color: #e8a59d; background: #fff8f7; }
.invx-balance.is-clear { color: #0b6e4f; border-color: #a9dcc8; background: #f5fbf8; }
.invx-signs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-top: 56px;
    text-align: center;
}
.invx-signs span { font-size: 0.82rem; font-weight: 600; color: #5d6b7c; }
.invx-formula {
    text-align: right;
    font-size: 0.76rem;
    color: #7a8796;
    font-variant-numeric: tabular-nums;
}
.invx-account {
    margin-top: 22px;
    border: 1px solid #e3e9ef;
    border-radius: 12px;
    overflow: hidden;
}
.invx-account-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 10px 16px;
    background: #f5f8fa;
    border-bottom: 1px solid #e3e9ef;
}
.invx-account-head h3 { margin: 0; font-size: 0.92rem; font-weight: 700; color: #152033; }
.invx-account-head span { font-size: 0.76rem; color: #7a8796; }
.invx-account-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; color: #243447; }
.invx-account-table td { padding: 7px 16px; border-bottom: 1px solid #f0f3f6; }
.invx-account-table td small { color: #7a8796; }
.invx-account-table td.op { width: 24px; text-align: center; font-weight: 700; color: #7a8796; padding: 7px 0; }
.invx-account-table td.r { width: 160px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.invx-account-table td.paid { color: #0b6e4f; }
.invx-account-table tr.sub td { background: #fafbfc; color: #5d6b7c; }
.invx-account-table tr.total td {
    border-bottom: 0;
    background: #fff8f7;
    color: #c0392b;
    font-weight: 700;
    font-size: 0.95rem;
}
@media print {
    .invx-stamp, .invx-balance, .invx-account-head, .invx-account-table tr.total td, .invx-account-table tr.sub td {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

.invx-table {
    width: 100%;
    border-collapse: collapse;
}
.invx-table th,
.invx-table td {
    padding: 11px 10px;
    border-bottom: 1px solid #e8eef3;
    text-align: left;
    font-size: 0.9rem;
    vertical-align: top;
}
.invx-table th {
    background: #f1f4f7;
    color: #5d6b7c;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid #dce3ea;
}
.invx-table .n { width: 36px; color: #6b7785; }
.invx-table .r {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.invx-table .sn {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.82rem;
    color: #334155;
}
.invx-table .sn-chip {
    display: inline-block;
    white-space: nowrap;
    margin: 0 6px 4px 0;
    padding: 2px 8px;
    border: 1px solid #e3e9ef;
    border-radius: 6px;
    background: #f7fafc;
    font-size: 0.78rem;
    line-height: 1.5;
}
.invx-table .disc { color: #d35400; font-weight: 700; }
.invx-table .muted { color: #7a8796; font-weight: 500; }
.invx-table .empty {
    text-align: center !important;
    color: #8a97a6;
    padding: 28px !important;
}
.invx-table tbody tr:last-child td { border-bottom: 1px solid #dce3ea; }

.invx-foot {
    display: grid;
    grid-template-columns: 1.2fr 0.9fr;
    gap: 28px;
    margin-top: 22px;
    align-items: start;
}
.invx-block h3 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #152033;
}
.invx-block p,
.invx-block ol {
    margin: 0;
    color: #445566;
    font-size: 0.9rem;
    line-height: 1.5;
}
.invx-block ol { padding-left: 18px; }
.invx-cust {
    display: grid;
    gap: 5px;
    font-size: 0.9rem;
    color: #243447;
}
.invx-cust span {
    display: inline-block;
    min-width: 58px;
    color: #6b7785;
    font-weight: 600;
}
.invx-pay {
    margin: 14px 0 0;
    font-size: 0.86rem;
    color: #5d6b7c;
}
.invx-pay strong { color: #c0392b; }

.invx-foot-right {
    display: grid;
    gap: 6px;
    justify-items: stretch;
    padding-top: 4px;
}
.invx-sumline {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    font-size: 0.9rem;
    color: #445566;
}
.invx-sumline.disc b { color: #d35400; }
.invx-total {
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #d8f3e7;
    border-radius: 8px;
}
.invx-total span {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0d4f39;
}
.invx-total strong {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: #0b3d2c;
    font-variant-numeric: tabular-nums;
}

.invx-sign {
    margin-top: 48px;
    margin-left: auto;
    width: 210px;
    text-align: center;
}
.invx-sign-line {
    border-top: 1px solid #8a97a6;
    margin-bottom: 8px;
}
.invx-sign span {
    font-size: 0.84rem;
    font-weight: 600;
    color: #5d6b7c;
}

@media (max-width: 720px) {
    .invx { padding: 0 18px 28px; }
    .invx-hero {
        grid-template-columns: 1fr;
        margin: 0 -18px 8px;
    }
    .invx-hero-wave {
        clip-path: none;
        min-height: auto;
    }
    .invx-meta {
        margin: 0 18px 12px;
        justify-items: start;
        text-align: left;
    }
    .invx-meta dd { text-align: left; }
    .invx-foot { grid-template-columns: 1fr; }
    .invx-sign { margin-left: 0; width: 100%; }
}

@media print {
    body { background: #fff !important; }
    .sidebar,
    .topbar,
    .mobile-context,
    .nav-close,
    .inv-toolbar,
    .no-print,
    .flash,
    .alert { display: none !important; }
    .app-shell { display: block !important; }
    .main { padding: 0 !important; margin: 0 !important; }
    .invx {
        max-width: none;
        margin: 0;
        border: 0;
        box-shadow: none;
        padding: 0 8mm 8mm;
    }
    .invx-hero { margin: 0 -8mm 4mm; }
    .invx-hero-wave,
    .invx-table th,
    .invx-total {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    @page { margin: 8mm; size: A4; }
}

.pdf-paper { background: var(--surface); color: var(--ink); padding: 10px; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover { border-color: var(--brand); color: var(--brand); }
.theme-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .ico-sun { display: none; }
html[data-theme="dark"] .theme-toggle .ico-sun { display: block; color: #f2bd62; }
html[data-theme="dark"] .theme-toggle .ico-moon { display: none; }

html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease !important;
}

/* ---------- Dark theme specifics (colours that are not plain variables) ---------- */
html[data-theme="dark"] .alert-success { background: rgba(69, 196, 135, 0.12); color: #8fe0b6; border-color: rgba(69, 196, 135, 0.35); }
html[data-theme="dark"] .alert-danger { background: rgba(240, 107, 91, 0.12); color: #ffb4aa; border-color: rgba(240, 107, 91, 0.35); }
html[data-theme="dark"] .alert-warning { background: rgba(232, 165, 60, 0.12); color: #f5cd7e; border-color: rgba(232, 165, 60, 0.35); }
html[data-theme="dark"] .alert-info { background: rgba(85, 172, 217, 0.12); color: #a6d6f1; border-color: rgba(85, 172, 217, 0.35); }
html[data-theme="dark"] .brand-block { border-bottom-color: transparent; }
html[data-theme="dark"] .login-logo { border-radius: 12px; }
html[data-theme="dark"] .invx { border-color: transparent; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45); }
html[data-theme="dark"] .form-control::placeholder { color: var(--muted-2); }
html[data-theme="dark"] .badge-dark { background: #3a4b5e; }

