/* Zamzam Sales Portal — Premium Design System */
:root {
    --font: 'Inter', 'DM Sans', system-ui, -apple-system, sans-serif;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
    --space-5: 20px; --space-6: 24px; --space-8: 32px;
    --header-h: 56px;
    --sidebar-w: 260px;
    --sidebar-collapsed: 72px;
    --bottom-nav-h: 64px;
    --fab-size: 56px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --transition: .2s cubic-bezier(.4,0,.2,1);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 4px 16px rgba(0,0,0,.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.12);
}

[data-theme="light"] {
    --bg: #f8fafc;
    --bg-elevated: #ffffff;
    --bg-subtle: #f1f5f9;
    --border: #e2e8f0;
    --border-subtle: #f1f5f9;
    --text: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --primary: #0d9488;
    --primary-hover: #0f766e;
    --primary-subtle: #ccfbf1;
    --accent: #d97706;
    --accent-subtle: #fef3c7;
    --success: #059669;
    --success-subtle: #d1fae5;
    --warning: #d97706;
    --warning-subtle: #fef3c7;
    --danger: #dc2626;
    --danger-subtle: #fee2e2;
    --info: #2563eb;
    --info-subtle: #dbeafe;
    --sidebar-bg: #ffffff;
    --chart-grid: #f1f5f9;
}

[data-theme="dark"] {
    --bg: #0f1419;
    --bg-elevated: #1a1f26;
    --bg-subtle: #252b33;
    --border: #2d3748;
    --border-subtle: #252b33;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --primary: #2dd4bf;
    --primary-hover: #5eead4;
    --primary-subtle: rgba(45,212,191,.12);
    --accent: #fbbf24;
    --accent-subtle: rgba(251,191,36,.12);
    --success: #34d399;
    --success-subtle: rgba(52,211,153,.12);
    --warning: #fbbf24;
    --warning-subtle: rgba(251,191,36,.12);
    --danger: #f87171;
    --danger-subtle: rgba(248,113,113,.12);
    --info: #60a5fa;
    --info-subtle: rgba(96,165,250,.12);
    --sidebar-bg: #1a1f26;
    --chart-grid: #252b33;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Login ── */
.login-page {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #0f766e 0%, #115e59 45%, #134e4a 100%);
}
.login-page__bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,.12), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(45,212,191,.18), transparent 45%);
    pointer-events: none;
}
.login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 920px;
    display: grid;
    gap: var(--space-6);
    align-items: center;
}
@media (min-width: 768px) {
    .login-shell {
        grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
        gap: var(--space-8);
    }
}
.login-hero {
    color: #ecfdf5;
    display: none;
}
@media (min-width: 768px) {
    .login-hero { display: block; }
}
.login-hero .login-logo {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.2);
    display: grid;
    place-items: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--space-4);
}
.login-hero__title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-2);
}
.login-hero__text {
    font-size: .9375rem;
    opacity: .9;
    line-height: 1.55;
    max-width: 22rem;
}
.login-hero__list {
    list-style: none;
    margin-top: var(--space-6);
    display: grid;
    gap: var(--space-3);
}
.login-hero__list li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    font-size: .8125rem;
    opacity: .92;
    line-height: 1.45;
}
.login-hero__list svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    opacity: .95;
}
.login-card {
    width: 100%;
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,.08);
}
.login-card__header { margin-bottom: var(--space-5); }
.login-card__header h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
}
.login-card__header p {
    font-size: .875rem;
    color: var(--text-secondary);
    margin-top: var(--space-1);
    line-height: 1.45;
}
.login-2fa-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--primary-subtle);
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    margin-bottom: var(--space-3);
}
.login-error {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-3);
    margin-bottom: var(--space-4);
    border-radius: var(--radius-sm);
    font-size: .8125rem;
    line-height: 1.45;
    background: var(--danger-subtle);
    color: var(--danger);
    border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
}
.login-error[hidden] { display: none !important; }
.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon .input-icon {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}
.input-with-icon .form-input { padding-left: 2.5rem; }
.input-with-icon--toggle .form-input { padding-right: 2.75rem; }
.password-toggle {
    position: absolute;
    right: 4px;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: grid;
    place-items: center;
}
.password-toggle svg { width: 18px; height: 18px; }
.password-toggle:hover { color: var(--primary); background: var(--primary-subtle); }
.form-input-code {
    font-family: ui-monospace, monospace;
    letter-spacing: .18em;
    text-align: center;
    font-size: 1.125rem;
}
.login-hint {
    margin-top: var(--space-4);
    font-size: .75rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.45;
}
.login-footnote {
    margin-top: var(--space-3);
    font-size: .75rem;
    color: var(--text-secondary);
    text-align: center;
}
.login-footnote a { font-weight: 600; }
.login-back-btn { margin-top: var(--space-3); }
.btn .btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: login-spin .7s linear infinite;
}
.btn.is-loading .btn-label { opacity: .85; }
.btn.is-loading .btn-spinner { display: inline-block; }
@keyframes login-spin { to { transform: rotate(360deg); } }

/* Mobile brand inside card */
@media (max-width: 767px) {
    .login-card__header::before {
        content: 'Z';
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        border-radius: var(--radius);
        background: linear-gradient(135deg, var(--primary), #0f766e);
        color: #fff;
        font-weight: 700;
        font-size: 1.25rem;
        margin-bottom: var(--space-3);
    }
}

/* legacy aliases */
.login-brand { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-6); }
.login-brand h1 { font-size: 1.25rem; font-weight: 700; }
.login-brand p { font-size: .8125rem; color: var(--text-secondary); }

/* ── App Shell ── */
#app { display: none; min-height: 100dvh; }
.app-layout { display: flex; min-height: 100dvh; }

/* Sidebar */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    z-index: 50;
    transition: width var(--transition), transform var(--transition);
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .nav-label, .sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .user-info, .sidebar.collapsed .collapse-btn span:last-child { display: none; }
.sidebar-brand {
    padding: var(--space-5) var(--space-4);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: var(--space-3);
}
.sidebar-brand-icon {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: var(--primary-subtle); color: var(--primary);
    display: grid; place-items: center; font-weight: 700; flex-shrink: 0;
}
.sidebar-brand-text h2 { font-size: .9375rem; font-weight: 700; }
.sidebar-brand-text p { font-size: .6875rem; color: var(--text-muted); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: var(--space-3); }
.nav-section { margin-bottom: var(--space-4); }
.nav-section-title {
    font-size: .625rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--text-muted);
    padding: var(--space-2) var(--space-3); margin-bottom: var(--space-1);
}
.nav-link {
    display: flex; align-items: center; gap: var(--space-3);
    padding: 10px var(--space-3); border-radius: var(--radius);
    color: var(--text-secondary); font-size: .875rem; font-weight: 500;
    border: none; background: none; width: 100%; text-align: left;
    cursor: pointer; transition: background var(--transition), color var(--transition);
    margin-bottom: 2px;
}
.nav-link:hover { background: var(--bg-subtle); color: var(--text); }
.nav-link.active { background: var(--primary-subtle); color: var(--primary); font-weight: 600; }
.nav-link svg { width: 20px; height: 20px; flex-shrink: 0; opacity: .85; }
.nav-link.active svg { opacity: 1; }
.sidebar-user {
    padding: var(--space-4); border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: var(--space-3);
}
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #0f766e);
    color: #fff; display: grid; place-items: center;
    font-size: .8125rem; font-weight: 700; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-info strong { display: block; font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info span { font-size: .6875rem; color: var(--text-muted); }
.collapse-btn {
    margin: var(--space-2) var(--space-3) var(--space-3);
    padding: var(--space-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: none;
    color: var(--text-muted); cursor: pointer; font-size: .75rem;
    display: flex; align-items: center; justify-content: center; gap: var(--space-2);
}

/* Main content */
.main-wrap {
    flex: 1; margin-left: var(--sidebar-w);
    transition: margin-left var(--transition);
    min-height: 100dvh;
    display: flex; flex-direction: column;
}
.sidebar.collapsed ~ .main-wrap { margin-left: var(--sidebar-collapsed); }

.topbar {
    position: sticky; top: 0; z-index: 30;
    height: calc(var(--header-h) + var(--safe-top));
    padding-top: var(--safe-top);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding-left: var(--space-4); padding-right: var(--space-4);
    gap: var(--space-3);
}
.topbar-back-btn { flex-shrink: 0; }
.topbar-back-btn[hidden] { display: none !important; }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 1.0625rem; font-weight: 700; }
.topbar-title p { font-size: .75rem; color: var(--text-muted); }
.topbar-actions { display: flex; align-items: center; gap: var(--space-2); }

.icon-btn {
    width: 40px; height: 40px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--bg-elevated);
    color: var(--text-secondary); cursor: pointer;
    display: grid; place-items: center; transition: all var(--transition);
}
.icon-btn:hover { background: var(--bg-subtle); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

.page-content {
    flex: 1; padding: var(--space-4);
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--space-6));
}
@media (min-width: 1024px) {
    .page-content { padding-bottom: var(--space-6); }
}

.screen { display: none; animation: fadeIn .25s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Components ── */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary) 0%, #0f766e 100%);
    color: #fff; border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-6);
    margin-bottom: var(--space-5);
    position: relative; overflow: hidden;
}
.welcome-banner::after {
    content: ''; position: absolute; right: -20px; top: -20px;
    width: 120px; height: 120px; border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.welcome-banner h2 { font-size: 1.375rem; font-weight: 700; margin-bottom: var(--space-1); }
.welcome-banner p { opacity: .85; font-size: .875rem; }
.welcome-target-summary {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid rgba(255,255,255,.2);
    font-size: .8125rem;
    opacity: .95;
}
.welcome-target-summary strong { font-weight: 700; }

.target-section { margin-bottom: var(--space-5); }
.target-section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: var(--space-3);
}
.target-section-header h3 { font-size: .9375rem; font-weight: 700; color: var(--text); }
.target-section-header span { font-size: .75rem; color: var(--text-muted); }

.target-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
}
@media (min-width: 640px) { .target-card-grid { grid-template-columns: repeat(2, 1fr); } }

