/* KoKo Beach Hotels — Invoice Payments */
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --ink: #0f1f2e;
  --ink-2: #334556;
  --muted: #647585;
  --border: #e2e7ec;
  --border-strong: #cfd7df;
  --navy: #0b2a3c;
  --navy-2: #123a52;
  --teal: #0c7a83;
  --teal-2: #0a666e;
  --teal-soft: #e4f3f4;
  --sand: #efe6d6;
  --gold: #c69a4b;
  --focus: #2b8cff;

  --pending: #a8620a; --pending-bg: #fff4de; --pending-bd: #f4d9a4;
  --approved: #0c6fa8; --approved-bg: #e5f1fa; --approved-bd: #b9d9ef;
  --suspended: #b3261e; --suspended-bg: #fdeceb; --suspended-bd: #f3c1bd;
  --paid: #17804a; --paid-bg: #e5f5ec; --paid-bd: #b5e0c7;
  --pop: #7446b0; --pop-bg: #f1eafb; --pop-bd: #d8c6f1;
  --draft: #56626e; --draft-bg: #eef1f4; --draft-bd: #d6dce2;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 31, 46, .06);
  --shadow: 0 1px 3px rgba(15, 31, 46, .06), 0 6px 20px rgba(15, 31, 46, .06);
  --shadow-lg: 0 20px 60px rgba(8, 24, 38, .25);
  --sidebar: 244px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
