/* =====================================================================
   MPPL Bill Flow — design system (V5)
   1. Tokens   2. Base   3. Layout   4. Components   5. Views   6. Responsive
   ===================================================================== */

/* 1. Tokens ----------------------------------------------------------- */
:root {
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;

  /* Brand — from the MPPL (Marysadan) logo: teal #1CBECF, slate wordmark #7A90AB */
  --brand-accent: #1cbecf;
  --brand: #0b7480;        /* logo teal, darkened for 4.5:1 text contrast on buttons and links */
  --brand-600: #085f69;
  --brand-50: #e7f7f9;
  --brand-100: #c3ebf0;
  --slate: #7a90ab;
  --slate-700: #44556b;

  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --ink: #1d2b3a;
  --ink-2: #3a4b5e;
  --muted: #687a8f;
  --line: #e2e8ee;
  --line-strong: #cdd6df;

  --success: #127a52;
  --success-600: #0d6644;
  --success-50: #e8f6ef;
  --warn: #a2620c;
  --warn-50: #fff4e3;
  --danger: #c0303f;
  --danger-600: #a32533;
  --danger-50: #fdecee;
  --info-50: #eef6f8;

  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  --sh-sm: 0 1px 2px rgba(15, 31, 53, .06);
  --sh: 0 1px 2px rgba(15, 31, 53, .05), 0 4px 14px rgba(15, 31, 53, .06);
  --sh-lg: 0 24px 64px rgba(15, 30, 45, .25);
  --focus: 0 0 0 3px rgba(28, 190, 207, .28);

  --control-h: 36px;
  --control-h-sm: 30px;
  --sidebar-w: 216px;
  --gutter: 20px;
}

/* 2. Base ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.5 var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.nav-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: inherit; }
h1, h2, h3 { color: var(--ink); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--danger); }
.mono { font-family: var(--mono); font-size: 11px; }
.hint { font-size: 12px; color: var(--muted); }
.mt { display: grid; margin-top: 16px; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Form controls */
input, select, textarea {
  width: 100%;
  min-height: var(--control-h);
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 72px; resize: vertical; }
select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2367778e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}
input:hover, select:hover, textarea:hover { border-color: #b7c3d2; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: #98a5b6; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--brand); cursor: pointer; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 12px; color: var(--ink-2); }
label small { font-weight: 400; }
label.check { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; }

.input-icon { position: relative; display: block; }
.input-icon > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #8695a8; pointer-events: none; width: 17px; height: 17px; }
.input-icon > input { padding-left: 38px; }
.input-icon.has-toggle > input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted);
}
.pw-toggle:hover { background: var(--surface-2); color: var(--ink); }