.target-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-sm);
}
.target-card-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: var(--space-3); margin-bottom: var(--space-3);
}
.target-card-name { font-size: .9375rem; font-weight: 700; color: var(--text); }
.target-card-badge {
    font-size: .6875rem; font-weight: 700; padding: 4px 8px;
    border-radius: 999px; background: var(--primary-subtle); color: var(--primary);
    white-space: nowrap;
}
.target-card-badge.complete { background: var(--success-subtle); color: var(--success); }
.target-card-stats {
    display: flex; justify-content: space-between; gap: var(--space-3);
    font-size: .75rem; color: var(--text-secondary); margin-bottom: var(--space-2);
}
.target-card-stats strong { display: block; font-size: .875rem; color: var(--text); margin-top: 2px; }
.target-progress {
    height: 8px; background: var(--bg-subtle); border-radius: 999px; overflow: hidden;
}
.target-progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--primary), #14b8a6);
    border-radius: 999px; transition: width .3s ease;
}
.target-progress-fill.complete { background: linear-gradient(90deg, var(--success), #34d399); }

.target-filter-summary {
    font-size: .75rem; color: var(--text-muted);
    margin: calc(var(--space-2) * -1) 0 var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-subtle); border-radius: var(--radius);
}

.ranking-section { margin-bottom: var(--space-5); }
.ranking-summary {
    display: flex; align-items: center; gap: var(--space-4);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    background: linear-gradient(135deg, var(--primary-subtle), var(--bg-elevated));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.ranking-summary-rank {
    width: 56px; height: 56px; border-radius: var(--radius-lg);
    display: grid; place-items: center;
    background: var(--primary); color: #fff;
    font-size: 1.25rem; font-weight: 800; flex-shrink: 0;
}
.ranking-summary-label { font-size: .75rem; color: var(--text-muted); margin-bottom: 2px; }
.ranking-summary-value { font-size: .9375rem; font-weight: 700; color: var(--text); }

.ranking-list {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.ranking-row {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
}
.ranking-row:last-child { border-bottom: none; }
.ranking-row.is-me {
    background: var(--primary-subtle);
}
.ranking-pos {
    width: 44px; flex-shrink: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; line-height: 1;
}
.ranking-num {
    font-size: .8125rem; font-weight: 700; color: var(--text-secondary);
}
.ranking-medal { font-size: 1.125rem; line-height: 1; }
.ranking-row.is-me .ranking-num { color: var(--primary); }
.ranking-info { flex: 1; min-width: 0; }
.ranking-name { font-size: .875rem; font-weight: 600; color: var(--text); }
.ranking-you {
    display: inline-block; margin-left: 6px;
    font-size: .625rem; font-weight: 700; text-transform: uppercase;
    padding: 2px 6px; border-radius: 999px;
    background: var(--primary); color: #fff; vertical-align: middle;
}
.ranking-meta { font-size: .6875rem; color: var(--text-muted); margin-top: 2px; }
.ranking-sales { font-size: .875rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.ranking-separator {
    padding: var(--space-2); text-align: center;
    font-size: .6875rem; color: var(--text-muted);
    background: var(--bg-subtle); letter-spacing: .2em;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}
@media (min-width: 768px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }

.kpi-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--space-3); }
.kpi-icon {
    width: 36px; height: 36px; border-radius: var(--radius);
    display: grid; place-items: center; font-size: 1rem;
}
.kpi-icon.teal { background: var(--primary-subtle); }
.kpi-icon.amber { background: var(--accent-subtle); }
.kpi-icon.blue { background: var(--info-subtle); }
.kpi-icon.red { background: var(--danger-subtle); }
.kpi-icon.green { background: var(--success-subtle); }
.kpi-change { font-size: .6875rem; font-weight: 600; padding: 2px 6px; border-radius: 999px; }
.kpi-change.up { background: var(--success-subtle); color: var(--success); }
.kpi-change.down { background: var(--danger-subtle); color: var(--danger); }
.kpi-value { font-size: 1.375rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.kpi-label { font-size: .75rem; color: var(--text-muted); margin-top: var(--space-1); font-weight: 500; }
.kpi-spark { height: 28px; margin-top: var(--space-2); opacity: .6; }

.section-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: var(--space-3);
}
.section-header h3 { font-size: .9375rem; font-weight: 700; }
.section-header a, .section-header button.link {
    font-size: .8125rem; color: var(--primary); font-weight: 600;
    background: none; border: none; cursor: pointer;
}

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.card-padded { padding: var(--space-4); }
.chart-card { padding: var(--space-4); margin-bottom: var(--space-4); }
.chart-wrap { height: 200px; position: relative; }

.quick-actions {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3);
    margin-bottom: var(--space-5);
}
@media (min-width: 640px) { .quick-actions { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .quick-actions { grid-template-columns: repeat(5, 1fr); } }

.qa-btn {
    display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
    padding: var(--space-4); border-radius: var(--radius-lg);
    border: 1px solid var(--border); background: var(--bg-elevated);
    cursor: pointer; transition: all var(--transition); text-align: center;
}
.qa-btn:hover { border-color: var(--primary); background: var(--primary-subtle); }
.qa-btn .qa-icon { font-size: 1.5rem; }
.qa-btn span { font-size: .75rem; font-weight: 600; color: var(--text-secondary); }
.qa-btn.primary { background: var(--primary); border-color: var(--primary); }
.qa-btn.primary span { color: #fff; }

.data-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.data-table th {
    text-align: left; padding: var(--space-3) var(--space-4);
    font-size: .6875rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: var(--text-muted);
    border-bottom: 1px solid var(--border); background: var(--bg-subtle);
}
.data-table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-subtle); }

.mobile-list { display: flex; flex-direction: column; gap: var(--space-2); }
@media (min-width: 768px) { .mobile-list.hide-desktop { display: none; } }
.desktop-table { display: none; }
@media (min-width: 768px) { .desktop-table { display: block; } }

.list-item {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius); padding: var(--space-4);
    cursor: pointer; transition: all var(--transition);
}
.list-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.list-item.selected { border-color: var(--primary); background: var(--primary-subtle); }
.list-item-row { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); }
.list-item-title {
    font-weight: 600;
    font-size: .875rem;
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.list-item-meta { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

.badge {
    display: inline-flex; align-items: center;
    padding: 3px 8px; border-radius: 999px;
    font-size: .625rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.badge-pending { background: var(--warning-subtle); color: var(--warning); }
.badge-confirmed { background: var(--info-subtle); color: var(--info); }
.badge-processing { background: #e0e7ff; color: #4338ca; }
[data-theme="dark"] .badge-processing { background: rgba(99,102,241,.2); color: #a5b4fc; }
.badge-shipped { background: var(--success-subtle); color: var(--success); }
.badge-delivered { background: var(--success-subtle); color: var(--success); }
.badge-cancelled { background: var(--danger-subtle); color: var(--danger); }
.badge-approved { background: var(--success-subtle); color: var(--success); }
.badge-rejected { background: var(--danger-subtle); color: var(--danger); }
.badge-low_stock { background: var(--warning-subtle); color: var(--warning); }
.badge-out_of_stock { background: var(--danger-subtle); color: var(--danger); }
.badge-in_stock { background: var(--success-subtle); color: var(--success); }

.search-bar {
    display: flex; gap: var(--space-2); margin-bottom: var(--space-4);
}
.search-input {
    flex: 1; padding: 11px var(--space-4);
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg-elevated); color: var(--text); font-size: .9375rem;
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-subtle); }
.filter-chips { display: flex; gap: var(--space-2); overflow-x: auto; padding-bottom: var(--space-2); margin-bottom: var(--space-3); }
.chip {
    padding: 6px 14px; border-radius: 999px; font-size: .75rem; font-weight: 600;
    border: 1px solid var(--border); background: var(--bg-elevated);
    color: var(--text-secondary); cursor: pointer; white-space: nowrap;
    transition: all var(--transition);
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    padding: 11px var(--space-5); border-radius: var(--radius);
    font-size: .875rem; font-weight: 600; cursor: pointer;
    border: none; transition: all var(--transition);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { background: var(--bg-subtle); color: var(--text); border: 1px solid var(--border); }
.btn-accent { background: linear-gradient(135deg, #d97706, #fbbf24); color: #78350f; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px var(--space-6); font-size: .9375rem; }

.form-group { margin-bottom: var(--space-4); }
.form-label { display: block; font-size: .75rem; font-weight: 600; color: var(--text-secondary); margin-bottom: var(--space-2); }
.form-input {
    width: 100%; padding: 11px var(--space-4);
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg-elevated); color: var(--text);
}

/* Product grid */
.product-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3);
}
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }

.product-card {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    transition: all var(--transition); cursor: pointer;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.product-img {
    aspect-ratio: 1; background: var(--bg-subtle);
    display: grid; place-items: center; font-size: 2rem; color: var(--text-muted);
}
.product-body { padding: var(--space-3); }
.product-body h4 { font-size: .8125rem; font-weight: 600; margin-bottom: 2px; line-height: 1.3; }
.product-body .sku { font-size: .6875rem; color: var(--text-muted); }
.product-body .price { font-size: .875rem; font-weight: 700; color: var(--primary); margin-top: var(--space-2); }

/* Bottom Nav (Mobile) */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 35;
    height: calc(var(--bottom-nav-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    display: flex; align-items: stretch;
    box-shadow: 0 -4px 20px rgba(0,0,0,.06);
}
@media (min-width: 1024px) { .bottom-nav { display: none; } }

.bottom-nav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2px;
    border: none; background: none; color: var(--text-muted);
    font-size: .625rem; font-weight: 600; cursor: pointer;
    position: relative; padding: var(--space-2);
    transition: color var(--transition);
}
.bottom-nav-item svg { width: 22px; height: 22px; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 32px; height: 3px; background: var(--primary); border-radius: 0 0 4px 4px;
}

/* FAB */
.fab {
    position: fixed; bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--space-4));
    right: var(--space-4); z-index: 34;
    width: var(--fab-size); height: var(--fab-size);
    border-radius: 50%; border: none;
    background: linear-gradient(135deg, var(--primary), #0f766e);
    color: #fff; font-size: 1.5rem; cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: grid; place-items: center;
    transition: transform var(--transition);
}
.fab:hover { transform: scale(1.05); }
@media (min-width: 1024px) {
    .fab { bottom: var(--space-6); }
}

/* Order Modal */
.order-sheet {
    position: fixed; inset: 0; z-index: 50;
    background: var(--bg);
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.4,0,.2,1);
    display: flex; flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}
.order-sheet.open { transform: translateY(0); }
.order-sheet-header {
    flex-shrink: 0;
    padding: calc(var(--safe-top) + var(--space-3)) var(--space-4) var(--space-3);
    background: var(--bg-elevated); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: var(--space-3);
}
.order-header-close { margin-left: auto; }
.order-steps {
    flex-shrink: 0;
    display: flex; gap: var(--space-2); padding: var(--space-3) var(--space-4);
    background: var(--bg-elevated); border-bottom: 1px solid var(--border);
}
.step-bar { flex: 1; height: 4px; border-radius: 999px; background: var(--border); }
.step-bar.done { background: var(--primary); }
.step-bar.active { background: var(--accent); }

.order-body-wrap {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.order-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-4);
    -webkit-overflow-scrolling: touch;
}

