/* ===== PosShop base theme (Bootstrap 5.3 + soft green) ===== */
:root {
    --brand: #1f8a5b;
    --brand-600: #18774d;
    --brand-50: #e8f5ee;
    --surface: #ffffff;
    --surface-2: #f4f6f5;
    --line: #e7ebe9;
    --ink: #1d2a24;
    --ink-soft: #6b7a73;
    --radius: 18px;
    --sidebar-w: 256px;
    --shadow: 0 6px 24px rgba(20, 50, 35, .07);
    --bs-primary: var(--brand);
    --bs-primary-rgb: 31, 138, 91;
    --bs-link-color: var(--brand);
    --bs-link-hover-color: var(--brand-600);
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
[data-bs-theme="dark"] {
    --surface: #18201c;
    --surface-2: #0f1512;
    --line: #26322c;
    --ink: #e4ece7;
    --ink-soft: #93a39b;
    --brand-50: #153526;
    --shadow: 0 6px 24px rgba(0, 0, 0, .35);
    --bs-body-bg: #0f1512;
}

body { background: var(--surface-2); color: var(--ink); min-height: 100vh; }

.btn-primary {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600);
    --bs-btn-active-bg: var(--brand-600); --bs-btn-active-border-color: var(--brand-600);
    --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand);
}
.text-brand { color: var(--brand) !important; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(31, 138, 91, .15); }

