/* ============================================================
   AVUB Branch Suite - design system
   ============================================================ */
:root {
  --primary: #0b4f6c;
  --primary-2: #083344;
  --primary-3: #0e6b87;
  --accent: #e6b83c;
  --accent-2: #c99a1e;
  --bg: #f2f6f9;
  --card: #ffffff;
  --text: #17263a;
  --muted: #67788e;
  --border: #e3eaf1;
  --border-strong: #cfd9e4;
  --success: #157f4d;
  --success-bg: #e6f6ee;
  --danger: #b42318;
  --danger-bg: #feeceb;
  --warn: #a15c07;
  --warn-bg: #fdf3e2;
  --info: #1d4ed8;
  --info-bg: #e9efff;
  --purple: #6d28d9;
  --purple-bg: #f1ebff;
  --sidebar-w: 252px;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(15, 44, 66, .06);
  --shadow-lg: 0 24px 60px rgba(10, 32, 48, .18);
  --font: "Segoe UI", "Nirmala UI", "Noto Sans Bengali", "SolaimanLipi", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.015em; }
svg { flex: 0 0 auto; width: 16px; height: 16px; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c5d2dd; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #a9bacb; }
::-webkit-scrollbar-track { background: transparent; }

a:focus-visible, button:focus-visible, .tab:focus-visible,
summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary-3);
  outline-offset: 2px;
  border-radius: 6px;
}
.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 1000;
  background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { left: 8px; }

.boot-screen {
  min-height: 100vh; display: flex; flex-direction: column; gap: 16px;
  align-items: center; justify-content: center; color: var(--muted);
}
.boot-mark {
  width: 68px; height: 68px; border-radius: 16px; display: grid; place-items: center;
  background: #fff; padding: 6px;
  box-shadow: var(--shadow-lg);
}
.boot-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.boot-text { font-size: 13px; letter-spacing: .02em; }