.order-footer,
.order-footer-step1,
.order-footer-enhanced {
    flex-shrink: 0;
    padding: var(--space-4);
    padding-bottom: calc(var(--space-4) + var(--safe-bottom));
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 32px rgba(0,0,0,.08);
}
.order-footer-step1 { display: none; }
.order-footer-step1.visible { display: block; }
.order-total-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-3); }
.order-total-row .amount { font-size: 1.25rem; font-weight: 700; }

/* Step 1 — customer picker */
.customer-step-hero {
    text-align: center;
    padding: var(--space-4) var(--space-2) var(--space-5);
}
.customer-step-hero-icon {
    width: 56px; height: 56px; border-radius: var(--radius-lg);
    background: var(--primary-subtle); color: var(--primary);
    display: grid; place-items: center; font-size: 1.75rem;
    margin: 0 auto var(--space-3);
}
.customer-step-hero h3 { font-size: 1.0625rem; font-weight: 700; margin-bottom: 4px; }
.customer-step-hero p { font-size: .8125rem; color: var(--text-muted); }

.customer-search-wrap {
    position: relative; margin-bottom: var(--space-4);
}
.customer-search-wrap .search-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 1rem; opacity: .45; pointer-events: none;
}
.customer-search-wrap .search-input {
    padding-left: 42px; margin-bottom: 0;
}

.customer-picker-list { display: flex; flex-direction: column; gap: var(--space-2); }

.customer-picker-card {
    display: flex; align-items: flex-start; gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left; width: 100%;
}
.customer-picker-card:active { transform: scale(.99); }
.customer-picker-card.selected {
    border-color: var(--primary);
    background: var(--primary-subtle);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, .12);
}
.customer-picker-card .cp-avatar {
    width: 44px; height: 44px; border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), #0f766e);
    color: #fff; display: grid; place-items: center;
    font-size: .8125rem; font-weight: 700; flex-shrink: 0;
}
.customer-picker-card .cp-body { flex: 1; min-width: 0; }
.customer-picker-card .cp-name {
    font-size: .9375rem; font-weight: 600;
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.customer-picker-card .cp-meta { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.customer-picker-card .cp-balance {
    font-size: .8125rem; font-weight: 700; color: var(--success);
    white-space: nowrap; flex-shrink: 0; text-align: right;
}
.customer-picker-card .cp-balance.due { color: var(--danger); }
.party-loading {
    padding: var(--space-4); text-align: center;
    font-size: .8125rem; color: var(--text-muted);
}
.text-due { color: var(--danger); font-weight: 600; }
.text-clear { color: var(--success); font-weight: 600; }
.customer-picker-card .cp-check {
    width: 24px; height: 24px; border-radius: 50%;
    border: 2px solid var(--border); flex-shrink: 0;
    display: grid; place-items: center; font-size: .75rem; color: transparent;
}
.customer-picker-card.selected .cp-check {
    background: var(--primary); border-color: var(--primary); color: #fff;
}

.customer-selected-preview {
    display: none;
    align-items: center; gap: var(--space-3);
    padding: var(--space-3);
    background: var(--primary-subtle);
    border: 1px solid var(--primary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
}
.customer-selected-preview.visible { display: flex; }
.customer-selected-preview strong { font-size: .875rem; display: block; }
.customer-selected-preview span { font-size: .75rem; color: var(--text-muted); }

/* Order step 2 — tabs & cart */
.order-customer-bar {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
}
.order-customer-avatar {
    width: 40px; height: 40px; border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), #0f766e);
    color: #fff; display: grid; place-items: center;
    font-size: .875rem; font-weight: 700; flex-shrink: 0;
}
.order-customer-info { flex: 1; min-width: 0; }
.order-customer-info strong {
    display: block;
    font-size: .9375rem;
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.order-customer-info span { font-size: .75rem; color: var(--text-muted); }
.order-date-pill {
    font-size: .6875rem; font-weight: 600; color: var(--primary);
    background: var(--primary-subtle); padding: 4px 10px; border-radius: 999px;
    white-space: nowrap;
}

.order-tabs {
    display: flex; gap: var(--space-2); padding: 4px;
    background: var(--bg-subtle); border-radius: var(--radius-lg);
    margin-bottom: var(--space-4); border: 1px solid var(--border);
}
.order-tab {
    flex: 1; padding: 10px 12px; border: none; border-radius: var(--radius);
    background: transparent; color: var(--text-muted);
    font-size: .8125rem; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: all var(--transition);
}
.order-tab.active {
    background: var(--bg-elevated); color: var(--text);
    box-shadow: var(--shadow-sm);
}
.cart-badge {
    min-width: 20px; height: 20px; padding: 0 6px;
    background: var(--primary); color: #fff;
    border-radius: 999px; font-size: .6875rem; font-weight: 700;
    display: inline-grid; place-items: center;
}
.cart-badge.empty { background: var(--border); color: var(--text-muted); }

.order-panel { display: none; }
.order-panel.active { display: block; animation: fadeIn .2s ease; }

.cart-panel { min-height: 120px; }
.cart-list { display: flex; flex-direction: column; gap: var(--space-3); }

.cart-item-card {
    display: flex; gap: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.cart-item-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--primary); border-radius: 3px 0 0 3px;
}
.cart-item-thumb {
    width: 52px; height: 52px; border-radius: var(--radius);
    background: var(--bg-subtle); border: 1px solid var(--border);
    display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0;
}
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-name { font-size: .875rem; font-weight: 600; line-height: 1.3; margin-bottom: 2px; }
.cart-item-unit { font-size: .75rem; color: var(--text-muted); }
.cart-item-row { display: flex; align-items: center; justify-content: space-between; margin-top: var(--space-2); gap: var(--space-2); }
.cart-item-qty {
    display: flex; align-items: center; gap: 2px;
    background: var(--bg-subtle); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 2px;
}
.cart-item-qty button {
    width: 32px; height: 32px; border: none; background: var(--bg-elevated);
    border-radius: var(--radius-sm); font-size: 1rem; font-weight: 700;
    color: var(--primary); cursor: pointer;
}
.cart-item-qty button:active { background: var(--primary-subtle); }
.cart-item-qty span { min-width: 32px; text-align: center; font-weight: 700; font-size: .875rem; }
.cart-item-line-total { font-size: .9375rem; font-weight: 700; color: var(--primary); white-space: nowrap; }
.cart-item-remove {
    position: absolute; top: 8px; right: 8px;
    width: 28px; height: 28px; border: none; border-radius: 50%;
    background: var(--danger-subtle); color: var(--danger);
    cursor: pointer; display: grid; place-items: center; font-size: .875rem;
}

.cart-empty {
    text-align: center; padding: var(--space-8) var(--space-4);
    background: var(--bg-subtle); border-radius: var(--radius-lg);
    border: 2px dashed var(--border);
}
.cart-empty-icon { font-size: 3rem; margin-bottom: var(--space-3); opacity: .45; }
.cart-empty h4 { font-size: .9375rem; font-weight: 600; color: var(--text-secondary); margin-bottom: var(--space-1); }
.cart-empty p { font-size: .8125rem; color: var(--text-muted); margin-bottom: var(--space-4); }

.order-footer-enhanced {
    padding-top: var(--space-2);
    padding-left: var(--space-4);
    padding-right: var(--space-4);
    padding-bottom: calc(var(--space-3) + var(--safe-bottom));
}

.cart-summary-toggle {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding: 0;
    margin: 0 0 var(--space-3);
    border: none;
    background: transparent;
    cursor: pointer;
    color: inherit;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

.cart-summary-handle {
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: var(--border);
    margin: 0 auto var(--space-2);
    flex-shrink: 0;
}

.cart-summary-toggle-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) 0;
}

.cart-summary-toggle-label {
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.cart-summary-toggle-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.cart-summary-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.cart-summary-chevron svg {
    width: 20px;
    height: 20px;
}

.order-footer-enhanced.expanded .cart-summary-chevron {
    transform: rotate(180deg);
}

.cart-summary-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .28s ease, opacity .22s ease, margin .28s ease;
    margin-bottom: 0;
}

.order-footer-enhanced.expanded .cart-summary-details {
    max-height: 420px;
    opacity: 1;
    margin-bottom: var(--space-3);
}

.order-footer-enhanced.collapsed .cart-summary-details {
    pointer-events: none;
}

.cart-summary-rows { margin-bottom: var(--space-2); }
.cart-summary-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: .8125rem; color: var(--text-muted); padding: 4px 0;
}
.cart-summary-row.total {
    padding-top: var(--space-2); margin-top: var(--space-1);
    border-top: 1px dashed var(--border);
    font-size: 1rem; font-weight: 700; color: var(--text);
}
.cart-summary-row.total .val { font-size: 1.25rem; color: var(--primary); }
.cart-summary-row-highlight {
    padding-top: var(--space-2);
    margin-top: var(--space-1);
    border-top: 1px dashed var(--border);
    font-weight: 600;
}
.cart-summary-row-highlight .val { font-size: 1.0625rem; }

.order-remark-field {
    margin-bottom: var(--space-3);
}
.order-remark-field label {
    display: block;
    font-size: .6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 6px;
}
.order-remark-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: .875rem;
}

