:root {
  --pr-primary: #4f46e5;
  --pr-primary-rgb: 79, 70, 229;
  --pr-primary-soft: #eef2ff;
  --pr-bg: #f4f6fb;
  --pr-surface: #ffffff;
  --pr-border: #e5e8f0;
  --pr-text: #1e2433;
  --pr-muted: #6b7386;
  --pr-side-bg: var(--pr-side-bg-l, #0f172a);
  --pr-side-text: #aab4cb;
  --pr-side-active: #ffffff;
  --pr-side-hover: rgba(255, 255, 255, .06);
  --pr-radius: 14px;
  --pr-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);
  --pr-side-w: 268px;
  --bs-primary: var(--pr-primary);
  --bs-primary-rgb: var(--pr-primary-rgb);
  --bs-body-bg: var(--pr-bg);
  --bs-body-color: var(--pr-text);
  --bs-border-color: var(--pr-border);
  --bs-link-color: var(--pr-primary);
  --bs-link-color-rgb: var(--pr-primary-rgb);
  --bs-body-font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

[data-bs-theme="dark"] {
  --pr-primary: #818cf8;
  --pr-primary-rgb: 129, 140, 248;
  --pr-primary-soft: rgba(129, 140, 248, .14);
  --pr-bg: #0b1020;
  --pr-surface: #141b2e;
  --pr-border: #242d45;
  --pr-text: #e6e9f2;
  --pr-muted: #8e98b3;
  --pr-side-bg: var(--pr-side-bg-d, #0a0f1d);
  --pr-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --bs-body-bg: var(--pr-bg);
  --bs-body-color: var(--pr-text);
  --bs-border-color: var(--pr-border);
  --bs-secondary-bg: var(--pr-surface);
  --bs-tertiary-bg: var(--pr-surface);
}

html, body { height: 100%; }
body { background: var(--pr-bg); color: var(--pr-text); font-size: .925rem; -webkit-font-smoothing: antialiased; }
.text-muted, .text-secondary { color: var(--pr-muted) !important; }
.btn-primary { --bs-btn-bg: var(--pr-primary); --bs-btn-border-color: var(--pr-primary); --bs-btn-hover-bg: color-mix(in srgb, var(--pr-primary) 86%, #000); --bs-btn-hover-border-color: color-mix(in srgb, var(--pr-primary) 86%, #000); --bs-btn-active-bg: color-mix(in srgb, var(--pr-primary) 74%, #000); --bs-btn-color: #fff; }
.form-control, .form-select { border-radius: 10px; background-color: var(--pr-surface); }
.form-control:focus, .form-select:focus { border-color: var(--pr-primary); box-shadow: 0 0 0 .2rem rgba(var(--pr-primary-rgb), .18); }
.btn { border-radius: 10px; font-weight: 500; }

/* shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--pr-side-w); flex: 0 0 var(--pr-side-w); background: var(--pr-side-bg); color: var(--pr-side-text); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 1040; transition: transform .25s ease; }
.brand { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.25rem 1rem; color: #fff; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--pr-side-accent, #6366f1), #22d3ee); display: grid; place-items: center; font-size: 1.15rem; color: #fff; }
.brand-name { font-weight: 650; line-height: 1.15; }
.brand-name small { display: block; font-weight: 400; font-size: .72rem; color: var(--pr-side-text); }
.module-switch { display: flex; gap: .35rem; margin: 0 1rem .5rem; padding: .25rem; background: rgba(255, 255, 255, .06); border-radius: 12px; }
.module-switch button { flex: 1; border: 0; background: transparent; color: var(--pr-side-text); padding: .45rem .5rem; border-radius: 9px; font-size: .82rem; font-weight: 500; }
.module-switch button.on { background: rgba(var(--pr-side-accent-rgb, 99, 102, 241), .35); color: #fff; }
.side-scroll { overflow-y: auto; padding: 0 .75rem 1rem; flex: 1; scrollbar-width: thin; }
.nav-label { text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; font-weight: 600; color: #6b7794; padding: 1rem .75rem .4rem; }
.side-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: 10px; color: var(--pr-side-text); text-decoration: none; font-size: .88rem; transition: background .15s, color .15s; }
.side-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
a.side-link:hover { background: var(--pr-side-hover); color: #fff; }
a.side-link.active { background: rgba(var(--pr-side-accent-rgb, 99, 102, 241), .22); color: var(--pr-side-active); box-shadow: inset 3px 0 0 var(--pr-side-accent, #818cf8); }
.side-link.disabled { opacity: .5; cursor: default; }
.side-link .soon { margin-left: auto; font-size: .62rem; padding: .1rem .4rem; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #94a0bd; }
.side-foot { padding: .9rem 1.25rem; font-size: .72rem; color: #5d6985; border-top: 1px solid rgba(255, 255, 255, .06); }

.app-main { flex: 1; margin-left: var(--pr-side-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1030; height: 64px; display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem; background: color-mix(in srgb, var(--pr-surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--pr-border); }
.topbar .spacer { flex: 1; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--pr-border); background: var(--pr-surface); color: var(--pr-text); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--pr-primary-soft); color: var(--pr-primary); }
.fy-select { width: auto; min-width: 130px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--pr-primary-soft); color: var(--pr-primary); display: grid; place-items: center; font-weight: 650; }
.content { padding: 1.75rem 1.5rem 3rem; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.page-head p { margin: .15rem 0 0; color: var(--pr-muted); }

/* cards & stats */
.card { background: var(--pr-surface); border: 1px solid var(--pr-border); border-radius: var(--pr-radius); box-shadow: var(--pr-shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--pr-border); font-weight: 600; padding: 1rem 1.25rem; }
.stat { padding: 1.25rem; display: flex; gap: 1rem; align-items: center; }
.stat-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; background: var(--pr-primary-soft); color: var(--pr-primary); }
.stat-icon.green { background: rgba(16, 185, 129, .14); color: #10b981; }
.stat-icon.amber { background: rgba(245, 158, 11, .15); color: #f59e0b; }
.stat-icon.sky { background: rgba(14, 165, 233, .14); color: #0ea5e9; }
.stat-value { font-size: 1.65rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.stat-label { color: var(--pr-muted); font-size: .8rem; }

/* tables */
.table-modern { --bs-table-bg: transparent; margin: 0; }
.table-modern thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--pr-muted); font-weight: 600; border-bottom: 1px solid var(--pr-border); padding: .8rem 1rem; white-space: nowrap; }
.table-modern td { padding: .8rem 1rem; vertical-align: middle; border-color: var(--pr-border); }
.table-modern tbody tr:hover { background: var(--pr-primary-soft); }
.badge-soft { background: var(--pr-primary-soft); color: var(--pr-primary); font-weight: 600; }

.fl { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--pr-muted); font-weight: 600; }
.fv { font-weight: 500; word-break: break-word; }
.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--pr-primary); font-weight: 700; padding-bottom: .4rem; border-bottom: 1px solid var(--pr-border); margin-bottom: 1rem; }
.nav-tabs { border-bottom: 1px solid var(--pr-border); flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
.nav-tabs .nav-link { white-space: nowrap; color: var(--pr-muted); border: 0; border-bottom: 2px solid transparent; font-weight: 500; }
.nav-tabs .nav-link.active { color: var(--pr-primary); background: transparent; border-bottom-color: var(--pr-primary); }
.modal-content { border: 0; border-radius: var(--pr-radius); background: var(--pr-surface); }
.pagination { --bs-pagination-color: var(--pr-primary); --bs-pagination-active-bg: var(--pr-primary); --bs-pagination-active-border-color: var(--pr-primary); }

/* validation + rule builder */
.issues { display: flex; flex-direction: column; gap: .35rem; }
.issue { display: flex; gap: .5rem; align-items: flex-start; font-size: .86rem; }
.issue i { margin-top: .15rem; }
.issue-error i { color: #dc3545; }
.issue-warn i { color: #f59e0b; }
.validation { border-radius: 12px; padding: .9rem 1rem; border: 1px solid var(--pr-border); background: var(--pr-surface); }
.validation.ok { border-color: rgba(16, 185, 129, .5); background: rgba(16, 185, 129, .07); }
.validation.bad { border-color: rgba(220, 53, 69, .45); background: rgba(220, 53, 69, .06); }
.branch { border: 1px solid var(--pr-border); border-radius: 12px; padding: .7rem .8rem; margin-bottom: .5rem; background: var(--pr-surface); }
.branch-tag { font-weight: 700; font-size: .72rem; letter-spacing: .06em; background: var(--pr-primary-soft); color: var(--pr-primary); border-radius: 8px; padding: .4rem .55rem; }
[hidden] { display: none !important; }
fieldset:disabled .btn-check + .btn { opacity: .75; }

.trace { background: var(--pr-primary-soft); border-radius: 10px; padding: .9rem 1rem; margin: .25rem 0 .75rem; }

/* reports + payslips */
.report-card:hover { border-color: var(--pr-primary); transform: translateY(-1px); transition: .15s; }
.report-head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--pr-border); }
.table-report { font-size: .82rem; --bs-table-bg: transparent; }
.table-report th { background: var(--pr-primary-soft); font-weight: 600; white-space: nowrap; padding: .5rem .65rem; border-bottom: 1px solid var(--pr-border); }
.table-report td { padding: .35rem .65rem; border-color: var(--pr-border); white-space: nowrap; }
.table-report tr.grp td { background: rgba(var(--pr-primary-rgb), .07); font-weight: 700; }
.table-report tr.sub td { font-weight: 600; border-top: 1px solid var(--pr-border); }
.table-report tr.tot td { font-weight: 700; border-top: 2px solid var(--pr-text); background: var(--pr-primary-soft); }
.payslip { padding: 1.25rem 1.5rem; max-width: 900px; margin-inline: auto; }
.ps-head { display: flex; justify-content: space-between; border-bottom: 2px solid var(--pr-text); padding-bottom: .6rem; margin-bottom: .8rem; }
.ps-info { padding-bottom: .8rem; border-bottom: 1px solid var(--pr-border); margin-bottom: .8rem; }
.ps-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--pr-primary); margin-bottom: .3rem; }
.ps-col { padding-right: 1rem; }
.ps-col table td { border-color: var(--pr-border); padding: .2rem 0; }
.ps-col tr.tot td { font-weight: 700; border-top: 1px solid var(--pr-text); }
.ps-tax { background: var(--pr-primary-soft); border-radius: 10px; padding: .7rem .9rem; margin-top: .8rem; }
.ps-net { display: flex; justify-content: space-between; align-items: center; margin-top: .9rem; padding: .7rem .9rem; border: 2px solid var(--pr-text); border-radius: 10px; }

@media print {
  .sidebar, .topbar, .no-print, .toast-host, .sidebar-backdrop, #loadbar { display: none !important; }
  .app-main { margin: 0 !important; }
  .content { padding: 0 !important; max-width: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .card { box-shadow: none !important; border: 0 !important; }
  .payslip { border: 1px solid #999 !important; page-break-after: always; break-inside: avoid; margin-bottom: 0 !important; max-width: none; }
  .table-responsive { overflow: visible !important; }
  .table-report { font-size: .68rem; }
}

/* bar chart */
.bars { display: flex; align-items: flex-end; gap: .6rem; height: 210px; padding-top: .5rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .4rem; min-width: 0; }
.bar { width: 100%; max-width: 38px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, color-mix(in srgb, var(--pr-primary) 65%, #fff), var(--pr-primary)); min-height: 3px; transition: opacity .15s; }
.bar.empty { background: var(--pr-border); }
.bar-col:hover .bar { opacity: .8; }
.bar-label { font-size: .7rem; color: var(--pr-muted); }
.bar-val { font-size: .66rem; color: var(--pr-muted); white-space: nowrap; }

/* empty + progress */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--pr-muted); }
.empty i { font-size: 2rem; opacity: .5; }
.phase { display: flex; gap: .75rem; align-items: flex-start; padding: .65rem 0; border-bottom: 1px dashed var(--pr-border); }
.phase:last-child { border: 0; }
.phase i { margin-top: .15rem; }
.phase.done i { color: #10b981; }
.phase.todo i { color: var(--pr-muted); }

/* SPA loading bar + toasts */
#loadbar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--pr-side-accent, #6366f1), #22d3ee); z-index: 2000; transition: width .3s ease, opacity .3s; opacity: 0; }
#loadbar.on { opacity: 1; }
.is-loading { opacity: .6; pointer-events: none; transition: opacity .15s; }
.toast-host { position: fixed; right: 1rem; bottom: 1rem; z-index: 2100; display: flex; flex-direction: column; gap: .5rem; }
.toast { border: 0; border-radius: 12px; box-shadow: 0 8px 28px rgba(16, 24, 40, .22); }
.btn-busy { position: relative; pointer-events: none; }
.btn-busy::after { content: ""; width: 1em; height: 1em; margin-left: .5rem; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; vertical-align: -.15em; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* auth */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: radial-gradient(1200px 600px at 10% 10%, color-mix(in srgb, var(--pr-side-accent, #4f46e5) 70%, #000) 0%, color-mix(in srgb, var(--pr-side-accent, #4f46e5) 22%, #0b1020) 55%, #0f172a 100%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-hero h2 { font-weight: 700; font-size: 2.1rem; max-width: 18ch; letter-spacing: -.02em; }
.auth-hero p { color: #c7d2fe; max-width: 42ch; }
.auth-form { display: grid; place-items: center; padding: 2rem; background: var(--pr-surface); }
.auth-card { width: 100%; max-width: 380px; }

/* responsive */
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 1035; }
  .app-main { margin-left: 0; }
  .topbar { padding: 0 1rem; }
  .content { padding: 1.25rem 1rem 2.5rem; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}

/* ---------------------------------------------------------------------------------------------
   Refinement layer: motion, focus, depth and typography. Everything here is plain CSS and works offline.
   --------------------------------------------------------------------------------------------- */
:root { --pr-ease: cubic-bezier(.22, .61, .36, 1); --pr-ring: 0 0 0 3px rgba(var(--pr-primary-rgb), .28); }
::selection { background: rgba(var(--pr-primary-rgb), .22); }
html { scroll-behavior: smooth; }
body { font-feature-settings: "cv02", "cv03", "cv04", "cv11"; text-rendering: optimizeLegibility; }

/* keyboard focus is always visible, mouse focus stays quiet */
:focus-visible { outline: none; box-shadow: var(--pr-ring); border-radius: 8px; }
.btn:focus-visible, .icon-btn:focus-visible, .side-link:focus-visible, .nav-link:focus-visible { box-shadow: var(--pr-ring); }

/* themed scrollbars */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--pr-muted) 45%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--pr-muted) 40%, transparent); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--pr-muted) 65%, transparent); background-clip: content-box; }

/* page transition: content eases in after every in-page navigation */
@keyframes pr-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#app-content > * { animation: pr-rise .32s var(--pr-ease) both; }
#app-content > *:nth-child(2) { animation-delay: .04s; }
#app-content > *:nth-child(3) { animation-delay: .08s; }
#app-content > *:nth-child(n+4) { animation-delay: .12s; }

/* sidebar */
.sidebar { background: linear-gradient(180deg, var(--pr-side-bg), color-mix(in srgb, var(--pr-side-bg) 82%, #1e1b4b)); }
.brand-mark { box-shadow: 0 6px 18px rgba(var(--pr-side-accent-rgb, 99, 102, 241), .45); }
.side-link { position: relative; }
.side-link .bi { font-size: 1.08rem; opacity: .85; transition: transform .18s var(--pr-ease), opacity .15s; }
a.side-link:hover .bi { transform: translateX(2px); opacity: 1; }
a.side-link.active { background: linear-gradient(90deg, rgba(var(--pr-side-accent-rgb, 99, 102, 241), .32), rgba(var(--pr-side-accent-rgb, 99, 102, 241), .12)); font-weight: 600; }
a.side-link.active .bi { opacity: 1; color: var(--pr-side-accent, #a5b4fc); }
.module-switch button { transition: background .18s, color .18s; }
.module-switch button.on { background: linear-gradient(135deg, rgba(var(--pr-side-accent-rgb, 99, 102, 241), .55), rgba(34, 211, 238, .25)); box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }

/* top bar */
.topbar { box-shadow: 0 1px 0 var(--pr-border), 0 8px 24px -18px rgba(16, 24, 40, .35); }
.icon-btn { transition: background .15s, color .15s, transform .15s var(--pr-ease); }
.icon-btn:active { transform: scale(.94); }
.avatar { background: linear-gradient(135deg, var(--pr-primary-soft), color-mix(in srgb, var(--pr-primary) 22%, transparent)); box-shadow: inset 0 0 0 1px rgba(var(--pr-primary-rgb), .25); }

/* headings and labels */
.page-head h1 { font-size: 1.65rem; }
.form-label { font-size: .8rem; font-weight: 600; color: var(--pr-muted); margin-bottom: .3rem; }
.form-text { font-size: .75rem; }
.form-control, .form-select { border-color: color-mix(in srgb, var(--pr-border) 80%, var(--pr-muted)); transition: border-color .15s, box-shadow .15s; }
.form-control::placeholder { color: color-mix(in srgb, var(--pr-muted) 70%, transparent); }
.input-group-text { border-radius: 10px 0 0 10px; border-color: color-mix(in srgb, var(--pr-border) 80%, var(--pr-muted)); }
.form-check-input:checked { background-color: var(--pr-primary); border-color: var(--pr-primary); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; cursor: pointer; }

/* buttons */
.btn { transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s var(--pr-ease); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background-image: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0)); box-shadow: 0 1px 2px rgba(var(--pr-primary-rgb), .35), 0 6px 14px -6px rgba(var(--pr-primary-rgb), .55); }
.btn-primary:hover { box-shadow: 0 2px 4px rgba(var(--pr-primary-rgb), .35), 0 10px 20px -8px rgba(var(--pr-primary-rgb), .6); }
.btn-light { --bs-btn-bg: color-mix(in srgb, var(--pr-primary-soft) 70%, var(--pr-surface)); --bs-btn-border-color: transparent; --bs-btn-hover-bg: var(--pr-primary-soft); --bs-btn-hover-border-color: transparent; --bs-btn-color: var(--pr-text); --bs-btn-hover-color: var(--pr-primary); --bs-btn-active-bg: var(--pr-primary-soft); }
.btn-outline-primary { --bs-btn-color: var(--pr-primary); --bs-btn-border-color: color-mix(in srgb, var(--pr-primary) 55%, transparent); --bs-btn-hover-bg: var(--pr-primary); --bs-btn-hover-border-color: var(--pr-primary); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--pr-primary); }
.btn:disabled, .btn.disabled { opacity: .5; }
.btn-sm { border-radius: 8px; }

/* cards and stats */
.card { transition: box-shadow .2s var(--pr-ease), border-color .2s, transform .2s var(--pr-ease); }
.stat { position: relative; overflow: hidden; }
/* (the stat card accent line is defined in the interface layer below) */
.stat:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(16, 24, 40, .05), 0 14px 30px -12px rgba(16, 24, 40, .2); }
.stat-icon { box-shadow: inset 0 0 0 1px rgba(var(--pr-primary-rgb), .12); }
.stat-icon .bi { font-size: 1.25rem; }
.card-header { letter-spacing: -.005em; }
a.list-group-item-action { transition: background .15s, padding-left .2s var(--pr-ease); }
a.list-group-item-action:hover { background: var(--pr-primary-soft) !important; padding-left: 1.4rem; }

/* tables */
.table-modern tbody tr { transition: background .12s; }
.table-modern tbody td:first-child { color: var(--pr-muted); font-variant-numeric: tabular-nums; }
.table-modern td, .table-modern th { font-variant-numeric: tabular-nums; }
.table-modern thead th { background: color-mix(in srgb, var(--pr-primary-soft) 55%, var(--pr-surface)); position: sticky; top: 0; z-index: 1; }
.table-modern thead th:first-child { border-top-left-radius: 10px; }
.table-modern thead th:last-child { border-top-right-radius: 10px; }
.table-responsive { border-radius: var(--pr-radius); }
.table-modern .badge { font-weight: 600; letter-spacing: .01em; }
.badge { border-radius: 999px; padding: .38em .7em; }

/* modals */
.modal-backdrop.show { opacity: 1; background: rgba(15, 23, 42, .5); backdrop-filter: blur(3px); }
.modal.fade .modal-dialog { transform: translateY(14px) scale(.985); transition: transform .28s var(--pr-ease), opacity .2s; }
.modal.show .modal-dialog { transform: none; }
.modal-content { box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .45); }
.modal-header { border-bottom: 1px solid var(--pr-border); padding: 1.1rem 1.4rem; }
.modal-body { padding: 1.3rem 1.4rem; }
.modal-footer { border-top: 1px solid var(--pr-border); padding: .9rem 1.4rem; gap: .5rem; }
.modal-title { font-weight: 650; letter-spacing: -.01em; }
.btn-close { border-radius: 8px; transition: background .15s; }
.btn-close:hover { background-color: var(--pr-primary-soft); }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }

/* tabs */
.nav-tabs .nav-link { padding: .65rem 1rem; transition: color .15s, border-color .15s; }
.nav-tabs .nav-link:hover:not(.active) { color: var(--pr-text); border-bottom-color: var(--pr-border); }
.nav-tabs .nav-link.active { font-weight: 600; }

/* toasts get a coloured accent so success and errors read at a glance */
.toast { border-left: 4px solid var(--pr-primary); backdrop-filter: blur(8px); animation: pr-rise .25s var(--pr-ease) both; }
.toast.text-bg-success { border-left-color: #34d399; }
.toast.text-bg-danger { border-left-color: #f87171; }
.toast.text-bg-warning { border-left-color: #fbbf24; }

/* alerts */
.alert { border-radius: 12px; border-width: 1px; }
.alert .bi { font-size: 1.05rem; }

/* dashboard chart: grid lines and a calmer empty bar */
.bars { position: relative; height: 300px; background-image: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), color-mix(in srgb, var(--pr-border) 70%, transparent) calc(25% - 1px), color-mix(in srgb, var(--pr-border) 70%, transparent) 25%); }
.bar { max-width: 44px; box-shadow: 0 6px 14px -6px rgba(var(--pr-primary-rgb), .55); }
.bar.empty { box-shadow: none; opacity: .55; }
.bar-col { cursor: default; }
.chart-foot { display: flex; flex-wrap: wrap; gap: 1.5rem; padding: .9rem 1.25rem; border-top: 1px solid var(--pr-border); }
.chart-foot .k { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--pr-muted); font-weight: 600; }
.chart-foot .v { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }

/* empty states */
.empty .bi { font-size: 2.2rem; opacity: .4; }
.empty p { max-width: 38ch; margin-inline: auto; }

/* sign-in */
.auth-hero { position: relative; overflow: hidden; }
.auth-hero::before, .auth-hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.auth-hero::before { width: 520px; height: 520px; right: -180px; bottom: -200px; background: radial-gradient(closest-side, rgba(34, 211, 238, .22), transparent); }
.auth-hero::after { width: 380px; height: 380px; left: -140px; top: 35%; background: radial-gradient(closest-side, rgba(129, 140, 248, .28), transparent); }
.auth-card { animation: pr-rise .45s var(--pr-ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
/* ---------------------------------------------------------------------------------------------
   Branding: logo, letterhead, signature lines, settings screen
   --------------------------------------------------------------------------------------------- */
.brand-mark.has-logo { background: #fff; padding: 4px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.letterhead { display: flex; align-items: center; gap: 1rem; }
.lh-logo { width: 58px; height: 58px; flex: none; display: grid; place-items: center; }
.lh-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lh-name { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.lh-sub { font-weight: 600; color: var(--pr-muted); font-size: .85rem; }
.lh-addr { font-size: .78rem; color: var(--pr-muted); line-height: 1.35; }
.lh-addr:empty, .lh-sub:empty { display: none; }
.lh-title { margin-top: .6rem; padding-top: .55rem; border-top: 2px solid var(--pr-text); font-weight: 700; font-size: 1rem; }
.lh-title span { font-weight: 500; color: var(--pr-muted); margin-left: .6rem; font-size: .88rem; }
.report-head { padding: 1.1rem 1.25rem .6rem; border-bottom: 0; }
.report-foot { display: none; padding: .75rem 1.25rem 1rem; }
.rf-note { font-size: .78rem; color: var(--pr-muted); text-align: center; margin-bottom: 1.6rem; }
.signatures { display: flex; justify-content: space-between; gap: 2.5rem; margin-top: 2.6rem; }
.signatures > div { flex: 1; text-align: center; font-size: .78rem; font-weight: 600; }
.signatures > div > span { display: block; border-top: 1px solid var(--pr-text); margin-bottom: .3rem; }
.rf-meta { font-size: .66rem; color: var(--pr-muted); text-align: right; margin-top: 1rem; }
@media print { .report-foot { display: block; } .lh-title { border-top-color: #000; } }

.swatches { display: flex; flex-wrap: wrap; gap: .6rem; }
.swatch { cursor: pointer; text-align: center; font-size: .7rem; color: var(--pr-muted); }
.swatch input { position: absolute; opacity: 0; }
.swatch > span { display: block; width: 44px; height: 44px; border-radius: 14px; margin-bottom: .25rem; transition: transform .15s var(--pr-ease), box-shadow .15s; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); }
.swatch:hover > span { transform: translateY(-2px); }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--pr-surface), 0 0 0 5px currentColor, inset 0 0 0 2px rgba(255, 255, 255, .35); color: var(--pr-text); }
.swatch input:focus-visible + span { box-shadow: var(--pr-ring); }
.logo-well { width: 76px; height: 76px; border-radius: 16px; border: 1px dashed var(--pr-border); background: var(--pr-primary-soft); display: grid; place-items: center; flex: none; overflow: hidden; }
.logo-well img { max-width: 90%; max-height: 90%; object-fit: contain; }
.logo-well .bi { font-size: 1.8rem; color: var(--pr-muted); opacity: .6; }
.sidebar-mini { background: linear-gradient(180deg, var(--pr-side-bg, #0f172a), color-mix(in srgb, var(--pr-side-bg, #0f172a) 82%, #1e1b4b)); color: var(--pr-side-text, #aab4cb); padding: .9rem .9rem 1rem; border-radius: 0 0 var(--pr-radius) var(--pr-radius); }
.sidebar-mini .brand { padding: 0 0 .8rem; }
.sidebar-mini .side-link { pointer-events: none; }
/* ---------------------------------------------------------------------------------------------
   Messages: toasts, confirmation dialogs, friendly error pages
   --------------------------------------------------------------------------------------------- */
.toast-host { right: 1.25rem; bottom: 1.25rem; gap: .65rem; align-items: flex-end; max-width: calc(100vw - 2rem); }
.pr-toast { --tone: var(--pr-primary); position: relative; overflow: hidden; width: min(400px, calc(100vw - 2rem)); display: flex; gap: .85rem; align-items: flex-start; padding: .9rem 2.4rem .95rem .95rem; border-radius: 14px;
  background: var(--pr-surface); color: var(--pr-text); border: 1px solid var(--pr-border); box-shadow: 0 14px 40px -10px rgba(15, 23, 42, .35), 0 2px 6px rgba(15, 23, 42, .08);
  opacity: 0; transform: translateX(24px) scale(.98); transition: opacity .25s var(--pr-ease), transform .25s var(--pr-ease); }
.pr-toast.in { opacity: 1; transform: none; }
.pr-toast.out { opacity: 0; transform: translateX(24px) scale(.98); }
.pr-toast::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--tone); }
.pr-toast-success { --tone: #10b981; } .pr-toast-danger { --tone: #ef4444; } .pr-toast-warning { --tone: #f59e0b; } .pr-toast-info { --tone: #3b82f6; }
.pt-icon { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 1.15rem; color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); }
.pt-body { min-width: 0; padding-top: .05rem; }
.pt-title { font-weight: 650; font-size: .9rem; line-height: 1.25; }
.pt-msg { font-size: .84rem; color: var(--pr-muted); margin-top: .1rem; line-height: 1.4; word-break: break-word; }
.pt-close { position: absolute; top: .55rem; right: .55rem; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--pr-muted); display: grid; place-items: center; font-size: .8rem; transition: background .15s, color .15s; }
.pt-close:hover { background: var(--pr-primary-soft); color: var(--pr-text); }
.pt-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--tone); opacity: .55; transform-origin: left; animation: pt-shrink var(--ms, 5s) linear forwards; }
.pr-toast.paused .pt-bar { animation-play-state: paused; }
@keyframes pt-shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.pr-dialog-overlay { position: fixed; inset: 0; z-index: 2200; display: grid; place-items: center; padding: 1rem; background: rgba(15, 23, 42, .5); backdrop-filter: blur(3px); opacity: 0; transition: opacity .18s; }
.pr-dialog-overlay.in { opacity: 1; }
.pr-dialog { --tone: var(--pr-primary); width: min(420px, 100%); text-align: center; padding: 1.7rem 1.6rem 1.35rem; border-radius: 20px; background: var(--pr-surface); color: var(--pr-text);
  box-shadow: 0 30px 70px -14px rgba(15, 23, 42, .55); transform: translateY(14px) scale(.97); transition: transform .22s var(--pr-ease); }
.pr-dialog-overlay.in .pr-dialog { transform: none; }
.pr-dialog.tone-danger { --tone: #ef4444; } .pr-dialog.tone-warning { --tone: #f59e0b; } .pr-dialog.tone-success { --tone: #10b981; }
.pd-icon { width: 58px; height: 58px; margin: 0 auto 1rem; border-radius: 18px; display: grid; place-items: center; font-size: 1.6rem; color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); box-shadow: 0 0 0 7px color-mix(in srgb, var(--tone) 7%, transparent); }
.pd-title { font-weight: 700; letter-spacing: -.01em; margin-bottom: .35rem; }
.pd-msg { color: var(--pr-muted); font-size: .92rem; margin-bottom: 1.35rem; line-height: 1.5; }
.pd-actions { display: flex; gap: .6rem; justify-content: center; }
.pd-actions .btn { min-width: 120px; padding: .55rem 1rem; }

/* friendly error and empty pages */
.state-page { max-width: 520px; margin: 4vh auto; text-align: center; padding: 2.4rem 1.5rem; }
.state-code { font-size: 4.2rem; font-weight: 800; line-height: 1; letter-spacing: -.04em; background: linear-gradient(135deg, var(--pr-primary), color-mix(in srgb, var(--pr-primary) 40%, #22d3ee)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.state-icon { width: 74px; height: 74px; margin: 0 auto 1.1rem; border-radius: 22px; display: grid; place-items: center; font-size: 2rem; color: var(--pr-primary); background: var(--pr-primary-soft); box-shadow: 0 0 0 9px rgba(var(--pr-primary-rgb), .06); }
.state-page h2 { font-weight: 700; margin: .6rem 0 .4rem; }
.state-page p { color: var(--pr-muted); }
/* ---------------------------------------------------------------------------------------------
   Interface layer: fixes (cards, modal scrolling) and modern native motion
   Everything below is plain CSS / browser APIs: offline, no packages to download, no extra weight.
   --------------------------------------------------------------------------------------------- */

/* ---- stat cards: icon on the left, figure and label on the right (Bootstrap's .card is a column, which stacked them) ---- */
.card.stat { flex-direction: row; align-items: center; gap: 1rem; height: 100%; padding: 1.15rem 1.25rem; }
.stat > div:last-child { min-width: 0; }
.stat-value { font-variant-numeric: tabular-nums; }
.stat-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--pr-primary), transparent 70%); opacity: 0; transition: opacity .25s var(--pr-ease); }
.stat:hover::before { opacity: 1; }
.stat-icon { flex: none; transition: transform .25s var(--pr-ease); }
.stat:hover .stat-icon { transform: scale(1.08) rotate(-4deg); }
.row > [class*="col"]:nth-child(1) > .stat { --n: 0; } .row > [class*="col"]:nth-child(2) > .stat { --n: 1; }
.row > [class*="col"]:nth-child(3) > .stat { --n: 2; } .row > [class*="col"]:nth-child(4) > .stat { --n: 3; } .row > [class*="col"]:nth-child(5) > .stat { --n: 4; }
.row > [class*="col"] > .stat { animation: pr-rise .45s var(--pr-ease) both; animation-delay: calc(var(--n, 0) * 60ms + 80ms); }

/* ---- modals: the header and footer stay put and only the body scrolls, also when the form wraps all three ---- */
#appModal .modal-dialog-scrollable .modal-content { max-height: 100%; }
#appModal .modal-content > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; max-height: 100%; overflow: hidden; }
#appModal .modal-header, #appModal .modal-footer { flex: none; }
#appModal .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  /* soft shadows at the top and bottom edge show that there is more to scroll */
  background:
    linear-gradient(var(--pr-surface) 30%, transparent) top / 100% 36px no-repeat local,
    linear-gradient(transparent, var(--pr-surface) 70%) bottom / 100% 36px no-repeat local,
    radial-gradient(farthest-side at 50% 0, rgba(15, 23, 42, .16), transparent) top / 100% 12px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, rgba(15, 23, 42, .16), transparent) bottom / 100% 12px no-repeat scroll; }