/* 4. Components ------------------------------------------------------- */
/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--control-h);
  padding: 8px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: var(--sh-sm);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn .ic { width: 16px; height: 16px; }
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: #b7c3d2; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: 0; box-shadow: var(--focus); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--brand-600); border-color: var(--brand-600); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.success:hover:not(:disabled) { background: var(--success-600); border-color: var(--success-600); }
.btn.danger { background: var(--danger-50); border-color: #f4c3c9; color: var(--danger-600); }
.btn.danger:hover:not(:disabled) { background: #fbdde1; border-color: #eba7b0; }
.btn-sm { min-height: var(--control-h-sm); padding: 5px 11px; font-size: 12px; }
.btn-lg { min-height: 46px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-row { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .logo { height: 52px; width: auto; flex: none; }
.brand span { font-weight: 700; font-size: 14px; color: var(--slate-700); letter-spacing: .2px; white-space: nowrap; }

/* Pills / badges */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600; font-size: 11.5px; line-height: 1.6;
  background: var(--brand-50); color: var(--brand-600);
  white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.red { background: var(--danger-50); color: var(--danger-600); }
.pill.green { background: var(--success-50); color: var(--success); }
.pill.amber { background: var(--warn-50); color: var(--warn); }

.conn i { width: 7px; height: 7px; border-radius: 50%; background: #18a874; box-shadow: 0 0 0 3px rgba(24, 168, 116, .18); }

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  margin-bottom: 14px;
  overflow: hidden;
}
.panelhead {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
.panelhead h3 { margin: 0; font-size: 14px; font-weight: 650; }
.formbox { padding: 16px; }
.panel.formbox > .panelhead { margin: -16px -16px 14px; }

/* Alerts / notices */
.alert { padding: 11px 14px; border-radius: var(--r); font-size: 13px; margin: 0 0 16px; border: 1px solid; }
.alert-error { background: var(--danger-50); border-color: #f4c3c9; color: var(--danger-600); }
.notice {
  margin: 0 0 14px; padding: 9px 14px;
  border: 1px solid #f3dcb4; border-radius: var(--r-lg);
  background: var(--warn-50); color: #7a4b0b; font-size: 13px;
}
.notice-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.notice-row .btn { min-height: var(--control-h-sm); padding: 4px 11px; font-size: 12px; }
.issue-notice { border-color: #f0bcb3; background: #fff2ef; color: #8b3328; margin-top: 16px; }
.issue-notice b { color: #75251e; }
.empty { padding: 56px 20px !important; text-align: center; color: var(--muted); }

/* Toast */
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  max-width: min(400px, calc(100vw - 32px));
  padding: 13px 18px;
  border-radius: var(--r-lg);
  background: var(--ink); color: #fff;
  box-shadow: var(--sh-lg);
  font-size: 13px; font-weight: 500;
  border-left: 4px solid var(--brand-accent);
  animation: toast-in .2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Tables */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th {
  position: sticky; top: 0;
  padding: 9px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
  text-align: left; white-space: nowrap;
}
td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf1f5;
  font-size: 13px;
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .1s; }
tbody tr:hover td { background: #f9fbfe; }
tr.is-selected td { background: var(--brand-50) !important; }
th.num, td.num { text-align: right; white-space: nowrap; }
td small { display: block; font-size: 11.5px; }
.id { font-weight: 700; color: var(--brand-600); }
.vendor { font-weight: 600; color: var(--ink); }
.td-bill { min-width: 170px; }
.td-issue { min-width: 160px; max-width: 240px; }
.td-update { min-width: 170px; white-space: nowrap; }
.issue-route { font-weight: 700; color: #a0362b; }

/* Action column stays visible at the right edge on wide tables */
.bills .th-actions, .bills .td-actions {
  position: sticky; right: 0; z-index: 1;
  background: var(--surface);
  box-shadow: -8px 0 12px -10px rgba(15, 31, 53, .25);
}
.bills thead .th-actions { background: var(--surface-2); z-index: 2; }
.bills tbody tr:hover .td-actions { background: #f9fbfe; }
.action-cell { display: flex; align-items: flex-start; gap: 8px; }
.inline-actions { display: grid; gap: 6px; align-items: center; }
.inline-actions input { min-height: var(--control-h-sm); padding: 5px 9px; font-size: 12px; border-radius: var(--r-sm); }
.inline-actions .btn { min-height: var(--control-h-sm); padding: 5px 12px; font-size: 12px; }
.inline-proc { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 330px; }
.inline-proc .item { grid-column: span 2; }
.inline-proc .btn { grid-column: 1 / -1; }
.inline-remark { grid-template-columns: 1fr auto; width: 250px; }
.inline-front { grid-template-columns: auto auto; }
.inline-front .hint { white-space: nowrap; }
.th-select, .td-select { width: 54px; text-align: center; }

/* Detail grid (bill modal) */
.details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.detail { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.detail small { display: block; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
.detail strong { display: block; margin-top: 3px; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.section-title { margin: 20px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }

/* Modal */
.modalbg {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(15, 30, 45, .5);
  backdrop-filter: blur(2px);
  animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(820px, 100%); max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  overflow: hidden;
}
.modalhead {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modalhead h2 { margin: 0 0 4px; font-size: 18px; letter-spacing: -.2px; }
.modalhead small { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.modalbody { padding: 20px 22px 24px; overflow-y: auto; }
.status-proof {
  margin: 0 0 14px; padding: 12px 14px;
  border: 1px solid var(--brand-100); border-radius: var(--r);
  background: var(--info-50); color: var(--slate-700); font-size: 13px;
}
.status-proof strong { color: var(--ink); }
.issue-panel {
  margin: 0 0 14px; padding: 12px 14px;
  border: 1px solid #f0bcb3; border-radius: var(--r);
  background: #fff2ef; color: #8b3328; font-size: 13px;
}
.issue-panel strong { color: #75251e; }
.action-form { margin-top: 20px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
.formactions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.history-block { margin-top: 24px; }
.history-block h3 { margin: 0 0 12px; font-size: 15px; }
.event { position: relative; margin-left: 6px; padding: 0 0 16px 20px; border-left: 2px solid var(--line); }
.event::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand-accent); }
.event:last-child { border-left-color: transparent; }
.event strong { font-size: 13px; }
.event small { display: block; color: var(--muted); font-size: 12px; }
.event .muted { font-size: 12.5px; }

/* 3. Layout ----------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0;
  width: var(--sidebar-w); height: 100vh; flex: none;
  transition: width .2s ease, padding .2s ease;
  display: flex; flex-direction: column; gap: 14px;
  padding: 14px 10px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 12px; border-bottom: 1px solid var(--line); }
.nav-close, .nav-open-btn, .nav-backdrop, .nav-collapse { display: none; }
.nav { display: grid; gap: 2px; }
.nav button {
  display: flex; align-items: center; gap: 10px;
  min-height: 38px; padding: 8px 10px;
  border: 0; border-radius: var(--r);
  background: transparent; color: var(--ink-2);
  font-weight: 500; text-align: left;
  transition: background .15s, color .15s;
}
.nav button .ic { color: var(--slate); }
.nav button:hover { background: var(--surface-2); color: var(--ink); }
.nav button.active { background: var(--brand-50); color: var(--brand-600); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand-accent); }
.nav button.active .ic { color: var(--brand); }
.sidefoot { margin-top: auto; display: grid; gap: 10px; padding: 12px 6px 2px; border-top: 1px solid var(--line); font-size: 12px; }
.me { display: flex; align-items: center; gap: 9px; min-width: 0; }
.me > span:last-child { min-width: 0; }
.me b { display: block; color: var(--ink); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me small { display: block; color: var(--muted); font-size: 11.5px; }
.avatar { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--brand-50); color: var(--brand-600); font-weight: 700; font-size: 11px; }
.conn { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11.5px; }
.side-logout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 34px; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 12.5px;
}
.side-logout:hover { background: var(--surface-2); color: var(--ink); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  min-height: 52px; padding: 6px var(--gutter);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.top-title { flex: 1; min-width: 0; }
.top-title strong { display: block; font-size: 15px; font-weight: 650; }
.top-actions { display: flex; align-items: center; gap: 10px; }
@media (min-width: 1024px) { .top { display: none; } .content { padding-top: 16px; } }
.content { width: 100%; padding: 14px var(--gutter) 24px; }
.headline { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.headline h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.3px; }

/* 5. Views ------------------------------------------------------------ */
/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(180deg, var(--brand-50), var(--bg) 55%); }
.login-card { width: min(380px, 100%); padding: 28px 28px 30px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--brand-accent); border-radius: var(--r-xl); box-shadow: var(--sh); }
.login-logo { display: flex; justify-content: center; margin-bottom: 10px; }
.login-logo .logo { width: 116px; height: auto; }
.login-card h1 { margin: 0 0 20px; text-align: center; font-size: 17px; font-weight: 650; color: var(--slate-700); letter-spacing: .2px; }
.stack { display: grid; gap: 14px; }
.login-card .input-icon > input { min-height: 42px; }

/* Metric cards */
.cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.stat {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; row-gap: 2px; align-items: center;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  text-align: left;
  transition: border-color .15s, box-shadow .15s;
  --accent: var(--brand); --accent-bg: var(--brand-50);
}
.stat-button { width: 100%; font: inherit; color: inherit; }
.stat-button:hover { border-color: var(--brand-100); box-shadow: var(--sh); }
.stat-button:focus-visible { outline: 0; box-shadow: var(--focus); }
.stat-top { display: contents; }
.stat .label { grid-column: 1; grid-row: 1; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-icon { grid-column: 2; grid-row: 1 / span 2; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-bg); color: var(--accent); }
.stat-icon .ic { width: 16px; height: 16px; }
.stat .number { grid-column: 1; grid-row: 2; display: block; font-size: 22px; font-weight: 700; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-queue { --accent: var(--slate-700); --accent-bg: #edf1f6; }
.stat-returned { --accent: var(--danger); --accent-bg: var(--danger-50); }
.stat-aging { --accent: var(--warn); --accent-bg: var(--warn-50); }
.stat-closed { --accent: var(--success); --accent-bg: var(--success-50); }

/* Toolbar / filters */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.search-box { flex: 1 1 220px; max-width: 320px; }
.toolbar select { width: auto; min-width: 130px; }
.toolbar input[type=date] { width: 148px; }
.filter-scope { display: inline-flex; align-items: center; min-height: 32px; padding: 5px 11px; border-radius: var(--r); background: var(--brand-50); color: var(--brand-600); font-size: 12px; font-weight: 600; }
.export-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.selection-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 16px; background: var(--brand-50); border-bottom: 1px solid var(--brand-100); color: var(--brand-600); font-size: 13px;
}

/* Returned-today report */
.return-report { margin: 0 0 14px; padding: 12px 16px; border: 1px solid #f3dcb4; border-radius: var(--r-lg); background: #fffaf1; }
.return-report h3 { margin: 0 0 4px; font-size: 15px; }
.return-report p { margin: 0; }
.return-report .report-list { margin: 10px 0 0; padding-left: 20px; }
.return-report li { margin: 5px 0; }
.return-report .formactions { margin-top: 14px; justify-content: flex-start; }

/* Forms */
.formgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 18px; }
.formgrid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.formgrid .wide { grid-column: 1 / -1; }
.person-modal { width: min(500px, 100%); }
.profile-hint { font-size: 12px; color: var(--muted); margin-top: 7px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Bulk entry */
.bulk-note { margin-bottom: 12px; padding: 9px 14px; border: 1px solid var(--brand-100); border-radius: var(--r); background: var(--brand-50); color: var(--brand-600); font-size: 13px; }
.bulk-table { min-width: 1000px; border: 1px solid var(--line); border-radius: var(--r); }
.bulk-table th, .bulk-table td { padding: 6px 8px; }
.bulk-table th:first-child, .bulk-table td:first-child { width: 44px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.bulk-table td { vertical-align: middle; border-bottom: 1px solid #edf1f5; }
.bulk-table tbody tr:nth-child(even) td { background: #fbfcfe; }
.bulk-table input { min-width: 120px; min-height: 34px; padding: 6px 9px; border-radius: var(--r-sm); font-size: 13px; }
.bulk-table input[type=number] { min-width: 105px; }
.bulk-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }

/* 6. Responsive ------------------------------------------------------- */
@media (max-width: 1500px) {
  .td-update { white-space: normal; min-width: 150px; }
}
@media (max-width: 1280px) {
  .formgrid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Off-canvas navigation below 1024px */
@media (max-width: 1023px) {
  :root { --gutter: 16px; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
    width: min(290px, 84vw); height: auto;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--sh-lg);
  }
  body.nav-open .sidebar { transform: none; }
  .nav-backdrop { position: fixed; inset: 0; z-index: 45; background: rgba(7, 21, 40, .5); }
  body.nav-open .nav-backdrop { display: block; }
  .nav-close { display: inline-grid; }
  .nav-open-btn { display: inline-grid; }
  .nav button { min-height: 46px; }
  .details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .formgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Card layout for data tables on phones and small tablets */
@media (max-width: 760px) {
  :root { --gutter: 12px; }
  body { font-size: 15px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cards > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  input, select, textarea { min-height: 44px; font-size: 16px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .hide-sm { display: none; }
  .top { min-height: 52px; gap: 10px; }
  .top .btn { padding: 8px 11px; }
  .content { padding-top: 12px; }
  .headline h1 { font-size: 18px; }
  .headline > .btn { min-height: 38px; }
  .panelhead { padding: 14px 16px; }
  .formbox { padding: 16px; }
  .panel.formbox > .panelhead { margin: -16px -16px 16px; }
  .formgrid, .formgrid-4 { grid-template-columns: 1fr; }
  .formactions { justify-content: stretch; }
  .formactions .btn { flex: 1 1 100%; }
  .toolbar { padding: 12px 16px; }
  .toolbar > *, .search-box { flex: 1 1 100%; max-width: none; }
  .toolbar select, .toolbar input[type=date] { width: 100%; min-width: 0; }
  .toolbar input[type=date] { flex: 1 1 calc(50% - 5px); }
  .export-actions { margin-left: 0; }
  .export-actions .btn, .toolbar > .btn { width: 100%; }
  .selection-bar { padding: 12px 16px; }
  .selection-bar .btn-row, .selection-bar .btn-row .btn { width: 100%; }
  .selection-bar .btn-row .btn { flex: 1; }

  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable thead { display: none; }
  .rtable tbody { padding: 12px; display: grid; gap: 12px; background: var(--surface-2); }
  .rtable tr { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-sm); overflow: hidden; }
  .rtable tr.is-active { border-left: 3px solid var(--brand); }
  .rtable tbody tr:hover td { background: transparent; }
  .rtable td {
    position: relative;
    min-width: 0; max-width: none; padding: 9px 14px 9px 132px; border-bottom: 1px solid #f0f3f7;
    text-align: left !important; white-space: normal;
  }
  .rtable td::before { content: attr(data-label); position: absolute; left: 14px; top: 11px; width: 108px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .3px; line-height: 1.3; text-transform: uppercase; }
  .rtable td.td-bill { padding: 14px 14px 10px; background: var(--surface-2); }
  .rtable td.td-bill::before { display: none; }
  .rtable td.td-actions { position: static; padding-left: 14px; box-shadow: none; border-bottom: 0; padding: 12px 14px 14px; }
  .rtable td.td-actions::before { display: none; }
  .rtable td.td-select:not(:has(input)) { display: none; }
  .rtable tr.empty-row { border: 0; box-shadow: none; background: transparent; }
  .rtable tr.empty-row td { padding-left: 14px; }
  .rtable tr.empty-row td::before { display: none; }
  .action-cell { flex-direction: column; align-items: stretch; }
  .action-cell > .btn { width: 100%; }
  .inline-actions, .inline-proc, .inline-remark { width: 100%; }
  .inline-front { grid-template-columns: 1fr; }
  .inline-front .hint { white-space: normal; }
  .inline-actions input, .inline-actions .btn { min-height: 42px; font-size: 15px; }

  .modalbg { padding: 0; place-items: end stretch; }
  .modal { width: 100%; max-height: 94vh; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .modalhead { padding: 16px; }
  .modalbody { padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
  .details { grid-template-columns: 1fr 1fr; gap: 8px; }
  .action-form { padding: 14px; }
  .sticky-actions { position: sticky; bottom: -20px; margin: 16px -14px -14px; padding: 12px 14px; background: var(--surface-2); border-top: 1px solid var(--line); }

  .login { place-items: start center; }
  .login-card { padding: 24px 18px; margin-top: 6vh; }
  .toast { left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); max-width: none; }
}

@media (max-width: 400px) {
  .stat { padding: 9px 12px; }
  .rtable td { padding-left: 116px; }
  .rtable td::before { width: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .sidebar, .top, .toolbar, .td-actions, .th-actions, .nav-backdrop { display: none !important; }
  .panel { box-shadow: none; }
}

/* =====================================================================
   V5.2 — restored features: loading, dialogs, notes, Store, revoke, MIS, KPI, roles
   ===================================================================== */
/* Loading overlay: blocks duplicate taps while a request is running */
.loading-overlay { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; background: rgba(15, 30, 45, .32); }
.loading-overlay.show { display: grid; }
.loading-card { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-lg); border-left: 4px solid var(--brand-accent); color: var(--ink); font-size: 13px; }
.spinner { width: 20px; height: 20px; border: 3px solid var(--brand-100); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* In-app dialog (replaces prompt / confirm / alert) */
.dialogbg { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgba(15, 30, 45, .5); animation: fade .12s ease-out; }
.dialog { width: min(460px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-lg); border-top: 3px solid var(--brand-accent); }
.dialog.is-danger { border-top-color: var(--danger); }
.dialoghead { padding: 16px 20px 0; }
.dialoghead h2 { margin: 0; font-size: 16px; font-weight: 650; }
.dialogbody { display: grid; gap: 14px; padding: 12px 20px 4px; }
.dialog-msg { color: var(--ink-2); font-size: 13px; display: grid; gap: 6px; }
.dialog-msg p { margin: 0; }
.dialog-error { min-height: 0; color: var(--danger); font-size: 12.5px; font-weight: 600; }
.dialog-error:empty { display: none; }
.dialogactions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-solid:hover:not(:disabled) { background: var(--danger-600); border-color: var(--danger-600); }
.choice { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.choice legend { padding: 0 0 6px; font-weight: 600; font-size: 12px; color: var(--ink-2); }
.choice-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; font-weight: 500; }
.choice-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.choice-opt input { width: 16px; height: 16px; min-height: 0; margin-top: 2px; accent-color: var(--brand); }
.choice-opt b { display: block; font-size: 13px; color: var(--ink); }
.choice-opt small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }

/* Tags on bill rows */
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 2px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: var(--r-sm); font-size: 10.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; }
.tag .ic { width: 12px; height: 12px; }
.tag-store { background: #eef1f6; color: var(--slate-700); }
.tag-note { background: #fff6d6; color: #7a5b06; }
.btn-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.action-cell { flex-wrap: wrap; }
.note-btn { border-color: #ecd98f; background: #fffaea; color: #6d5207; }
.note-btn:hover:not(:disabled) { background: #fff3c8; border-color: #e0c766; }
.nav-count { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 99px; background: var(--brand-50); color: var(--brand-600); font-style: normal; font-size: 11px; font-weight: 700; text-align: center; }

/* Sticky notes in the bill modal */
.sticky-notes { margin: 0 0 14px; padding: 12px 14px; border: 1px solid #eedc96; border-radius: var(--r); background: #fffbeb; }
.sticky-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.sticky-head h3 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: #6d5207; }
.sticky-note { padding: 8px 0; border-top: 1px solid #f1e5b5; }
.sticky-note:first-of-type { border-top: 0; }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.sticky-note small { display: block; color: #85733e; font-size: 12px; }
.note-actions { display: flex; gap: 6px; margin-top: 6px; }
.carry-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 12px; border: 1px dashed #d8c57a; border-radius: var(--r); background: #fffbeb; color: #6d5207; font-size: 13px; }
.carry-note small { flex-basis: 100%; color: #85733e; font-weight: 400; }
.store-edit { margin: 0 0 14px; padding: 14px; border: 1px solid var(--line); border-left: 3px solid var(--slate); border-radius: var(--r); background: var(--surface-2); }
.store-edit h3 { margin: 0 0 12px; font-size: 13px; color: var(--slate-700); }
.revoke-notice { justify-content: space-between; }

/* MIS / KPI */
.mis-controls { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)) auto; gap: 10px; align-items: end; padding: 12px 16px; }
.mis-buttons { display: flex; gap: 8px; }
.cards-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.kpi-panels .panel { margin-bottom: 14px; }
.kpi-bars { display: grid; gap: 10px; padding: 14px 16px; }
.kpi-bar { display: grid; grid-template-columns: 120px minmax(0, 1fr) 40px; gap: 10px; align-items: center; font-size: 13px; }
.kpi-bar b { font-weight: 600; color: var(--ink-2); }
.kpi-bar strong { text-align: right; font-variant-numeric: tabular-nums; }
.kpi-track { height: 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.kpi-fill { display: block; height: 100%; border-radius: 99px; background: var(--brand-accent); }
.kpi-bar.is-hot .kpi-fill { background: var(--warn); }
.kpi-bar.is-hot b { color: var(--warn); }
.kpi-bottleneck b { color: var(--warn); }

@media (max-width: 1280px) { .cards-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mis-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mis-buttons { grid-column: 1 / -1; } }
@media (max-width: 900px) { .kpi-panels { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .cards-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mis-controls { grid-template-columns: 1fr; }
  .mis-buttons .btn { flex: 1; }
  .kpi-bar { grid-template-columns: 96px minmax(0, 1fr) 34px; }
  .btn-stack .btn { flex: 1 1 auto; }
  .dialogbg { padding: 0; place-items: end stretch; }
  .dialog { width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .dialogactions .btn { flex: 1; }
  .revoke-notice .btn { width: 100%; }
}
.formgrid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
tr.is-disabled td:not(.td-actions) { opacity: .55; }
@media (max-width: 1100px) { .formgrid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .formgrid-3 { grid-template-columns: 1fr; } }

/* Collapsible sidebar — desktop only (the mobile drawer below 1024px always shows full labels) */
@media (min-width: 1024px) {
  .nav-collapse { display: inline-grid; width: 32px; height: 32px; flex: none; border-color: transparent; color: var(--slate); }
  .nav-collapse:hover { border-color: var(--line); }
  .sidebar-head { gap: 8px; }
  body.nav-collapsed { --sidebar-w: 64px; }
  body.nav-collapsed .sidebar { padding: 12px 8px; overflow-x: hidden; }
  body.nav-collapsed .sidebar-head { flex-direction: column; align-items: center; padding: 0 0 10px; }
  body.nav-collapsed .brand { justify-content: center; }
  body.nav-collapsed .brand .logo { height: 36px; }
  body.nav-collapsed .brand span,
  body.nav-collapsed .nav button span,
  body.nav-collapsed .me > span:last-child,
  body.nav-collapsed .conn span,
  body.nav-collapsed .side-logout span { display: none; }
  body.nav-collapsed .nav button { position: relative; justify-content: center; padding: 8px 0; }
  body.nav-collapsed .nav-count { position: absolute; top: 3px; right: 5px; min-width: 16px; padding: 0 4px; font-size: 9.5px; line-height: 15px; background: var(--brand); color: #fff; }
  body.nav-collapsed .sidefoot { padding: 10px 0 2px; justify-items: center; }
  body.nav-collapsed .me, body.nav-collapsed .conn { justify-content: center; }
  body.nav-collapsed .side-logout { width: 40px; padding: 0; }
}
@media (max-width: 760px) { .headline > .export-actions { width: 100%; } .headline > .export-actions .btn { flex: 1 1 0; } }

/* V5.3 — Bill details popup: wide rectangle, 4-column card grid, vertical scroll only */
.modal.bill-modal {
  width: min(1200px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 30, 45, .22), 0 2px 8px rgba(15, 30, 45, .08);
}
.modal.bill-modal .modalhead.bill-head {
  flex: 0 0 auto; position: relative; z-index: 2;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 24px 12px;
  background: var(--surface); border-bottom: 0;
}
.bill-accent { align-self: stretch; flex: none; width: 6px; border-radius: 4px; background: var(--brand-accent); }
.bill-title { flex: 1 1 auto; min-width: 0; }
.bill-head h2 { margin: 0 0 8px; font-size: 22px; font-weight: 700; line-height: 1.2; color: var(--ink); overflow-wrap: anywhere; }
.bill-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.bill-ref { color: var(--brand); font-size: 14px; font-weight: 500; letter-spacing: .2px; overflow-wrap: anywhere; }
.bill-meta .pill { padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 30%, transparent); }
.bill-meta .tag { padding: 4px 12px; border-radius: 999px; font-size: 12px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong); }
.bill-close { flex: none; align-self: flex-start; width: 48px; height: 48px; border-radius: 10px; }
.bill-close .ic { width: 22px; height: 22px; }

.modalbody.bill-scroll {
  flex: 1 1 auto; min-height: 0;
  padding: 4px 18px 20px;
  overflow-x: hidden; overflow-y: auto;   /* vertical only — no sideways scrolling */
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.modalbody.bill-scroll:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.modalbody.bill-scroll::-webkit-scrollbar { width: 10px; height: 0; }
.modalbody.bill-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 2px solid var(--surface); }
.bill-inner { min-width: 0; max-width: 100%; }
.bill-inner > * { max-width: 100%; }

.bill-inner .details.bill-details { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; margin: 0 0 18px; }
.bill-details .detail {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 8px 14px; min-height: 48px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface-2);
}
.bill-details .d-ic { flex: none; display: grid; place-items: center; width: 28px; color: var(--slate-700); }
.bill-details .d-ic .ic { width: 22px; height: 22px; stroke-width: 1.6; }
.bill-details .d-txt { min-width: 0; flex: 1 1 auto; }
.bill-details .detail small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; color: var(--ink-2); text-transform: uppercase; line-height: 1.25; }
.bill-details .detail strong { display: block; margin-top: 2px; font-size: 14px; font-weight: 500; color: var(--ink); line-height: 1.3; overflow-wrap: anywhere; }

.bill-modal .notice.bill-notice { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 8px 14px; font-size: 14px; border-color: #f0c98a; border-radius: 6px; }
.bill-notice .ic { width: 20px; height: 20px; color: var(--warn); }
.bill-modal .action-form { margin: 0 0 14px; }
.bill-modal .history-block { margin-top: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.bill-modal .history-block h3 { margin: 0 0 10px; font-size: 18px; font-weight: 700; color: var(--ink); }
.bill-modal #history { display: block; }
/* V5.2.3 - Proof history as a connected vertical timeline (newest first) */
.bill-modal .timeline { list-style: none; margin: 0; padding: 0; }
.bill-modal .event {
  --ev: var(--brand-accent); --ev-bg: var(--brand-50);
  position: relative; display: flex; align-items: flex-start; gap: 14px;
  margin: 0; padding: 0 0 14px; border: 0; background: none;
}
.bill-modal .event:last-child { padding-bottom: 0; }
.bill-modal .event::before {
  content: ""; display: block; position: absolute; left: 17px; top: 36px; bottom: 0;
  width: 2px; height: auto; border: 0; border-radius: 0; background: var(--line-strong);
}
.bill-modal .event:last-child::before { display: none; }
.bill-modal .ev-node {
  flex: none; position: relative; z-index: 1; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--ev); color: var(--ev);
}
.bill-modal .ev-node .ic { width: 18px; height: 18px; }
.bill-modal .ev-latest .ev-node { background: var(--ev); color: #fff; box-shadow: 0 0 0 4px var(--ev-bg); }
.bill-modal .ev-card {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: flex-start; gap: 14px;
  padding: 10px 14px; border: 1px solid var(--line); border-left: 3px solid var(--ev);
  border-radius: 8px; background: var(--surface);
}
.bill-modal .ev-latest .ev-card { background: var(--ev-bg); }
.bill-modal .ev-create { --ev: var(--brand); --ev-bg: var(--brand-50); }
.bill-modal .ev-done   { --ev: var(--success); --ev-bg: var(--success-50); }
.bill-modal .ev-reject { --ev: var(--danger); --ev-bg: var(--danger-50); }
.bill-modal .ev-revoke,
.bill-modal .ev-edit   { --ev: var(--warn); --ev-bg: var(--warn-50); }
.bill-modal .ev-note,
.bill-modal .ev-info   { --ev: var(--slate-700); --ev-bg: var(--surface-2); }
.bill-modal .ev-delete { --ev: var(--danger-600); --ev-bg: var(--danger-50); }
.bill-modal .ev-main { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.bill-modal .event strong { display: block; font-size: 15px; font-weight: 700; color: var(--ink); }
.bill-modal .event small { display: block; color: var(--muted); font-size: 12.5px; }
.bill-modal .ev-date {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--surface); color: var(--ink-2); font-size: 13px; white-space: nowrap;
}
.bill-modal .ev-date .ic { width: 16px; height: 16px; }

@media (max-width: 1100px) {
  .bill-inner .details.bill-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .modalbg { padding: 0; place-items: end stretch; }
  .modal.bill-modal { width: 100%; max-height: 94vh; max-height: 94dvh; border-radius: 14px 14px 0 0; }
  .modal.bill-modal .modalhead.bill-head { padding: 14px 16px 10px; gap: 10px; }
  .bill-head h2 { font-size: 18px; }
  .bill-close { width: 40px; height: 40px; }
  .modalbody.bill-scroll { padding: 4px 12px calc(16px + env(safe-area-inset-bottom)); }
  .bill-modal .ev-card { flex-wrap: wrap; }
  .bill-modal .ev-date { white-space: normal; }
}
@media (max-width: 560px) {
  .bill-inner .details.bill-details { grid-template-columns: 1fr; }
}

/* V5.2.2 — Bills table: bottom horizontal scrollbar that stays in view */
.scroll.has-hbar { scrollbar-width: none; }
.scroll.has-hbar::-webkit-scrollbar { display: none; }
.hbar {
  position: sticky; bottom: 0; z-index: 6;
  overflow-x: auto; overflow-y: hidden;
  min-height: 16px;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  scrollbar-width: auto;
  scrollbar-color: var(--muted) var(--surface-2);
}
.hbar[hidden] { display: none; }
.hbar > div { height: 1px; }
.hbar::-webkit-scrollbar { height: 14px; }
.hbar::-webkit-scrollbar-track { background: var(--surface-2); }
.hbar::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 8px; border: 3px solid var(--surface-2); }
.hbar::-webkit-scrollbar-thumb:hover { background: var(--text, #334); }
/* overflow:hidden on the panel blocks position:sticky; clip keeps the rounded corners without that */
.panel:has(.hbar) { overflow: clip; }