.order-window-banner {
    margin: 0 var(--space-4) var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: rgba(239, 68, 68, .1);
    border: 1px solid rgba(239, 68, 68, .35);
    border-radius: var(--radius-lg);
    font-size: .8125rem;
    color: var(--danger);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.order-window-banner strong { font-size: .875rem; }
.order-window-banner .order-window-time { display: block; font-size: .75rem; margin-top: 4px; opacity: .85; }

.order-window-notice {
    margin-bottom: var(--space-3);
    padding: var(--space-3);
    background: rgba(239, 68, 68, .08);
    border: 1px solid rgba(239, 68, 68, .25);
    border-radius: var(--radius);
    font-size: .8125rem;
    color: var(--danger);
    text-align: center;
}

.fab.fab-disabled { opacity: .45; pointer-events: none; }
.btn-new-voucher.btn-disabled,
.btn-new-voucher:disabled {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
}
.payments-day-closed-notice { margin-bottom: var(--space-3); }
.btn-submit-order {
    width: 100%; padding: 16px; border: none; border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary), #0f766e);
    color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: var(--space-2);
    box-shadow: 0 4px 16px rgba(13, 148, 136, .35);
    transition: transform var(--transition), opacity var(--transition);
}
.btn-submit-order:active:not(:disabled) { transform: scale(.98); }
.btn-submit-order:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

.product-row-order {
    display: flex; align-items: flex-start; gap: var(--space-3);
    padding: var(--space-3); background: var(--bg-elevated);
    border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: var(--space-2);
}
.product-row-order-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.packing-select {
    width: 100%; max-width: 100%;
    padding: 8px 10px; font-size: .75rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-subtle); color: var(--text);
}
.packing-chip-list {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.packing-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 8px; font-size: .6875rem; font-weight: 600;
    border-radius: 999px; background: var(--primary-soft); color: var(--primary);
    border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
}
.packing-chip-price { opacity: .85; font-weight: 500; }
.packing-chip-sm {
    display: inline-block; padding: 2px 7px; font-size: .625rem; font-weight: 700;
    border-radius: 999px; background: var(--primary-soft); color: var(--primary);
}
.list-item-items, .order-table-items {
    font-size: .75rem; color: var(--text-muted); margin-top: 4px; line-height: 1.4;
}
.order-items-preview {
    margin-top: 8px; display: flex; flex-direction: column; gap: 6px;
}
.order-item-line {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-size: .75rem; padding: 6px 8px; border-radius: var(--radius-sm);
    background: var(--bg-subtle); border: 1px solid var(--border);
}
.order-item-main { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.order-item-name { font-weight: 600; color: var(--text); }
.order-item-meta { display: flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--text-muted); }
.order-item-meta strong { color: var(--text); }
.cart-item-packing {
    font-size: .75rem; color: var(--primary); font-weight: 600; margin-top: 2px;
}
.cart-item-lot {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .02em;
    background: rgba(13, 148, 136, .12);
    border: 1px solid rgba(13, 148, 136, .28);
    color: var(--primary);
    max-width: 100%;
}
.cart-item-lot .lot-expiry-near { color: #DC2626; font-weight: 600; }
.cart-item-lot .lot-expiry-medium { color: #EA580C; font-weight: 600; }
.cart-item-lot .lot-expiry-normal { color: inherit; }
.cart-lot-chip-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px;
}
.cart-lot-chip-label {
    font-size: .625rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: var(--text-muted);
}
.cart-lot-chip {
    display: inline-flex; align-items: center;
    padding: 2px 7px; border-radius: 999px;
    font-size: .625rem; font-weight: 700;
    background: rgba(234, 88, 12, .12);
    border: 1px solid rgba(234, 88, 12, .28);
    color: #c2410c;
}
.qty-control { display: flex; align-items: center; gap: var(--space-1); }
.qty-btn {
    width: 32px; height: 32px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg-subtle);
    cursor: pointer; font-weight: 700; color: var(--text);
}

/* Mobile drawer overlay */
.drawer-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 40;
    opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
[data-theme="dark"] .drawer-overlay {
    background: rgba(0, 0, 0, 0.45);
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

.sidebar-close-btn {
    display: none;
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--bg-subtle);
    color: var(--text-secondary); cursor: pointer;
    place-items: center; flex-shrink: 0; margin-left: auto;
}
.sidebar-close-btn svg { width: 18px; height: 18px; }

@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
        width: min(300px, 85vw);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
        pointer-events: none;
        background: var(--sidebar-bg);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
        pointer-events: auto;
    }
    .main-wrap {
        margin-left: 0 !important;
        width: 100%;
    }
    .collapse-btn { display: none; }
    .sidebar-close-btn { display: grid; }
    .mobile-menu-btn { display: grid; }
    body.drawer-open { overflow: hidden; }
}

@media (min-width: 1024px) {
    .mobile-menu-btn { display: none !important; }
    .sidebar-close-btn { display: none !important; }
    .drawer-overlay { display: none !important; }
}

/* Empty & Skeleton */
.empty-state { text-align: center; padding: var(--space-8) var(--space-4); color: var(--text-muted); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: var(--space-3); opacity: .4; }
.empty-state h4 { font-size: .9375rem; font-weight: 600; color: var(--text-secondary); margin-bottom: var(--space-1); }
.skeleton {
    background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--border) 50%, var(--bg-subtle) 75%);
    background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.toast-stack {
    position: fixed; top: calc(var(--safe-top) + var(--space-3)); left: 50%;
    transform: translateX(-50%); z-index: 100;
    display: flex; flex-direction: column; gap: var(--space-2);
    width: min(420px, calc(100% - var(--space-8)));
    pointer-events: none;
}
.toast {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius); padding: var(--space-3) var(--space-4);
    box-shadow: var(--shadow-lg); font-size: .875rem;
    display: flex; align-items: center; gap: var(--space-3);
    pointer-events: auto; animation: toastIn .3s ease;
}
.toast.success { border-color: var(--success); background: var(--success-subtle); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Profile screen */
.profile-hero {
    background: linear-gradient(135deg, var(--primary) 0%, #0f766e 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-4);
    position: relative;
    overflow: hidden;
}
.profile-hero::after {
    content: '';
    position: absolute;
    right: -24px;
    top: -24px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    pointer-events: none;
}
.profile-hero-top {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    position: relative;
    z-index: 1;
}
.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .18);
    border: 2px solid rgba(255, 255, 255, .35);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    font-weight: 800;
    flex-shrink: 0;
    letter-spacing: -.02em;
}
.profile-identity {
    flex: 1;
    min-width: 0;
}
.profile-name {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.25;
}
.profile-role-badge {
    display: inline-flex;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.profile-email {
    margin-top: 6px;
    font-size: .8125rem;
    opacity: .88;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-hero-progress {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, .2);
    position: relative;
    z-index: 1;
}
.profile-hero-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .75rem;
    opacity: .92;
    margin-bottom: var(--space-2);
}
.profile-hero-progress-head strong {
    font-size: .875rem;
    font-weight: 800;
}
.profile-hero-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, .22);
    border-radius: 999px;
    overflow: hidden;
}
.profile-hero-progress-fill {
    height: 100%;
    background: #fff;
    border-radius: 999px;
    transition: width .3s ease;
}
.profile-hero-progress-meta {
    margin-top: var(--space-2);
    font-size: .75rem;
    opacity: .9;
}
.profile-hero-progress-meta strong {
    font-weight: 700;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.profile-stat {
    padding: var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
}
[data-theme="dark"] .profile-stat {
    box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}
.profile-stat-label {
    display: block;
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.profile-stat-value {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.profile-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}
.profile-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 76px;
    padding: var(--space-3);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
[data-theme="dark"] .profile-quick-action {
    box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}
.profile-quick-action:active {
    transform: scale(.98);
}
.profile-quick-action:hover {
    border-color: rgba(13, 148, 136, .35);
    box-shadow: 0 4px 14px rgba(13, 148, 136, .1);
}
.profile-quick-action-icon {
    font-size: 1.375rem;
    line-height: 1;
}

.profile-menu-section {
    margin-bottom: var(--space-4);
}
.profile-menu-label {
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
    padding-left: var(--space-1);
}
.profile-menu-group {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
}
[data-theme="dark"] .profile-menu-group {
    box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}
.profile-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: 14px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.profile-menu-item:last-child {
    border-bottom: none;
}
.profile-menu-item:hover {
    background: var(--bg-subtle);
}
.profile-menu-item.danger .profile-menu-title {
    color: var(--danger);
}
.profile-menu-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary-subtle);
    display: grid;
    place-items: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}
.profile-menu-item.danger .profile-menu-icon {
    background: var(--danger-subtle);
}
.profile-menu-text {
    flex: 1;
    min-width: 0;
}
.profile-menu-title {
    display: block;
    font-size: .9375rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}
.profile-menu-sub {
    display: block;
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.profile-menu-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    opacity: .45;
    display: grid;
    place-items: center;
}
.profile-menu-chevron svg {
    width: 18px;
    height: 18px;
}

.profile-contact-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
}
[data-theme="dark"] .profile-contact-card {
    box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}
.profile-contact-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.profile-contact-row:last-child {
    border-bottom: none;
}
.profile-contact-label {
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
}
.profile-contact-value {
    font-size: .875rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}
.profile-contact-value[href]:hover {
    color: var(--primary);
}

#screen-profile .target-section,
#screen-profile .ranking-section {
    margin-bottom: var(--space-5);
}

@media (max-width: 380px) {
    .profile-quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    .profile-quick-action {
        min-height: 68px;
    }
}
.toggle {
    width: 44px; height: 24px; border-radius: 999px;
    background: var(--border); position: relative; cursor: pointer;
    transition: background var(--transition);
}
.toggle.on { background: var(--primary); }
.toggle::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 20px; height: 20px; border-radius: 50%; background: #fff;
    transition: transform var(--transition); box-shadow: var(--shadow-sm);
}
.toggle.on::after { transform: translateX(20px); }

