/* Hayat Sales & Tax — the Maalsoor / Rafiiq design, in the night-ink and rose of the hotel POS. */
:root, [data-bs-theme="light"] {
  --ms-bg: #f2f1f4; --ms-surface: #ffffff; --ms-surface-2: #e9e8ee; --ms-ink: #1c1d26; --ms-muted: #5b5d6b; --ms-line: #d6d5de;
  --ms-accent: #23264a; --ms-accent-hover: #181a36; --ms-accent-ink: #ffffff; --ms-accent-soft: #e0e1f0; --ms-sand: #a8326a;
  --ms-green: #1d6b3f; --ms-green-bg: #dbf0e2; --ms-gold: #8a5300; --ms-gold-bg: #fbead0; --ms-red: #ad2318; --ms-red-bg: #f9dedb;
  --ms-blue: #23508c; --ms-blue-bg: #dce7f5; --ms-slate: #4f5260; --ms-slate-bg: #e6e6ec; --ms-sand-bg: #f6e2ec;
  --ms-purple: #6b2f97; --ms-purple-bg: #eee1f7; --ms-rose: #c4245f; --ms-rose-hover: #a51c4f;
  --ms-amber: #c4245f; --ms-wa: #1a8a4a; --ms-wa-hover: #146f3b;
  --c-rev: #23508c; --c-exp: #c4245f; --c-pro: #6b2f97;
  --ms-f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --ms-f-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ms-f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --bs-body-bg: var(--ms-bg); --bs-body-color: var(--ms-ink); --bs-border-color: var(--ms-line);
  --bs-secondary-color: var(--ms-muted); --bs-body-font-family: var(--ms-f-body); --bs-body-font-size: .9375rem;
  --bs-link-color: var(--ms-accent); --bs-link-hover-color: var(--ms-accent-hover); --bs-link-color-rgb: 35, 38, 74;
  --bs-primary: var(--ms-accent); --bs-primary-rgb: 35, 38, 74; --bs-focus-ring-color: rgba(35, 38, 74, .3);
  --bs-tertiary-bg: var(--ms-surface-2);
}
[data-bs-theme="dark"] {
  --ms-bg: #121218; --ms-surface: #1a1a22; --ms-surface-2: #23232d; --ms-ink: #e7e6ee; --ms-muted: #a2a1b2; --ms-line: #30303c;
  --ms-accent: #a9aef0; --ms-accent-hover: #c0c4f5; --ms-accent-ink: #12132a; --ms-accent-soft: #24264a; --ms-sand: #f08cb6;
  --ms-green: #84d3a0; --ms-green-bg: #19301f; --ms-gold: #f0bb55; --ms-gold-bg: #392b10; --ms-red: #ff8b7f; --ms-red-bg: #3d1a17;
  --ms-blue: #8fbff0; --ms-blue-bg: #17293b; --ms-slate: #a9abb8; --ms-slate-bg: #2a2a34; --ms-sand-bg: #3a1a2a;
  --ms-purple: #cfa3f0; --ms-purple-bg: #2e1d3d; --ms-rose: #f06d9c; --ms-rose-hover: #f48ab0;
  --ms-amber: #f06d9c; --ms-wa: #25a35a; --ms-wa-hover: #2fb867;
  --c-rev: #8fbff0; --c-exp: #f06d9c; --c-pro: #cfa3f0;
  --bs-link-color-rgb: 169, 174, 240; --bs-primary-rgb: 169, 174, 240; --bs-focus-ring-color: rgba(169, 174, 240, .35);
  color-scheme: dark;
}
html, body { height: 100%; }
body { background: var(--ms-bg); color: var(--ms-ink); font-family: var(--ms-f-body); -webkit-tap-highlight-color: transparent; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 2000; background: var(--ms-accent); color: var(--ms-accent-ink); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
h1, h2, h3, .h1, .h2, .h3 { color: inherit; font-family: var(--ms-f-display); letter-spacing: -.015em; text-wrap: balance; }
.num, .table td.num, .table th.num { font-family: var(--ms-f-mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.text-muted { color: var(--ms-muted) !important; }

/* ---- Buttons & forms ------------------------------------------------------- */
.btn { --bs-btn-border-radius: 8px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 500; }
.btn-sm { min-height: 32px; }
.btn.btn-primary, .btn-primary { background-image: none; --bs-btn-bg: var(--ms-accent); --bs-btn-border-color: var(--ms-accent); --bs-btn-color: var(--ms-accent-ink);
  --bs-btn-hover-bg: var(--ms-accent-hover); --bs-btn-hover-border-color: var(--ms-accent-hover); --bs-btn-hover-color: var(--ms-accent-ink);
  --bs-btn-active-bg: var(--ms-accent-hover); --bs-btn-active-border-color: var(--ms-accent-hover); --bs-btn-active-color: var(--ms-accent-ink);
  --bs-btn-disabled-bg: var(--ms-accent); --bs-btn-disabled-border-color: var(--ms-accent); --bs-btn-disabled-color: var(--ms-accent-ink); }
.btn.btn-light, .btn-light { background-image: none; --bs-btn-bg: var(--ms-surface); --bs-btn-border-color: var(--ms-line); --bs-btn-color: var(--ms-ink);
  --bs-btn-hover-bg: var(--ms-surface-2); --bs-btn-hover-border-color: var(--ms-line); --bs-btn-hover-color: var(--ms-ink);
  --bs-btn-active-bg: var(--ms-surface-2); --bs-btn-active-border-color: var(--ms-line); --bs-btn-active-color: var(--ms-ink); }
.btn-icon { width: 40px; padding: 0; color: var(--ms-ink); border: 1px solid transparent; }
.btn-icon:hover { background: var(--ms-surface-2); }
.lang-btn { font-family: var(--ms-f-mono); font-size: 13px; font-weight: 600; text-decoration: none; }
.form-control, .form-select { min-height: 44px; border-radius: 8px; background-color: var(--ms-surface); border-color: var(--ms-line); color: var(--ms-ink); }
.form-control:focus, .form-select:focus { border-color: var(--ms-accent); box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); }
.form-label { font-weight: 600; font-size: .875rem; margin-bottom: .3rem; }
.form-text { color: var(--ms-muted); }
.req { color: var(--ms-red); }
.form-check-input:checked { background-color: var(--ms-accent); border-color: var(--ms-accent); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--ms-line); background: var(--ms-surface-2); color: var(--ms-ink); border-radius: 999px; padding: 3px 10px; font-size: .8rem; min-height: 30px; cursor: pointer; }
.chip:hover { border-color: var(--ms-accent); }
.alert { border-radius: 10px; }

/* ---- Shell ------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100%; }
.sidebar { width: 252px; flex: 0 0 252px; background: var(--ms-surface); border-right: 1px solid var(--ms-line); display: flex; flex-direction: column; }
@media (min-width: 992px) {
  .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; visibility: visible !important; transform: none !important; }
}
@media (max-width: 991.98px) { .sidebar { --bs-offcanvas-width: 280px; background: var(--ms-surface); } }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ms-ink); }
.brand b { display: block; font-family: var(--ms-f-display); font-size: 1.35rem; line-height: 1; color: var(--ms-accent); letter-spacing: -.02em; }
.brand small { display: block; color: var(--ms-muted); font-size: .75rem; margin-top: 2px; }
.sidebar-nav ul { list-style: none; margin: 0; padding: 0; }
.sidebar-nav { padding: 8px 10px; flex: 1; }
.sidebar-nav .nav-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; color: var(--ms-ink); text-decoration: none; border: 0; background: none; text-align: left; font-size: .9rem; }
.sidebar-nav .nav-link:hover { background: var(--ms-surface-2); }
.sidebar-nav .nav-link .bi { font-size: 1.05rem; color: var(--ms-muted); }
.sidebar-nav .nav-link.active { background: var(--ms-accent-soft); color: var(--ms-accent); font-weight: 600; }
.sidebar-nav .nav-link.active .bi { color: var(--ms-accent); }
.sidebar-nav .caret { margin-left: auto; font-size: .75rem !important; transition: transform .15s; }
.sidebar-nav .nav-toggle[aria-expanded="true"] .caret { transform: rotate(180deg); }
.sidebar-nav .sub { padding-left: 30px !important; }
.sidebar-nav .sub .nav-link { padding: 7px 10px; font-size: .875rem; }
.sidebar-foot { padding: 12px 16px 18px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--ms-line); }
.btn-install { background: var(--ms-accent-soft); color: var(--ms-accent); border: 1px solid transparent; font-weight: 600; }
.btn-install:hover { background: var(--ms-accent); color: var(--ms-accent-ink); }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top, 0px)) 20px 8px; background: color-mix(in srgb, var(--ms-bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--ms-line); }
.topbar-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (min-width: 992px) { .topbar-title { visibility: hidden; } }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.btn-user { display: flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--ms-ink); padding: 4px 6px; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-size: .75rem; font-weight: 600;
  background: hsl(var(--hue) 45% 85%); color: hsl(var(--hue) 50% 22%); }
[data-bs-theme="dark"] .avatar { background: hsl(var(--hue) 30% 28%); color: hsl(var(--hue) 60% 88%); }
.net-status { font-size: .8rem; color: var(--ms-gold); background: var(--ms-gold-bg); padding: 3px 10px; border-radius: 999px; }
.dropdown-menu { --bs-dropdown-bg: var(--ms-surface); --bs-dropdown-border-color: var(--ms-line); --bs-dropdown-link-color: var(--ms-ink); --bs-dropdown-link-hover-bg: var(--ms-surface-2); border-radius: 10px; }
.dropdown-item { display: flex; gap: 8px; align-items: center; min-height: 40px; }
.content { padding: 24px 28px 48px; max-width: 1280px; width: 100%; display: flex; flex-direction: column; gap: 20px; }
.foot { padding: 0 28px 24px; color: var(--ms-muted); font-size: .75rem; }
@media (max-width: 991.98px) {
  .content { padding: 16px 16px 96px; gap: 16px; }
  .foot { padding: 0 16px 90px; }
  .topbar { padding-left: 8px; padding-right: 12px; }
}

/* Bottom tab bar on phones */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--ms-surface); border-top: 1px solid var(--ms-line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; color: var(--ms-muted); text-decoration: none; font-size: .7rem; border: 0; background: none; }
.tabbar .bi { font-size: 1.25rem; }
.tabbar a.active { color: var(--ms-accent); font-weight: 600; }