/* ---- Sidebar ---- */
.app-sidebar {
    position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 1040; width: var(--sidebar-w);
    display: flex; flex-direction: column;
    /* Change these four values to recolour the whole sidebar. */
    --side-bg: #0f3d2a;
    --side-ink: #c9dfd4;
    --side-hover: rgba(255, 255, 255, .1);
    --side-active: #18774d;
    background: var(--side-bg); border-inline-end: 1px solid rgba(255, 255, 255, .08);
    transition: transform .2s ease, visibility .2s;
}
[data-bs-theme="dark"] .app-sidebar { --side-bg: #0b2a1d; }
.sidebar-brand { display: flex; align-items: center; flex: none; min-height: 69px; padding: .6rem 1rem; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.app-sidebar .brand, .app-sidebar .brand-text small { color: #fff; }
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: .2rem; padding: .75rem; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
.side-link {
    display: flex; align-items: center; gap: .7rem; flex: none; width: 100%; padding: .62rem .8rem; border: 0; border-radius: 12px;
    background: none; color: var(--side-ink); font-weight: 500; text-align: start; text-decoration: none;
}
.side-link > i:first-child { flex: none; font-size: 1.1rem; }
.side-link > span { flex: 1; min-width: 0; }
.side-link:hover { color: #fff; background: var(--side-hover); }
.side-link:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.side-link.active, .side-link.active:hover { color: #fff; background: var(--side-active); font-weight: 600; }
.side-link.has-active { color: #fff; font-weight: 600; }
.side-chevron { flex: none; font-size: .75rem; transition: transform .2s ease; }
.side-link[aria-expanded="true"] .side-chevron { transform: rotate(180deg); }
.side-children { display: flex; flex-direction: column; gap: .1rem; padding-block: .1rem .3rem; padding-inline-start: 1rem; }
.side-link.child { padding: .45rem .7rem; font-size: .9rem; }
.side-link.child > i:first-child { font-size: 1rem; }
.sidebar-backdrop { display: none; }

@media (min-width: 1200px) {
    .has-sidebar .app-shell { margin-inline-start: var(--sidebar-w); transition: margin .2s ease; }
    html.sidebar-hidden .has-sidebar .app-shell { margin-inline-start: 0; }
    html.sidebar-hidden .app-sidebar { transform: translateX(-100%); visibility: hidden; }
    html[dir="rtl"].sidebar-hidden .app-sidebar { transform: translateX(100%); }
}
@media (max-width: 1199.98px) {
    .app-sidebar { transform: translateX(-100%); visibility: hidden; }
    [dir="rtl"] .app-sidebar { transform: translateX(100%); }
    html.sidebar-open .app-sidebar { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
    html.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(0, 0, 0, .45); }
    html.sidebar-open body { overflow: hidden; }
}
@media print {
    .app-sidebar, .sidebar-backdrop, .app-topbar { display: none !important; }
    .has-sidebar .app-shell { margin: 0 !important; }
}

/* ---- Page loading and connection notices ---- */
.nav-progress { position: fixed; top: 0; inset-inline: 0; z-index: 2000; height: 3px; overflow: hidden; background: rgba(24, 119, 77, .25); }
.nav-progress::after { content: ''; position: absolute; top: 0; bottom: 0; width: 35%; background: #18774d; animation: nav-slide 1s ease-in-out infinite; }
.nav-progress[hidden] { display: none; }
@keyframes nav-slide { from { inset-inline-start: -35%; } to { inset-inline-start: 100%; } }
@media (prefers-reduced-motion: reduce) { .nav-progress::after { width: 100%; animation: none; } }
.net-notice {
    position: fixed; z-index: 2000; bottom: 1rem; inset-inline-start: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 2rem);
    padding: .55rem 1rem; border-radius: 12px; background: #7c3a06; color: #fff; font-size: .85rem; font-weight: 600; text-align: center; box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
}
[dir="rtl"] .net-notice { transform: translateX(50%); }
.net-notice[hidden] { display: none; }
.net-notice.offline { background: #861f1f; }

/* ---- System settings ---- */
.system-logo-preview { width: 96px; height: 96px; padding: 6px; border: 1px solid var(--line); border-radius: 18px; background: #fff; object-fit: contain; flex: none; }

/* ---- Top bar ---- */
.app-shell { min-width: 0; }
.app-topbar {
    position: sticky; top: 0; z-index: 1030;
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .03);
}
.topbar-inner {
    display: flex; align-items: center; gap: 1rem;
    max-width: 1680px; margin: 0 auto; padding: .6rem 1rem; min-height: 68px;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-mark {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none;
    background: var(--brand-50); color: var(--brand); font-size: 1.3rem; border: 1px solid rgba(31, 138, 91, .25);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 11px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--ink-soft); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.has-sidebar .app-topbar .brand { display: none; }
html.sidebar-hidden .has-sidebar .app-topbar .brand { display: flex; }
@media (max-width: 1199.98px) {
    .has-sidebar .app-topbar .brand { display: flex; }
}

.topbar-actions { display: flex; align-items: center; flex: none; gap: .6rem; margin-inline-start: auto; }
.round-btn {
    width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
    color: var(--ink); display: grid; place-items: center; flex: none; box-shadow: var(--shadow);
}
.round-btn:hover { color: var(--brand); }
#sidebarToggle { font-size: 1.35rem; }
.avatar-btn {
    width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--brand-50); background: var(--brand);
    color: #fff; font-weight: 600; font-size: .9rem;
}

.app-main { max-width: 1680px; margin: 0 auto; padding: 1.25rem 1rem 2rem; }

/* ---- Cards ---- */
.soft-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1.1rem 1.2rem;
}
.soft-card-title {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    font-weight: 600; font-size: .98rem; margin-bottom: .85rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line);
}
.soft-card-title i { color: var(--brand); }

.kpi { display: flex; flex-direction: column; gap: .2rem; }
.kpi .label { color: var(--ink-soft); font-size: .85rem; }
.kpi .value { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; }

.app-toast { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); border-radius: 14px; }
.app-toast-success i { color: var(--brand); }
.app-toast-danger i { color: #d64545; }
.app-toast-warning i { color: #d99a1e; }

@media (max-width: 767.98px) {
    .app-main { padding: 1rem 1rem 2rem; }
}

/* ---- Module pages ---- */
.module-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.module-head h1 { font-size: 1.4rem; font-weight: 700; margin: 0; }
.module-head p { margin: .15rem 0 0; color: var(--ink-soft); font-size: .88rem; }
.module-head .actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: 1rem; }
.filter-bar .form-control, .filter-bar .form-select { min-width: 150px; }
.filter-bar .grow { flex: 1 1 220px; }
.data-table { margin: 0; --bs-table-bg: transparent; }
.data-table thead th {
    font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft);
    font-weight: 600; border-bottom-width: 1px; white-space: nowrap; background: var(--surface-2);
}
.data-table thead th:first-child { border-start-start-radius: 10px; }
.data-table thead th:last-child { border-start-end-radius: 10px; }
.data-table td { vertical-align: middle; border-color: var(--line); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table .muted { color: var(--ink-soft); font-size: .8rem; }
.empty-row td { text-align: center; color: var(--ink-soft); padding: 2.5rem 1rem !important; }
.icon-btn { width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; border-radius: 9px; }
.status-pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; }
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-green { background: #e3f4ea; color: #1b7a4e; }
.pill-amber { background: #fdf1d6; color: #956200; }
.pill-red { background: #fde4e4; color: #b42318; }
.pill-grey { background: #eceff1; color: #5c6b73; }
.pill-blue { background: #e2edfb; color: #1d5fb4; }
[data-bs-theme="dark"] .pill-green { background: #173a29; color: #8fe0b5; }
[data-bs-theme="dark"] .pill-amber { background: #3d2f12; color: #f1c66b; }
[data-bs-theme="dark"] .pill-red { background: #3d1a1a; color: #f3a5a5; }
[data-bs-theme="dark"] .pill-grey { background: #253037; color: #b4c1c8; }
[data-bs-theme="dark"] .pill-blue { background: #172b45; color: #9ec3f3; }
.soft-alert { border: 0; border-radius: 14px; box-shadow: var(--shadow); }
.modal-content { border: 0; border-radius: 20px; }
.stat-mini { background: var(--surface-2); border-radius: 12px; padding: .7rem .9rem; }
.stat-mini small { display: block; color: var(--ink-soft); font-size: .76rem; }
.stat-mini b { font-size: 1.15rem; }
.doc-items td { vertical-align: middle; }
.doc-items input { min-width: 80px; }
.lookup { position: relative; }
.lookup-results {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--surface);
    border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .12); padding: .3rem; max-height: 300px; overflow-y: auto;
}
.lookup-results button { display: flex; justify-content: space-between; gap: .5rem; width: 100%; border: 0; background: none; color: inherit; text-align: start; padding: .5rem .6rem; border-radius: 8px; font-size: .88rem; }
.lookup-results button:hover, .lookup-results button.active { background: var(--brand-50); }

/* ---- Languages ---- */
html[lang="ar"] { --bs-body-font-family: 'Noto Sans Arabic', 'Inter', system-ui, sans-serif; }
html[lang="ar"] body { font-size: 1.02rem; }
.lang-btn { width: auto; min-width: 42px; padding: 0 .7rem; border-radius: 999px; display: inline-flex; gap: .35rem; font-size: .78rem; font-weight: 600; }
[dir="rtl"] .bi-arrow-left, [dir="rtl"] .bi-arrow-right, [dir="rtl"] .bi-chevron-left, [dir="rtl"] .bi-chevron-right,
[dir="rtl"] .bi-arrow-return-right, [dir="rtl"] .bi-box-arrow-right { display: inline-block; transform: scaleX(-1); }
.pw-cell { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .04em; }

/* ---- Camera scanner ---- */
.scan-overlay {
    position: fixed; inset: 0; z-index: 2000; background: rgba(15, 23, 42, .6); display: grid; place-items: center; padding: 1rem;
}
.scan-box { width: 100%; max-width: 460px; background: var(--surface); color: var(--ink); border-radius: 18px; padding: 1rem; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
.scan-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.scan-view { position: relative; background: #0f172a; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; }
.scan-view #scanView { width: 100%; height: 100%; }
.scan-view #scanView video { width: 100% !important; height: 100% !important; object-fit: cover; }
.scan-idle { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .45); font-size: 2.5rem; pointer-events: none; }
.scan-view.live .scan-idle { display: none; }
.scan-msg { min-height: 2.6em; margin: .7rem 0; font-size: .9rem; color: var(--ink-soft); text-align: center; }
.scan-msg[data-type="ok"] { color: var(--brand-600); font-weight: 600; }
.scan-msg[data-type="error"] { color: var(--bs-danger); }
.scan-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; align-items: center; }
.scan-actions select { flex: 1 1 160px; width: auto; }

/* product photo thumbnail in lists */
.product-thumb { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-soft); }

/* Excel import dialog */
.import-steps { padding-inline-start: 1.2rem; margin-bottom: 1rem; font-size: .9rem; color: var(--ink-soft); }
.import-steps li { margin-bottom: .25rem; }

/* payment method badge (EVC Plus, Zaad, …) and WhatsApp button — used on several pages */
.pay-badge {
    display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 .3rem; border-radius: 7px;
    background: var(--pay-color); color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: -.02em; flex-shrink: 0;
}
.btn-whatsapp { background: #25d366; border-color: #25d366; color: #fff; white-space: nowrap; }
.btn-whatsapp:hover, .btn-whatsapp:focus-visible { background: #1ebe5b; border-color: #1ebe5b; color: #fff; }

/* settings: sections and payment-method toggles */
.settings-section { display: flex; align-items: center; gap: .5rem; font-size: 1rem; font-weight: 700; margin: 2rem 0 1rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.settings-section i { color: var(--brand); }
.method-toggles { display: flex; flex-wrap: wrap; gap: .5rem; }
.method-toggle { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .8rem; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 600; font-size: .88rem; user-select: none; }
.method-toggle > i { color: var(--line); }
.btn-check:checked + .method-toggle { border-color: var(--brand); background: var(--brand-50); }
.btn-check:checked + .method-toggle > i { color: var(--brand); }
.btn-check:disabled + .method-toggle { opacity: .8; cursor: default; }
.btn-check:focus-visible + .method-toggle { outline: 2px solid var(--brand); outline-offset: 2px; }

/* partial returns */
.return-lines { display: flex; flex-direction: column; }
.return-line { display: grid; grid-template-columns: 1fr auto 110px; gap: .5rem 1rem; align-items: center; padding: .8rem .2rem; border-bottom: 1px solid var(--line); }
.return-line:last-child { border-bottom: 0; }
.return-line.done { opacity: .55; grid-template-columns: 1fr auto; }
.return-line.picked { background: #fff5f5; border-radius: 10px; }
[data-bs-theme="dark"] .return-line.picked { background: #3a1f22; }
.return-line .r-qty { display: flex; align-items: center; gap: .3rem; }
.return-line .r-qty input { width: 80px; text-align: center; font-weight: 700; }
.return-line .r-qty .btn-light { width: 40px; height: 40px; }
.return-line .r-amount { text-align: end; font-weight: 700; }
.reason-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.reason-btn { border: 2px solid var(--line); border-radius: 10px; padding: .5rem; font-size: .84rem; font-weight: 600; text-align: center; cursor: pointer; }
.btn-check:checked + .reason-btn { border-color: #c53030; background: #fde8e8; color: #9b1c1c; }
.return-total { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; border-radius: 12px; background: var(--surface-2); }
.return-total strong { font-size: 1.5rem; }
.return-split { display: flex; align-items: center; gap: .5rem; padding: .55rem .2rem; border-bottom: 1px dashed var(--line); }
.return-split span { flex: 1; }
.return-split.account i { color: var(--brand); }
.return-split.money i { color: #c53030; }
.return-split.money b { color: #c53030; font-size: 1.15rem; }
@media (max-width: 575.98px) {
    .return-line { grid-template-columns: 1fr auto; }
    .return-line .r-qty { grid-column: 1 / -1; }
}

/* day-end cash count: tappable banknotes */
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.note-tile { display: flex; flex-direction: column; gap: .4rem; padding: .4rem; border-radius: 14px; border: 2px solid transparent; }
.note-tile.has-count { border-color: var(--note); background: color-mix(in srgb, var(--note) 8%, transparent); }
.note-face {
    position: relative; aspect-ratio: 2.1 / 1; border: 0; border-radius: 10px; color: #fff; overflow: hidden;
    background: linear-gradient(135deg, var(--note), color-mix(in srgb, var(--note) 60%, #000));
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .25), 0 3px 8px rgba(0, 0, 0, .15); transition: transform .08s;
}
.note-face::after { content: ''; position: absolute; inset: 18% auto 18% 8%; width: 26%; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.note-face:active { transform: scale(.96); }
.note-value { position: relative; z-index: 1; font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.note-corner { position: absolute; top: .3rem; inset-inline-end: .5rem; font-size: .7rem; font-weight: 700; opacity: .8; }
.note-code { position: absolute; bottom: .3rem; inset-inline-end: .5rem; font-size: .7rem; font-weight: 700; opacity: .85; }
.note-controls { display: grid; grid-template-columns: 40px 1fr 40px; gap: .3rem; }
.note-controls .btn { height: 40px; padding: 0; }
.note-controls input { height: 40px; text-align: center; font-weight: 800; font-size: 1.1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); min-width: 0; }
.note-sum { text-align: center; font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.count-result { position: sticky; top: 88px; }
.count-row { display: flex; justify-content: space-between; padding: .45rem 0; border-bottom: 1px dashed var(--line); }
.count-row b { font-size: 1.15rem; }
.count-row.minor { padding: .25rem 0; font-size: .85rem; border-bottom: 0; color: var(--ink-soft); }
.count-row.minor.text-success { color: var(--bs-success) !important; }
.count-row.minor.text-danger { color: var(--bs-danger) !important; }

/* money moved between the drawer, wallets and the bank */
.move-presets { display: flex; flex-wrap: wrap; gap: .4rem; }
.move-presets .btn { border-radius: 999px; }
.move-sides { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: .6rem; }
.move-arrow { padding-bottom: .55rem; color: var(--brand); font-size: 1.2rem; }
[dir="rtl"] .move-arrow { transform: scaleX(-1); }
.move-preview { padding: .7rem .9rem; border-radius: 12px; background: var(--brand-50); font-size: .88rem; line-height: 1.5; }
.move-preview[hidden] { display: none; }
.move-preview.warn { background: #fff3d6; color: #7a5200; }
[data-bs-theme="dark"] .move-preview.warn { background: #3a2c0a; color: #f1c66b; }
.count-verdict { display: flex; align-items: center; gap: .8rem; margin-top: 1rem; padding: 1rem; border-radius: 14px; }
.count-verdict i { font-size: 2.4rem; }
.count-verdict strong { display: block; font-size: 1.15rem; }
.count-verdict small { font-size: 1.3rem; font-weight: 800; }
.count-verdict.ok { background: #e3f7ea; color: #1f8a5b; }
.count-verdict.short { background: #fde8e8; color: #b42318; }
.count-verdict.over { background: #fff3d6; color: #9a6700; }
[data-bs-theme="dark"] .count-verdict.ok { background: #173d24; color: #8ee0a8; }
[data-bs-theme="dark"] .count-verdict.short { background: #4a1f24; color: #ffb4b4; }
[data-bs-theme="dark"] .count-verdict.over { background: #453a0f; color: #fde08a; }

/* dashboard: Today panel */
.today-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .8rem; flex-wrap: wrap; }
.today-head h2, .section-label { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; font-weight: 700; margin: 0; }
.today-head h2 i { color: #e8a317; }
.today-head h2 small { font-size: .82rem; font-weight: 500; color: var(--ink-soft); }
.section-label { margin: .5rem 0 .8rem; color: var(--ink-soft); font-size: .95rem; }
.money-card { display: flex; flex-direction: column; gap: 1rem; }
.money-total { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.2rem; border-radius: 14px; background: #18774d; color: #fff; }
.money-total .label { display: block; font-size: .85rem; opacity: .9; }
.money-total .value { display: block; font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.money-total small { opacity: .8; font-size: .75rem; }
.money-total-side { display: flex; gap: 1.2rem; }
.money-total-side div { display: flex; flex-direction: column; }
.money-total-side small { font-size: .72rem; }
.money-total-side b { font-size: 1.15rem; }
.method-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.method-tile { padding: .7rem .8rem; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--pay-color) 30%, transparent); border-top: 4px solid var(--pay-color); background: color-mix(in srgb, var(--pay-color) 12%, var(--surface)); }
.method-tile.zero { opacity: .55; }
.method-tile .mt-head { display: flex; align-items: center; gap: .45rem; font-weight: 600; font-size: .85rem; }
.method-tile .mt-value { font-size: 1.35rem; font-weight: 800; margin-top: .3rem; }
.method-tile .mt-sub { display: flex; flex-direction: column; font-size: .72rem; color: var(--ink-soft); min-height: 1em; }
.today-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
/* Coloured dashboard cards: every tone keeps white text readable. */
.tone-blue   { --tone: #1e46d6; }
.tone-purple { --tone: #7c3aed; }
.tone-green  { --tone: #18774d; }
.tone-red    { --tone: #c53030; }
.tone-amber  { --tone: #b45309; }
.color-card, .today-stats .today-stat {
    background: var(--tone);
    border: 0; color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--tone) 25%, transparent);
}
.color-card .label, .color-card small { color: #fff; }
a:hover > .color-card, .today-stats a.today-stat:hover { filter: brightness(1.08); color: #fff; }
/* Plain stat tiles (Payroll); the dashboard's .today-stats colours them below. */
.today-stat { display: flex; gap: .7rem; align-items: center; padding: 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.today-stat > i { width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; display: grid; place-items: center; font-size: 1.15rem; }
.today-stat small { display: block; color: var(--ink-soft); font-size: .78rem; }
.today-stat b { display: block; font-size: 1.3rem; font-weight: 800; }
.today-stat span { font-size: .72rem; color: var(--ink-soft); }
.today-stat.tone-red > i { background: #fde8e8; color: #c53030; }
.today-stat.tone-green > i { background: #e3f7ea; color: #1f8a5b; }
.today-stat.tone-amber > i { background: #fff3d6; color: #9a6700; }
.today-stat.tone-blue > i { background: #e8edff; color: #1e46d6; }
.today-stat.tone-purple > i { background: #f1e8ff; color: #7c3aed; }
.today-stats .today-stat > i { background: rgba(255, 255, 255, .2); color: #fff; }
.today-stats .today-stat small, .today-stats .today-stat span { color: #fff; }
/* Profit tile: full width, split into money already in hand and profit still owed in the dues book. */
.today-stat.profit-split { grid-column: 1 / -1; align-items: flex-start; }
.profit-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .3); margin: .55rem 0 .5rem; overflow: hidden; }
.profit-bar i { display: block; height: 100%; background: #fff; border-radius: inherit; }
.profit-parts { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.profit-parts > * { padding: .4rem .55rem; border-radius: 10px; background: rgba(0, 0, 0, .22); color: #fff; text-decoration: none; }
.profit-parts small { display: flex; align-items: center; gap: .3rem; font-size: .72rem; }
.profit-parts b { font-size: 1.05rem; }
.sold-list li { padding: .4rem 0; }
/* Branch photo: full-bleed cover at the top of the card. */
.branch-card .branch-cover { position: relative; margin: -1.1rem -1.2rem .9rem; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface-2); }
.branch-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.branch-cover-empty { width: 100%; height: 100%; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; color: var(--ink-soft); font-size: .82rem; background: linear-gradient(135deg, var(--surface-2), rgba(31, 138, 91, .12)); }
.branch-cover-empty i { font-size: 2.2rem; color: var(--brand); }
.branch-cover-empty:hover { color: var(--brand); }
.branch-code { position: absolute; top: .6rem; inset-inline-start: .6rem; padding: .15rem .55rem; border-radius: 999px; background: rgba(17, 24, 39, .72); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.branch-photo-pick { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 7; border: 2px dashed var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--surface-2); color: var(--ink-soft); font-size: .82rem; }
.branch-photo-pick img { width: 100%; height: 100%; object-fit: cover; }
.branch-photo-pick span { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; padding: .5rem; }
.branch-photo-pick i { font-size: 1.6rem; }
@media (max-width: 575.98px) {
    .today-stats { grid-template-columns: 1fr; }
    .money-total .value { font-size: 1.8rem; }
}