.detail-grid { display: grid; gap: var(--space-3); margin-bottom: var(--space-5); }
@media (min-width: 640px) { .detail-grid { grid-template-columns: repeat(2, 1fr); } }
.detail-stat {
    padding: var(--space-4); background: var(--bg-subtle);
    border-radius: var(--radius); border: 1px solid var(--border);
}
.detail-stat label { font-size: .6875rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.detail-stat value, .detail-stat .val { display: block; font-size: 1rem; font-weight: 700; margin-top: 2px; }

.coming-soon {
    text-align: center; padding: var(--space-8);
    background: var(--bg-subtle); border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
}
.coming-soon h3 { font-size: 1rem; margin-bottom: var(--space-2); }
.coming-soon p { font-size: .8125rem; color: var(--text-muted); }

.payment-customer-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.payment-customer-balance {
    margin-top: 4px;
    font-size: .8125rem;
    font-weight: 600;
}

.payment-customer-results {
    margin-top: var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    max-height: 220px;
    overflow-y: auto;
}

.payment-customer-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--surface);
    border: none;
    border-bottom: 1px solid var(--border);
    text-align: left;
    cursor: pointer;
}

.payment-customer-option:last-child { border-bottom: none; }
.payment-customer-option:hover { background: var(--bg-subtle); }

.payment-customer-empty {
    padding: var(--space-3) var(--space-4);
    font-size: .8125rem;
    color: var(--text-muted);
}

textarea.form-input {
    resize: vertical;
    min-height: 72px;
}

/* Add item modal */
.add-item-overlay {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(15, 23, 42, .45);
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
}
.add-item-overlay.open { opacity: 1; pointer-events: auto; }

.add-item-modal {
    position: fixed; left: 50%; bottom: 0; z-index: 61;
    width: min(100%, 480px);
    transform: translate(-50%, 110%);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-lg);
    transition: transform .32s cubic-bezier(.4,0,.2,1);
    display: flex; flex-direction: column;
    max-height: min(85dvh, 640px);
    pointer-events: none;
}
.add-item-modal.open { pointer-events: auto; transform: translate(-50%, 0); }
@media (min-width: 640px) {
    .add-item-modal {
        bottom: auto; top: 50%;
        border-radius: var(--radius-lg);
        transform: translate(-50%, -40%);
        opacity: 0;
    }
    .add-item-modal.open {
        transform: translate(-50%, -50%);
        opacity: 1;
        pointer-events: auto;
    }
}

.add-item-modal-header {
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
}
.add-item-modal-header h3 { font-size: 1rem; font-weight: 700; }

.add-item-modal-body {
    flex: 1; min-height: 0;
    overflow-y: auto;
    padding: var(--space-4);
}

.add-item-modal-footer {
    flex-shrink: 0;
    display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3);
    padding: var(--space-4);
    padding-bottom: calc(var(--space-4) + var(--safe-bottom));
    border-top: 1px solid var(--border);
}

.add-item-product-name { font-size: .9375rem; font-weight: 700; margin-bottom: 2px; }
.add-item-product-meta { font-size: .75rem; color: var(--text-muted); margin-bottom: var(--space-4); }
.add-item-field { margin-bottom: var(--space-4); }
.add-item-field label {
    display: block; font-size: .6875rem; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: .04em; margin-bottom: 6px;
}
.add-item-field select,
.add-item-field input {
    width: 100%; padding: 12px 14px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg); color: var(--text);
    font-size: .9375rem;
}
.add-item-lot-hint { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }
.add-item-lot-empty {
    padding: 12px 14px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: .875rem;
}
.add-item-lot-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.add-item-lot-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--lot-color, var(--text));
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.add-item-lot-option-swatch {
    width: 10px;
    height: 10px;
    margin-top: 5px;
    border-radius: 999px;
    background: var(--lot-color, #111827);
    flex-shrink: 0;
}
.add-item-lot-option-text {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
    color: inherit;
}
.add-item-lot-option.lot-expiry-near { color: #DC2626; --lot-color: #DC2626; }
.add-item-lot-option.lot-expiry-medium { color: #EA580C; --lot-color: #EA580C; }
.add-item-lot-option.lot-expiry-normal { color: var(--text); --lot-color: #6b7280; }
.add-item-lot-option.selected {
    border-color: var(--lot-color, var(--primary));
    background: var(--bg-subtle);
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
    position: relative;
}
.add-item-lot-option-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}
.add-item-lot-option-badge {
    display: none;
    align-self: flex-start;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--lot-color, var(--primary));
    color: #fff;
    line-height: 1.4;
}
.add-item-lot-option.selected .add-item-lot-option-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.add-item-lot-option.selected .add-item-lot-option-badge::before {
    content: '✓';
    font-size: .7rem;
}
.add-item-lot-option.lot-expiry-near.selected {
    background: rgba(220, 38, 38, 0.08);
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.22);
}
.add-item-lot-option.lot-expiry-medium.selected {
    background: rgba(234, 88, 12, 0.08);
    box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.22);
}
.add-item-lot-option.lot-expiry-normal.selected {
    background: rgba(107, 114, 128, 0.08);
    box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.2);
}
.add-item-lot-option:active {
    transform: scale(0.99);
}
#add-item-lot option.lot-expiry-near { color: #DC2626; font-weight: 600; }
#add-item-lot option.lot-expiry-medium { color: #EA580C; font-weight: 600; }
#add-item-lot option.lot-expiry-normal { color: #000000; }
#add-item-lot.lot-expiry-near-selected { color: #DC2626; border-color: rgba(220,38,38,.45); font-weight: 600; }
#add-item-lot.lot-expiry-medium-selected { color: #EA580C; border-color: rgba(234,88,12,.45); font-weight: 600; }
#add-item-lot.lot-expiry-normal-selected { color: #000000; }

.lot-expiry-legend { display: flex; flex-wrap: wrap; gap: 0.35rem 0.85rem; font-size: 0.68rem; margin: 0.25rem 0 0.5rem; color: var(--text-muted); }
.lot-expiry-legend span::before { content: '● '; }
.lot-expiry-legend .lot-expiry-near { color: #DC2626; font-weight: 600; }
.lot-expiry-legend .lot-expiry-medium { color: #EA580C; font-weight: 600; }
.lot-expiry-legend .lot-expiry-normal { color: #000000; }

.cart-item-lot .lot-expiry-near,
.order-item-mobile-lot .lot-expiry-near,
.oit-lot .lot-expiry-near { color: #DC2626; font-weight: 600; }
.cart-item-lot .lot-expiry-medium,
.order-item-mobile-lot .lot-expiry-medium,
.oit-lot .lot-expiry-medium { color: #EA580C; font-weight: 600; }
.cart-item-lot .lot-expiry-normal,
.order-item-mobile-lot .lot-expiry-normal,
.oit-lot .lot-expiry-normal { color: var(--text-primary); }
.price-basis-tag {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: .625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--primary);
    background: rgba(238, 192, 88, 0.12);
    vertical-align: middle;
}
.add-item-price-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--space-3); background: var(--bg-subtle);
    border-radius: var(--radius); margin-top: var(--space-2);
    font-size: .875rem;
}
.add-item-price-row strong { color: var(--primary); font-size: 1rem; }

.product-row-order .btn-add-product {
    padding: 8px 16px; font-size: .8125rem; border-radius: 10px;
    white-space: nowrap;
}

/* Payment vouchers */
.payments-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.payments-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.payments-toolbar-title {
    flex: 1;
    min-width: 0;
}
.payments-toolbar h3 {
    font-size: .9375rem;
    font-weight: 700;
    margin: 0;
}
.payments-total-count {
    margin: 4px 0 0;
    font-size: .75rem;
    color: var(--text-muted);
    font-weight: 500;
}
.payments-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 20px;
}
@media (max-width: 480px) {
    .payments-kpi-grid .kpi-value {
        font-size: 1rem;
    }
    .payments-kpi-grid .kpi-label {
        font-size: .625rem;
    }
}
.btn-new-voucher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: .8125rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(13, 148, 136, .28);
    transition: transform var(--transition), box-shadow var(--transition);
}
.btn-new-voucher:active { transform: scale(.98); }

.btn-download-today-vouchers {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    color: var(--text);
    font-size: .75rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity var(--transition), transform var(--transition);
}
.btn-download-today-vouchers:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.btn-download-today-vouchers:not(:disabled):active {
    transform: scale(.98);
}

@media (max-width: 480px) {
    .payments-toolbar {
        flex-wrap: wrap;
    }
    .payments-toolbar-actions {
        width: 100%;
        justify-content: stretch;
    }
    .payments-toolbar-actions .btn-download-today-vouchers,
    .payments-toolbar-actions .btn-new-voucher {
        flex: 1 1 0;
        justify-content: center;
    }
}

.payment-filter-bar {
    margin-bottom: var(--space-4);
}
.payment-filter-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--primary-subtle);
    border: 1px solid rgba(13, 148, 136, .25);
    border-radius: var(--radius-md);
}
.payment-filter-selected-label {
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.payment-filter-selected-name {
    font-size: .875rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.payment-filter-results {
    margin-top: var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-elevated);
}

.voucher-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.voucher-card {
    position: relative;
    display: flex;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
    transition: box-shadow var(--transition), border-color var(--transition);
}
[data-theme="dark"] .voucher-card {
    box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}
.voucher-card:active {
    transform: scale(.995);
}
.voucher-card-accent {
    width: 5px;
    flex-shrink: 0;
    background: var(--primary);
}
.voucher-card-accent.pending { background: var(--warning); }
.voucher-card-accent.approved { background: var(--success); }
.voucher-card-accent.rejected { background: var(--danger); }

.voucher-card-body {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
}
.voucher-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: 8px;
}
.voucher-card-no {
    font-size: .8125rem;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: var(--primary);
    letter-spacing: -.01em;
}
.voucher-card-account {
    font-size: .9375rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.3;
}
.voucher-card-meta {
    font-size: .75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.voucher-card-desc {
    font-size: .8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.voucher-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}
.voucher-card-amount {
    font-size: 1.125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    letter-spacing: -.02em;
}
.btn-voucher-pdf {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-voucher-pdf:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-subtle);
}

.voucher-loading {
    text-align: center;
    padding: var(--space-4);
    font-size: .8125rem;
    color: var(--text-muted);
}