/* ---- Page parts -------------------------------------------------------------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head h1 { font-size: 1.85rem; font-weight: 700; margin: 0; }
.page-sub { margin: 4px 0 0; color: var(--ms-muted); max-width: 65ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs { font-size: .8rem; color: var(--ms-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.crumbs a { color: var(--ms-muted); text-decoration: none; }
.crumbs a:hover { color: var(--ms-accent); }
.crumbs .bi { font-size: .65rem; }
@media (max-width: 575.98px) { .page-head h1 { font-size: 1.5rem; } .page-actions { width: 100%; } .page-actions .btn { flex: 1 1 auto; } }

.panel { background: var(--ms-surface); border: 1px solid var(--ms-line); border-radius: 12px; min-width: 0; }
.panel-body { padding: 18px; }
.panel-head { padding: 14px 18px; border-bottom: 1px solid var(--ms-line); display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.panel-head h2, .section-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.panel-head a { font-size: .8rem; text-decoration: none; white-space: nowrap; }
.panel-foot { padding: 12px 18px; border-top: 1px solid var(--ms-line); background: var(--ms-surface-2); border-radius: 0 0 12px 12px; }
.panel-danger { border-color: var(--ms-red); }
.section-title { margin-bottom: 10px; }

.stat-strip { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); background: var(--ms-surface); border: 1px solid var(--ms-line); border-radius: 12px; overflow: hidden; }
.stat { display: flex; gap: 12px; padding: 14px 16px; border-left: 1px solid var(--ms-line); text-decoration: none; color: var(--ms-ink); min-width: 0; }
.stat:first-child { border-left: 0; }
a.stat:hover { background: var(--ms-surface-2); }
.stat-icon { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; display: grid; place-items: center; font-size: 1.1rem; }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-value { font-family: var(--ms-f-display); font-size: 1.75rem; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-label { font-weight: 600; font-size: .85rem; }
.stat-sub { color: var(--ms-muted); font-size: .75rem; }
.tone-green .stat-icon { background: var(--ms-green-bg); color: var(--ms-green); }
.tone-gold .stat-icon { background: var(--ms-gold-bg); color: var(--ms-gold); }
.tone-red .stat-icon { background: var(--ms-red-bg); color: var(--ms-red); }
.tone-blue .stat-icon { background: var(--ms-blue-bg); color: var(--ms-blue); }
.tone-sand .stat-icon { background: var(--ms-sand-bg); color: var(--ms-sand); }
.tone-slate .stat-icon { background: var(--ms-slate-bg); color: var(--ms-slate); }
@media (max-width: 991.98px) {
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { border-left: 0; border-top: 1px solid var(--ms-line); }
  .stat:nth-child(even) { border-left: 1px solid var(--ms-line); }
  .stat:nth-child(-n+2) { border-top: 0; }
  .stat-value { font-size: 1.45rem; }
}

.eyebrow { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ms-muted); font-weight: 600; }

.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.figures > div { padding: 12px 18px; border-left: 1px solid var(--ms-line); border-top: 1px solid var(--ms-line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.figures > div:nth-child(4n+1) { border-left: 0; } .figures > div:nth-child(-n+4) { border-top: 0; }
.figures span { font-size: .78rem; color: var(--ms-muted); }
.figures b { font-family: var(--ms-f-mono); font-weight: 500; font-size: 1.1rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 767.98px) {
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures > div:nth-child(n) { border-left: 1px solid var(--ms-line); border-top: 1px solid var(--ms-line); }
  .figures > div:nth-child(2n+1) { border-left: 0; } .figures > div:nth-child(-n+2) { border-top: 0; }
}

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--ms-line); }
.mini-list li:first-child { border-top: 0; }
.mini-list a.t { color: var(--ms-ink); text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.mini-list a.t:hover { color: var(--ms-accent); }
.mini-list .d { grid-column: 1; font-size: .78rem; color: var(--ms-muted); }
.mini-empty { padding: 14px 18px; color: var(--ms-muted); font-size: .875rem; }

/* Pills: colour plus a dot plus text, so status reads without colour */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-green { background: var(--ms-green-bg); color: var(--ms-green); } .pill-gold { background: var(--ms-gold-bg); color: var(--ms-gold); }
.pill-red { background: var(--ms-red-bg); color: var(--ms-red); } .pill-blue { background: var(--ms-blue-bg); color: var(--ms-blue); }
.pill-slate { background: var(--ms-slate-bg); color: var(--ms-slate); } .pill-sand { background: var(--ms-sand-bg); color: var(--ms-sand); }
.tag-ex { font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--ms-sand); border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; vertical-align: 1px; }