/* ---------------- shell ---------------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  position: fixed; inset: 0 auto 0 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(230, 184, 60, .13), transparent 40%),
    linear-gradient(180deg, #0a3448 0%, #082a3b 55%, #061f2c 100%);
  color: #d8e6ee;
  display: flex; flex-direction: column;
  z-index: 50;
  transition: transform .25s ease;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: #fff; padding: 3px;
  display: grid; place-items: center;
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-text { min-width: 0; }
.brand-name { font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 10.5px; color: #8fb0c1; letter-spacing: .09em; text-transform: uppercase; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { flex: 1; overflow-y: auto; padding: 14px 10px 20px; }
.nav-group { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #6f91a3; padding: 14px 12px 7px; font-weight: 700; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9.5px 12px; margin: 2px 0;
  border-radius: 10px; color: #b7cbd7; font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s;
  position: relative;
}
.nav a svg { width: 18px; height: 18px; opacity: .86; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active {
  background: linear-gradient(90deg, rgba(230,184,60,.18), rgba(230,184,60,.035));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav a.active svg { color: var(--accent); opacity: 1; }
.nav .nav-count {
  margin-left: auto; font-size: 10.5px; background: rgba(255,255,255,.1);
  padding: 1px 7px; border-radius: 999px; color: #dbeaf2;
}
.sidebar-foot {
  padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.07);
  font-size: 11px; color: #7d9cac; display: flex; align-items: center; gap: 8px;
}
.sidebar-foot .dot { width: 7px; height: 7px; border-radius: 50%; background: #41c98a; box-shadow: 0 0 0 3px rgba(65,201,138,.15); }

.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 66px; position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
}
.searchbox {
  position: relative; flex: 1; max-width: 480px;
}
.searchbox svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: #8a9aab;
}
.searchbox input {
  width: 100%; border: 1px solid var(--border); background: #f7fafc;
  border-radius: 10px; padding: 9px 12px 9px 38px; font-size: 13px;
  outline: none; transition: box-shadow .15s, border .15s, background .15s;
}
.searchbox input:focus { background: #fff; border-color: #b9cfe0; box-shadow: 0 0 0 4px rgba(11,79,108,.07); }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); max-height: 430px; overflow: auto; display: none; z-index: 60;
}
.search-results.open { display: block; }
.search-group { padding: 8px 10px 2px; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.search-item { padding: 9px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.search-item:hover { background: #f5f9fc; }
.search-item .muted { font-size: 11.5px; }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.lang-toggle {
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  border-radius: 9px; padding: 7px 10px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.lang-toggle:hover { color: var(--primary); border-color: #bdd3e0; }
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px;
  border: 1px solid var(--border); border-radius: 999px; background: #fff; cursor: pointer;
}
.user-chip:hover { border-color: #bdd3e0; }
.user-chip .avatar { width: 30px; height: 30px; font-size: 11px; }
.user-chip > svg { width: 14px; height: 14px; color: #8496a8; }
.user-chip .u-name { font-size: 12.5px; font-weight: 700; line-height: 1.1; }
.user-chip .u-role { font-size: 10px; color: var(--muted); }
.menu-toggle { display: none; }

.page { padding: 22px 24px 40px; max-width: 1640px; width: 100%; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-size: 25px; font-weight: 700; }
.page-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 9px;
  background: var(--primary); color: #fff;
  padding: 8.5px 13px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, transform .08s, box-shadow .15s;
}
.btn:hover { background: #0d5c7d; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: #f6fafc; border-color: #c3d5e2; }
.btn.gold { background: linear-gradient(145deg, #f0c75e, var(--accent)); color: #2a2718; }
.btn.gold:hover { filter: brightness(1.03); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #971a12; }
.btn.soft { background: var(--info-bg); color: var(--info); }
.btn.sm { padding: 5.5px 9px; font-size: 11.5px; border-radius: 8px; }
.btn.sm svg { width: 13px; height: 13px; }
.btn.icon { padding: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-link { border: 0; background: none; color: var(--primary); font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 4px; }
.btn-link.danger { color: var(--danger); }

/* ---------------- layout bits ---------------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { padding: 15px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { font-size: 14px; font-weight: 700; }
.card-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px; }
.card-body.flush { padding: 0; }
.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; }
.grid-2.equal { grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.right { text-align: right; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.mono { font-variant-numeric: tabular-nums; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.w-100 { width: 100%; }
.span-2 { grid-column: 1 / -1; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------------- hero / stats ---------------- */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(circle at 88% 15%, rgba(230,184,60,.24), transparent 34%),
              radial-gradient(circle at 74% 120%, rgba(255,255,255,.12), transparent 42%),
              linear-gradient(112deg, #0a3b51 0%, #0c5571 58%, #0f718e 100%);
  color: #fff; border-radius: 18px; padding: 23px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 22px;
  margin-bottom: 18px; box-shadow: 0 16px 34px rgba(7,47,66,.18);
}
.hero::after {
  content: ""; position: absolute; right: -40px; bottom: -90px; width: 260px; height: 260px;
  border: 1px solid rgba(255,255,255,.13); border-radius: 50%;
}
.hero h2 { font-size: 22px; margin-bottom: 5px; }
.hero p { margin: 0; color: #c8dfe9; font-size: 12.5px; }
.hero-date {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px;
  background: rgba(255,255,255,.1); padding: 5px 10px; border-radius: 999px; color: #e8f4f9;
}
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero .btn.gold { box-shadow: 0 8px 20px rgba(0,0,0,.18); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 13px; margin-bottom: 18px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); opacity: .85; }
.stat.gold::before { background: var(--accent); }
.stat.green::before { background: var(--success); }
.stat.red::before { background: var(--danger); }
.stat.amber::before { background: var(--warn); }
.stat.purple::before { background: var(--purple); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.stat-label { font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: .015em; }
.icon-bubble {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: #eef6fa; color: var(--primary);
}
.icon-bubble svg { width: 16px; height: 16px; }
.stat.gold .icon-bubble { background: #fdf6e2; color: #9a7210; }
.stat.green .icon-bubble { background: var(--success-bg); color: var(--success); }
.stat.red .icon-bubble { background: var(--danger-bg); color: var(--danger); }
.stat.amber .icon-bubble { background: var(--warn-bg); color: var(--warn); }
.stat.purple .icon-bubble { background: var(--purple-bg); color: var(--purple); }
.stat-value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: 11px; color: var(--muted); margin-top: 5px; display: flex; align-items: center; gap: 5px; }
.trend-up { color: var(--success); font-weight: 700; }
.trend-down { color: var(--danger); font-weight: 700; }

/* ---------------- tables ---------------- */
.table-wrap { overflow: auto; border-radius: 10px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th {
  position: sticky; top: 0; z-index: 1;
  background: #f7fafc; color: #63758a;
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700;
  padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap;
}
.tbl tbody td { padding: 10px 12px; border-bottom: 1px solid #eef3f7; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #f8fbfd; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tfoot td { padding: 10px 12px; font-weight: 700; background: #f8fbfd; border-top: 1px solid var(--border); }
.tbl .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tbl .actions { display: flex; gap: 5px; justify-content: flex-end; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 38px; height: 38px; margin-bottom: 8px; opacity: .45; }
.empty-title { font-weight: 700; color: #4a5b70; margin-bottom: 3px; }
.empty-text { font-size: 12px; }
.row-title { font-weight: 600; }
.row-sub { font-size: 11px; color: var(--muted); }
.cell-nowrap { white-space: nowrap; }
.checkbox-cell { width: 34px; }

/* ---------------- badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 2.5px 8px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .01em;
  background: #eef2f6; color: #475569; white-space: nowrap;
}
.badge.green { background: var(--success-bg); color: var(--success); }
.badge.red { background: var(--danger-bg); color: var(--danger); }
.badge.amber { background: var(--warn-bg); color: var(--warn); }
.badge.blue { background: var(--info-bg); color: var(--info); }
.badge.purple { background: var(--purple-bg); color: var(--purple); }
.badge.gray { background: #eef2f6; color: #5b6b7f; }
.badge.dark { background: #17303c; color: #fff; }
.badge.dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: #fff; border-radius: 8px;
  padding: 5px 9px; font-size: 11.5px; color: #4d5f74;
}
.chip strong { color: var(--text); }

/* ---------------- forms ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 15px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 11.5px; font-weight: 700; color: #46586e; letter-spacing: .01em; }
.field > label .req { color: var(--danger); }
.input, .field select, .field textarea, select.input, textarea.input {
  border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 8.5px 10px; font-size: 13px; background: #fff; color: var(--text);
  width: 100%; outline: none;
  transition: border .15s, box-shadow .15s;
}
.input:focus, .field select:focus, .field textarea:focus {
  border-color: #7fa9c0; box-shadow: 0 0 0 4px rgba(11,79,108,.08);
}
.input:disabled { background: #f5f8fa; color: var(--muted); }
.field textarea { min-height: 76px; resize: vertical; }
.field .hint { font-size: 10.5px; color: var(--muted); }
.form-section {
  grid-column: 1 / -1; font-size: 10.5px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--primary);
  border-bottom: 1px dashed var(--border); padding-bottom: 6px; margin-top: 4px;
}
.form-section:first-child { margin-top: 0; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #42536a; }
.checkbox input { width: 15px; height: 15px; accent-color: var(--primary); }
.inline-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.form-error { background: var(--danger-bg); color: var(--danger); border-radius: 8px; padding: 9px 12px; font-size: 12px; }
.filterbar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filterbar .input, .filterbar select { width: auto; min-width: 140px; }
.search-input { position: relative; }
.search-input .input { padding-left: 32px; min-width: 220px; }
.search-input svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: #93a3b4; }
.file-drop {
  border: 1.5px dashed #c8d6e2; border-radius: 10px; padding: 14px;
  text-align: center; font-size: 11.5px; color: var(--muted); cursor: pointer;
  background: #fbfdff;
}
.file-drop:hover { border-color: #9db9cc; background: #f6fbfe; }
.file-drop img { max-height: 70px; max-width: 100%; border-radius: 6px; display: block; margin: 0 auto 6px; }
.nid-scan {
  display: grid; grid-template-columns: 1fr 1fr 1.1fr; gap: 12px; align-items: stretch;
  border: 1px solid var(--border); background: #f8fbfd; border-radius: 12px; padding: 12px;
}
.nid-drop { display: flex; flex-direction: column; gap: 6px; justify-content: center; min-height: 138px; }
.nid-drop[data-nid-drop="nid_combined"] { grid-column: 1 / 3; min-height: 116px; }
.nid-drop-title { font-weight: 700; font-size: 11.5px; color: #46586e; }
.nid-drop img { max-height: 92px; }
.nid-placeholder { display: flex; justify-content: center; color: #a9bccb; }
.nid-placeholder svg { width: 34px; height: 34px; }
.nid-drop-action { font-size: 10.5px; color: var(--primary); font-weight: 700; }
.nid-drop-note { font-size: 10px; color: var(--muted); }
.nid-side { display: flex; flex-direction: column; gap: 8px; justify-content: center; grid-column: 3; grid-row: 1 / span 2; }
.nid-side .btn { justify-content: center; }
.nid-status { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.nid-status.ok { color: #1f7a46; }
.nid-status.error { color: var(--danger); }
.nid-status svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.nid-side details summary { cursor: pointer; font-size: 11px; color: var(--primary); font-weight: 700; }
.nid-side pre {
  max-height: 150px; overflow: auto; white-space: pre-wrap; font-size: 10.5px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px; margin: 6px 0 0;
}
.nid-docs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nid-doc { margin: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; cursor: zoom-in; }
.nid-doc img { width: 100%; display: block; max-height: 180px; object-fit: contain; }
.nid-doc figcaption { font-size: 10.5px; color: var(--muted); padding: 5px 8px; border-top: 1px solid var(--border); text-align: center; }
.nid-doc.wide { grid-column: 1 / -1; }
.nid-doc.wide img { max-height: 320px; }

/* ---------------- modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(6, 25, 36, .55); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 36px 16px; overflow: auto; animation: fadeIn .12s ease;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 620px;
  box-shadow: var(--shadow-lg); animation: slideUp .18s ease;
  margin: auto 0;
}
.modal.wide { max-width: 900px; }
.modal.xwide { max-width: 1120px; }
.modal-head {
  padding: 15px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  position: sticky; top: 0; background: #fff; border-radius: 16px 16px 0 0; z-index: 3;
}
.modal-title { font-size: 15.5px; font-weight: 700; }
.modal-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.modal-body { padding: 19px 20px; }
.modal-foot {
  padding: 13px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 9px;
  position: sticky; bottom: 0; background: #fff; border-radius: 0 0 16px 16px; z-index: 3;
}
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; display: grid; place-items: center; cursor: pointer; color: #68798d;
}
.icon-btn:hover { background: #f4f8fb; color: var(--text); }
.icon-btn svg { width: 15px; height: 15px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------- toast ---------------- */
#toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 300; display: flex; flex-direction: column; gap: 9px; max-width: 380px; }
.toast {
  background: #102c3b; color: #fff; border-radius: 10px; padding: 11px 14px;
  font-size: 12.5px; box-shadow: 0 14px 34px rgba(6,25,36,.3);
  display: flex; gap: 9px; align-items: flex-start; animation: slideUp .18s ease;
  border-left: 3px solid #41c98a;
}
.toast.error { border-left-color: #f26d63; }
.toast.info { border-left-color: #6aa9ff; }
.toast svg { width: 16px; height: 16px; margin-top: 1px; }
.toast .toast-close { margin-left: auto; cursor: pointer; opacity: .6; background: none; border: 0; color: #fff; font-size: 15px; line-height: 1; }

/* ---------------- tabs ---------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab {
  padding: 9px 13px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--accent); }
.tab .count { background: #eef3f7; color: #5f7188; font-size: 10px; padding: 1px 6px; border-radius: 999px; }
.tab.active .count { background: #e4f0f5; color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------------- charts ---------------- */
.chart-area { padding: 6px 2px 0; }
.bar-chart { display: flex; align-items: flex-end; gap: 12px; height: 185px; padding-top: 8px; }
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 155px; width: 100%; }
.bar {
  width: 13px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #2b86a9, #0b4f6c);
  min-height: 2px; transition: height .35s ease; position: relative;
}
.bar.gold { background: linear-gradient(180deg, #f0c75e, #d3a01f); }
.bar:hover { filter: brightness(1.08); }
.bar-label { font-size: 10px; color: var(--muted); white-space: nowrap; }
.legend { display: flex; gap: 14px; align-items: center; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; }
.donut { width: 150px; height: 150px; border-radius: 50%; position: relative; flex: 0 0 auto; }
.donut::after {
  content: ""; position: absolute; inset: 24px; border-radius: 50%; background: #fff;
  box-shadow: inset 0 0 0 1px #eef3f7;
}
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; text-align: center; }
.donut-center strong { display: block; font-size: 17px; }
.donut-center span { font-size: 10px; color: var(--muted); }
.donut-legend { display: flex; flex-direction: column; gap: 7px; font-size: 11.5px; min-width: 150px; }
.donut-legend .li { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.donut-legend .li span:first-child { display: flex; align-items: center; gap: 7px; color: #4d5f74; }
.donut-legend i { width: 8px; height: 8px; border-radius: 2px; }

/* ---------------- dashboard lists ---------------- */
.alert-list { display: flex; flex-direction: column; }
.alert-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 0;
  border-bottom: 1px solid #eef3f7; cursor: pointer;
}
.alert-item:last-child { border-bottom: 0; }
.alert-item:hover .alert-title { color: var(--primary); }
.alert-icon {
  width: 33px; height: 33px; border-radius: 9px; display: grid; place-items: center;
  background: var(--warn-bg); color: var(--warn); flex: 0 0 auto;
}
.alert-icon.red { background: var(--danger-bg); color: var(--danger); }
.alert-icon.blue { background: var(--info-bg); color: var(--info); }
.alert-icon svg { width: 15px; height: 15px; }
.alert-main { min-width: 0; flex: 1; }
.alert-title { font-size: 12.5px; font-weight: 600; }
.alert-meta { font-size: 10.5px; color: var(--muted); }
.alert-amount { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-btn {
  border: 1px solid var(--border); background: #fff; border-radius: 11px; padding: 13px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer;
  font-size: 11.5px; font-weight: 600; color: #40536a; text-align: center;
  transition: border .15s, background .15s, transform .1s;
}
.quick-btn:hover { border-color: #bcd2e0; background: #f8fcfd; transform: translateY(-1px); }
.quick-btn svg { width: 19px; height: 19px; color: var(--primary); }

/* ---------------- detail pages ---------------- */
.profile-head {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(145deg, #d9ebf4, #b7d4e3); color: #0b4f6c;
  display: grid; place-items: center; font-weight: 800; font-size: 15px; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 68px; height: 68px; font-size: 20px; }
.profile-main { flex: 1; min-width: 220px; }
.profile-name { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.profile-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11.5px; color: #52657b; margin-top: 8px; }
.profile-meta span { display: inline-flex; align-items: center; gap: 5px; }
.profile-meta svg { width: 13px; height: 13px; color: #8fa1b3; }
.profile-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 18px; }
.kv { min-width: 0; }
.kv-label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.kv-value { font-size: 12.5px; font-weight: 600; margin-top: 2px; word-break: break-word; }
.kv-value.big { font-size: 17px; }
.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.summary-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border-top: 1px solid var(--border); }
.summary-strip > div { padding: 12px 18px; border-right: 1px solid var(--border); }
.summary-strip > div:last-child { border-right: 0; }
.summary-strip .label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.summary-strip .value { font-size: 15px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.actionbar { display: flex; gap: 7px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--border); background: #fbfdff; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 5px; bottom: 5px; width: 1.5px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -21px; top: 3px; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2.5px solid var(--primary); }
.tl-title { font-size: 12.5px; font-weight: 700; }
.tl-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tl-note { font-size: 11.5px; color: #4a5d72; margin-top: 4px; background: #f7fafc; border-radius: 7px; padding: 7px 9px; }
.progress { height: 7px; border-radius: 999px; background: #eaf0f5; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2b86a9, var(--primary)); }
.stat-line { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; padding: 6px 0; border-bottom: 1px dashed #e8eef4; }
.stat-line:last-child { border-bottom: 0; }
.stat-line .val { font-weight: 700; font-variant-numeric: tabular-nums; }
.notice-box { background: #fbfdff; border: 1px dashed #c9d9e6; border-radius: 10px; padding: 12px; font-size: 12px; color: #4d6076; }
.notice-box strong { color: var(--text); }

/* ---------------- report ---------------- */
.report-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.report-nav { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 3px; }
.report-nav button {
  text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 9px;
  font-size: 12.5px; color: #4d6177; cursor: pointer; display: flex; align-items: center; gap: 9px;
}
.report-nav button svg { width: 15px; height: 15px; opacity: .7; }
.report-nav button:hover { background: #eef5f9; color: var(--primary); }
.report-nav button.active { background: #e6f1f6; color: var(--primary); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.report-surface { min-width: 0; }
.report-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.report-title { font-size: 17px; font-weight: 700; margin-bottom: 2px; }
.report-note { font-size: 11.5px; color: var(--muted); }
.report-foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 20px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.signature-row { display: flex; justify-content: space-between; gap: 30px; margin-top: 36px; flex-wrap: wrap; }
.signature { border-top: 1px solid #aebfcd; padding-top: 5px; font-size: 11px; color: #58697c; min-width: 170px; text-align: center; }

/* ---------------- auth / setup ---------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.06fr .94fr; }
.auth-brand {
  position: relative; overflow: hidden; padding: 48px 52px;
  background:
    radial-gradient(circle at 85% 10%, rgba(230,184,60,.28), transparent 32%),
    radial-gradient(circle at 10% 90%, rgba(84, 191, 220, .18), transparent 42%),
    linear-gradient(145deg, #082f42 0%, #0a4560 56%, #0d5c7b 100%);
  color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.auth-brand::after {
  content: ""; position: absolute; right: -110px; bottom: -160px; width: 420px; height: 420px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 50%;
}
.auth-logo { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.auth-logo .brand-mark { width: 58px; height: 58px; padding: 4px; }
.auth-logo .t1 { font-size: 15px; font-weight: 700; }
.auth-logo .t2 { font-size: 11px; color: #a9c6d5; letter-spacing: .1em; text-transform: uppercase; }
.auth-hero { position: relative; z-index: 1; max-width: 490px; }
.auth-hero h1 { font-size: 34px; line-height: 1.12; margin-bottom: 14px; letter-spacing: -.03em; }
.auth-hero h1 em { font-style: normal; color: var(--accent); }
.auth-hero p { color: #c2d9e5; font-size: 14px; line-height: 1.6; margin: 0; }
.auth-features { display: flex; flex-direction: column; gap: 13px; position: relative; z-index: 1; }
.auth-feature { display: flex; gap: 11px; align-items: flex-start; font-size: 12.5px; color: #d6e8f0; }
.auth-feature svg { width: 17px; height: 17px; color: var(--accent); margin-top: 1px; }
.auth-feature strong { display: block; color: #fff; font-size: 12.5px; margin-bottom: 1px; }
.auth-foot { font-size: 10.5px; color: #7fa4b6; position: relative; z-index: 1; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 38px 24px; background: #f7fafc; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card.wide { max-width: 760px; }
.auth-title { font-size: 24px; font-weight: 700; margin-bottom: 5px; }
.auth-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 22px; }
.auth-form { display: flex; flex-direction: column; gap: 13px; }
.auth-form .field > label { font-size: 12px; }
.auth-form .input { padding: 10px 12px; font-size: 13.5px; }
.auth-submit { width: 100%; padding: 11px; font-size: 13.5px; margin-top: 2px; }
.auth-note { margin-top: 18px; font-size: 11px; color: var(--muted); line-height: 1.6; }
.auth-error { background: var(--danger-bg); color: var(--danger); padding: 9px 12px; border-radius: 8px; font-size: 12px; display: none; }
.auth-error.show { display: block; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.setup-grid .span-2 { grid-column: 1 / -1; }
.demo-box {
  border: 1px solid #d8e4ed; background: #fbfdff; border-radius: 10px; padding: 12px 13px;
  display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: #4a5e74;
}
.demo-box input { margin-top: 2px; accent-color: var(--primary); }
.demo-box strong { display: block; color: var(--text); margin-bottom: 1px; }

/* ---------------- misc ---------------- */
.spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
.spinner.dark { border-color: #d5e1ea; border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { padding: 50px; display: flex; justify-content: center; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.skeleton {
  background: linear-gradient(90deg, #edf2f6 25%, #f6f9fb 50%, #edf2f6 75%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; height: 13px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.dot-sep { color: #b9c6d2; }
.amount-pos { color: var(--success); font-weight: 700; }
.amount-neg { color: var(--danger); font-weight: 700; }
.help { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.pill-tabs { display: inline-flex; background: #edf3f7; padding: 3px; border-radius: 9px; gap: 2px; }
.pill-tabs button { border: 0; background: none; padding: 6px 11px; border-radius: 7px; font-size: 11.5px; font-weight: 600; color: #5a6d82; cursor: pointer; }
.pill-tabs button.active { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(20,50,70,.12); }
.data-note { font-size: 11px; color: var(--muted); padding: 8px 2px; }
.big-amount { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.flex-1 { flex: 1; }
.table-actions { display: flex; gap: 4px; justify-content: flex-end; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head h3 { font-size: 13px; font-weight: 700; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); background: #fff;
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  min-width: 170px; padding: 5px; z-index: 70; display: none;
}
.dropdown.open { display: block; }
.dropdown button { width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 7px; font-size: 12.5px; cursor: pointer; color: #3d4f64; display: flex; align-items: center; gap: 8px; }
.dropdown button svg { width: 15px; height: 15px; opacity: .75; }
.dropdown button:hover { background: #f4f8fb; }
.dropdown button.danger { color: var(--danger); }
.relative { position: relative; }

/* ---------------- responsive ---------------- */
@media (max-width: 1180px) {
  .grid-2, .detail-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle {
    display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--border);
    border-radius: 9px; background: #fff; cursor: pointer; color: var(--text);
  }
  .menu-toggle svg { width: 17px; height: 17px; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { min-height: 300px; padding: 32px; order: 2; }
  .auth-hero h1 { font-size: 27px; }
  .auth-features { display: none; }
  .auth-panel { order: 1; }
  .report-layout { grid-template-columns: 1fr; }
  .report-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .report-nav button { white-space: nowrap; }
}
@media (max-width: 760px) {
  .page { padding: 16px 14px 34px; }
  .topbar { padding: 0 14px; height: 60px; }
  .searchbox { max-width: none; }
  .user-chip .u-name, .user-chip .u-role { display: none; }
  .user-chip { padding: 4px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 18px; }
  .form-grid, .form-grid.three, .setup-grid { grid-template-columns: 1fr; }
  .nid-scan { grid-template-columns: 1fr; }
  .nid-drop[data-nid-drop="nid_combined"], .nid-side { grid-column: auto; grid-row: auto; }
  .nid-docs { grid-template-columns: 1fr; }
  .inline-2 { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .page-title { font-size: 21px; }
  .hero { padding: 18px; flex-direction: column; align-items: flex-start; }
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal { max-width: none; border-radius: 0; min-height: 100vh; margin: 0; }
  .modal-head, .modal-foot { border-radius: 0; }
  .auth-brand { display: none; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .summary-strip > div:nth-child(2n) { border-right: 0; }
  .summary-strip > div { border-bottom: 1px solid var(--border); }
  .profile-actions { width: 100%; }
  .top-actions { gap: 6px; }
  .lang-toggle { padding: 6px 8px; }
  .card-head { flex-wrap: wrap; }
  .tbl thead th, .tbl tbody td { padding: 8px 9px; }
}
@media (max-width: 430px) {
  .stat-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .searchbox { display: none; }
}

/* ---------------- print preview ---------------- */
.print-preview {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(6, 22, 32, .74);
  display: flex; flex-direction: column;
}
.pp-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: #0f2f40; color: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.28);
}
.pp-title { font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.pp-actions { display: flex; align-items: center; gap: 8px; }
.pp-paper { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #dbe9f2; }
.pp-select { background: #123c50; color: #fff; border: 1px solid rgba(255,255,255,.28);
  border-radius: 7px; padding: 5px 8px; font-size: 12px; max-width: 250px; }
.pp-select:focus { outline: 2px solid rgba(255,255,255,.45); outline-offset: 1px; }
.pp-actions .btn.ghost { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.2); color: #eaf3f8; }
.pp-actions .btn.ghost:hover { background: rgba(255,255,255,.17); }
.pp-stage { flex: 1; min-height: 0; padding: 18px; overflow: auto; }
.pp-stage iframe {
  display: block; flex: 0 0 auto; margin: 0 auto;
  border: 0; background: #fff; box-shadow: 0 16px 44px rgba(0,0,0,.42);
}
@media (max-width: 720px) {
  .pp-stage { padding: 10px; }
  .pp-title { font-size: 12px; }
}

/* ---------------- vouchers ---------------- */
.input-sm { padding: 6px 8px; font-size: 12px; border-radius: 7px; }
.vlines { display: flex; flex-direction: column; gap: 7px; }
.vline {
  display: grid; grid-template-columns: minmax(0, 1fr) 130px minmax(0, 1fr) 30px;
  gap: 7px; align-items: center;
}
.vlines.transfer .vline { grid-template-columns: 88px minmax(0, 1fr) 130px minmax(0, 1fr) 30px; }
.vline .icon-btn { width: 30px; height: 30px; justify-self: center; }
.vline .icon-btn svg { width: 14px; height: 14px; }
.vline select.input-sm { height: 33px; }
.voucher-summary {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px;
  margin-top: 11px; padding: 10px 13px;
  background: #f4f9fc; border: 1px dashed #c8d9e5; border-radius: 9px;
  font-size: 12px; color: #46586e;
}
.voucher-summary strong { color: var(--text); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .vline, .vlines.transfer .vline { grid-template-columns: 1fr 1fr; }
  .vline .icon-btn { grid-column: 2; justify-self: end; }
}

/* ---------------- receipts ---------------- */
.rc-amounts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; }
@media (max-width: 900px) { .rc-amounts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .rc-amounts { grid-template-columns: 1fr; } }


/* ---------------- security ---------------- */
.security-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 16px; background: #fff4e5; color: #7a4a00;
  border-bottom: 1px solid #f0d9b5; font-size: 12.5px; font-weight: 600;
}
.security-banner svg { width: 16px; height: 16px; flex: none; }
.security-banner span { flex: 1 1 260px; }

/* ---------------- command palette ---------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
kbd {
  display: inline-block; min-width: 18px; text-align: center;
  border: 1px solid var(--border-strong); border-bottom-width: 2px; background: #fff;
  border-radius: 5px; padding: 1px 5px; font-family: inherit; font-size: 10px;
  font-weight: 700; color: #5b6b7f; line-height: 1.4;
}
.search-kbd {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font-size: 10px; color: #8a9aab; border: 1px solid var(--border); background: #fff;
  border-radius: 5px; padding: 1px 5px; cursor: pointer;
}
.searchbox input { padding-right: 58px; }
body.palette-open { overflow: hidden; }
.palette-backdrop {
  position: fixed; inset: 0; z-index: 200; background: rgba(6, 25, 36, .55);
  backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center;
  padding: 10vh 16px 24px; animation: fadeIn .12s ease;
}
.palette-backdrop[hidden] { display: none; }
.palette {
  width: 100%; max-width: 640px; max-height: 72vh; background: #fff;
  border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden;
  display: flex; flex-direction: column; animation: slideUp .16s ease;
}
.palette-search { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.palette-search > svg { width: 18px; height: 18px; color: #8a9aab; }
.palette-search input { flex: 1; border: 0; outline: none; font-size: 14.5px; background: none; color: var(--text); min-width: 0; }
.palette-list { overflow-y: auto; padding: 6px; min-height: 84px; }
.pal-group {
  padding: 9px 10px 4px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}
.pal-item {
  width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none;
  padding: 9px 10px; border-radius: 9px; cursor: pointer; text-align: left; color: var(--text);
}
.pal-item svg { width: 16px; height: 16px; color: var(--primary); opacity: .82; }
.pal-item:hover, .pal-item.active { background: #e8f2f7; }
.pal-label { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; display: flex; flex-direction: column; }
.pal-sub { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.pal-go { font-size: 11px; color: #9aabbc; }
.pal-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 12.5px; }
.palette-foot {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding: 8px 14px; border-top: 1px solid var(--border); background: #fbfdff;
  font-size: 10.5px; color: var(--muted);
}
.palette-foot span { display: inline-flex; align-items: center; gap: 4px; }
.shortcut-list { display: flex; flex-direction: column; }
.shortcut-row {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 8px 2px; border-bottom: 1px dashed #e8eef4; font-size: 12.5px; color: #46586e;
}
.shortcut-row:last-child { border-bottom: 0; }
.shortcut-keys { display: flex; gap: 4px; flex: 0 0 auto; }

/* ---------------- notifications ---------------- */
.notif-btn { position: relative; width: 32px; height: 32px; }
.notif-dot {
  position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 0 2px #fff;
}
.notif-dot[hidden] { display: none; }
.notif-menu { width: 320px; padding: 0; max-height: 420px; overflow-y: auto; }
.notif-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 12.5px;
}
.notif-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #eef3f7; }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: #f6fafc; }
.notif-main { display: flex; flex-direction: column; min-width: 0; }
.notif-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.notif-meta { font-size: 11px; color: var(--muted); }
.notif-empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 26px 12px; color: var(--muted); font-size: 12px; text-align: center;
}
.notif-empty svg { width: 26px; height: 26px; color: var(--success); opacity: .8; }

/* ---------------- sortable tables / links ---------------- */
.tbl thead th[data-sort] { cursor: pointer; user-select: none; }
.tbl thead th[data-sort]:hover { color: var(--primary); background: #f1f7fa; }
.tbl thead th[aria-sort="ascending"], .tbl thead th[aria-sort="descending"] { color: var(--primary); }
.sort-ind { display: inline-block; width: 9px; margin-left: 5px; opacity: .4; }
.sort-ind::before { content: "↕"; font-size: 9px; }
th[aria-sort="ascending"] .sort-ind::before { content: "▲"; }
th[aria-sort="descending"] .sort-ind::before { content: "▼"; }
th[aria-sort="ascending"] .sort-ind, th[aria-sort="descending"] .sort-ind { opacity: 1; }
a.stat { display: block; color: inherit; transition: transform .1s, border-color .15s, box-shadow .15s; }
a.stat:hover { transform: translateY(-1px); border-color: #bcd2e0; box-shadow: 0 10px 26px rgba(15, 44, 66, .1); }
a.stat:hover .stat-label { color: var(--primary); }

/* ---------------- interactive chart ---------------- */
.bar-group {
  cursor: pointer; border-radius: 8px; padding: 2px 4px 0;
  transition: background .15s; outline: none;
}
.bar-group:hover, .bar-group.active { background: #f1f8fb; }
.bar-group:focus-visible { outline: 2px solid var(--primary-3); outline-offset: 2px; }
.chart-detail {
  margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px;
  display: flex; gap: 20px; flex-wrap: wrap; font-size: 12px; color: #46586e;
}
.chart-detail .cd-item { display: flex; flex-direction: column; gap: 1px; }
.chart-detail .cd-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700;
}
.chart-detail strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------------- loan calculator ---------------- */
.calc-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.calc-result > div {
  border: 1px solid var(--border); background: #fbfdff; border-radius: 10px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 3px;
}
.calc-result span { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.calc-result strong { font-size: 16px; font-variant-numeric: tabular-nums; }

/* ---------------- KYC completeness ---------------- */
.kyc-meter { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.kyc-meter .row.between { font-size: 11.5px; }
.kyc-meter .progress { height: 8px; }
.kyc-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.kyc-chip {
  font-size: 10px; color: #8a6a12; background: #fdf6e2; border: 1px solid #f0d9a8;
  border-radius: 999px; padding: 2px 7px;
}
.kyc-ok { color: var(--success); font-weight: 700; font-size: 11.5px; display: inline-flex; align-items: center; gap: 5px; }
.kyc-ok svg { width: 14px; height: 14px; }

@media (max-width: 760px) {
  .search-kbd { display: none; }
  .searchbox input { padding-right: 12px; }
  .notif-menu { width: 290px; }
}
@media (max-width: 560px) {
  .palette-backdrop { padding: 0; }
  .palette { max-width: none; height: 100vh; max-height: none; border-radius: 0; }
  .palette-foot { display: none; }
  .calc-result { grid-template-columns: 1fr; }
}
.donut-legend a.li { color: inherit; }
.donut-legend a.li:hover span:first-child { color: var(--primary); }

.lunch-bill { table-layout: fixed; min-width: 760px; }
.lunch-bill th, .lunch-bill td { padding: 10px 4px; }
.lunch-bill th, .lunch-bill th.num { white-space: normal; overflow-wrap: normal; text-transform: none; letter-spacing: normal; }
.lunch-bill td { overflow-wrap: anywhere; }
.lunch-bill .lunch-dates { line-height: 1.6; white-space: normal; }
.lunch-date { display: inline-block; white-space: nowrap; }
.leave-dashboard-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.leave-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; margin: 16px 0; }
.leave-details p { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
#leave-form [data-days] { margin-top: 12px; margin-bottom: 0; font-weight: 600; color: var(--primary); }
.staff-tabs { min-width: 0; }
.staff-tabs .tabs { min-width: 0; }
.payroll-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; padding: 16px; border-bottom: 1px solid var(--border); }
.payroll-toolbar label { display: grid; gap: 6px; font-weight: 600; }
.payroll-note { margin: 16px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.payroll-form .payroll-note { margin: 0 0 16px; }
.payroll-form fieldset { border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 16px; padding: 16px; min-width: 0; }
.payroll-form legend { padding: 0 6px; font-weight: 700; color: var(--primary); }
.payroll-form [hidden] { display: none; }
.payroll-form [data-daily] { margin-top: 12px; }
.payroll-form .input:disabled { background: var(--bg); color: var(--text); opacity: 1; }
.payroll-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; padding: 16px; background: var(--bg); border-radius: var(--radius); }
.payroll-totals div { display: grid; gap: 4px; }
.payroll-totals span { color: var(--muted); font-size: 12px; }
.payroll-totals strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.attendance-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 12px; }
.attendance-day { display: grid; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.attendance-day strong { color: var(--primary); }
.attendance-register { width: max-content; min-width: 100%; }
.attendance-register td, .attendance-register thead th { text-align: center; min-width: 34px; }
.attendance-register tbody th { text-align: left; min-width: 185px; padding: 12px; font-weight: 600; background: var(--card); }
.attendance-register td.attendance-present { color: var(--success); background: var(--success-bg); }
.attendance-register td.attendance-absent { color: var(--danger); background: var(--danger-bg); }
.attendance-register td.attendance-leave { color: var(--warn); background: var(--warn-bg); }
.attendance-register td.attendance-blank { color: var(--muted); }
@media (max-width: 640px) {
  .staff-tabs { padding: 10px; gap: 4px; }
  .staff-tabs .tab, .staff-tabs .btn, #payroll-register .btn, .payroll-form .input { min-height: 44px; }
  .payroll-form .input { font-size: 16px; }
  .payroll-form fieldset { padding: 12px; }
  .payroll-toolbar { padding: 12px; }
}