.payment-sheet-modal .add-item-modal-body {
    padding-bottom: calc(var(--space-4) + var(--safe-bottom));
}

/* Customers list */
.customers-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}
.customers-toolbar-title {
    flex: 1;
    min-width: 0;
}
.customers-toolbar h3 {
    font-size: .9375rem;
    font-weight: 700;
    margin: 0;
}
.customers-total-count {
    margin: 4px 0 0;
    font-size: .75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.customer-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.customer-list-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: 14px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
[data-theme="dark"] .customer-list-card {
    box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}
.customer-list-card:active {
    transform: scale(.995);
}
.customer-list-card:hover {
    border-color: rgba(13, 148, 136, .35);
    box-shadow: 0 4px 14px rgba(13, 148, 136, .1);
}

.clc-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #0f766e);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: .875rem;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: -.02em;
}

.clc-body {
    flex: 1;
    min-width: 0;
}

.clc-name {
    font-size: .9375rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.clc-meta {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.clc-phone {
    font-size: .75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.clc-side {
    flex-shrink: 0;
    text-align: right;
    min-width: 72px;
}

.clc-balance {
    font-size: .875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--success);
}

.clc-balance.due {
    color: var(--danger);
}

.clc-last-order {
    font-size: .6875rem;
    color: var(--text-muted);
    margin-top: 3px;
    white-space: nowrap;
}

.clc-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
    opacity: .5;
    display: grid;
    place-items: center;
}

.clc-chevron svg {
    width: 18px;
    height: 18px;
}

/* Orders list */
.orders-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: var(--space-4);
}
@media (max-width: 480px) {
    .orders-kpi-grid .kpi-value { font-size: 1rem; }
    .orders-kpi-grid .kpi-label { font-size: .625rem; }
}

.orders-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}
.orders-toolbar-title {
    flex: 1;
    min-width: 0;
}
.orders-toolbar h3 {
    font-size: .9375rem;
    font-weight: 700;
    margin: 0;
}
.orders-total-count {
    margin: 4px 0 0;
    font-size: .75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
    border-radius: 999px;
    font-size: .625rem;
    font-weight: 700;
    background: rgba(255, 255, 255, .22);
}
.chip:not(.active) .chip-count {
    background: var(--bg-subtle);
    color: var(--text-secondary);
}

.order-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.order-card {
    position: relative;
    display: flex;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
    transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
[data-theme="dark"] .order-card {
    box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}
.order-card.clickable {
    cursor: pointer;
}
.order-card.clickable:hover {
    border-color: rgba(13, 148, 136, .35);
    box-shadow: 0 4px 14px rgba(13, 148, 136, .1);
}
.order-card.clickable:active {
    transform: scale(.995);
}
.order-card.compact .order-card-preview {
    display: none;
}
.order-card.compact .order-card-footer {
    padding-top: 6px;
    border-top: none;
}
.order-card.compact .order-card-amount {
    font-size: .9375rem;
}

.order-card-accent {
    width: 5px;
    flex-shrink: 0;
    background: var(--primary);
}
.order-card-accent.pending { background: var(--warning); }
.order-card-accent.processing { background: var(--info); }
.order-card-accent.delivered { background: var(--success); }
.order-card-accent.cancelled { background: var(--danger); }
.order-card-accent.default { background: var(--text-muted); }

.order-card-body {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
}
.order-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: 6px;
}
.order-card-no {
    font-size: .8125rem;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: var(--primary);
    letter-spacing: -.01em;
}
.order-card-customer {
    font-size: .9375rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 4px;
}
.order-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: .75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.order-card-preview {
    font-size: .75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.order-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}
.order-card-amount {
    font-size: 1.125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    letter-spacing: -.02em;
}
.order-card-chevron {
    flex-shrink: 0;
    align-self: center;
    padding-right: 12px;
    color: var(--text-muted);
    opacity: .45;
}
.order-card-chevron svg {
    width: 18px;
    height: 18px;
}

/* Order detail */
.order-detail-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.order-detail-back {
    margin-bottom: 0;
}
.order-detail-hero {
    background: linear-gradient(135deg, var(--primary-subtle), var(--bg-elevated));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-4);
}
.order-detail-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.order-detail-number {
    font-size: 1.125rem;
    font-weight: 800;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: var(--primary);
    margin-bottom: 4px;
}
.order-detail-customer {
    font-size: .875rem;
    color: var(--text-secondary);
}
.order-detail-total-label {
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.order-detail-total {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.03em;
}

.order-items-table-card {
    overflow: hidden;
    margin-bottom: var(--space-5);
}
.order-items-mobile {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3);
}
@media (min-width: 768px) {
    .order-items-mobile { display: none; }
}
.order-items-table {
    display: none;
}
@media (min-width: 768px) {
    .order-items-table { display: table; }
}
.order-item-mobile-card {
    padding: var(--space-3);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.order-item-mobile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: 4px;
}
.order-item-mobile-name {
    font-size: .875rem;
    font-weight: 600;
    color: var(--text);
}
.order-item-mobile-packing {
    font-size: .75rem;
    color: var(--primary);
    font-weight: 600;
}
.order-item-mobile-lot {
    font-size: .6875rem;
    color: var(--text-muted);
}
.order-item-mobile-meta {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: 8px;
    font-size: .75rem;
    color: var(--text-muted);
}
.oit-product {
    font-weight: 600;
    color: var(--text);
}
.oit-packing {
    font-size: .75rem;
    color: var(--primary);
    font-weight: 600;
    margin-top: 2px;
}
.oit-lot {
    font-size: .6875rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.order-items-total-row td {
    font-weight: 700;
    background: var(--bg-subtle);
    border-top: 1px solid var(--border);
}
.order-items-total-row td:last-child {
    color: var(--primary);
    font-size: 1rem;
}

/* Customer detail */
.customer-detail-back {
    margin-bottom: var(--space-4);
}

.customer-detail-hero {
    background: linear-gradient(135deg, var(--primary-subtle), var(--bg-elevated));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-4);
}

.customer-detail-hero-top {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.customer-detail-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), #0f766e);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: -.02em;
}

.customer-detail-identity {
    flex: 1;
    min-width: 0;
}

.customer-detail-name {
    font-size: 1.125rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text);
}

.customer-detail-meta {
    font-size: .8125rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.customer-detail-balance-label {
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.customer-detail-balance {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--success);
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.customer-detail-balance.due {
    color: var(--danger);
}

.customer-detail-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.customer-detail-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 76px;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

[data-theme="dark"] .customer-detail-action {
    box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}

.customer-detail-action:active {
    transform: scale(.99);
}

.customer-detail-action:hover {
    border-color: rgba(13, 148, 136, .35);
    box-shadow: 0 4px 14px rgba(13, 148, 136, .1);
}

.customer-detail-action.primary {
    background: linear-gradient(135deg, rgba(13, 148, 136, .12), rgba(13, 148, 136, .04));
    border-color: rgba(13, 148, 136, .28);
    color: var(--primary);
}

.customer-detail-action-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.customer-detail-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.customer-detail-stat {
    padding: var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}

[data-theme="dark"] .customer-detail-stat {
    box-shadow: 0 2px 12px rgba(0, 0, 0, .2);
}

.customer-detail-stat-label {
    display: block;
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
}

.customer-detail-stat-value {
    display: block;
    margin-top: 4px;
    font-size: .9375rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.customer-detail-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}

[data-theme="dark"] .customer-detail-card {
    box-shadow: 0 2px 12px rgba(0, 0, 0, .2);
}

.customer-detail-card .section-header {
    margin-bottom: var(--space-2);
}

.customer-detail-contact-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
}

.customer-detail-contact-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.customer-detail-contact-row:first-child {
    padding-top: 0;
}

.customer-detail-contact-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-subtle);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: .9375rem;
}

.customer-detail-contact-label {
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
}

.customer-detail-contact-value {
    font-size: .875rem;
    font-weight: 500;
    margin-top: 2px;
    color: var(--text);
    word-break: break-word;
}

.customer-detail-contact-link {
    color: var(--primary);
    text-decoration: none;
}

.customer-detail-contact-link:hover {
    text-decoration: underline;
}

#screen-customer-detail .section-header {
    margin-bottom: var(--space-3);
}

#screen-customer-detail .order-list {
    margin-bottom: var(--space-5);
}

.profile-back-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    padding: 8px 0;
    border: none;
    background: none;
    color: var(--primary);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
}