/* Lists */
.list-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.list-toolbar .search { position: relative; flex: 1 1 220px; max-width: 360px; }
.list-toolbar .search .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ms-muted); }
.list-toolbar .search input { padding-left: 34px; }
.list-toolbar .form-select { width: auto; flex: 0 1 180px; }
.list-toolbar > * { min-width: 0; max-width: 100%; }
.table-wrap { background: var(--ms-surface); border: 1px solid var(--ms-line); border-radius: 12px; overflow-x: auto; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--ms-ink); --bs-table-border-color: var(--ms-line); --bs-table-hover-bg: var(--ms-surface-2); --bs-table-hover-color: var(--ms-ink); margin: 0; min-width: 680px; }
.table th { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ms-muted); font-weight: 600; background: var(--ms-surface-2); white-space: nowrap; padding: 10px 12px; }
.table td { padding: 11px 12px; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table a.row-link { color: var(--ms-ink); font-weight: 600; text-decoration: none; }
.table a.row-link:hover { color: var(--ms-accent); text-decoration: underline; }
.table tr[data-href] { cursor: pointer; }
.table td.notes { color: var(--ms-muted); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plus { color: var(--ms-green); } .minus { color: var(--ms-red); }
.bar { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bar i { display: block; width: 70px; height: 6px; border-radius: 3px; background: var(--ms-surface-2); overflow: hidden; }
.bar i b { display: block; height: 100%; background: var(--ms-accent); }
.bar i b.gold { background: var(--ms-gold); } .bar i b.red { background: var(--ms-red); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--ms-muted); font-size: .8rem; }
.foot-note { font-size: .78rem; color: var(--ms-muted); }
.calc-card { background: var(--ms-accent-soft); color: var(--ms-ink); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.calc-card dl { margin: 0; display: grid; grid-template-columns: auto auto; gap: 6px 16px; }
.calc-card dt { font-weight: 500; color: var(--ms-muted); }
.calc-card dd { margin: 0; text-align: right; font-family: var(--ms-f-mono); font-variant-numeric: tabular-nums; }

.empty-state { text-align: center; padding: 48px 16px; color: var(--ms-muted); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-state > .bi { font-size: 2.2rem; color: var(--ms-accent); }
.empty-state h2 { font-size: 1.2rem; color: var(--ms-ink); margin: 6px 0 0; }
.empty-state p { max-width: 46ch; margin: 0 0 8px; }

/* Sign-in page */
.auth-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background:
  linear-gradient(180deg, color-mix(in srgb, var(--ms-amber) 22%, var(--ms-bg)) 0, var(--ms-bg) 340px); }
.auth-card { width: min(420px, 100%); }
.auth-card .brand { justify-content: center; margin-bottom: 18px; }
.auth-card .brand b { font-size: 2rem; }

/* Monthly report (prints cleanly from the browser) */
@media print {
  .sidebar, .topbar, .tabbar, .foot, .no-print, .alert { display: none !important; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .panel, .stat-strip, .table-wrap { border-color: #bbb; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- Tabs, figures, selection ---- */
.dash-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ms-line); overflow-x: auto; scrollbar-width: none; }
.dash-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; min-height: 44px; color: var(--ms-muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.dash-tabs a:hover { color: var(--ms-ink); }
.dash-tabs a.active { color: var(--ms-accent); border-bottom-color: var(--ms-accent); }
.dash-tabs .n { font-family: var(--ms-f-mono); font-weight: 500; font-size: .8rem; background: var(--ms-surface-2); color: var(--ms-muted); border-radius: 999px; padding: 0 8px; }
.dash-tabs .n:empty { display: none; }

.figures-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.figures-2 > div:nth-child(n) { border-left: 1px solid var(--ms-line); border-top: 1px solid var(--ms-line); }
.figures-2 > div:nth-child(2n+1) { border-left: 0; }
.figures-2 > div:nth-child(-n+2) { border-top: 0; }
.figures b small { font-family: var(--ms-f-body); font-size: .72rem; }

.select-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; margin-bottom: 8px; background: var(--ms-surface); border: 1px solid var(--ms-line); border-radius: 10px; color: var(--ms-muted); }
.select-bar.active { border-color: var(--ms-accent); background: var(--ms-accent-soft); color: var(--ms-ink); position: sticky; top: calc(58px + env(safe-area-inset-top, 0px)); z-index: 5; }
.seg .btn { min-height: 40px; }
.btn-check:checked + .btn.btn-light { background: var(--ms-accent); color: var(--ms-accent-ink); border-color: var(--ms-accent); }
.seg-nav { gap: 6px; }
.seg-nav .nav-link { color: var(--ms-muted); border-radius: 8px; font-weight: 600; }
.seg-nav .nav-link.active { background: var(--ms-accent-soft); color: var(--ms-accent); }
.text-warning-emphasis { color: var(--ms-gold) !important; }

/* ---- Rafiiq Truck ------------------------------------------------------------------ */
.rate-chip { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--ms-muted); font-family: var(--ms-f-mono); }
.brand img { border-radius: 9px; }
.btn-quick { min-height: 36px; padding: 0 12px; }
.usd { font-family: var(--ms-f-mono); font-variant-numeric: tabular-nums; }
small.sos { display: block; font-family: var(--ms-f-mono); font-size: .72rem; color: var(--ms-muted); font-weight: 400; line-height: 1.2; }
.stat-value small.sos { font-size: .72rem; margin-top: 3px; }
.stat-value .usd { font-family: var(--ms-f-display); }
.neg, .neg .usd { color: var(--ms-red); }
.pos .usd { color: var(--ms-green); }
.table td.num small.sos { text-align: right; }
.table tfoot td { font-weight: 600; background: var(--ms-surface-2); border-bottom: 0; }
.table td .sub { display: block; color: var(--ms-muted); font-size: .78rem; }

/* Money input: amount, SOS / USD switch, live conversion */
.money-row { display: flex; gap: 8px; align-items: stretch; }
.money-row .money-amt { font-family: var(--ms-f-mono); font-size: 1.15rem; flex: 1 1 auto; min-width: 0; }
.money-row .seg .btn { min-width: 64px; }
.money-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; margin-top: 6px; font-size: .82rem; color: var(--ms-muted); align-items: center; }
.money-eq { font-family: var(--ms-f-mono); }
.rate-box { display: inline-flex; align-items: center; gap: 6px; }
.rate-box input { width: 100px; min-height: 30px; font-family: var(--ms-f-mono); }
.subform { border: 1px dashed var(--ms-line); border-radius: 10px; padding: 14px; margin-top: 16px; background: var(--ms-surface-2); }
.subform h3 { font-size: .95rem; margin: 0 0 10px; font-family: var(--ms-f-body); font-weight: 600; }

/* Monthly chart */
.mchart { width: 100%; height: auto; display: block; }
.mchart .grid { stroke: var(--ms-line); stroke-width: 1; }
.mchart .grid.zero { stroke: var(--ms-muted); }
.mchart .ax { fill: var(--ms-muted); font: 500 11px var(--ms-f-mono); }
.mchart .b-rev { fill: var(--c-rev); } .mchart .b-exp { fill: var(--c-exp); }
.mchart .hist { opacity: .45; }
.mchart .p-line { fill: none; stroke: var(--c-pro); stroke-width: 2; stroke-linejoin: round; }
.mchart .p-dot { fill: var(--c-pro); stroke: var(--ms-surface); stroke-width: 2; }
.mchart .p-dot.neg { fill: var(--ms-red); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .k-rev { background: var(--c-rev); } .legend .k-exp { background: var(--c-exp); }
.legend .k-pro { background: var(--c-pro); border-radius: 50%; width: 9px; height: 9px; }

/* Share bars (owners) */
.share-list { list-style: none; margin: 0; padding: 0; }
.share-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 18px; border-top: 1px solid var(--ms-line); align-items: center; }
.share-list li:first-child { border-top: 0; }
.share-list .meter { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--ms-surface-2); overflow: hidden; }
.share-list .meter b { display: block; height: 100%; background: var(--ms-amber); }
.share-list .who { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; }

/* WhatsApp */
.btn-wa { --bs-btn-bg: var(--ms-wa); --bs-btn-border-color: var(--ms-wa); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--ms-wa-hover); --bs-btn-hover-border-color: var(--ms-wa-hover); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--ms-wa-hover); --bs-btn-active-color: #fff; --bs-btn-disabled-bg: var(--ms-wa); --bs-btn-disabled-border-color: var(--ms-wa); --bs-btn-disabled-color: #fff; }
.btn-outline-wa { --bs-btn-color: var(--ms-wa); --bs-btn-border-color: var(--ms-wa); --bs-btn-hover-bg: var(--ms-wa); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: var(--ms-wa); }
.wa-bubble { background: #e7f7ea; color: #102016; border-radius: 10px 10px 10px 2px; padding: 10px 12px; white-space: pre-wrap; font-size: .85rem; line-height: 1.4; max-height: 240px; overflow: auto; border: 1px solid #cbe8d2; }
[data-bs-theme="dark"] .wa-bubble { background: #173323; color: #dff2e5; border-color: #24452f; }
.wa-table td { vertical-align: top; }
.wa-table .wa-bubble { max-width: 520px; max-height: 120px; font-size: .78rem; }
.queue-card { border: 2px solid var(--ms-wa); }
.queue-progress { height: 6px; background: var(--ms-surface-2); border-radius: 3px; overflow: hidden; }
.queue-progress b { display: block; height: 100%; background: var(--ms-wa); transition: width .2s; }
tr.sent td { opacity: .55; }
tr.sent td:last-child { opacity: 1; }

/* Day sheet */
.day-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.day-nav input { width: auto; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; margin: 0; }
.kv dt { font-weight: 500; color: var(--ms-muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--ms-f-mono); font-variant-numeric: tabular-nums; }
.kv .total { border-top: 1px solid var(--ms-line); padding-top: 6px; color: var(--ms-ink); font-weight: 600; }
.note-box { background: var(--ms-gold-bg); color: var(--ms-ink); border-radius: 10px; padding: 12px 14px; font-size: .875rem; }
.hist-table td, .hist-table th { white-space: nowrap; }
@media (max-width: 575.98px) {
  .stat { padding: 12px; gap: 8px; }
  .stat-icon { display: none; }
  .stat-value { font-size: 1.2rem; overflow-wrap: normal; white-space: nowrap; }
  .money-row .seg .btn { min-width: 52px; }
}

/* ---- Hayat Sales & Tax --------------------------------------------------------------- */
.pill-purple { background: var(--ms-purple-bg); color: var(--ms-purple); }
.pill-purple::before { background: var(--ms-purple); }
.btn-rose { --bs-btn-bg: var(--ms-rose); --bs-btn-border-color: var(--ms-rose); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--ms-rose-hover); --bs-btn-hover-border-color: var(--ms-rose-hover); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--ms-rose-hover); --bs-btn-active-color: #fff; }
.btn-paid { --bs-btn-bg: var(--ms-green); --bs-btn-border-color: var(--ms-green); --bs-btn-color: #fff; --bs-btn-hover-bg: #155a33; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #155a33; --bs-btn-active-color: #fff; }
[data-bs-theme="dark"] .btn-paid { --bs-btn-color: #0d1f13; }
.mchart .s1 { fill: var(--ms-green); } .mchart .s2 { fill: var(--ms-purple); } .mchart .s3 { fill: var(--ms-accent); }
.legend i.s1 { background: var(--ms-green); } .legend i.s2 { background: var(--ms-purple); } .legend i.s3 { background: var(--ms-accent); }
/* The receipt as printed */
.slip { background: #fff; color: #111; width: 100%; max-width: 340px; margin: 0 auto; padding: 18px 18px 22px; border-radius: 6px; box-shadow: 0 1px 0 var(--ms-line), 0 8px 24px rgba(20, 20, 40, .08);
  font-family: var(--ms-f-mono); font-size: .78rem; line-height: 1.45; }
.slip h3 { font-family: var(--ms-f-body); font-size: 1rem; text-align: center; margin: 0; }
.slip .c { text-align: center; }
.slip .row2 { display: flex; justify-content: space-between; gap: 8px; }
.slip hr { border: 0; border-top: 1px dashed #999; margin: 6px 0; opacity: 1; }
.slip table { width: 100%; border-collapse: collapse; }
.slip td { padding: 1px 0; vertical-align: top; }
.slip td.n { text-align: right; white-space: nowrap; padding-left: 6px; }
.slip .b { font-weight: 600; }
.slip .struck { text-decoration: line-through; color: #777; }
.slip .stamp { text-align: center; font-weight: 700; letter-spacing: .2em; margin: 6px 0; }
.slip-img { max-width: 100%; border-radius: 6px; border: 1px solid var(--ms-line); }
.flags { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: .85rem; }
.flags li { background: var(--ms-gold-bg); color: var(--ms-ink); border-radius: 8px; padding: 6px 10px; }
.raw { white-space: pre-wrap; font-family: var(--ms-f-mono); font-size: .75rem; max-height: 320px; overflow: auto; background: var(--ms-surface-2); border-radius: 8px; padding: 10px; }
.toggle-form { display: inline; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn { min-height: 30px; padding: 2px 10px; font-size: .8rem; }
tr.waived td.tax { color: var(--ms-purple); text-decoration: line-through; }
.new-bar { position: sticky; top: 64px; z-index: 5; }
.items-edit td { padding: 4px; }
.items-edit input { min-height: 34px; }
.big-total { font-family: var(--ms-f-display); font-size: 1.6rem; font-weight: 700; }
.month-grid td { white-space: nowrap; }
@media print {
  .sidebar, .topbar, .tabbar, .no-print, .foot, .page-actions { display: none !important; }
  .app-shell, .main-col { display: block !important; margin: 0 !important; }
  .content { padding: 0 !important; }
  body { background: #fff !important; }
  .panel, .stat-strip, .table-wrap { box-shadow: none !important; break-inside: avoid; }
}
.panel .table-responsive { overflow-x: auto; }
.panel .table th, .panel .table td { padding: 8px 10px; }
.panel .table td.num, .panel .table th.num { white-space: nowrap; }
.panel .table th { font-size: .66rem; }
.panel .table td { font-size: .86rem; }
.panel .table { min-width: 0; }
.month-grid th { white-space: normal; vertical-align: bottom; line-height: 1.25; }
.month-grid td, .month-grid th { padding-left: 8px; padding-right: 8px; }