.tnum, .amount, td.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); color: #d5e2ea; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { padding: 20px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; gap: 12px; align-items: center; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--teal), #13a0a8); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font-weight: 750; letter-spacing: .08em; font-size: 12.5px; color: #fff; }
.brand-sub { font-size: 11px; color: #8fb0c2; letter-spacing: .06em; text-transform: uppercase; }
.brand.brand-logo { flex-direction: column; align-items: flex-start; gap: 10px; padding: 22px 20px 18px; }
.brand-logo .logo { display: block; width: 150px; height: auto; }
.auth-logo { display: block; width: 220px; height: auto; position: relative; z-index: 1; }
.auth-logo-sm { display: none; width: 170px; height: auto; margin: 0 auto 28px; }
.nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #6f93a8; padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: #cfdde6; font-weight: 500; font-size: 13.5px; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.active { background: rgba(19, 160, 168, .18); color: #fff; box-shadow: inset 3px 0 0 #2fc3c9; }
.nav .badge-count { margin-left: auto; background: #e24c3f; color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: #8fb0c2; }
.sidebar-foot .who { color: #fff; font-weight: 600; font-size: 13px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.topbar .crumb { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.topbar .spacer { flex: 1; }
.bell.menu-btn { display: none; }
.bell { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.bell:hover { background: var(--surface-2); }
.bell svg { width: 20px; height: 20px; }
.bell .dot { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #e24c3f; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--sand); color: var(--navy); font-weight: 700; display: grid; place-items: center; font-size: 13px; flex: none; }
.user-chip .nm { font-weight: 600; font-size: 13px; }
.user-chip .rl { font-size: 11.5px; color: var(--muted); }
.content { padding: 26px 28px 60px; max-width: 1440px; width: 100%; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .grow { flex: 1; min-width: 240px; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin-bottom: 6px; }
.subtle { color: var(--muted); }
.page-head p { margin: 6px 0 0; color: var(--muted); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { flex: 1; }
.card + .card, .stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- Hero (payments this period) ---------- */
.hero { background: linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 55%, #0f5663 100%); color: #fff; border-radius: 16px; padding: 24px 28px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(47,195,201,.25), transparent 65%); pointer-events: none; }
.hero-top { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-label { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: #9fd3d8; font-weight: 700; }
.hero-count { font-size: 15px; color: #d7e7ee; margin-top: 8px; }
.hero-amount { font-size: 40px; font-weight: 750; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.hero-amount .alt { display: block; font-size: 22px; font-weight: 650; color: #cfe6ea; margin-top: 2px; }
.hero-period { margin-left: auto; text-align: right; }
.hero-period .lbl { font-size: 11.5px; color: #9fc3cf; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.hero-period .rng { font-size: 16px; font-weight: 650; margin-top: 4px; }
.hero-period .nav-arrows { display: inline-flex; gap: 6px; margin-top: 10px; }
.hero-period .nav-arrows button { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #fff; width: 34px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 16px; }
.hero-period .nav-arrows button:hover { background: rgba(255,255,255,.2); }
.hero-bars { display: flex; height: 8px; border-radius: 99px; overflow: hidden; margin-top: 18px; background: rgba(255,255,255,.12); position: relative; z-index: 1; }
.hero-bars span { display: block; height: 100%; }

/* ---------- Status cards ---------- */
.status-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.scard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 15px; text-align: left; cursor: pointer; font: inherit; color: inherit; position: relative; transition: transform .08s, box-shadow .15s, border-color .15s; box-shadow: var(--shadow-sm); }
.scard::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.scard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.scard.on { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.scard .t { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--c); display: flex; align-items: center; gap: 6px; }
.scard .n { font-size: 26px; font-weight: 750; margin-top: 6px; font-variant-numeric: tabular-nums; }
.scard .a { font-size: 13.5px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.scard .a + .a { margin-top: 1px; }
.scard .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.c-pending { --c: var(--pending); } .c-approved { --c: var(--approved); } .c-suspended { --c: var(--suspended); }
.c-paid { --c: var(--paid); } .c-pop { --c: var(--pop); } .c-draft { --c: var(--draft); } .c-all { --c: var(--teal); }

/* ---------- Period selector ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 7px; font: inherit; font-size: 13px; font-weight: 550; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button:hover { background: var(--surface-2); }
.seg button.on { background: var(--navy); color: #fff; }
.seg button .cnt { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 99px; background: var(--draft-bg); color: var(--ink-2); }
.seg button.on .cnt { background: rgba(255,255,255,.2); color: #fff; }
.custom-range { display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Banner ---------- */
.banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 10px; border: 1px solid; margin-top: 14px; font-size: 13.5px; }
.banner svg { width: 20px; height: 20px; flex: none; }
.banner.warn { background: var(--pending-bg); border-color: var(--pending-bd); color: #7a4706; }
.banner.danger { background: var(--suspended-bg); border-color: var(--suspended-bd); color: #8b1c16; }
.banner.info { background: var(--approved-bg); border-color: var(--approved-bd); color: #0a4e78; }
.banner.ok { background: var(--paid-bg); border-color: var(--paid-bd); color: #0f5b33; }
.banner .grow { flex: 1; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; }
table.data th { text-align: left; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 10px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--ink); }
table.data th .arr { opacity: .35; margin-left: 4px; }
table.data th.sorted .arr { opacity: 1; color: var(--teal); }
table.data { font-size: 13.5px; }
table.data td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr { transition: background .1s; }
table.data tbody tr.click { cursor: pointer; }
table.data tbody tr.click:hover { background: #f5fafb; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; }
table.data tfoot td { padding: 12px 14px; font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--border-strong); }
.cell-main { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.due-over { color: var(--suspended); font-weight: 650; }
.due-soon { color: var(--pending); font-weight: 650; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 42px; height: 42px; color: #b6c3ce; margin-bottom: 8px; }
.empty .big { font-size: 15px; font-weight: 600; color: var(--ink-2); }

/* ---------- Status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; padding: 3px 10px 3px 8px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.SUBMITTED { color: var(--pending); background: var(--pending-bg); border-color: var(--pending-bd); }
.pill.APPROVED { color: var(--approved); background: var(--approved-bg); border-color: var(--approved-bd); }
.pill.SUSPENDED { color: var(--suspended); background: var(--suspended-bg); border-color: var(--suspended-bd); }
.pill.PAID { color: var(--paid); background: var(--paid-bg); border-color: var(--paid-bd); }
.pill.POP { color: var(--pop); background: var(--pop-bg); border-color: var(--pop-bd); }
.pill.DRAFT, .pill.CANCELLED { color: var(--draft); background: var(--draft-bg); border-color: var(--draft-bd); }
.pill.lg { font-size: 14px; padding: 6px 14px 6px 12px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--draft-bg); color: var(--ink-2); letter-spacing: .03em; }
.tag.red { background: var(--suspended-bg); color: var(--suspended); }
.tag.teal { background: var(--teal-soft); color: var(--teal-2); }
.tag.gold { background: #fbf1dc; color: #8a6420; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: 13.5px; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--surface-2); border-color: #b8c3cd; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-2); }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.dark:hover { background: var(--navy-2); }
.btn.danger { color: var(--suspended); border-color: var(--suspended-bd); }
.btn.danger:hover { background: var(--suspended-bg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { padding: 12px 22px; font-size: 15px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--teal); cursor: pointer; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .lbl { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.field .req { color: var(--suspended); }
.field .help { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input { font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 9px; background: #fff; color: var(--ink); width: 100%; transition: border-color .12s, box-shadow .12s; }
.input:hover { border-color: #b3bfca; }
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(12,122,131,.15); }
.input.sm { padding: 6px 10px; font-size: 13px; }
textarea.input { min-height: 90px; resize: vertical; }
.input-group { display: flex; }
.input-group .input:first-child { border-radius: 9px 0 0 9px; }
.input-group .input:last-child { border-radius: 0 9px 9px 0; border-left: 0; }
.input-group select.input { width: auto; flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { padding: 20px; }
.form-section + .form-section { border-top: 1px solid var(--border); }
.form-section h3 { margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.form-section h3 .num { width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; display: grid; place-items: center; }
.err-text { color: var(--suspended); font-size: 12.5px; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.checkbox input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--teal); }
.radio-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.radio-card input { accent-color: var(--teal); width: 17px; height: 17px; }
.radio-list { display: grid; gap: 8px; }

.dropzone { border: 2px dashed var(--border-strong); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; background: var(--surface-2); transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--teal); background: var(--teal-soft); }
.dropzone svg { width: 30px; height: 30px; color: var(--teal); }
.dropzone .t { font-weight: 650; color: var(--ink-2); margin-top: 4px; }
.file-list { margin-top: 10px; display: grid; gap: 6px; }
.file-item { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: 9px; background: #fff; font-size: 13px; }
.file-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.file-item svg { width: 18px; height: 18px; color: var(--teal); flex: none; }

/* ---------- Detail page ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.action-panel { position: sticky; top: 80px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); font-weight: 550; }
.kv dd { margin: 0; font-weight: 550; word-break: break-word; }
.big-amount { font-size: 32px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bank-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.bank-num { font-family: var(--mono); font-size: 16px; letter-spacing: .06em; font-weight: 600; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 16px 28px; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: -2px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--c, var(--teal)); }
.timeline .what { font-weight: 600; }
.timeline .when { font-size: 12px; color: var(--muted); }
.timeline .why { margin-top: 4px; font-size: 13px; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; border: 1px solid var(--border); }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.doc-row:last-child { border-bottom: 0; }
.doc-icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); flex: none; }
.doc-icon.pop { background: var(--pop-bg); color: var(--pop); }
.doc-icon svg { width: 18px; height: 18px; }
.doc-row .nm { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Slide to confirm ---------- */
.slider { --c: var(--teal); position: relative; height: 58px; border-radius: 999px; background: color-mix(in srgb, var(--c) 12%, #fff); border: 1px solid color-mix(in srgb, var(--c) 35%, #fff); user-select: none; touch-action: none; overflow: hidden; }
.slider.approve { --c: #0f8a53; }
.slider.suspend { --c: var(--suspended); }
.slider.paid { --c: var(--approved); }
.slider .fill { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--c) 28%, #fff); border-radius: 999px; width: 58px; }
.slider .label { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: var(--c); letter-spacing: .01em; padding-left: 50px; pointer-events: none; }
.slider .label span { background: linear-gradient(90deg, var(--c) 0%, var(--c) 40%, color-mix(in srgb, var(--c) 30%, #fff) 50%, var(--c) 60%, var(--c) 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 2.6s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.slider .knob { position: absolute; top: 4px; left: 4px; width: 50px; height: 50px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; cursor: grab; box-shadow: 0 3px 10px color-mix(in srgb, var(--c) 45%, transparent); z-index: 2; }
.slider .knob:active { cursor: grabbing; }
.slider .knob svg { width: 22px; height: 22px; }
.slider.done .label span { animation: none; color: var(--c); background: none; }
.slider.anim .knob, .slider.anim .fill { transition: left .25s ease, width .25s ease; }
.slider.disabled { opacity: .5; pointer-events: none; }
.action-stack { display: grid; gap: 12px; }
.action-note { font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 24, 38, .55); backdrop-filter: blur(2px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .15s ease; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow: auto; animation: pop .18s ease; }
.modal.wide { max-width: 980px; }
.modal-head { padding: 20px 24px 6px; display: flex; gap: 12px; align-items: flex-start; }
.modal-head h2 { flex: 1; font-size: 19px; }
.modal-body { padding: 12px 24px 20px; }
.modal-foot { padding: 14px 24px 20px; display: grid; gap: 12px; }
.modal-close { border: 0; background: var(--surface-2); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 18px; color: var(--muted); }
.confirm-box { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.confirm-box .row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.confirm-box .row:last-child { border-bottom: 0; }
.confirm-box .row span:first-child { color: var(--muted); }
.confirm-box .row span:last-child { font-weight: 650; text-align: right; }
.confirm-box .row.total { background: var(--surface-2); font-size: 17px; }
.preview-frame { width: 100%; height: 72vh; border: 0; border-radius: 10px; background: #525659; }
.preview-img { max-width: 100%; max-height: 72vh; display: block; margin: 0 auto; border-radius: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Toast ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: grid; gap: 10px; }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 550; display: flex; gap: 10px; align-items: center; max-width: 420px; animation: pop .2s ease; }
.toast.ok { background: #145f3b; }
.toast.err { background: #8e1f19; }
.toast svg { width: 18px; height: 18px; flex: none; }

/* ---------- Notifications dropdown ---------- */
.notif-panel { position: absolute; top: 54px; right: 90px; width: 400px; max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 50; }
.notif-item { display: block; padding: 14px 16px; border-bottom: 1px solid var(--border); color: inherit; position: relative; }
.notif-item:hover { background: var(--surface-2); text-decoration: none; }
.notif-item.unread { background: #f3fafb; }
.notif-item.unread::before { content: ""; position: absolute; left: 6px; top: 20px; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.notif-title { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; color: var(--teal-2); }
.notif-title.INVOICE_SUSPENDED { color: var(--suspended); }
.notif-title.INVOICE_PAID { color: var(--paid); }
.notif-title.INVOICE_APPROVED { color: var(--approved); }
.notif-body { display: grid; grid-template-columns: 110px 1fr; gap: 2px 8px; font-size: 13px; margin-top: 6px; }
.notif-body span:nth-child(odd) { color: var(--muted); }
.notif-body span:nth-child(even) { font-weight: 600; }
.notif-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); }
.notif-meta b { color: var(--teal); }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: linear-gradient(160deg, #06202f 0%, var(--navy) 40%, #0e5561 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-art .waves { position: absolute; left: 0; right: 0; bottom: 0; opacity: .5; }
.auth-art h1 { font-size: 38px; letter-spacing: -.02em; margin-top: auto; max-width: 480px; line-height: 1.12; }
.auth-art p { color: #b5d2dc; max-width: 440px; font-size: 15px; margin-top: 14px; }
.auth-art .feats { display: grid; gap: 10px; margin: 28px 0 64px; position: relative; z-index: 1; }
.auth-art .feat { display: flex; gap: 10px; align-items: center; color: #d9eaf0; font-size: 14px; }
.auth-art .feat svg { width: 18px; height: 18px; color: #4fd1d6; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h2 { font-size: 24px; margin-bottom: 6px; }
.auth-box .subtle { margin-bottom: 26px; }
.auth-box .field + .field { margin-top: 16px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--teal); font-weight: 650; font-size: 12.5px; cursor: pointer; padding: 6px; }
.alert { padding: 11px 14px; border-radius: 9px; font-size: 13.5px; margin-bottom: 16px; border: 1px solid; }
.alert.err { background: var(--suspended-bg); border-color: var(--suspended-bd); color: #8b1c16; }
.alert.ok { background: var(--paid-bg); border-color: var(--paid-bd); color: #0f5b33; }
.alert.info { background: var(--approved-bg); border-color: var(--approved-bd); color: #0a4e78; }
.secure-note { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 26px; }
.secure-note svg { width: 15px; height: 15px; }
.pw-meter { height: 5px; border-radius: 9px; background: var(--border); overflow: hidden; margin-top: 6px; }
.pw-meter span { display: block; height: 100%; transition: width .2s, background .2s; }

/* ---------- Misc ---------- */
.muted-box { background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 10px; padding: 14px 16px; color: var(--muted); font-size: 13px; }
.stat-inline { display: flex; gap: 28px; flex-wrap: wrap; }
.stat-inline .s .l { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.stat-inline .s .v { font-size: 20px; font-weight: 750; margin-top: 2px; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; display: flex; }
.bar span { height: 100%; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.filters { display: grid; grid-template-columns: 2fr repeat(5, minmax(0, 1fr)); gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.filters .field > label { font-size: 11.5px; }
.chip-x { display: inline-flex; align-items: center; gap: 6px; background: var(--teal-soft); color: var(--teal-2); padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; border: 0; cursor: pointer; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #eef1f4, #f7f9fa, #eef1f4); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--surface-2); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt-0 { margin-top: 0 !important; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.flex { display: flex; gap: 10px; align-items: center; } .flex.wrap { flex-wrap: wrap; } .grow { flex: 1; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .status-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .action-panel { position: static; order: -1; }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters .q { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 90; transform: translateX(-100%); transition: transform .2s ease; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(8,24,38,.4); z-index: 80; }
  .bell.menu-btn { display: grid; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 60px; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .status-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-amount { font-size: 30px; }
  .hero-period { margin-left: 0; text-align: left; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-logo-sm { display: block; }
  .user-chip .txt { display: none; }
  .notif-panel { right: 12px; left: 12px; width: auto; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .filters { grid-template-columns: 1fr 1fr; }
  table.data.responsive thead { display: none; }
  table.data.responsive tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 14px; border-bottom: 1px solid var(--border); gap: 2px 10px; }
  table.data.responsive td { border: 0; padding: 2px 0; }
  table.data.responsive td[data-hide-sm] { display: none; }
}

@media print {
  .sidebar, .topbar, .no-print, .toasts { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; }
  .hero { color: #000; background: #fff; border: 1px solid #ccc; }
  body { background: #fff; }
}

/* list rows (clickable) */
.list-row { display: flex; gap: 14px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); color: inherit; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: var(--surface-2); text-decoration: none; }
.card-head h2 svg { width: 18px; height: 18px; vertical-align: -3px; color: var(--teal); }
.card-head h2 svg.warn-ic { color: var(--suspended); }
.ic-sm { width: 15px; height: 15px; vertical-align: -2px; }
.timeline li .dot { border-color: var(--c, var(--teal)); }
a.list-link { color: inherit; transition: box-shadow .15s, transform .08s; }
a.list-link:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-1px); }
a.list-link svg { width: 26px; height: 26px; color: var(--teal); }
tr.sel td { background: var(--teal-soft); }
.tag + .tag { margin-left: 4px; }

table.data td:first-child, table.data th:first-child { padding-left: 18px; }
table.data td:last-child, table.data th:last-child { padding-right: 18px; }
td .cell-main.nw, td.nowrap { white-space: nowrap; }
.card-head .input, .btn-row .input, .toolbar .input { width: auto; }
.card-head select.input { max-width: 220px; }
.next-nav { display: flex; justify-content: space-between; gap: 8px; }
.gap-lg { gap: 32px; }
table.imp td:nth-child(2) { min-width: 320px; }
table.imp select.dept { min-width: 170px; }
.imp-warn { font-size: 12px; color: #8a5a00; background: var(--pending-bg); border-radius: 6px; padding: 3px 8px; margin-top: 5px; display: inline-block; }
/* keep the Action column on screen even with long invoice numbers / supplier names */
table.data td .cell-main.nw { white-space: normal; overflow-wrap: anywhere; max-width: 150px; }
table.data.responsive td:nth-child(2) { max-width: 230px; }
table.data td:last-child .btn { padding: 6px 10px; }
@media (max-width: 1500px) { table.data.responsive th, table.data.responsive td { padding-left: 8px; padding-right: 8px; } }
/* demo page only */
.demo-ribbon { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 300; background: #fff8e6; color: #5c3d00; border: 1px solid #f0d28c; border-radius: 999px; padding: 7px 10px 7px 16px; font-size: 12.5px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; max-width: calc(100vw - 24px); flex-wrap: wrap; justify-content: center; }
.demo-ribbon code { background: #fff; border: 1px solid #f0d28c; border-radius: 5px; padding: 1px 6px; font-family: var(--mono); }
.demo-ribbon button { border: 1px solid #e3be6a; background: #fff; border-radius: 999px; padding: 3px 10px; font: inherit; font-weight: 600; cursor: pointer; color: #5c3d00; }
@media print { .demo-ribbon { display: none; } }
/* In the hosted demo, printing and file downloads are blocked by the viewer, so hide those buttons there only. */
.demo #print, .demo #wprint, .demo #mprint, .demo #csv, .demo #wcsv, .demo #export, .demo [data-dl], .demo #pv-dl { display: none !important; }
@media (max-width: 700px) { .demo-ribbon .users { display: none; } .demo-ribbon { bottom: 8px; font-size: 11.5px; } }

/* ---------- Approver quick actions (one click) ---------- */
.quick-approve { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-approve .btn { justify-content: center; font-size: 16px; min-height: 54px; }
.quick-approve .btn:only-child { grid-column: 1 / -1; }
.btn.approve { background: var(--paid); border-color: var(--paid); color: #fff; }
.btn.approve:hover:not(:disabled) { filter: brightness(.92); }
.btn.suspend { background: #fff; border-color: var(--suspended); color: var(--suspended); }
.btn.suspend:hover:not(:disabled) { background: var(--suspended); color: #fff; }
.qa-reason { display: grid; gap: 10px; }
.qa-reason[hidden] { display: none; }
.qa-reason label { font-weight: 700; font-size: 13px; }
.qa-reason .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 6px 11px; font: inherit; font-size: 12.5px; cursor: pointer; color: inherit; }
.chip:hover, .chip:focus-visible { border-color: var(--suspended); color: var(--suspended); }