.profile-2fa-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.profile-2fa-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.profile-2fa-desc {
    font-size: .8125rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

.profile-2fa-status {
    display: inline-flex;
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: var(--space-4);
}

.profile-2fa-status.on {
    background: var(--success-subtle);
    color: var(--success);
}

.profile-2fa-status.off {
    background: var(--bg-subtle);
    color: var(--text-muted);
}

.profile-2fa-setup {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.profile-2fa-qr {
    width: 192px;
    height: 192px;
    align-self: center;
    background: #fff;
    border-radius: var(--radius);
    padding: var(--space-2);
}

.profile-2fa-secret-label {
    font-size: .6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.profile-2fa-secret {
    font-family: ui-monospace, monospace;
    font-size: .8125rem;
    word-break: break-all;
}

.profile-2fa-recovery {
    padding: var(--space-4);
    border-radius: var(--radius);
    background: var(--warning-subtle);
    margin-bottom: var(--space-4);
}

.profile-2fa-recovery p {
    font-size: .8125rem;
    color: var(--text-secondary);
    margin-top: var(--space-1);
}

.profile-2fa-recovery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
    margin-top: var(--space-3);
    font-family: ui-monospace, monospace;
    font-size: .75rem;
}

.profile-2fa-recovery-grid span {
    padding: 8px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.profile-2fa-form {
    margin-top: var(--space-2);
}

.booker-pdf-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}
.booker-pdf-overlay[hidden] { display: none !important; }
.booker-pdf-overlay__card {
    min-width: 220px;
    max-width: 90vw;
    padding: 20px 24px;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.booker-pdf-overlay__spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto 12px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: booker-spin .8s linear infinite;
}
@keyframes booker-spin { to { transform: rotate(360deg); } }

.daily-summary-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding-bottom: var(--space-6);
}
.daily-summary-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, var(--bg-elevated)), var(--bg-elevated));
    border-color: color-mix(in srgb, var(--primary) 22%, var(--border));
}
.daily-summary-hero-main { min-width: 0; flex: 1; }
.daily-summary-hero-badge {
    display: inline-block;
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--primary-subtle);
    padding: 4px 8px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.daily-summary-hero-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
}
.daily-summary-hero-meta {
    margin: 6px 0 0;
    font-size: .75rem;
    color: var(--text-muted);
}
.daily-summary-hero-pdf {
    flex-shrink: 0;
    min-height: 40px;
}
.btn-icon-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.daily-summary-toolbar {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-bottom: 0;
}
.daily-summary-toolbar-section { display: flex; flex-direction: column; gap: var(--space-2); }
.daily-summary-toolbar-label {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.daily-summary-presets { margin-bottom: 0; padding-bottom: 0; }
.daily-summary-date-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: var(--space-2);
    align-items: end;
}
.daily-summary-refresh-btn {
    height: 42px;
    padding-inline: 12px;
    white-space: nowrap;
}
.daily-summary-close-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    border-color: color-mix(in srgb, var(--warning) 35%, var(--border));
    background: color-mix(in srgb, var(--warning) 8%, var(--bg-elevated));
}
.daily-summary-close-card--locked {
    border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
    background: color-mix(in srgb, var(--danger) 8%, var(--bg-elevated));
}
.daily-summary-close-card h3 {
    margin: 0 0 4px;
    font-size: .9375rem;
    font-weight: 700;
}
.daily-summary-close-card p {
    margin: 0;
    font-size: .8125rem;
    color: var(--text-secondary);
    line-height: 1.45;
}
.daily-summary-close-icon { font-size: 1.5rem; flex-shrink: 0; }
.daily-summary-close-copy { min-width: 0; flex: 1; }
.daily-summary-close-btn {
    flex-shrink: 0;
    background: var(--warning);
    border-color: var(--warning);
    color: #fff;
}
.daily-summary-close-btn:hover { filter: brightness(.95); }
.daily-summary-kpis { margin-bottom: 0; }
.daily-summary-stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
}
@media (min-width: 768px) {
    .daily-summary-stats-grid { grid-template-columns: 1fr 1fr; }
}
.daily-summary-collections-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
}
@media (min-width: 900px) {
    .daily-summary-collections-grid { grid-template-columns: 1fr 1fr; }
}
.daily-summary-collection-card .section-header { margin-bottom: var(--space-3); align-items: flex-start; }
.daily-summary-collection-note {
    margin: 4px 0 0;
    font-size: .75rem;
    line-height: 1.4;
}
.daily-summary-collection-list {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.daily-summary-collection-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3);
    border-top: 1px solid var(--border-subtle);
}
.daily-summary-collection-item:first-child { border-top: none; }
.daily-summary-collection-main { min-width: 0; flex: 1; }
.daily-summary-collection-title {
    font-weight: 600;
    font-size: .875rem;
    line-height: 1.3;
}
.daily-summary-collection-meta {
    margin-top: 2px;
    font-size: .75rem;
    color: var(--text-muted);
}
.daily-summary-collection-amount {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-weight: 700;
    font-size: .875rem;
    white-space: nowrap;
}
.daily-summary-collection-amount.received { color: var(--functional-teal, #0f766e); }
.daily-summary-collection-amount.pending { color: var(--danger); }
.daily-summary-stat-card .section-header { margin-bottom: var(--space-3); }
.daily-summary-stat-head h3 { font-size: .875rem; }
.daily-summary-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
    padding: 4px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.daily-summary-tab {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: .8125rem;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.daily-summary-tab.active {
    background: var(--bg-elevated);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}
.daily-summary-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--bg-subtle);
    font-size: .6875rem;
    font-weight: 700;
}
.daily-summary-tab.active .daily-summary-tab-count {
    background: var(--primary-subtle);
    color: var(--primary);
}
.daily-summary-panel[hidden] { display: none !important; }
.daily-summary-list { overflow: hidden; padding: 0; }
.daily-summary-list-item {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: inherit;
    font: inherit;
    transition: background var(--transition);
}
.daily-summary-list-item:last-child { border-bottom: 0; }
.daily-summary-list-item:not(.daily-summary-list-item-static):hover,
.daily-summary-list-item:not(.daily-summary-list-item-static):focus-visible {
    background: var(--bg-subtle);
    outline: none;
}
.daily-summary-list-item-static { cursor: default; }
.daily-summary-list-main { min-width: 0; flex: 1; }
.daily-summary-list-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}
.daily-summary-list-title {
    font-size: .875rem;
    font-weight: 700;
    color: var(--text);
}
.daily-summary-list-sub {
    font-size: .8125rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
.daily-summary-list-meta {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.daily-summary-list-amount {
    font-size: .9375rem;
    font-weight: 700;
    font-family: ui-monospace, monospace;
}
.daily-summary-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: var(--space-6) var(--space-4);
    text-align: center;
    color: var(--text-muted);
}
.daily-summary-empty-icon { font-size: 1.75rem; opacity: .85; }
.daily-summary-empty p { margin: 0; font-size: .875rem; }
.daily-status-count {
    font-size: .875rem;
    font-weight: 700;
    font-family: ui-monospace, monospace;
}
.daily-voucher-status-meta { color: var(--text-secondary); font-size: .8125rem; }
.daily-voucher-status-amount {
    font-family: ui-monospace, monospace;
    font-size: .875rem;
}
.daily-summary-date-field { flex: 1 1 180px; margin: 0; }
.daily-summary-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    align-items: center;
}
@media (max-width: 640px) {
    .daily-summary-hero { flex-direction: column; }
    .daily-summary-hero-pdf { width: 100%; justify-content: center; }
    .daily-summary-date-row { grid-template-columns: 1fr 1fr; }
    .daily-summary-refresh-btn { grid-column: 1 / -1; width: 100%; }
    .daily-summary-close-card { flex-direction: column; align-items: stretch; }
    .daily-summary-close-btn { width: 100%; }
}
.close-day-btn {
    border-color: color-mix(in srgb, var(--warning) 45%, var(--border));
    color: var(--warning);
}
.close-day-btn:not(:disabled):hover {
    border-color: var(--warning);
    background: color-mix(in srgb, var(--warning) 12%, transparent);
}
.close-day-btn.is-disabled,
.close-day-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
}
.close-day-modal .close-day-city-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.close-day-city-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.close-day-city-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
    cursor: pointer;
}
.close-day-city-option input {
    width: 18px;
    height: 18px;
    accent-color: var(--warning);
}
.daily-summary-closed-cities-note {
    grid-column: 1 / -1;
    margin: 0 0 4px;
    font-size: .85rem;
}
.daily-status-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.daily-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
    min-width: calc(50% - var(--space-1));
    flex: 1 1 calc(50% - var(--space-1));
}
.daily-voucher-status-list {
    display: grid;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-subtle);
}
.daily-voucher-status-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}
.daily-voucher-status-row:last-child { border-bottom: 0; }
.daily-empty-inline {
    margin: 0;
    color: var(--text-muted);
    font-size: .875rem;
}
.daily-summary-promo .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}
.text-muted { color: var(--text-muted); font-size: .8125rem; }