@media (max-width: 575.98px) { #appModal .modal-dialog { margin: .5rem; } #appModal .modal-dialog-scrollable { height: calc(100% - 1rem); } #appModal .modal-header, #appModal .modal-body, #appModal .modal-footer { padding-left: 1rem; padding-right: 1rem; } }
@media (max-height: 520px) { #appModal .modal-header { padding-top: .65rem; padding-bottom: .65rem; } #appModal .modal-footer { padding-top: .6rem; padding-bottom: .6rem; } }

/* ---- page change: only the content area animates (View Transitions API, with the CSS rise above as the fallback) ---- */
html.vt #app-content { view-transition-name: app-content; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(app-content) { animation: pr-vt-out .14s ease both; }
::view-transition-new(app-content) { animation: pr-vt-in .3s var(--pr-ease) both; }
@keyframes pr-vt-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes pr-vt-in { from { opacity: 0; transform: translateY(10px); } }

/* ---- loading: a moving highlight line instead of a dead grey-out ---- */
.is-loading { position: relative; }
.is-loading::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--pr-primary), transparent); background-size: 220% 100%; animation: pr-shimmer 1s linear infinite; z-index: 2; }
@keyframes pr-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* ---- dropdowns and popovers pop in ---- */
.dropdown-menu.show { animation: pr-pop .18s var(--pr-ease) both; transform-origin: top right; }
@keyframes pr-pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } }

