/* Design system v1.0: tokens */
@font-face { font-family: "Inter"; src: url("../vendor/fonts/inter-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-soft: #EFF4FF;
  --primary-disabled: #BFD0F7;
  --navy: #0F2749;
  --navy-2: #173561;
  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --border: #E5E7EB;
  --border-soft: #F0F2F5;
  --text: #111827;
  --muted: #6B7280;
  --faint: #9CA3AF;
  --success: #10B981;
  --success-ink: #047857;
  --success-soft: #ECFDF5;
  --danger: #EF4444;
  --danger-ink: #B91C1C;
  --danger-soft: #FEF2F2;
  --warning-ink: #B45309;
  --warning-soft: #FFFBEB;
  --info-soft: #EFF6FF;
  --violet-soft: #F3F0FF;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --e1: 0 1px 2px rgba(16, 24, 40, .05);
  --e2: 0 4px 12px rgba(16, 24, 40, .08);
  --e3: 0 12px 32px rgba(16, 24, 40, .14);
  --brand: #D71920; /* company brand colour: logo mark + PDFs */
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-primary: var(--primary);
  --bs-primary-rgb: 37, 99, 235;
  --bs-link-color-rgb: 37, 99, 235;
}
html, body { background: var(--bg); color: var(--text); font-family: var(--bs-body-font-family); font-size: 14px; line-height: 20px; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.num, .value, .figure { font-variant-numeric: tabular-nums; }
h1, .h1 { font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -.02em; }
h2, .h2 { font-size: 24px; line-height: 32px; font-weight: 600; }
h3, .h3 { font-size: 18px; line-height: 28px; font-weight: 600; }
.caption { font-size: 12px; line-height: 16px; color: var(--muted); }

/* ---------- shell ---------- */
.app { display: flex; min-height: 100vh; padding: 8px 0 8px 8px; gap: 0; }
.sidebar {
  width: 248px; flex: 0 0 248px; background: var(--navy); color: #C7D2E5; border-radius: var(--r-md);
  position: sticky; top: 8px; height: calc(100vh - 16px); overflow-y: auto; scrollbar-width: thin;
}
.sidebar .brand { padding: 20px 16px 18px; display: flex; gap: 12px; align-items: center; }
.sidebar .brand img { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; background: #fff; padding: 3px; }
.sidebar .brand .mark { width: 40px; height: 40px; border-radius: 10px; background: var(--brand); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; flex: none; }
.sidebar .brand .name { color: #fff; font-weight: 600; font-size: 15px; line-height: 20px; }
.sidebar .brand small { color: #93A3BE; font-size: 12px; line-height: 16px; display: block; }
.sidebar nav { padding: 0 10px 24px; }
.sidebar .section { padding: 18px 8px 8px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #8193B2; font-weight: 600; }
.sidebar a.nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; margin: 2px 0; border-radius: var(--r-sm); color: #D5DEEC; font-weight: 450; }
.sidebar a.nav-item i { font-size: 17px; width: 20px; text-align: center; color: #AAB8D0; }
.sidebar a.nav-item:hover { background: var(--navy-2); color: #fff; }
.sidebar a.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(37, 99, 235, .35); }
.sidebar a.nav-item.active i { color: #fff; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 28px; position: sticky; top: 0; z-index: 20; background: rgba(246, 248, 251, .9); backdrop-filter: blur(8px); }
.search { position: relative; flex: 1; max-width: 460px; }
.search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px 56px 9px 36px; font-size: 14px; color: var(--text); box-shadow: var(--e1); }
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: var(--border-soft); color: var(--muted); border: 1px solid var(--border); border-radius: 6px; font-size: 11px; padding: 2px 6px; font-family: inherit; }
.top-tools { display: flex; align-items: center; gap: 18px; color: var(--text); }
.top-date { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13.5px; white-space: nowrap; }
.top-date i { color: var(--muted); }
.icon-btn { position: relative; width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--muted); background: transparent; border: 0; }
.icon-btn:hover { background: var(--surface); color: var(--text); box-shadow: var(--e1); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid var(--bg); }
.who { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.content { padding: 8px 28px 48px; width: 100%; max-width: 1520px; }

/* ---------- page head ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 4px 0 24px; }
.page-head h1 { font-size: 32px; line-height: 40px; font-weight: 700; margin: 0; letter-spacing: -.02em; color: var(--text); }
.page-head .sub { color: var(--muted); font-size: 15px; margin-top: 4px; }
.page-head .d-flex { flex-wrap: wrap; }

/* ---------- cards ---------- */
.card { border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--e1); background: var(--surface); }
.card-header { background: var(--surface); border-bottom: 1px solid var(--border-soft); font-weight: 600; font-size: 16px; line-height: 24px; padding: 16px 20px; color: var(--text); border-radius: var(--r-md) var(--r-md) 0 0 !important; }
.card-header a.small, .card-header .small { font-size: 13px; font-weight: 500; }
.card-body { padding: 20px; }
.list-group-item { border-color: var(--border-soft); padding: 12px 20px; }

/* stat card */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--e1); padding: 18px 20px; height: 100%; }
.stat .label { color: var(--text); font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.stat .value { font-size: 26px; line-height: 34px; font-weight: 700; margin-top: 14px; letter-spacing: -.02em; color: var(--text); }
.stat .foot { color: var(--muted); font-size: 13px; margin-top: 6px; }
.stat .value.pos, .value.pos { color: var(--success-ink); }
.stat .value.neg, .value.neg { color: var(--danger-ink); }
.ico { width: 32px; height: 32px; border-radius: var(--r-sm); display: inline-grid; place-items: center; font-size: 16px; flex: none; }
.ico.red { background: var(--danger-soft); color: var(--danger); }
.ico.violet { background: var(--violet-soft); color: #6D5BD0; }
.ico.amber { background: var(--warning-soft); color: #D97706; }
.ico.blue { background: var(--info-soft); color: var(--primary); }
.ico.green { background: var(--success-soft); color: var(--success); }

/* cash docket */
.docket { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--e1); overflow: hidden; height: 100%; }
.docket.cash { border-top: 3px solid var(--success); }
.docket.bank { border-top: 3px solid var(--primary); }
.docket .docket-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.docket .docket-head h2 { font-size: 17px; line-height: 24px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 10px; }
.docket.cash .docket-head h2 .ico { background: var(--success-soft); color: var(--success); }
.docket.bank .docket-head h2 .ico { background: var(--info-soft); color: var(--primary); }
.docket .docket-head a { font-size: 13.5px; font-weight: 500; }
.docket .perf { display: none; }
.docket .flow { display: grid; grid-template-columns: repeat(3, 1fr) auto; padding: 14px 20px 20px; gap: 12px; align-items: center; }
.docket .flow .k { color: var(--muted); font-size: 13.5px; margin-bottom: 6px; }
.docket .flow .v { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.docket .flow .v.in { color: var(--success-ink); }
.docket .flow .v.out { color: var(--danger); }
.docket .flow .close { border-radius: var(--r-sm); padding: 10px 16px; text-align: center; min-width: 120px; }
.docket.cash .flow .close { background: var(--success-soft); }
.docket.bank .flow .close { background: var(--info-soft); }
.docket .flow .close .v { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }

/* ---------- tables ---------- */
.table { margin: 0; --bs-table-bg: transparent; --bs-table-hover-bg: #F9FAFB; font-size: 13.5px; }
.table > :not(caption) > * > * { padding: 12px 16px; border-bottom-color: var(--border-soft); }
.table thead th { background: #F9FAFB; color: var(--muted); font-weight: 500; font-size: 12.5px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table-sm > :not(caption) > * > * { padding: 9px 14px; }
.table tfoot td, .table tfoot th { background: #F9FAFB; font-weight: 600; border-top: 1px solid var(--border); border-bottom: 0; }
.table td a:not(.btn) { font-weight: 500; }
.table tr.table-light td { --bs-table-bg: #F9FAFB; color: var(--muted); }
.card > .table-responsive:last-child .table tr:last-child td, .card > .table:last-child tr:last-child td { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pos { color: var(--success-ink); }
.neg { color: var(--danger-ink); }
code { color: var(--navy); background: var(--border-soft); padding: 2px 6px; border-radius: 6px; font-size: 12px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty-state { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty-state .ring { width: 56px; height: 56px; border-radius: 50%; background: var(--border-soft); display: grid; place-items: center; margin: 0 auto 14px; font-size: 22px; color: var(--muted); }
.empty-state strong { display: block; color: var(--text); font-weight: 500; margin-bottom: 2px; }

/* ---------- filters & forms ---------- */
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--e1); padding: 14px 16px; margin: 0 0 16px; }
.form-control, .form-select { border-color: var(--border); border-radius: var(--r-sm); padding: 9px 12px; font-size: 14px; color: var(--text); background-color: var(--surface); }
.form-control::placeholder { color: var(--faint); }
.form-control-sm, .form-select-sm { padding: 6px 10px; font-size: 13px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.form-control:disabled { background: var(--border-soft); }
.form-label { font-weight: 500; font-size: 13.5px; margin-bottom: 6px; color: var(--text); }
.helptext { color: var(--muted); font-size: 12px; line-height: 16px; margin-top: 4px; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-control-color { width: 64px; height: 40px; padding: 4px; }

/* ---------- buttons ---------- */
.btn { border-radius: var(--r-sm); font-weight: 500; font-size: 14px; padding: 8px 16px; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-brand, .btn-primary, .btn-dark { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-brand:hover, .btn-brand:focus, .btn-primary:hover, .btn-dark:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-brand:disabled, .btn-primary:disabled { background: var(--primary-disabled); border-color: var(--primary-disabled); }
.btn-outline-secondary, .btn-outline-dark { color: var(--text); border-color: var(--border); background: var(--surface); box-shadow: var(--e1); }
.btn-outline-secondary:hover, .btn-outline-dark:hover { background: #F9FAFB; color: var(--text); border-color: #D1D5DB; }
.btn-outline-success { color: var(--success-ink); border-color: #A7F3D0; background: var(--surface); }
.btn-outline-success:hover { background: var(--success-soft); color: var(--success-ink); border-color: var(--success); }
.btn-outline-danger { color: var(--danger-ink); border-color: #FECACA; background: var(--surface); }
.btn-outline-danger:hover { background: var(--danger-soft); color: var(--danger-ink); border-color: var(--danger); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-link { color: var(--primary); text-decoration: none; font-weight: 500; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--border-soft); }
.btn-group .btn { box-shadow: none; }
.btn-group .btn-dark { background: var(--primary); }
.dropdown-menu { border-color: var(--border); border-radius: var(--r-md); box-shadow: var(--e3); padding: 6px; font-size: 14px; }
.dropdown-item { border-radius: 6px; padding: 8px 12px; }
.dropdown-item:active { background: var(--primary); }
.dropdown-header { font-size: 12px; color: var(--muted); }
.pagination { gap: 6px; }
.pagination .page-link { color: var(--text); border: 1px solid var(--border); border-radius: var(--r-sm) !important; min-width: 32px; text-align: center; }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* ---------- badges ---------- */
.badge-status { font-weight: 500; font-size: 12px; padding: 4px 10px; border-radius: 20px; border: 1px solid transparent; }
.s-draft { background: #F3F4F6; color: #374151; border-color: #E5E7EB; }
.s-pending, .s-unpaid { background: #FEF9C3; color: #854D0E; border-color: #FDE68A; }
.s-submitted, .s-partial, .s-info { background: #DBEAFE; color: #1D4ED8; border-color: #BFDBFE; }
.s-approved { background: #EDE9FE; color: #5B21B6; border-color: #DDD6FE; }
.s-paid, .s-completed { background: #DCFCE7; color: #166534; border-color: #BBF7D0; }
.s-rejected, .s-cancelled { background: #FEE2E2; color: #B91C1C; border-color: #FECACA; }
.badge.text-bg-light { background: #F3F4F6 !important; color: #374151 !important; font-weight: 500; border: 1px solid var(--border); }

/* ---------- toasts ---------- */
.toast-stack { position: fixed; top: 16px; right: 16px; z-index: 1080; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.app-toast { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--r-md); box-shadow: var(--e3); padding: 14px 40px 14px 14px; display: flex; gap: 12px; position: relative; animation: toast-in .25s ease-out; }
.app-toast.success { border-left-color: var(--success); }
.app-toast.error { border-left-color: var(--danger); }
.app-toast.warning { border-left-color: #F59E0B; }
.app-toast .ico { width: 28px; height: 28px; }
.app-toast strong { display: block; font-weight: 600; font-size: 14px; }
.app-toast span { color: var(--muted); font-size: 13px; }
.app-toast .btn-close { position: absolute; top: 12px; right: 12px; font-size: 11px; }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- alerts (inline) ---------- */
.alert { border-radius: var(--r-md); border: 1px solid transparent; font-size: 14px; }
.alert-success { background: var(--success-soft); color: var(--success-ink); border-color: #A7F3D0; }
.alert-danger { background: var(--danger-soft); color: var(--danger-ink); border-color: #FECACA; }
.alert-info { background: var(--info-soft); color: #1D4ED8; border-color: #BFDBFE; }

/* ---------- confirm dialog page ---------- */
.confirm-card { max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--e3); padding: 24px; margin: 40px auto; }
.confirm-card h1 { font-size: 18px; line-height: 28px; font-weight: 600; margin: 0 0 8px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--surface); }
.login-art { position: relative; overflow: hidden; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; color: #C7D2E5;
  background: linear-gradient(90deg, rgba(8,24,56,.96) 0%, rgba(10,32,74,.9) 40%, rgba(10,32,74,.45) 58%, rgba(10,32,74,0) 74%), var(--hero) 40% center / cover no-repeat, var(--navy); }
.login-brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 600; font-size: 17px; }
.login-logo { width: 40px; height: 40px; border-radius: 10px; background: var(--brand, var(--primary)); color: #fff; display: grid; place-items: center; font-weight: 700; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.login-art h2 { color: #fff; font-size: clamp(34px, 3.4vw, 50px); line-height: 1.12; font-weight: 800; letter-spacing: -.03em; margin: 0; }
.login-art h2 span { display: block; color: #60A5FA; }
.login-art p { max-width: 40ch; color: #C7D2E5; margin: 18px 0 0; font-size: 16px; line-height: 26px; }
.login-features { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 14px; }
.login-features li { display: flex; align-items: center; gap: 16px; color: #fff; font-weight: 600; font-size: 14px; }
.login-features i { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; color: #DCE8FF;
  background: rgba(255,255,255,.08); border: 1px solid rgba(147,180,255,.22); backdrop-filter: blur(6px); }
.login-address { font-size: 13px; color: #9DAECB; }
.login-form { position: relative; overflow: hidden; display: grid; place-items: center; padding: 40px 24px; background: #FBFCFE; }
.login-form::before, .login-form::after { content: ""; position: absolute; border-radius: 50%; border: 56px solid #EEF3FC; pointer-events: none; }
.login-form::before { width: 320px; height: 320px; top: -150px; right: -110px; }
.login-form::after { width: 300px; height: 300px; bottom: -170px; right: -60px; }
.login-card { position: relative; z-index: 1; width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 20px; padding: 48px 44px 36px; box-shadow: 0 24px 60px rgba(16,24,40,.08); }
.login-card h1 { font-size: 30px; line-height: 38px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.login-card .form-label { font-weight: 500; }
.login-input { position: relative; }
.login-input > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 17px; pointer-events: none; }
.login-input .form-control { height: 50px; padding-left: 46px; padding-right: 48px; background: #F1F5FD; border-color: #DCE4F2; border-radius: 10px; }
.login-input .form-control:focus { background: #fff; }
.login-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none; border-radius: 8px; color: var(--muted); font-size: 17px; }
.login-eye:hover { color: var(--text); background: rgba(0,0,0,.04); }
.login-submit { height: 50px; border-radius: 10px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.login-help { margin: 28px 0 0; padding-top: 22px; border-top: 1px solid var(--border-soft); text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- responsive ---------- */
.mobile-toggle { display: none; }
.scrim { display: none; }
@media (max-width: 1200px) { .top-date { display: none; } }
@media (max-width: 992px) {
  .app { padding: 0; }
  .sidebar { position: fixed; left: -270px; top: 0; height: 100vh; border-radius: 0; z-index: 40; transition: left .2s ease; }
  .sidebar.open { left: 0; }
  .sidebar.open + .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 39, 73, .35); z-index: 30; }
  .mobile-toggle { display: inline-flex; }
  .content { padding: 8px 16px 48px; }
  .topbar { padding: 10px 16px; }
  .search kbd { display: none; }
  .page-head h1 { font-size: 26px; line-height: 34px; }
  .docket .flow { grid-template-columns: repeat(3, 1fr); }
  .docket .flow .close { grid-column: 1 / -1; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
}
@media (max-width: 576px) { .login-card { padding: 32px 22px 26px; } .search { display: none; } .who .d-sm-inline { display: none; } }
@media (prefers-reduced-motion: reduce) { .sidebar, .app-toast { transition: none; animation: none; } }
@media print { .sidebar, .topbar, .no-print, .filters, .scrim, .toast-stack { display: none !important; } .content { padding: 0; } .app { padding: 0; } }
.page-head .btn-sm { padding: 8px 16px; font-size: 14px; }
.page-head .form-control-sm { padding: 8px 12px; font-size: 14px; }

/* ---------- density pass: match reference proportions ---------- */
.app { padding: 8px 0 8px 8px; }
.sidebar { width: 232px; flex-basis: 232px; }
.sidebar .brand { padding: 16px 14px 14px; }
.sidebar .brand img, .sidebar .brand .mark { width: 36px; height: 36px; font-size: 16px; }
.sidebar .brand .name { font-size: 14px; }
.sidebar .section { padding: 14px 8px 6px; font-size: 10.5px; }
.sidebar a.nav-item { padding: 7px 10px; font-size: 13.5px; gap: 11px; }
.sidebar a.nav-item i { font-size: 16px; }
.topbar { padding: 10px 24px; }
.search input { padding: 8px 56px 8px 36px; font-size: 13.5px; }
.content { padding: 6px 24px 40px; max-width: none; }
.page-head { margin: 2px 0 18px; }
.page-head h1 { font-size: 28px; line-height: 36px; }
.page-head .sub { font-size: 14px; margin-top: 2px; }
.card-header { font-size: 15px; padding: 13px 18px; }
.card-body { padding: 16px 18px; }
.stat { padding: 14px 16px; }
.stat .label { font-size: 13px; gap: 9px; }
.stat .value { font-size: 22px; line-height: 30px; margin-top: 10px; }
.stat .foot { font-size: 12.5px; margin-top: 2px; }
.ico { width: 30px; height: 30px; font-size: 15px; }
.docket .docket-head { padding: 14px 18px 4px; }
.docket .docket-head h2 { font-size: 15.5px; }
.docket .flow { padding: 10px 18px 16px; }
.docket .flow .k { font-size: 12.5px; margin-bottom: 4px; }
.docket .flow .v { font-size: 16px; }
.docket .flow .close { padding: 8px 14px; min-width: 110px; }
.docket .flow .close .v { font-size: 21px; }
.table > :not(caption) > * > * { padding: 10px 14px; }
.table-sm > :not(caption) > * > * { padding: 8px 12px; }
.chart-box { position: relative; height: 210px; }
.empty-state { padding: 26px 16px; }
.empty-state .ring { width: 48px; height: 48px; font-size: 20px; margin-bottom: 10px; }
.form-card { width: 100%; }
.range-select { width: auto; padding: 5px 30px 5px 10px; font-size: 13px; }

/* ---------- sectioned forms ---------- */
.form-section { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding: 22px 22px; border-bottom: 1px solid var(--border-soft); }
.form-section:last-of-type { border-bottom: 0; }
.form-section-head h3 { font-size: 15px; line-height: 22px; font-weight: 600; margin: 0; color: var(--text); }
.form-section-head p { font-size: 12.5px; line-height: 18px; color: var(--muted); margin: 4px 0 0; }
.form-actions { display: flex; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: #FAFBFC; border-radius: 0 0 var(--r-md) var(--r-md); }
.route { display: grid; grid-template-columns: 1fr 36px 1fr; align-items: stretch; }
.route-leg { background: #FAFBFC; border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px 16px; }
.route-title { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.route-title i { color: var(--primary); }
.route-arrow { display: grid; place-items: center; color: var(--faint); font-size: 18px; }
@media (max-width: 992px) {
  .form-section { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 18px 16px; }
  .route { grid-template-columns: 1fr; gap: 10px; }
  .route-arrow { transform: rotate(90deg); height: 20px; }
  .form-actions { padding: 12px 16px; }
}
.docket .flow .v { white-space: nowrap; }

/* ---------- product picker / POS ---------- */
.picker { position: relative; }
.picker-input { font-size: 16px; padding: 12px 14px 12px 42px !important; }
.picker .bi-upc-scan { position: absolute; left: 14px; top: 13px; font-size: 18px; color: var(--muted); }
.picker-results { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--e3); max-height: 360px; overflow: auto; padding: 4px; }
.picker-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.picker-item:hover, .picker-item.active { background: var(--primary-soft); }
.picker-status { font-size: 13px; margin-top: 6px; min-height: 18px; }
.picker-status.error { color: var(--danger-ink); }
.picker-status.muted { color: var(--muted); }
.camera-box { margin-top: 10px; border-radius: var(--r-md); overflow: hidden; max-width: 420px; border: 1px solid var(--border); }
.btn.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.lines td { vertical-align: middle; }
.lines input.form-control { padding: 6px 8px; font-size: 14px; min-width: 70px; }
.lines .qty { width: 84px; }
.lines .rm { color: var(--faint); border: 0; background: none; font-size: 18px; }
.lines .rm:hover { color: var(--danger); }
.pos-screen { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; }
.pos-side { position: sticky; top: 74px; }
.held-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.held-title { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 4px; }
.held-chip .btn { white-space: nowrap; }
.held-chip .caption { color: inherit; opacity: .7; }
.pos-total { font-size: 38px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.sum-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.sum-row.big { font-size: 17px; font-weight: 600; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; }
.pay-row { display: grid; grid-template-columns: 110px 1fr 28px; gap: 8px; margin-bottom: 8px; align-items: center; }
.kbd-hint { font-size: 12px; color: var(--muted); }
.kbd-hint kbd { background: var(--border-soft); color: var(--text); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; font-family: inherit; font-size: 11px; }
@media (max-width: 1100px) { .pos-screen { grid-template-columns: 1fr; } .pos-side { position: static; } }
.lines select.form-select { min-width: 78px; padding-right: 26px; }
.pos-screen > div { min-width: 0; }
@media (max-width: 576px) { .pos-screen .picker-input { font-size: 15px; } .lines th:nth-child(4), .lines td:nth-child(4) { display: none; } }
@media (max-width: 576px) {
  .pos-cart thead { display: none; }
  .pos-cart tr { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 8px 8px; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); }
  .pos-cart td { padding: 0 !important; border: 0 !important; }
  .pos-cart td:nth-child(1) { grid-column: 1 / 4; grid-row: 1; }
  .pos-cart td:nth-child(6) { grid-column: 4; grid-row: 1; justify-self: end; }
  .pos-cart td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .pos-cart td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .pos-cart td:nth-child(4) { display: none; }
  .pos-cart td:nth-child(5) { grid-column: 3 / 5; grid-row: 2; text-align: right; }
  .pos-cart td:nth-child(2) input { width: 84px !important; margin: 0 !important; }
  .pos-cart .qty { width: 48px; padding: 6px 4px; }
  .pos-cart td[colspan] { grid-column: 1 / -1; grid-row: 1; }
}
@media (max-width: 1100px) { .pos-recent { display: none; } }

/* ---------- sidebar: collapsible groups ---------- */
.sidebar { background: linear-gradient(180deg, #0F2749 0%, #0C2142 60%, #0E2A55 100%); }
.sidebar nav { padding: 4px 12px 24px; }
.sidebar nav .nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 3px 0; border-radius: 10px; color: #D5DEEC; font-weight: 500; font-size: 14px; cursor: pointer; }
.sidebar nav .nav-item i { font-size: 18px; width: 20px; text-align: center; color: #AAB8D0; }
.sidebar nav .nav-item:hover { background: var(--navy-2); color: #fff; }
.sidebar .nav-group > summary { list-style: none; }
.sidebar .nav-group > summary::-webkit-details-marker { display: none; }
.sidebar .nav-group > summary::after { content: "\F282"; font-family: "bootstrap-icons"; margin-left: auto; font-size: 11px; color: #7F91B0; transition: transform .15s ease; }
.sidebar .nav-group[open] > summary::after { transform: rotate(180deg); }
.sidebar .nav-group[open] > summary { color: #fff; }
.sidebar nav .nav-sub a.nav-item { padding: 7px 12px 7px 44px; margin: 1px 0; font-size: 13.5px; font-weight: 450; color: #B9C6DC; position: relative; }
.sidebar nav .nav-sub a.nav-item::before { content: ""; position: absolute; left: 21px; top: 0; bottom: 0; border-left: 1px solid rgba(170, 184, 208, .2); }
.sidebar nav .nav-sub a.nav-item.active { background: rgba(37, 99, 235, .22); color: #fff; box-shadow: none; font-weight: 600; }
.sidebar nav .nav-sub a.nav-item.active::before { border-left: 2px solid #60A5FA; }
.sidebar > nav > a.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 6px 16px rgba(37, 99, 235, .4); }
.sidebar > nav > a.nav-item.active i { color: #fff; }

/* ---------- dashboard ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 4px 0 18px; }
.dash-hello { display: flex; align-items: center; gap: 14px; }
.dash-hello .wave { font-size: 40px; line-height: 1; }
.dash-hello h1 { font-size: 30px; line-height: 38px; font-weight: 800; letter-spacing: -.025em; margin: 0; }
.dash-hello .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.dash-tip { display: flex; align-items: center; gap: 14px; padding: 12px 18px 12px 12px; border-radius: var(--r-md); background: linear-gradient(90deg, #E6EEFD, #F2F6FE); border: 1px solid #DCE6FA; color: var(--muted); font-size: 12.5px; line-height: 18px; max-width: 440px; }
.dash-tip strong { display: block; color: var(--primary); font-size: 14px; font-weight: 600; }
.dash-tip:hover { color: var(--muted); border-color: #BFD0F7; }
.dash-tip-img { width: 76px; height: 52px; object-fit: contain; mix-blend-mode: multiply; flex: none; }
.dash-tip-ico { width: 52px; height: 44px; border-radius: 10px; background: #fff; display: grid; place-items: center; font-size: 24px; color: var(--primary); box-shadow: var(--e1); flex: none; }

.quick-actions { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
/* quick-action tiles: see "dashboard v2" below */

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.dash-side { position: sticky; top: 74px; }

.glance-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px 4px; }
.glance-item { display: flex; align-items: center; gap: 10px; padding: 14px 12px; color: var(--text); border-left: 1px solid var(--border-soft); border-radius: 0; min-width: 0; }
.glance-item:first-child { border-left: 0; }
.glance-item:hover { background: #F9FAFB; color: var(--text); }
.glance-item .ico { width: 36px; height: 36px; border-radius: 10px; font-size: 17px; }
.glance-item > span:nth-child(2) { min-width: 0; flex: 1; }
.glance-item .k { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glance-item .v { display: block; font-size: 17px; line-height: 26px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glance-item .f { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glance-item .go { color: var(--faint); font-size: 11px; margin-left: -4px; }
@media (max-width: 1700px) { .glance-item .go { display: none; } }

.work-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.work-head h2 { font-size: 20px; line-height: 28px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.work-head .sub { color: var(--muted); font-size: 13px; }
.work-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.work-tabs button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: var(--r-sm); padding: 6px 12px; font-size: 13px; font-weight: 500; }
.work-tabs button:hover { border-color: #D1D5DB; }
.work-tabs button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.work-card { overflow: hidden; }
.work-card[hidden] { display: none; }
.work-card-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-weight: 600; font-size: 14px; }
.work-card-head a { margin-left: auto; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.work-card-head .ico { width: 28px; height: 28px; font-size: 14px; }
.tint-red .work-card-head { background: #FFF5F5; }
.tint-amber .work-card-head { background: #FFF9EE; }
.tint-green .work-card-head { background: #F0FBF6; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; font-size: 12px; font-weight: 600; color: #fff; }
.count.red { background: #EF4444; } .count.amber { background: #F59E0B; } .count.green { background: #10B981; }
.table.mini { font-size: 13px; }
.table.mini > :not(caption) > * > * { padding: 9px 14px; }
.table.mini thead th { background: transparent; font-size: 12px; }
.work-card .empty-state { padding: 22px 14px; font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip.red { background: #FEE2E2; color: #B91C1C; }
.chip.amber { background: #FEF3C7; color: #92400E; }
.chip.green { background: var(--success-soft); color: var(--success-ink); border: 1px solid #A7F3D0; }
.chip.grey { background: #F3F4F6; color: #374151; }
.chip i { font-size: 9px; }

.month-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.month-strip .m { padding: 14px 18px; border-left: 1px solid var(--border-soft); }
.month-strip .m:first-child { border-left: 0; }
.month-strip .k { display: block; color: var(--muted); font-size: 12.5px; }
.month-strip .v { display: block; font-size: 18px; line-height: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.month-strip .f { display: block; color: var(--muted); font-size: 12px; }

.drawer .drow { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; color: var(--muted); }
.drawer .drow .num { color: var(--text); font-weight: 500; }
.drawer .drow .num.up { color: var(--success-ink); }
.drawer .drow .num.down { color: var(--danger); }
.drawer .drow.total { border-top: 1px solid var(--border-soft); margin-top: 8px; padding-top: 14px; color: var(--text); font-weight: 500; }
.drawer .drow.total .num { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.drawer .drow.bank { font-size: 13px; padding-top: 10px; }
.drawer .btn { padding: 11px 16px; }

.timeline { list-style: none; margin: 0; padding: 8px 0; position: relative; }
.timeline li a { display: grid; grid-template-columns: 58px 32px 1fr auto; align-items: center; gap: 10px; padding: 10px 18px; color: var(--text); position: relative; }
.timeline li a:hover { background: #F9FAFB; }
.timeline li a::before { content: ""; position: absolute; left: 102px; top: 0; bottom: 0; border-left: 1px dashed var(--border); z-index: 0; }
.timeline li:first-child a::before { top: 50%; } .timeline li:last-child a::before { bottom: 50%; }
.timeline .t { font-size: 12px; color: var(--muted); white-space: nowrap; }
.timeline .ico { position: relative; z-index: 1; width: 32px; height: 32px; }
.timeline .what { min-width: 0; }
.timeline .what strong { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline .what span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline .amt { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.timeline .amt.down { color: var(--danger); }
.glance-item .v.down { color: var(--danger-ink); }
.month-strip .v.up { color: var(--success-ink); } .month-strip .v.down { color: var(--danger-ink); }

@media (max-width: 1500px) { .quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1400px) { .glance-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } .glance-item:nth-child(4) { border-left: 0; } }
@media (max-width: 1280px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .work-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qa kbd { display: none; }
  .glance-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .glance-item { border-left: 0; }
  .work-grid, .dash-side { grid-template-columns: 1fr; }
  .month-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .month-strip .m:nth-child(3) { border-left: 0; }
  .dash-tip { display: none; }
  .dash-hello h1 { font-size: 24px; line-height: 32px; }
  .dash-hello .wave { font-size: 30px; }
}
@media (max-width: 480px) { .glance-row { grid-template-columns: 1fr; } .glance-item + .glance-item { border-top: 1px solid var(--border-soft); } }

/* ---------- phone app shell: tab bar, search, stacked tables ---------- */
.tabbar, .search-toggle, .search-close { display: none; }
@media (max-width: 992px) {
  .topbar { padding-top: calc(10px + env(safe-area-inset-top)); }
  .content { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--border);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(16, 24, 40, .06); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; font-size: 11px; font-weight: 500;
    color: var(--muted); background: none; border: 0; }
  .tabbar i { font-size: 21px; line-height: 1; }
  .tabbar .on { color: var(--primary); }
  .tabbar .tab-main { margin-top: -26px; color: var(--text); }
  .tab-fab { width: 54px; height: 54px; border-radius: 17px; background: var(--primary); display: grid; place-items: center;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .4); border: 3px solid #fff; }
  .tabbar .tab-fab i { color: #fff; font-size: 24px; }
  .sidebar { z-index: 45; }
  .sidebar.open + .scrim { z-index: 40; }
  .toast-stack { top: calc(12px + env(safe-area-inset-top)); }
}
@media (max-width: 576px) {
  .search-toggle { display: grid; }
  body.searching .search { display: block; position: absolute; left: 12px; right: 12px; top: calc(8px + env(safe-area-inset-top)); max-width: none; z-index: 5; }
  body.searching .search input { padding: 11px 44px 11px 38px; font-size: 16px; }
  body.searching .search-close { display: grid; place-items: center; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border: 0; background: none; color: var(--muted); }
  .topbar { position: sticky; }
  .page-head { margin-bottom: 14px; }
  .page-head h1 { font-size: 24px; line-height: 32px; }
  .page-head > .d-flex, .page-head > div:last-child { width: 100%; }

  .table-responsive:has(> .table.stack) { overflow: visible; }
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tfoot, .table.stack tr { display: block; width: 100%; }
  .table.stack tbody tr, .table.stack tfoot tr { padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
  .table.stack tfoot tr { background: #F9FAFB; }
  .table.stack > :not(caption) > * > * { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 3px 0;
    border: 0; text-align: right; white-space: normal; background: transparent; box-shadow: none; }
  .table.stack td::before { content: attr(data-label); flex: none; max-width: 45%; color: var(--muted); font-size: 12.5px; font-weight: 500; text-align: left; }
  .table.stack td:not([data-label])::before, .table.stack td:first-child::before { display: none; }
  .table.stack tbody td:first-child { justify-content: flex-start; text-align: left; font-size: 15px; font-weight: 600; padding-bottom: 6px; }
  .table.stack td[colspan] { display: block; text-align: center; }
  .table.stack td:empty, .table.stack .m-hide { display: none; }
  .table.stack .btn { padding: 5px 10px; }
}

/* ---------- offline page ---------- */
.offline-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.offline-card { max-width: 380px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 32px 26px; box-shadow: var(--e2); }
.offline-card h1 { font-size: 22px; line-height: 30px; margin: 14px 0 8px; }
.offline-card p { color: var(--muted); margin-bottom: 20px; }
.offline-ico { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto; display: grid; place-items: center; font-size: 28px; background: var(--primary-soft); color: var(--primary); }
@media (display-mode: standalone) { .login-help { display: none; } }

/* ---------- send bill dialog ---------- */
.modal-content { border: 0; border-radius: var(--r-lg); box-shadow: var(--e3); }
.modal-header { border-bottom-color: var(--border-soft); }
.send-options { display: grid; gap: 10px; }
.send-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--r-md); background: var(--surface); color: var(--muted); font-size: 13px; line-height: 18px; }
.send-opt:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--muted); }
.send-opt strong { display: block; color: var(--text); font-size: 14.5px; }
.send-opt .ico { width: 38px; height: 38px; font-size: 18px; }
.send-divider { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.send-divider::before, .send-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* ---------- pager ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--border-soft); }
.pager-info { color: var(--muted); font-size: 13px; }
.pager-info b { color: var(--text); font-weight: 600; }
.pager .pagination { gap: 4px; flex-wrap: wrap; }
.pager .page-link { display: inline-flex; align-items: center; justify-content: center; gap: 2px; min-width: 34px; height: 34px; padding: 0 10px; font-size: 13px; color: var(--text); border-radius: var(--r-sm) !important; }
.pager .page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager .page-item.disabled .page-link { color: var(--faint); background: var(--surface); }
.pager .pg-compact { display: none; }
.pager-size { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin: 0; }
.pager-size .form-select { width: auto; padding: 5px 28px 5px 10px; }
@media (max-width: 576px) {
  .pager { justify-content: center; }
  .pager-info { width: 100%; text-align: center; }
  .pager .pg-num { display: none; }
  .pager .pg-compact { display: list-item; }
  .pager .pg-word { display: none; }
  .pager .page-link { min-width: 44px; height: 40px; }
}

/* UPI QR on the POS screen */
.upi-box { display: flex; gap: 12px; align-items: center; margin-top: 10px; padding: 10px; border: 1px dashed var(--bs-border-color, #d0d4d9); border-radius: 10px; background: #fff; }
.upi-box img { width: 130px; height: 130px; flex: none; }
.upi-amt { font-size: 20px; font-weight: 700; }
.upi-overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(10, 14, 24, .72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.upi-overlay[hidden], .upi-box[hidden] { display: none; }
.upi-card { background: #fff; color: #111; border-radius: 16px; padding: 24px; text-align: center; max-width: 420px; width: 100%; }
.upi-card img { display: block; margin: 8px auto; width: min(320px, 80vw); height: auto; aspect-ratio: 1; }
.upi-shop { font-weight: 700; font-size: 18px; margin-bottom: 6px; }
.upi-amt-big { font-size: 34px; font-weight: 800; margin: 4px 0; }
.upi-card .num { text-align: center; }
.upi-box img, .upi-card img { background: #fff; image-rendering: crisp-edges; }
.upi-qr svg { width: 100%; height: 100%; }

/* Software licence */
.license-banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; text-decoration: none; border: 1px solid transparent; }
.license-banner i { font-size: 18px; }
.license-banner.amber { background: #FEF3C7; color: #92400E; border-color: #FCD34D; }
.license-banner.red { background: #FEE2E2; color: #991B1B; border-color: #FCA5A5; }
.license-banner:hover { filter: brightness(.98); }
.license-card .card-body { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.license-card .lc-main { flex: 1 1 220px; min-width: 0; }
.license-card .lc-meter { display: flex; align-items: baseline; gap: 6px; }
.license-card .lc-meter b { font-size: 26px; line-height: 1; }
.license-card .lc-contact { text-align: right; }
@media (max-width: 576px) { .license-card .lc-contact { text-align: left; } }

/* Licence card at the foot of the sidebar (admins) */
.sidebar { display: flex; flex-direction: column; }
.sidebar nav { flex: 1 0 auto; }
.side-licence { display: block; margin: 0 12px 12px; padding: 12px; border-radius: 12px; background: var(--navy-2);
  border: 1px solid rgba(255,255,255,.08); color: #D5DEEC; font-size: 12px; line-height: 1.35; flex: none; }
.side-licence:hover { background: #1d3f72; color: #fff; }
.side-licence .sl-top { display: flex; align-items: center; gap: 6px; font-weight: 600; color: #fff; font-size: 12.5px; }
.side-licence .sl-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex: none; }
.side-licence.amber .sl-dot { background: #f59e0b; } .side-licence.red .sl-dot { background: #ef4444; }
.side-licence .sl-plan { margin-left: auto; font-weight: 500; color: #93A3BE; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }
.side-licence .sl-days { margin-top: 8px; color: #AAB8D0; }
.side-licence .sl-days b { font-size: 20px; color: #fff; margin-right: 2px; }
.side-licence .sl-bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.12); margin: 6px 0; overflow: hidden; }
.side-licence .sl-bar i { display: block; height: 100%; background: #22c55e; border-radius: 4px; }
.side-licence.amber .sl-bar i { background: #f59e0b; } .side-licence.red .sl-bar i { background: #ef4444; }
.side-licence .sl-foot { color: #93A3BE; margin-top: 4px; }
.side-licence .sl-vendor { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.08); color: #93A3BE; font-size: 11px; }

/* Forms without sections still need breathing room inside the card. */
.form-plain { padding: 22px; margin: 0; }
@media (max-width: 767.98px) { .form-plain { padding: 16px; } }

/* ---------- floating icon rail (desktop) ---------- */
.nav-sub-title { display: none; }
.rail-toggle { display: none; }
@media (min-width: 993px) {
  :root { --bg: #F3F4FA; }
  .app { padding: 12px 0 12px 12px; }
  .sidebar { border-radius: 22px; top: 12px; height: calc(100vh - 24px); box-shadow: 0 10px 30px rgba(15, 39, 73, .18); }
  .rail-toggle { display: flex; align-items: center; gap: 10px; margin: 0 12px 12px; padding: 9px 12px; border: 0; border-radius: 10px; background: rgba(255,255,255,.06); color: #AAB8D0; font-size: 13px; }
  .rail-toggle:hover { background: rgba(255,255,255,.12); color: #fff; }
  .rail-toggle i { font-size: 17px; width: 20px; text-align: center; }

  html.nav-rail .sidebar { width: 76px; flex: 0 0 76px; overflow: visible; z-index: 50; }
  html.nav-rail .sidebar .brand { justify-content: center; padding: 16px 0 12px; }
  html.nav-rail .sidebar .brand > div { display: none; }
  html.nav-rail .sidebar nav { padding: 4px 12px 12px; }
  html.nav-rail .sidebar nav > .nav-item, html.nav-rail .sidebar .nav-group > summary { justify-content: center; padding: 0; height: 46px; width: 52px; margin: 6px 0; font-size: 0; border-radius: 14px; gap: 0; }
  html.nav-rail .sidebar nav .nav-item i { font-size: 20px; width: auto; }
  html.nav-rail .sidebar .nav-group > summary::after { display: none; }
  html.nav-rail .sidebar .nav-group { position: relative; }
  html.nav-rail .sidebar .nav-group.here > summary { background: rgba(37, 99, 235, .28); }
  html.nav-rail .sidebar .nav-group.here > summary i { color: #fff; }
  html.nav-rail .sidebar .nav-sub { display: none; position: absolute; left: 100%; top: -8px; padding-left: 14px; z-index: 60; }
  html.nav-rail .sidebar .nav-group:hover > .nav-sub, html.nav-rail .sidebar .nav-group:focus-within > .nav-sub { display: block; }
  html.nav-rail .sidebar .nav-sub-inner { min-width: 220px; padding: 8px; border-radius: 16px; background: #fff; box-shadow: 0 16px 40px rgba(15, 39, 73, .22); border: 1px solid var(--border-soft); }
  html.nav-rail .sidebar .nav-sub-title { display: block; padding: 6px 12px 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
  html.nav-rail .sidebar nav .nav-sub a.nav-item { padding: 8px 12px; margin: 1px 0; color: var(--text); font-weight: 500; border-radius: 10px; }
  html.nav-rail .sidebar nav .nav-sub a.nav-item::before { display: none; }
  html.nav-rail .sidebar nav .nav-sub a.nav-item:hover { background: var(--primary-soft); color: var(--primary); }
  html.nav-rail .sidebar nav .nav-sub a.nav-item.active { background: var(--primary); color: #fff; }
  /* plain rail links show their name as a small tag on hover */
  html.nav-rail .sidebar nav > a.nav-item { position: relative; }
  html.nav-rail .sidebar nav > a.nav-item:hover::after { content: attr(data-label); position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%); white-space: nowrap; background: var(--navy); color: #fff; font-size: 13px; font-weight: 500; padding: 6px 10px; border-radius: 8px; box-shadow: var(--e2); z-index: 60; }
  html.nav-rail .side-licence { margin: 0 10px 10px; padding: 10px 0; text-align: center; }
  html.nav-rail .side-licence > *:not(.sl-top) { display: none; }
  html.nav-rail .side-licence .sl-top { justify-content: center; font-size: 0; }
  html.nav-rail .side-licence .sl-top .sl-plan { display: none; }
  html.nav-rail .side-licence .sl-dot { width: 12px; height: 12px; }
  html.nav-rail .rail-toggle { justify-content: center; margin: 0 12px 14px; padding: 10px 0; }
  html.nav-rail .rail-toggle span { display: none; }
}

/* ---------- dashboard v2: soft cards, big tiles, launcher ---------- */
.t-blue { --t: #2563EB; --t-bg: #E8EFFE; } .t-sky { --t: #0EA5E9; --t-bg: #E3F4FC; } .t-green { --t: #10B981; --t-bg: #E2F7EE; }
.t-amber { --t: #F59E0B; --t-bg: #FEF3DC; } .t-violet { --t: #7C6CF0; --t-bg: #EEEBFE; } .t-red { --t: #EF4444; --t-bg: #FDE8E8; }
.t-slate { --t: #475569; --t-bg: #EEF0F4; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin: 6px 0 22px; }
.hero h1 { font-size: 34px; line-height: 42px; font-weight: 800; letter-spacing: -.03em; margin: 0; }
.hero p { margin: 4px 0 0; font-size: 18px; line-height: 26px; color: #4B5563; font-weight: 500; }
.hero-sub { display: block; font-size: 13px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.hero-tip { display: flex; align-items: center; gap: 14px; padding: 12px 20px 12px 12px; border-radius: 22px; background: #fff; box-shadow: 0 6px 20px rgba(15, 39, 73, .06); color: var(--muted); font-size: 12.5px; line-height: 18px; max-width: 420px; }
.hero-tip strong { display: block; color: var(--text); font-size: 14px; }
.hero-tip img { width: 84px; height: 58px; object-fit: contain; mix-blend-mode: multiply; flex: none; }
.hero-tip:hover { color: var(--muted); box-shadow: var(--e2); }

.quick-actions { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.qa { position: relative; display: flex; flex-direction: column; padding: 18px 18px 16px; min-height: 150px; border-radius: 24px; background: #fff; color: var(--muted); font-size: 12.5px; line-height: 17px; box-shadow: 0 6px 20px rgba(15, 39, 73, .06); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.qa::after { content: ""; position: absolute; right: -36px; bottom: -36px; width: 120px; height: 120px; border-radius: 50%; background: var(--t-bg); z-index: 0; }
.qa > * { position: relative; z-index: 1; }
.qa:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(15, 39, 73, .12); color: var(--muted); }
.qa-art { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; font-size: 26px; color: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--t) 75%, #fff), var(--t)); box-shadow: 0 8px 18px color-mix(in srgb, var(--t) 35%, transparent); margin-bottom: auto; }
.qa strong { display: block; color: var(--text); font-size: 15.5px; font-weight: 700; margin: 16px 0 2px; }
.qa kbd { position: absolute; top: 16px; right: 16px; background: var(--t-bg); color: var(--t); border: 0; border-radius: 8px; font: 700 11px/1 inherit; padding: 5px 7px; }
.qa.t-blue { background: linear-gradient(140deg, #2F6BF0, #1E4FD8); color: #DCE8FF; }
.qa.t-blue strong { color: #fff; }
.qa.t-blue .qa-art { background: rgba(255,255,255,.2); box-shadow: none; }
.qa.t-blue kbd { background: rgba(255,255,255,.2); color: #fff; }
.qa.t-blue::after { background: rgba(255,255,255,.1); }

.dash-grid .card, .launch { border: 0; border-radius: 24px; box-shadow: 0 6px 20px rgba(15, 39, 73, .06); }
.dash-grid .card-header { background: transparent; border-bottom: 1px solid var(--border-soft); }
.launcher .work-head { margin-bottom: 12px; }
.launch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.launch { background: #fff; padding: 16px; display: flex; flex-direction: column; }
.launch-head { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--text); margin-bottom: 8px; }
.launch-ico { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: var(--t-bg); color: var(--t); font-size: 18px; flex: none; }
.launch a { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; margin: 0 -6px; border-radius: 10px; color: #374151; font-size: 13.5px; }
.launch a::after { content: "\F285"; font-family: "bootstrap-icons"; font-size: 11px; color: var(--faint); opacity: 0; transition: opacity .12s; }
.launch a:hover { background: var(--t-bg); color: var(--t); }
.launch a:hover::after { opacity: 1; color: var(--t); }

.drawer.promo { background: linear-gradient(150deg, #4F46E5 0%, #2563EB 55%, #1E40AF 100%); color: #DCE4FF; position: relative; overflow: hidden; }
.drawer.promo::before { content: ""; position: absolute; width: 220px; height: 220px; right: -70px; top: -80px; border-radius: 50%; background: rgba(255,255,255,.09); }
.drawer.promo .card-header { color: #fff; border-bottom-color: rgba(255,255,255,.14); position: relative; }
.drawer.promo .card-header .ico { background: rgba(255,255,255,.18); color: #fff; }
.drawer.promo .chip { background: rgba(255,255,255,.16); color: #fff; }
.drawer.promo .card-body { position: relative; }
.drawer.promo .drow { color: #C9D4FF; }
.drawer.promo .drow .num, .drawer.promo .drow.total { color: #fff; }
.drawer.promo .drow .num.up { color: #A7F3D0; } .drawer.promo .drow .num.down { color: #FECACA; }
.drawer.promo .drow.total { border-top-color: rgba(255,255,255,.18); }
.drawer.promo .drow.total .num { font-size: 26px; }
.drawer.promo .btn { background: #fff; color: #1E3A8A; border: 0; font-weight: 600; border-radius: 14px; }
.drawer.promo .btn:hover { background: #EEF2FF; }

.month-strip .m-ring { display: flex; align-items: center; gap: 12px; }
.ring-prog { --c: #7C6CF0; width: 54px; height: 54px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #ECEAFB 0); }
.ring-prog b { width: 42px; height: 42px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 12px; color: var(--text); }
@media (max-width: 1400px) { .quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 768px) {
  .hero h1 { font-size: 26px; line-height: 34px; } .hero p { font-size: 15px; } .hero-tip { display: none; }
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .qa { min-height: 128px; padding: 14px; border-radius: 20px; } .qa-art { width: 44px; height: 44px; font-size: 21px; border-radius: 14px; }
  .launch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
@media (max-width: 340px) { .launch-grid { grid-template-columns: 1fr; } }
@media (max-width: 576px) { .launch { padding: 12px; border-radius: 18px; } .launch a { font-size: 13px; padding: 5px 8px; } .launch-head { font-size: 14px; } .launch-ico { width: 32px; height: 32px; font-size: 15px; } }

/* ---------- dashboard v2: compact sizes ---------- */
.hero { margin: 2px 0 14px; }
.hero h1 { font-size: 26px; line-height: 34px; }
.hero p { font-size: 15px; line-height: 22px; margin-top: 2px; }
.hero-sub { font-size: 12.5px; margin-top: 0; }
.hero-tip { padding: 8px 16px 8px 8px; border-radius: 16px; max-width: 380px; }
.hero-tip img { width: 64px; height: 44px; }
.quick-actions { gap: 12px; margin-bottom: 16px; }
.qa { flex-direction: row; align-items: center; gap: 12px; min-height: 0; padding: 14px 14px; border-radius: 18px; }
.qa::after { width: 80px; height: 80px; right: -28px; bottom: -34px; }
.qa-art { width: 40px; height: 40px; border-radius: 13px; font-size: 19px; margin: 0; flex: none; box-shadow: 0 5px 12px color-mix(in srgb, var(--t) 30%, transparent); }
.qa-body { min-width: 0; flex: 1; padding-right: 18px; }
.qa strong { font-size: 14px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qa-txt { min-width: 0; display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qa kbd { top: 8px; right: 8px; font-size: 10px; padding: 3px 5px; }
.dash-grid .card, .launch { border-radius: 18px; }
.launcher .work-head h2 { font-size: 18px; line-height: 26px; }
.launch-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.launch { padding: 12px; }
.launch-head { font-size: 14px; gap: 8px; margin-bottom: 4px; }
.launch-ico { width: 30px; height: 30px; border-radius: 10px; font-size: 15px; }
.launch a { padding: 4px 8px; font-size: 13px; line-height: 18px; }
@media (max-width: 768px) { .qa { padding: 12px; } .qa-art { width: 36px; height: 36px; font-size: 17px; } }

/* ---------- UAT fixes 2026-11-11 ---------- */
/* Dashboard: grids fill the row with however many tiles the role can see (staff see fewer). */
.dash-grid.no-side { grid-template-columns: minmax(0, 1fr); }
.quick-actions { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.glance-row { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.work-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.month-strip { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.glance-item { border-left: 0; box-shadow: -1px 0 0 var(--border-soft); }
/* Long amounts must never spill out of their box. */
.month-strip .m, .month-strip .m-ring > span:last-child { min-width: 0; }
.month-strip .v, .stat .value, .docket .flow .v { overflow-wrap: anywhere; }
.stat { min-width: 0; }
@media (max-width: 576px) { .stat .value { font-size: 19px; line-height: 26px; } }
/* Cash/bank docket: stack Closing under the three figures whenever the card itself is narrow. */
.docket { container-type: inline-size; }
.docket .flow > div { min-width: 0; }
@container (max-width: 700px) {
  .docket .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .docket .flow .close { grid-column: 1 / -1; }
  .docket .flow .v { white-space: normal; font-size: 15px; }
}
/* Desktop icon rail: keep every icon (incl. licence dot and collapse button) inside the rail on short screens. */
@media (min-width: 993px) {
  html.nav-rail .sidebar { overflow: visible; }
  html.nav-rail .sidebar nav > .nav-item, html.nav-rail .sidebar .nav-group > summary { height: 42px; margin: 4px 0; }
  html.nav-rail .side-licence { margin: 0 12px 10px; }
  html.nav-rail .rail-toggle { margin: 0 12px 12px; height: 42px; padding: 0; }
}
@media (min-width: 993px) and (max-height: 760px) {
  html.nav-rail .sidebar .brand { padding: 10px 0 6px; }
  html.nav-rail .sidebar nav > .nav-item, html.nav-rail .sidebar .nav-group > summary { height: 36px; margin: 2px 0; }
  html.nav-rail .sidebar nav .nav-item i { font-size: 18px; }
}
.glance-item:first-child { box-shadow: none; }
.glance-row { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.docket .docket-head { gap: 10px; } .docket .docket-head a { white-space: nowrap; flex: none; }