/* ── Account ledgers ── */
.ledger-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding-bottom: var(--space-4);
}
.ledger-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, var(--bg-elevated)), var(--bg-elevated));
    border-color: color-mix(in srgb, var(--primary) 22%, var(--border));
}
.ledger-hero--list { align-items: center; }
.ledger-hero-main { min-width: 0; flex: 1; }
.ledger-hero-badge {
    display: inline-block;
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--primary-subtle);
    padding: 4px 8px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.ledger-hero-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
}
.ledger-hero-meta {
    margin: 6px 0 0;
    font-size: .8125rem;
    color: var(--text-muted);
    line-height: 1.45;
}
.ledger-hero-balance {
    flex-shrink: 0;
    text-align: right;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    min-width: 120px;
}
.ledger-hero-balance span {
    display: block;
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.ledger-hero-balance strong {
    display: block;
    margin-top: 4px;
    font-size: 1.125rem;
    font-family: ui-monospace, monospace;
    color: var(--primary);
}
.ledger-hero-balance.due strong,
.ledger-balance-pill.due,
.ledger-balance.due { color: var(--danger); }
.ledger-back-btn {
    align-self: flex-start;
    margin-bottom: 0;
}
.ledger-search-label {
    display: block;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.ledger-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.ledger-search-icon {
    position: absolute;
    left: 12px;
    font-size: .875rem;
    opacity: .55;
    pointer-events: none;
}
.ledger-search-input {
    width: 100%;
    padding-left: 38px;
}
.ledger-accounts-list {
    overflow: hidden;
    padding: 0;
}
.ledger-accounts-list.is-loading { opacity: .65; pointer-events: none; }
.ledger-account-item {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: inherit;
    font: inherit;
    transition: background var(--transition);
}
.ledger-account-item:last-child { border-bottom: 0; }
.ledger-account-item:hover,
.ledger-account-item:focus-visible {
    background: var(--bg-subtle);
    outline: none;
}
.ledger-account-item-main { min-width: 0; flex: 1; }
.ledger-account-item-title {
    font-size: .9375rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.ledger-account-item-meta {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.ledger-account-item-side {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.ledger-balance-pill {
    font-size: .875rem;
    font-weight: 700;
    font-family: ui-monospace, monospace;
    color: var(--primary);
    white-space: nowrap;
}
.ledger-account-chevron {
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text-muted);
}
.ledger-toolbar {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: 0;
}
.ledger-toolbar-section { display: flex; flex-direction: column; gap: var(--space-2); }
.ledger-toolbar-label {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.ledger-presets { margin-bottom: 0; padding-bottom: 0; }
.ledger-date-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: var(--space-2);
    align-items: end;
}
.ledger-date-field { margin: 0; min-width: 0; }
.ledger-refresh-btn {
    height: 42px;
    min-width: 42px;
    padding-inline: 12px;
}
.ledger-period-note {
    margin: 0;
    font-size: .75rem;
    color: var(--text-muted);
}
.ledger-period-note strong { color: var(--text-secondary); font-weight: 600; }
.ledger-kpis { margin-bottom: 0; }
.ledger-kpis.is-loading,
.ledger-entries-card.is-loading { opacity: .55; pointer-events: none; }
.ledger-entries-card { padding: var(--space-4); overflow: hidden; }
.ledger-entries-head { margin-bottom: var(--space-3); }
.ledger-entries-head h3 { margin: 0; font-size: .9375rem; }
.ledger-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ledger-desktop-table { display: none; }
.ledger-mobile-entries { display: flex; flex-direction: column; gap: var(--space-2); }
@media (min-width: 768px) {
    .ledger-desktop-table { display: block; }
    .ledger-mobile-entries { display: none; }
}
.ledger-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: .8125rem;
}
.ledger-table th,
.ledger-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.ledger-table th {
    font-size: .6875rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    background: var(--bg-subtle);
    position: sticky;
    top: 0;
    z-index: 1;
}
.ledger-table .num { text-align: right; white-space: nowrap; }
.ledger-table tbody tr:hover td { background: var(--primary-subtle); }
.ledger-opening-row td {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
    font-weight: 600;
}
.ledger-dr { color: var(--text); font-family: ui-monospace, monospace; }
.ledger-cr { color: var(--success); font-family: ui-monospace, monospace; }
.ledger-balance { color: var(--primary); font-weight: 700; font-family: ui-monospace, monospace; }
.ledger-date { white-space: nowrap; font-size: .75rem; color: var(--text-muted); }
.ledger-desc { min-width: 140px; line-height: 1.35; }
.ledger-row-clickable {
    cursor: pointer;
    transition: background .15s ease;
}
.ledger-row-clickable:hover,
.ledger-row-clickable:focus-within {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}
.ledger-sale-hint {
    display: inline-block;
    margin-left: 8px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}
.ledger-entry-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-3);
    background: var(--bg-subtle);
}
.ledger-entry-card--clickable {
    cursor: pointer;
}
.ledger-entry-card--clickable:hover,
.ledger-entry-card--clickable:focus {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 15%, transparent);
}
.ledger-entry-card--opening {
    background: color-mix(in srgb, var(--primary) 8%, var(--bg-subtle));
    border-color: color-mix(in srgb, var(--primary) 20%, var(--border));
}
.ledger-entry-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: 6px;
}
.ledger-entry-card-desc {
    margin: 0;
    font-size: .875rem;
    line-height: 1.4;
    color: var(--text);
}
.ledger-entry-card-amounts {
    display: flex;
    gap: var(--space-4);
    margin-top: 8px;
    font-size: .8125rem;
    font-family: ui-monospace, monospace;
}
.ledger-entry-card-amounts em {
    font-style: normal;
    font-size: .625rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-right: 4px;
}
.ledger-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 24px 12px !important;
}
.ledger-empty--card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: var(--space-6) var(--space-4) !important;
}
.ledger-empty-icon { font-size: 1.75rem; opacity: .85; }
.ledger-empty p { margin: 0; font-size: .875rem; }
@media (max-width: 640px) {
    .ledger-hero { flex-direction: column; }
    .ledger-hero-balance { width: 100%; text-align: left; }
    .ledger-date-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
    .customer-detail-actions { grid-template-columns: 1fr; }
}

.town-bill-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}
.town-bill-city-field { flex: 1 1 280px; margin: 0; }
.town-bill-city-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}
.town-bill-city-toolbar .btn.active {
    background: var(--primary-container);
    color: var(--on-primary-container);
}
.town-bill-city-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-2);
    max-height: 220px;
    overflow-y: auto;
    padding: var(--space-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface-container-low);
}
.town-bill-city-option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    cursor: pointer;
}
.town-bill-city-option input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
}
.town-bill-city-hint,
.town-bill-city-empty {
    margin: var(--space-2) 0 0;
    font-size: 0.8125rem;
    line-height: 1.4;
}
.town-bill-actions { display: flex; gap: var(--space-2); }
.town-bill-intro p { margin: 0; line-height: 1.5; }
.town-bill-results-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin: var(--space-4) 0 var(--space-3);
}
.town-bill-results-head h3 { margin: 0; font-size: 1rem; }
.town-bill-city { margin-bottom: var(--space-3); overflow: hidden; }
.town-bill-city-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: 14px 16px;
    background: var(--primary-subtle);
    border-bottom: 1px solid var(--border);
}
.town-bill-city-head h3 {
    margin: 0;
    font-size: .95rem;
    color: var(--primary);
}
.town-bill-city-meta {
    font-size: .8125rem;
    color: var(--text-muted);
    font-family: ui-monospace, monospace;
}
.town-bill-table .town-bill-account-name { font-weight: 600; }
.town-bill-table .town-bill-account-code {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.town-bill-table .town-bill-meta {
    font-size: .8125rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.town-bill-table .ledger-balance.due { color: var(--danger); }
.town-bill-total-red { color: var(--danger); font-weight: 700; }
.town-bill-city-total td {
    background: rgba(13, 148, 136, 0.08);
    font-weight: 700;
}
.town-bill-city-total td:last-child,
.town-bill-table td.num { text-align: right; }
.town-bill-grand-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-2);
    font-size: .9375rem;
}
.town-bill-grand-total strong {
    font-family: ui-monospace, monospace;
    font-size: 1.05rem;
}

/* ── Reports UI Enhancements ── */
.reports-hero {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, var(--bg-elevated)), color-mix(in srgb, var(--primary) 5%, var(--bg-subtle)));
    border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-4);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 8%, transparent);
}
.reports-hero-kpi {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
}
.reports-hero-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.reports-hero-value {
    font-size: 2rem;
    font-family: ui-monospace, monospace;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}
.reports-hero-bg {
    position: absolute;
    right: -20px;
    bottom: -30px;
    font-size: 8rem;
    opacity: 0.03;
    pointer-events: none;
}
.reports-action-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
@media (min-width: 600px) {
    .reports-action-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.reports-action-tile {
    display: flex;
    align-items: center;
    text-align: left;
    padding: 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: pointer;
    gap: 16px;
    color: inherit;
    font: inherit;
}
.reports-action-tile:hover, .reports-action-tile:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
    outline: none;
}
.reports-action-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.reports-action-content {
    flex: 1;
    min-width: 0;
}
.reports-action-content h4 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}
.reports-action-content p {
    margin: 0;
    font-size: .75rem;
    color: var(--text-muted);
}
.reports-action-chevron {
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: transform var(--transition);
}
.reports-action-tile:hover .reports-action-chevron {
    transform: translateX(4px);
    color: var(--primary);
}
.reports-chart-card {
    padding: var(--space-4);
    margin-bottom: var(--space-4);
}
.reports-chart-header h3 {
    margin: 0 0 16px;
    font-size: 1.125rem;
}
.reports-top-product {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 16px;
    background: linear-gradient(to right, var(--accent-subtle), var(--bg-elevated));
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.reports-top-product-icon {
    font-size: 2rem;
    flex-shrink: 0;
}
.reports-top-product-info {
    flex: 1;
    min-width: 0;
}
.reports-top-product-label {
    display: block;
    font-size: .75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
    letter-spacing: .05em;
}
.reports-top-product-name {
    display: block;
    font-size: 1.125rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.reports-top-product-qty {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    text-align: right;
}
.reports-top-product-qty small {
    display: block;
    font-size: .75rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* ── Ledger UI Enhancements ── */
.ledger-hero {
    position: relative;
    overflow: hidden;
    padding: 24px;
    border: none;
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 80%, #000));
    color: #fff;
    box-shadow: 0 12px 32px color-mix(in srgb, var(--primary) 30%, transparent);
    display: block; /* Overriding previous flex */
}
.ledger-hero-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    z-index: 2;
}
.ledger-hero-main, .ledger-hero-balance {
    color: #fff;
}
.ledger-hero-title {
    color: #fff;
    font-size: 1.25rem;
    margin-bottom: 4px;
}
.ledger-hero-meta {
    color: rgba(255, 255, 255, 0.7);
}
.ledger-hero-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.ledger-hero-balance {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.ledger-hero-balance span {
    color: rgba(255, 255, 255, 0.8);
}
.ledger-hero-balance strong {
    color: #fff;
    font-size: 1.5rem;
}
.ledger-hero-balance.due strong {
    color: #fca5a5; /* lighter red for dark bg */
}
.ledger-hero-sparkline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    opacity: 0.8;
    z-index: 1;
    pointer-events: none;
}
.ledger-account-item {
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.ledger-account-item:hover, .ledger-account-item:focus-visible {
    background: var(--bg-elevated);
    box-shadow: var(--shadow);
    transform: scale(1.01);
    z-index: 1;
    position: relative;
    border-radius: var(--radius);
    border-bottom-color: transparent;
}
.ledger-entry-card {
    transition: transform var(--transition), box-shadow var(--transition);
}
.ledger-entry-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ── Notifications UI Enhancements ── */
.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    margin: -16px -16px 0;
    position: sticky;
    top: 0;
    z-index: 10;
}
.notification-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.notification-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.notification-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-subtle);
    border-radius: 50%;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.notification-content {
    flex: 1;
    min-width: 0;
}
.notification-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}
.notification-title {
    margin: 0;
    font-size: .9375rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.notification-time {
    font-size: .75rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.notification-body {
    margin: 0;
    font-size: .875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ── Profile UI Enhancements ── */
.profile-hero {
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 80%, #000));
    box-shadow: 0 12px 32px color-mix(in srgb, var(--primary) 30%, transparent);
    padding: 32px 24px;
    border: none;
}
.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.05));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.profile-stat {
    transition: transform var(--transition), box-shadow var(--transition);
}
.profile-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.profile-quick-action {
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), color var(--transition);
}
.profile-quick-action:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px color-mix(in srgb, var(--primary) 15%, transparent);
    color: var(--primary);
}
.profile-menu-item {
    transition: background var(--transition), padding-left var(--transition);
}
.profile-menu-item:hover {
    background: var(--bg-subtle);
    padding-left: 20px;
}
.profile-menu-item.danger:hover {
    background: var(--danger-subtle);
}
.profile-hero-progress-fill {
    background: linear-gradient(90deg, #fff, rgba(255,255,255,0.7));
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}