/* ---- scroll-driven reveal for long grids (progressive: browsers without it simply show everything) ---- */
@supports (animation-timeline: view()) {
  [data-report-card], .reveal { animation: pr-reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
  @keyframes pr-reveal { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
}

/* ---- tables: the row you point at gets an accent edge ---- */
.table-modern tbody tr { position: relative; }
.table-modern tbody tr:hover > td:first-child { box-shadow: inset 3px 0 0 var(--pr-primary); }

/* ---- links and buttons that open something get a subtle arrow nudge ---- */
.btn .bi-arrow-left, .btn .bi-send { transition: transform .2s var(--pr-ease); }
.btn:hover .bi-arrow-left { transform: translateX(-2px); } .btn:hover .bi-send { transform: translate(2px, -2px); }

@media (prefers-reduced-motion: reduce) {
  html.vt #app-content { view-transition-name: none; }
  .row > [class*="col"] > .stat, [data-report-card], .reveal { animation: none !important; }
}
/* ---- Status pills: every Bootstrap badge becomes a soft, tinted pill; status badges also get a dot ---- */
.badge {
  --tone: var(--bs-secondary-rgb); --ink: 70%;
  display: inline-flex; align-items: center; gap: .45em; vertical-align: middle; white-space: nowrap;
  font-weight: 600; font-size: .75rem; line-height: 1.1; letter-spacing: .01em;
  padding: .38em .8em; border-radius: 999px;
  border: 1px solid rgba(var(--tone), .30);
  background: linear-gradient(180deg, rgba(var(--tone), .14), rgba(var(--tone), .08)) !important;
  color: color-mix(in srgb, rgb(var(--tone)) var(--ink), var(--bs-body-color)) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset;
}
.badge.fs-6 { font-size: .85rem !important; padding: .42em .95em; }
.badge[class*="text-bg-"] { padding-left: .65em; }
.badge[class*="text-bg-"]::before {
  content: ""; flex: none; width: .5em; height: .5em; border-radius: 50%;
  background: rgb(var(--tone)); box-shadow: 0 0 0 .2em rgba(var(--tone), .20);
}
.badge.text-bg-success   { --tone: var(--bs-success-rgb); --ink: 62%; }
.badge.text-bg-danger    { --tone: var(--bs-danger-rgb);  --ink: 68%; }
.badge.text-bg-warning   { --tone: var(--bs-warning-rgb); --ink: 40%; }
.badge.text-bg-info      { --tone: var(--bs-info-rgb);    --ink: 50%; }
.badge.text-bg-primary   { --tone: var(--bs-primary-rgb); --ink: 70%; }
.badge.text-bg-secondary { --tone: var(--bs-secondary-rgb); --ink: 55%; }
.badge-soft {
  --tone: var(--pr-primary-rgb, 99, 102, 241); --ink: 80%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pr-primary) 16%, transparent), color-mix(in srgb, var(--pr-primary) 9%, transparent)) !important;
  border-color: color-mix(in srgb, var(--pr-primary) 28%, transparent);
  color: var(--pr-primary) !important;
}
.badge.rounded-pill.badge-soft { padding: .3em .7em; min-width: 1.9em; justify-content: center; }
.text-bg-info::before, .text-bg-warning.pulse::before { animation: pr-dot 1.8s ease-in-out infinite; }
@keyframes pr-dot { 0%,100% { box-shadow: 0 0 0 .2em rgba(var(--tone), .22); } 50% { box-shadow: 0 0 0 .42em rgba(var(--tone), 0); } }
[data-bs-theme="dark"] .badge { box-shadow: none; border-color: rgba(var(--tone), .38); }
[data-bs-theme="dark"] .badge { color: color-mix(in srgb, rgb(var(--tone)) 48%, #fff) !important; }
[data-bs-theme="dark"] .badge.text-bg-warning { color: color-mix(in srgb, rgb(var(--tone)) 80%, #fff) !important; }
[data-bs-theme="dark"] .badge-soft { color: color-mix(in srgb, var(--pr-primary) 70%, #fff) !important; }
@media (prefers-reduced-motion: reduce) { .text-bg-info::before, .text-bg-warning.pulse::before { animation: none; } }

/* ---- full-page forms (employee) ---- */
.form-card { overflow: visible; }
.form-card .card-head { display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; border-bottom: 1px solid var(--bs-border-color); }
.form-card .card-head i { color: var(--pr-primary); font-size: 1.1rem; }
.form-card .card-head h6 { margin: 0; font-weight: 700; letter-spacing: .01em; }
.form-actions { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; margin: 1rem -.25rem 0;
  background: color-mix(in srgb, var(--bs-body-bg) 88%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--bs-border-color); border-radius: 0 0 var(--pr-radius, 12px) var(--pr-radius, 12px); }
input[readonly].form-control { background: color-mix(in srgb, var(--bs-body-color) 5%, var(--bs-body-bg)); }
@keyframes pr-flash { 0% { box-shadow: 0 0 0 0 rgba(var(--pr-primary-rgb), .55); } 100% { box-shadow: 0 0 0 .6rem rgba(var(--pr-primary-rgb), 0); } }
input.flash { animation: pr-flash .8s ease-out; }
@media (prefers-reduced-motion: reduce) { input.flash { animation: none; } }

/* ---- roles and permissions ---- */
.role-icon { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: .7rem; background: color-mix(in srgb, var(--pr-primary) 14%, transparent); color: var(--pr-primary); font-size: 1.15rem; flex: none; }
.perm-row { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem .7rem; border: 1px solid var(--bs-border-color); border-radius: .6rem; cursor: pointer; transition: background .15s, border-color .15s; }
.perm-row:hover { background: color-mix(in srgb, var(--pr-primary) 6%, transparent); }
.perm-row:has(input:checked) { border-color: color-mix(in srgb, var(--pr-primary) 45%, var(--bs-border-color)); background: color-mix(in srgb, var(--pr-primary) 8%, transparent); }
.perm-row input { margin-top: .25rem; flex: none; }

/* ---- report filter panel, location picker, sortable headers ---- */
.filters .form-label { font-weight: 600; }
.multi-menu { min-width: 20rem; max-width: 26rem; }
.multi-list { max-height: 15rem; overflow: auto; display: grid; gap: .1rem; }
.multi-item { display: flex; gap: .5rem; align-items: center; padding: .3rem .4rem; border-radius: .4rem; cursor: pointer; font-size: .9rem; }
.multi-item:hover { background: color-mix(in srgb, var(--pr-primary) 8%, transparent); }
.multi-item[hidden] { display: none; }
.th-sort { color: inherit; text-decoration: none; display: inline-flex; gap: .3rem; align-items: center; white-space: nowrap; }
.th-sort:hover { color: var(--pr-primary); }
.th-sort i { opacity: .35; font-size: .75em; }
.th-sort.on i { opacity: 1; color: var(--pr-primary); }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--bs-secondary-color); }
.empty-state i { font-size: 2.4rem; opacity: .5; }

/* ---- pay slip (new design) ---- */
.ps2 { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: 16px; overflow: hidden; margin-bottom: 1.25rem; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06); font-variant-numeric: tabular-nums; }
.ps2-head { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.4rem; border-bottom: 3px solid var(--pr-primary);
  background: linear-gradient(135deg, color-mix(in srgb, var(--pr-primary) 9%, var(--bs-body-bg)), var(--bs-body-bg) 60%); }
.ps2-logo { flex: none; width: 76px; height: 76px; display: grid; place-items: center; }
.ps2-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ps2-org { flex: 1; min-width: 0; }
.ps2-org-name { font-size: 1.25rem; font-weight: 800; letter-spacing: .01em; line-height: 1.2; }
.ps2-org-sub { font-weight: 600; color: var(--pr-primary); }
.ps2-org-addr { font-size: .8rem; color: var(--bs-secondary-color); }
.ps2-title { text-align: right; flex: none; }
.ps2-title span { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--bs-secondary-color); }
.ps2-title b { display: inline-block; margin-top: .2rem; padding: .3rem .8rem; border-radius: 999px; background: var(--pr-primary); color: #fff; font-size: .95rem; letter-spacing: .02em; }
.ps2-who { display: flex; gap: 1.1rem; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--bs-border-color); align-items: flex-start; }
.ps2-photo { flex: none; width: 92px; height: 112px; object-fit: cover; border-radius: 10px; border: 2px solid var(--bs-border-color); background: var(--bs-tertiary-bg); }
.ps2-grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: .65rem 1.2rem; }
.ps2-f span, .ps2-service span { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bs-secondary-color); }
.ps2-f strong, .ps2-service strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.ps2-f.wide { grid-column: span 2; }
.ps2-cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1rem; padding: 1.1rem 1.4rem; align-items: start; }
.ps2-stack { display: grid; gap: 1rem; }
.ps2-panel { border: 1px solid var(--bs-border-color); border-radius: 12px; overflow: hidden; }
.ps2-panel h3 { margin: 0; padding: .55rem .9rem; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.ps2-panel.earn h3 { background: #15803d; } .ps2-panel.ded h3 { background: #b91c1c; } .ps2-panel.loan h3 { background: #b45309; }
.ps2-panel table, .ps2-loans table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.ps2-panel th { padding: .4rem .9rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--bs-secondary-color); border-bottom: 1px solid var(--bs-border-color); text-align: left; }
.ps2-panel th:last-child, .ps2-panel td:last-child, .ps2-loans td:nth-child(n+3), .ps2-loans th:nth-child(n+3) { text-align: right; }
.ps2-panel td { padding: .32rem .9rem; border-bottom: 1px dashed color-mix(in srgb, var(--bs-border-color) 70%, transparent); }
.ps2-panel tfoot td { font-weight: 800; border-top: 2px solid var(--bs-border-color); border-bottom: 0; background: var(--bs-tertiary-bg); padding: .5rem .9rem; }
.ps2-tax { padding: 0 1.4rem 1rem; } .ps2-tax h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--bs-secondary-color); }
.ps2-net { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0 1.4rem 1.1rem; padding: .9rem 1.2rem; border-radius: 12px;
  background: linear-gradient(135deg, var(--pr-primary), color-mix(in srgb, var(--pr-primary) 70%, #000)); color: #fff; }
.ps2-net span { display: block; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.ps2-net b { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.ps2-net p { margin: 0; max-width: 28rem; text-align: right; font-size: .85rem; opacity: .92; }
.ps2-loans { padding: 0 1.4rem 1.1rem; }
.ps2-loans table { border: 1px solid var(--bs-border-color); border-radius: 10px; overflow: hidden; }
.ps2-loans th { background: var(--pr-primary); color: #fff; padding: .45rem .8rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; text-align: left; }
.ps2-loans td { padding: .4rem .8rem; border-top: 1px solid var(--bs-border-color); }
.ps2-service { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding: .8rem 1.4rem; margin: 0 1.4rem 1rem; border: 1px solid var(--bs-border-color); border-radius: 10px; background: var(--bs-tertiary-bg); }
.ps2-foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .7rem 1.4rem; border-top: 1px solid var(--bs-border-color); font-size: .74rem; color: var(--bs-secondary-color); }
@media (max-width: 760px) { .ps2-cols { grid-template-columns: 1fr; } .ps2-head { flex-wrap: wrap; } .ps2-title { text-align: left; } .ps2-service { grid-template-columns: 1fr; } .ps2-net p { text-align: left; } .ps2-who { flex-direction: column; } }
@media print {
  .ps2 { border: 1px solid #999; border-radius: 0; box-shadow: none; margin: 0; break-inside: avoid; page-break-inside: avoid; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ps2 + .ps2 { break-before: page; page-break-before: always; }
  .ps2-head, .ps2-panel h3, .ps2-net, .ps2-loans th, .ps2-title b { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---- sign-in logo ---- */
.auth-logo { width: 168px; height: 168px; background: #fff; border-radius: 28px; padding: 12px; display: grid; place-items: center; box-shadow: 0 18px 40px rgba(0,0,0,.28); margin: 1.5rem 0 .5rem; }
.auth-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.auth-logo-sm { display: none; }
@media (max-width: 900px) { .auth-logo { display: none; } .auth-logo-sm { display: grid; width: 96px; height: 96px; margin: 0 auto 1rem; place-items: center; } .auth-logo-sm img { max-width: 100%; max-height: 100%; object-fit: contain; } }

/* ---- employee photo ---- */
.photo-card { display: flex; gap: 1rem; align-items: center; padding: 1rem; }
.photo-card img, .photo-card .photo-empty { width: 96px; height: 116px; border-radius: 12px; object-fit: cover; border: 2px solid var(--bs-border-color); flex: none; }
.photo-empty { display: grid; place-items: center; background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); font-size: 2rem; }
.avatar-sm { width: 44px; height: 54px; border-radius: 8px; object-fit: cover; border: 1px solid var(--bs-border-color); }

/* ---- light menu (chosen under Branding); in dark mode it becomes a dark menu again ---- */
html:not([data-bs-theme="dark"]) body[data-side="light"] .sidebar, html:not([data-bs-theme="dark"]) [data-side="light"] .sidebar-mini {
  --pr-side-bg: #ffffff; --pr-side-text: #475569; --pr-side-active: #0f172a; --pr-side-hover: rgba(15, 23, 42, .06);
  background: #fff; color: #475569; border-right: 1px solid var(--pr-border); }
html:not([data-bs-theme="dark"]) body[data-side="light"] .brand, html:not([data-bs-theme="dark"]) [data-side="light"] .sidebar-mini .brand { color: #0f172a; }
html:not([data-bs-theme="dark"]) body[data-side="light"] .module-switch, html:not([data-bs-theme="dark"]) [data-side="light"] .sidebar-mini .module-switch { background: rgba(15, 23, 42, .06); }
html:not([data-bs-theme="dark"]) body[data-side="light"] a.side-link:hover, html:not([data-bs-theme="dark"]) [data-side="light"] a.side-link:hover { color: #0f172a; }
html:not([data-bs-theme="dark"]) body[data-side="light"] a.side-link.active, html:not([data-bs-theme="dark"]) [data-side="light"] a.side-link.active {
  background: linear-gradient(90deg, rgba(var(--pr-primary-rgb), .16), rgba(var(--pr-primary-rgb), .05)); color: var(--pr-primary); }
html:not([data-bs-theme="dark"]) body[data-side="light"] a.side-link.active .bi { color: var(--pr-primary); }
html:not([data-bs-theme="dark"]) body[data-side="light"] .module-switch button.on { background: var(--pr-primary); color: #fff; }
html:not([data-bs-theme="dark"]) body[data-side="light"] .nav-label { color: #94a3b8; }
html:not([data-bs-theme="dark"]) body[data-side="light"] .side-foot { color: #94a3b8; border-top-color: var(--pr-border); }

/* ---- theme picker (Branding) ---- */
.theme-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.theme-card { border: 1px solid var(--bs-border-color); border-radius: 12px; background: var(--pr-surface); padding: .5rem; text-align: left; transition: border-color .15s, box-shadow .15s, transform .15s; }
.theme-card:hover { border-color: var(--pr-primary); transform: translateY(-1px); }
.theme-card.on { border-color: var(--pr-primary); box-shadow: 0 0 0 2px rgba(var(--pr-primary-rgb), .25); }
.theme-mini { display: flex; height: 56px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(0,0,0,.08); margin-bottom: .45rem; }
.theme-mini i { width: 30%; display: block; } .theme-mini b { flex: 1; display: grid; align-content: center; gap: 5px; padding: 0 .6rem; background: var(--pr-bg); }
.theme-mini b span { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--pr-text) 18%, transparent); } .theme-mini b em { height: 12px; width: 52%; border-radius: 4px; display: block; }
.theme-card strong { display: block; font-size: .82rem; } .theme-card small { color: var(--pr-muted); font-size: .7rem; line-height: 1.2; display: block; }
.swatches.big { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .5rem; }
.tone { cursor: pointer; text-align: center; font-size: .72rem; }
.tone input { position: absolute; opacity: 0; }
.tone span { display: block; height: 38px; border-radius: 10px; border: 2px solid var(--bs-border-color); margin-bottom: .25rem; }
.tone input:checked + span { border-color: var(--pr-primary); box-shadow: 0 0 0 2px rgba(var(--pr-primary-rgb), .3); }
.font-opt { display: flex; gap: .8rem; align-items: center; padding: .55rem .75rem; border: 1px solid var(--bs-border-color); border-radius: 10px; cursor: pointer; }
.font-opt:has(input:checked) { border-color: var(--pr-primary); background: color-mix(in srgb, var(--pr-primary) 7%, transparent); }
.font-opt .sample { font-size: 1.25rem; min-width: 2.2rem; text-align: center; color: var(--pr-primary); }
.font-opt small { color: var(--pr-muted); display: block; }

/* ---- module switch: a sliding highlight, a soft glow that follows the module, and the menu and page sliding across ---- */
@property --mod-glow { syntax: '<color>'; inherits: true; initial-value: rgba(99, 102, 241, .0); }
body { --mod-glow: rgba(var(--pr-side-accent-rgb, 99, 102, 241), .28); transition: --mod-glow .6s ease; }
body[data-module="pension"] { --mod-glow: rgba(245, 158, 11, .26); }
.sidebar { position: fixed; overflow: hidden; }
.sidebar::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 230px; pointer-events: none; z-index: 0;
  background: radial-gradient(260px 160px at 20% 0%, var(--mod-glow), transparent 70%); }
.sidebar > * { position: relative; z-index: 1; }
.module-switch { position: relative; isolation: isolate; }
.module-switch::before { content: ""; position: absolute; z-index: -1; top: .25rem; bottom: .25rem; left: .25rem; width: calc(50% - .3rem); border-radius: 9px;
  background: linear-gradient(135deg, rgba(var(--pr-side-accent-rgb, 99, 102, 241), .6), rgba(34, 211, 238, .28)); box-shadow: 0 2px 12px rgba(0, 0, 0, .3);
  transform: translateX(0); transition: transform .42s cubic-bezier(.3, 1.25, .45, 1), background .4s; }
.module-switch[data-module="pension"]::before { transform: translateX(calc(100% + .35rem)); background: linear-gradient(135deg, rgba(245, 158, 11, .62), rgba(251, 191, 36, .26)); }
.module-switch button, .module-switch button.on { background: transparent !important; box-shadow: none !important; position: relative; transition: color .25s; }
.module-switch button.on { color: #fff; font-weight: 600; }
.module-switch button:not(.on):hover { color: #fff; }
html:not([data-bs-theme="dark"]) body[data-side="light"] .module-switch::before { background: var(--pr-primary); }
html:not([data-bs-theme="dark"]) body[data-side="light"] .module-switch[data-module="pension"]::before { background: #d97706; }
html:not([data-bs-theme="dark"]) body[data-side="light"] .module-switch button:not(.on):hover { color: #0f172a; }
.side-scroll { view-transition-name: side-nav; }
html.vt-module #app-content { view-transition-name: app-content; }
::view-transition-group(side-nav), ::view-transition-group(app-content) { animation-duration: .5s; animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
html[data-mod-dir="fwd"]::view-transition-old(side-nav) { animation: pr-slide-out-l .32s cubic-bezier(.4, 0, 1, 1) both; }
html[data-mod-dir="fwd"]::view-transition-new(side-nav) { animation: pr-slide-in-r .45s cubic-bezier(.22, 1, .36, 1) both; }
html[data-mod-dir="back"]::view-transition-old(side-nav) { animation: pr-slide-out-r .32s cubic-bezier(.4, 0, 1, 1) both; }
html[data-mod-dir="back"]::view-transition-new(side-nav) { animation: pr-slide-in-l .45s cubic-bezier(.22, 1, .36, 1) both; }
html[data-mod-dir="fwd"]::view-transition-old(app-content) { animation: pr-vt-out-fwd .26s ease both; }
html[data-mod-dir="fwd"]::view-transition-new(app-content) { animation: pr-vt-in-fwd .5s cubic-bezier(.22, 1, .36, 1) both; }
html[data-mod-dir="back"]::view-transition-old(app-content) { animation: pr-vt-out-back .26s ease both; }
html[data-mod-dir="back"]::view-transition-new(app-content) { animation: pr-vt-in-back .5s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes pr-slide-out-l { to { transform: translateX(-28px); opacity: 0; } } @keyframes pr-slide-in-r { from { transform: translateX(28px); opacity: 0; } }
@keyframes pr-slide-out-r { to { transform: translateX(28px); opacity: 0; } } @keyframes pr-slide-in-l { from { transform: translateX(-28px); opacity: 0; } }
@keyframes pr-vt-out-fwd { to { opacity: 0; transform: translateX(-24px) scale(.99); } } @keyframes pr-vt-in-fwd { from { opacity: 0; transform: translateX(34px) scale(.99); } }
@keyframes pr-vt-out-back { to { opacity: 0; transform: translateX(24px) scale(.99); } } @keyframes pr-vt-in-back { from { opacity: 0; transform: translateX(-34px) scale(.99); } }
@media (prefers-reduced-motion: reduce) { .module-switch::before { transition: none; } body { transition: none; } }

/* ---- printing ---- */
.print-head { display: none; }
.print-preview { display: grid; place-items: center; padding: .8rem; border: 1px dashed var(--bs-border-color); border-radius: 10px; background: var(--bs-tertiary-bg); min-height: 120px; }
.print-preview .sheet { position: relative; background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.18); border-radius: 2px; padding: 8px 8px; display: grid; align-content: start; gap: 4px; transition: width .25s, height .25s; }
.print-preview .sheet .logo { display: block; width: 14px; height: 14px; margin: 0 auto; border-radius: 50%; background: var(--pr-primary); }
.print-preview .sheet b { display: block; height: 4px; width: 55%; margin: 0 auto; background: #333; border-radius: 2px; }
.print-preview .sheet span { display: block; height: 3px; background: #ddd; border-radius: 2px; }
.print-preview .sheet em { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font: 600 7px/1 var(--bs-body-font-family); color: #666; }
body.print-measure .table-report { font-size: 8.5pt !important; width: max-content !important; }
body.print-measure .table-report th, body.print-measure .table-report td { white-space: nowrap !important; padding: 2px 5px !important; }
body.print-measure .report { width: max-content !important; max-width: none !important; }
body.print-measure .table-responsive { overflow: visible !important; width: max-content !important; }
@media print {
  @page { margin: 10mm; }
  html, body { height: auto !important; }
  body { font-family: var(--bs-body-font-family); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-head { display: block; text-align: center; padding: 0 0 .5rem; margin-bottom: .5rem; border-bottom: 2px solid #000; break-after: avoid; }
  .print-head .ph-logo img { height: 24mm; max-width: 70mm; object-fit: contain; display: block; margin: 0 auto .2rem; }
  .print-head .ph-name { font-size: 16pt; font-weight: 800; line-height: 1.15; letter-spacing: .01em; }
  .print-head .ph-sub { font-size: 12pt; font-weight: 600; }
  .print-head .ph-addr { font-size: 8.5pt; color: #333; }
  .print-head .ph-title { margin-top: .45rem; font-size: 13pt; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
  .print-head .ph-sub2 { font-size: 9pt; color: #333; margin-top: .1rem; }
  .report-head { display: none !important; }
  .report.card { border: 0 !important; border-radius: 0 !important; background: #fff !important; }
  .table-responsive { overflow: visible !important; }
  .table-report { font-size: 8.5pt !important; width: 100% !important; border-collapse: collapse !important; }
  .table-report thead { display: table-header-group; }
  .table-report tfoot { display: table-footer-group; }
  .table-report tr { break-inside: avoid; page-break-inside: avoid; }
  .table-report th, .table-report td { border: .5pt solid #888 !important; padding: 2px 5px !important; white-space: nowrap !important; color: #000 !important; }
  .table-report thead th { background: #e4e4e4 !important; font-weight: 700; }
  .table-report tr.grp td { background: #efefef !important; }
  .table-report tr.sub td { background: #f6f6f6 !important; }
  .table-report tr.tot td { background: #e4e4e4 !important; border-top: 1.5pt solid #000 !important; }
  .th-sort { color: #000 !important; } .th-sort i { display: none !important; }
  .report-foot { display: block !important; break-inside: avoid; margin-top: 8mm; }
  a { color: inherit !important; text-decoration: none !important; }
  .empty-state { display: none; }
  .ps2, .ls { box-shadow: none !important; }
}

/* wide tables in print: headings of figure columns wrap so a column needs little room; split tables start each band on a new page */
body.print-measure .table-report th.text-end { white-space: normal !important; min-width: 52px; max-width: 100px; line-height: 1.15; overflow-wrap: break-word; }
.band-title { display: none; }
@media print {
  .table-report th.text-end { white-space: normal !important; min-width: 52px; max-width: 100px; line-height: 1.15; overflow-wrap: break-word; vertical-align: bottom; }
  .band-next { break-before: page; page-break-before: always; }
  .band-title { display: block; font: 700 9pt var(--bs-body-font-family); margin: 0 0 3px; }
}

/* ---- dashboard: figures and charts (all drawn here; nothing is loaded from outside) ---- */
:root { --c1: var(--pr-primary); --c2: #14b8a6; --c3: #f59e0b; --c4: #f43f5e; --c5: #0ea5e9; --c6: #8b5cf6; --c7: #84cc16; --c8: #64748b; --ch-net: var(--pr-primary); --ch-tax: #f59e0b; --ch-ded: #94a3b8; }
[data-bs-theme="dark"] { --ch-ded: #64748b; }
.kpis .stat-rich { position: relative; overflow: hidden; align-items: flex-start; padding-bottom: 2.4rem; }
.stat-rich .stat-delta { font-size: .72rem; margin-top: .15rem; color: var(--pr-muted); }
.stat-rich .stat-delta.up { color: #16a34a; font-weight: 600; } .stat-rich .stat-delta.down { color: #dc2626; font-weight: 600; }
.stat-icon.rose { background: color-mix(in srgb, #f43f5e 15%, transparent); color: #f43f5e; }
.spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 34px; opacity: .8; pointer-events: none; }
.spark polyline { fill: none; stroke: var(--pr-primary); stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 260; stroke-dashoffset: 260; animation: pr-draw 1.2s .25s ease-out forwards; }
.spark polygon { fill: color-mix(in srgb, var(--pr-primary) 14%, transparent); stroke: none; opacity: 0; animation: pr-fade .8s .9s ease-out forwards; }
@keyframes pr-draw { to { stroke-dashoffset: 0; } } @keyframes pr-fade { to { opacity: 1; } }
.kpis .stat-rich .flex-grow-1 { min-width: 0; position: relative; z-index: 1; }

.chart-wrap { display: flex; gap: .5rem; height: 270px; }
.chart-wrap .axis { display: flex; flex-direction: column; justify-content: space-between; font-size: .66rem; color: var(--pr-muted); text-align: right; padding-bottom: 1.6rem; min-width: 2.6rem; }
.chart-cols { flex: 1; display: flex; align-items: stretch; gap: .5rem; min-width: 0; position: relative; }
.chart-cols.stack { background-image: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), color-mix(in srgb, var(--pr-border) 80%, transparent) calc(25% - 1px), color-mix(in srgb, var(--pr-border) 80%, transparent) 25%); background-size: 100% calc(100% - 1.6rem); background-repeat: no-repeat; }
.chart-cols .col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .25rem; cursor: default; }
.chart-cols .seg-wrap { width: 100%; max-width: 44px; flex: 1; display: flex; flex-direction: column-reverse; justify-content: flex-start; }
.chart-cols .seg { width: 100%; transform-origin: bottom; animation: pr-grow .7s cubic-bezier(.22, 1, .36, 1) both; animation-delay: calc(var(--i) * 45ms); transition: filter .15s; }
.chart-cols .seg.net { background: linear-gradient(180deg, color-mix(in srgb, var(--ch-net) 78%, #fff), var(--ch-net)); }
.chart-cols .seg.tax { background: var(--ch-tax); } .chart-cols .seg.ded { background: var(--ch-ded); border-radius: 6px 6px 0 0; }
.chart-cols .seg.net:last-child { border-radius: 0 0 4px 4px; }
.chart-cols .seg.none { height: 3px; background: color-mix(in srgb, var(--pr-border) 90%, transparent); border-radius: 2px; margin-top: auto; }
.chart-cols .col:hover .seg { filter: brightness(1.08) saturate(1.1); }
.chart-cols .lbl { font-size: .68rem; color: var(--pr-muted); white-space: nowrap; height: 1.35rem; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.chart-cols.simple { height: 230px; --ch: var(--pr-primary); }
.chart-cols.simple .seg-wrap { max-width: 40px; }
.chart-cols.simple .seg { background: linear-gradient(180deg, color-mix(in srgb, var(--ch) 72%, #fff), var(--ch)); border-radius: 7px 7px 3px 3px; min-height: 3px; }
.chart-cols.simple .val { font-size: .64rem; color: var(--pr-muted); white-space: nowrap; height: .9rem; }
.chart-cols.simple .lbl { writing-mode: horizontal-tb; font-size: .64rem; }
@keyframes pr-grow { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; padding: .2rem 1.25rem .9rem; font-size: .74rem; color: var(--pr-muted); }
.legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .35rem; vertical-align: -.05rem; }
.legend i.net { background: var(--ch-net); } .legend i.tax { background: var(--ch-tax); } .legend i.ded { background: var(--ch-ded); }
.chart-empty { display: grid; place-items: center; min-height: 140px; color: var(--pr-muted); font-size: .85rem; }

.donut-wrap { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; justify-content: center; }
.donut { position: relative; width: 168px; height: 168px; flex: none; }
.donut svg { width: 100%; height: 100%; }
.donut circle { fill: none; stroke-width: 15; }
.donut .track { stroke: color-mix(in srgb, var(--pr-border) 70%, transparent); }
.donut .arc { stroke: var(--c); stroke-linecap: butt; animation: pr-donut 1s cubic-bezier(.22, 1, .36, 1) both; animation-delay: calc(var(--i) * 120ms); transition: stroke-width .15s, filter .15s; }
.donut .arc:hover { stroke-width: 18; filter: brightness(1.08); }
@keyframes pr-donut { from { stroke-dasharray: 0 100; } }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center strong { font-size: 1.35rem; letter-spacing: -.02em; line-height: 1.1; } .donut-center span { font-size: .68rem; color: var(--pr-muted); text-transform: uppercase; letter-spacing: .06em; }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 150px; display: grid; gap: .35rem; }
.donut-legend li { display: flex; align-items: center; gap: .5rem; font-size: .8rem; }
.donut-legend i { width: .7rem; height: .7rem; border-radius: 3px; background: var(--c); flex: none; }
.donut-legend .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend .v { font-weight: 650; white-space: nowrap; } .donut-legend small { color: var(--pr-muted); font-weight: 500; margin-left: .25rem; }

.hbars { display: grid; gap: .75rem; }
.hb-top { display: flex; justify-content: space-between; gap: .6rem; font-size: .8rem; margin-bottom: .2rem; }
.hb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .hb-val { font-weight: 650; white-space: nowrap; } .hb-val small { color: var(--pr-muted); font-weight: 500; }
.hb-track { height: 9px; border-radius: 999px; background: color-mix(in srgb, var(--pr-border) 65%, transparent); overflow: hidden; }
.hb-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c)); transform-origin: left; animation: pr-hgrow .9s cubic-bezier(.22, 1, .36, 1) both; animation-delay: calc(var(--i) * 70ms); }
@keyframes pr-hgrow { from { transform: scaleX(0); } }
.section-title-lg { display: flex; align-items: center; gap: .6rem; margin: 1.6rem 0 .8rem; }
.section-title-lg i { font-size: 1.3rem; color: var(--pr-primary); } .section-title-lg h2 { font-size: 1.1rem; margin: 0; font-weight: 700; } .section-title-lg span { color: var(--pr-muted); font-size: .82rem; }
.glance .list-group-item { display: flex; justify-content: space-between; background: transparent; font-size: .85rem; } .glance strong { font-variant-numeric: tabular-nums; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: .8rem; align-items: center; padding: .6rem 1.1rem; border-top: 1px solid var(--pr-border); font-size: .84rem; flex-wrap: wrap; }
.activity .when { color: var(--pr-muted); width: 6.6rem; flex: none; font-variant-numeric: tabular-nums; } .activity .who { font-weight: 650; width: 6rem; flex: none; } .activity .what { flex: 1; min-width: 10rem; }
@media (prefers-reduced-motion: reduce) { .chart-cols .seg, .donut .arc, .hb-fill, .spark polyline, .spark polygon { animation: none !important; stroke-dashoffset: 0; opacity: 1; } }
@media print { .spark, .no-print { display: none !important; } }

/* ---- notifications (bell, list) ---- */
.bell { position: relative; }
.bell-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #dc2626; color: #fff; font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; border: 2px solid var(--pr-surface); }
.bell.has-new .bi { animation: bell-ring 2.4s ease-in-out 1; transform-origin: 50% 0; }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 8% { transform: rotate(14deg); } 16% { transform: rotate(-12deg); } 24% { transform: rotate(8deg); } 32% { transform: rotate(-5deg); } 40% { transform: rotate(0); } }
.notify-menu { width: min(400px, calc(100vw - 24px)); padding: 0; border-radius: 14px; background: var(--pr-surface); overflow: hidden; }
.notify-head, .notify-foot { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; font-size: .85rem; }
.notify-head { border-bottom: 1px solid var(--pr-border); }
.notify-foot { border-top: 1px solid var(--pr-border); justify-content: space-between; background: var(--bs-tertiary-bg); }
.nlist { list-style: none; margin: 0; padding: 0; }
.nlist > li { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border-bottom: 1px solid var(--pr-border); }
.nlist > li:last-child { border-bottom: 0; }
.nlist > li.read { opacity: .72; }
.nlist .n-icon { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 1.05rem; background: var(--pr-primary-soft); color: var(--pr-primary); }
.nlist .n-warning .n-icon { background: rgba(245, 158, 11, .16); color: #b45309; }
.nlist .n-danger .n-icon { background: rgba(220, 38, 38, .13); color: #dc2626; }
.nlist .n-success .n-icon { background: rgba(22, 163, 74, .14); color: #15803d; }
.nlist .n-body { flex: 1; min-width: 0; }
.nlist .n-title { font-weight: 600; font-size: .88rem; line-height: 1.3; }
.nlist .n-text { font-size: .8rem; color: var(--pr-muted); margin-top: .15rem; }
.nlist .n-time { font-size: .72rem; color: var(--pr-muted); margin-top: .25rem; }
.nlist .n-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pr-primary); margin-left: .3rem; vertical-align: middle; }
.nlist .n-actions { flex: none; display: flex; flex-direction: column; gap: .35rem; }
.nlist.compact { max-height: 380px; overflow: auto; }
.nlist.compact .n-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nlist .n-empty { display: block; text-align: center; color: var(--pr-muted); padding: 1.6rem 1rem; }
@media (max-width: 640px) { .nlist:not(.compact) > li { flex-wrap: wrap; } .nlist .n-actions { flex-direction: row; width: 100%; padding-left: 46px; } }

/* ---- loan certificate (NOC) ---- */
.noc { background: #fff; color: #111; max-width: 794px; margin: 0 auto 1.5rem; padding: 2.2rem 2.6rem 1.6rem; border: 1px solid var(--pr-border); border-radius: 6px; box-shadow: var(--pr-shadow); min-height: 520px; font-family: Georgia, "Times New Roman", serif; display: flex; flex-direction: column; }
.noc.ur { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", "Noto Naskh Arabic", "Segoe UI", Tahoma, serif; line-height: 2.4; }
.noc-head { text-align: center; padding-bottom: .8rem; border-bottom: 2px solid #111; margin-bottom: 1rem; }
.noc-logo { height: 84px; max-width: 240px; object-fit: contain; display: block; margin: 0 auto .35rem; }
.noc-org { font-size: 1.35rem; font-weight: 800; line-height: 1.2; }
.noc-dept { font-size: 1.05rem; font-weight: 600; }
.noc-addr { font-size: .78rem; color: #333; }
.noc-ref { display: flex; justify-content: space-between; gap: 1rem; font-size: .88rem; margin-bottom: 1rem; }
.noc-title { text-align: center; font-size: 1.15rem; font-weight: 800; letter-spacing: .03em; text-decoration: underline; text-underline-offset: 6px; margin: .4rem 0 1.2rem; }
.noc.ur .noc-title { letter-spacing: 0; }
.noc-body { flex: 1; font-size: 1rem; line-height: 1.75; text-align: justify; }
.noc.ur .noc-body { font-size: 1.05rem; line-height: 2.5; }
.noc-body p { margin: 0 0 .9rem; }
.noc-sign { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-top: 2.2rem; }
.noc-sign .seal { width: 112px; height: 112px; border: 2px dashed #888; border-radius: 50%; display: grid; place-items: center; text-align: center; font-size: .72rem; color: #777; padding: .5rem; }
.noc-sign .sig { text-align: center; min-width: 210px; font-weight: 700; font-size: .9rem; }
.noc-sign .sig span { display: block; border-top: 1.5px solid #111; margin-bottom: .3rem; }
.noc-sign .sig small { display: block; font-weight: 400; color: #444; font-size: .75rem; }
.noc-foot { margin-top: 1.2rem; padding-top: .5rem; border-top: 1px solid #bbb; font-size: .7rem; color: #555; text-align: center; }
[data-bs-theme="dark"] .noc { box-shadow: 0 0 0 1px var(--pr-border), 0 6px 22px rgba(0,0,0,.35); }
.noc-chips { display: flex; flex-wrap: wrap; gap: .35rem; max-height: 132px; overflow: auto; }
.noc-chips .chip { border: 1px solid var(--pr-border); background: var(--pr-surface); color: var(--pr-text); border-radius: 999px; padding: .15rem .65rem; font-size: .75rem; cursor: pointer; }
.noc-chips .chip:hover { background: var(--pr-primary-soft); border-color: var(--pr-primary); color: var(--pr-primary); }
.noc-edit-ur { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", "Noto Naskh Arabic", "Segoe UI", Tahoma, serif; line-height: 2.2; font-size: 1.05rem; }
.noc-preview .noc { margin-top: 0; }
@media (max-width: 760px) { .noc { padding: 1.2rem 1.1rem; } .noc-sign { flex-direction: column; align-items: center; } .noc-ref { flex-direction: column; gap: .2rem; } }
@media print {
  .noc { border: 0; box-shadow: none; border-radius: 0; margin: 0; padding: 0 4mm; min-height: 0; max-width: none; color: #000; break-inside: avoid; page-break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .noc + .noc { break-before: page; page-break-before: always; }
  .noc-body { font-size: 12pt; }
}
.noc bdi.nb { white-space: nowrap; }

.logo-well.wide { width: 150px; height: 84px; border-radius: 10px; overflow: hidden; } .logo-well.wide img { width: 100%; height: 100%; object-fit: cover; }

/* ---- pay slips: two to a page ---- */
body.printing-slips .ps2.slip-print { box-sizing: border-box; overflow: hidden; margin: 0 !important; border-radius: 0; break-inside: avoid; page-break-inside: avoid; }
body.printing-slips .ps2.slip-print + .ps2.slip-print { break-before: auto; page-break-before: auto; }
body.printing-slips .ps2.slip-print.slip-second { margin-top: 4mm !important; }
body.printing-slips .ps2.slip-print.slip-pb { break-before: page; page-break-before: always; }
body.printing-slips #slips > .card, body.printing-slips #slips > [data-print-meta] { display: none !important; }
body.printing-slips .ps2.slip-print img { max-width: 100%; }
@media print {
  /* a slip always prints on white, with dark text, even when the screen is in dark mode */
  .ps2 { --bs-body-bg: #fff; --bs-body-color: #000; --bs-border-color: #8a8a8a; --bs-secondary-color: #444; --bs-tertiary-bg: #f3f3f3; background: #fff !important; color: #000 !important; }
  .ps2 img { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* the slip as printed: tight spacing so a whole slip fits half a page at a readable size */
body.printing-slips .ps2.slip-print { font-size: 13px; line-height: 1.25; }
body.printing-slips .ps2.slip-print .ps2-head { padding: .35rem .8rem; gap: .6rem; border-bottom-width: 2px; }
body.printing-slips .ps2.slip-print .ps2-logo { width: 44px; height: 44px; }
body.printing-slips .ps2.slip-print .ps2-org-name { font-size: 1.05rem; }
body.printing-slips .ps2.slip-print .ps2-org-sub { font-size: .8rem; }
body.printing-slips .ps2.slip-print .ps2-org-addr { font-size: .62rem; }
body.printing-slips .ps2.slip-print .ps2-title span { font-size: .6rem; }
body.printing-slips .ps2.slip-print .ps2-title b { margin-top: .1rem; padding: .12rem .6rem; font-size: .78rem; }
body.printing-slips .ps2.slip-print .ps2-who { padding: .35rem .8rem; gap: .6rem; }
body.printing-slips .ps2.slip-print .ps2-photo { width: 50px; height: 62px; border-width: 1px; border-radius: 4px; }
body.printing-slips .ps2.slip-print .ps2-grid { grid-template-columns: repeat(4, 1fr); gap: .15rem .7rem; }
body.printing-slips .ps2.slip-print .ps2-f.wide { grid-column: span 2; }
body.printing-slips .ps2.slip-print .ps2-f span, body.printing-slips .ps2.slip-print .ps2-service span { font-size: .52rem; letter-spacing: .05em; }
body.printing-slips .ps2.slip-print .ps2-f strong, body.printing-slips .ps2.slip-print .ps2-service strong { font-size: .72rem; }
body.printing-slips .ps2.slip-print .ps2-cols { padding: .35rem .8rem; gap: .5rem; }
body.printing-slips .ps2.slip-print .ps2-stack { gap: .35rem; }
body.printing-slips .ps2.slip-print .ps2-panel { border-radius: 4px; }
body.printing-slips .ps2.slip-print .ps2-panel h3 { padding: .18rem .5rem; font-size: .6rem; }
body.printing-slips .ps2.slip-print .ps2-panel table, body.printing-slips .ps2.slip-print .ps2-loans table { font-size: .7rem; }
body.printing-slips .ps2.slip-print .ps2-panel th { padding: .12rem .5rem; font-size: .52rem; }
body.printing-slips .ps2.slip-print .ps2-panel td { padding: .06rem .5rem; }
body.printing-slips .ps2.slip-print .ps2-panel tfoot td { padding: .15rem .5rem; }
body.printing-slips .ps2.slip-print .ps2-tax { padding: 0 .8rem .3rem; }
body.printing-slips .ps2.slip-print .ps2-net { margin: 0 .8rem .35rem; padding: .3rem .8rem; border-radius: 6px; }
body.printing-slips .ps2.slip-print .ps2-net span { font-size: .55rem; }
body.printing-slips .ps2.slip-print .ps2-net b { font-size: 1.05rem; }
body.printing-slips .ps2.slip-print .ps2-net p { font-size: .62rem; }
body.printing-slips .ps2.slip-print .ps2-loans { padding: 0 .8rem .35rem; }
body.printing-slips .ps2.slip-print .ps2-loans th { padding: .12rem .5rem; font-size: .52rem; }
body.printing-slips .ps2.slip-print .ps2-loans td { padding: .08rem .5rem; }
body.printing-slips .ps2.slip-print .ps2-service { padding: .25rem .8rem; margin: 0 .8rem .35rem; gap: .5rem; border-radius: 6px; }
body.printing-slips .ps2.slip-print .ps2-foot { padding: .2rem .8rem; font-size: .56rem; }