/* ============================================================================
   Vasanth & Co. — Balance Confirmation console
   Clean, modern, professional UI. Self-contained (no build step).
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --brand: #4f46e5; --brand-600: #4f46e5; --brand-700: #4338ca; --brand-800: #3730a3;
  --brand-50: #eef2ff; --brand-100: #e0e7ff;
  --bg: #f1f5f9; --surface: #ffffff; --surface-2: #f8fafc;
  --border: #e2e8f0; --border-strong: #cbd5e1;
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --muted-2: #94a3b8;
  --ok: #16a34a; --ok-bg: #f0fdf4; --ok-bd: #bbf7d0;
  --warn: #b45309; --warn-bg: #fffbeb; --warn-bd: #fde68a;
  --bad: #dc2626; --bad-bg: #fef2f2; --bad-bd: #fecaca;
  --info: #2563eb; --info-bg: #eff6ff; --info-bd: #bfdbfe;
  --side: #0f172a; --side-2: #1e293b; --side-text: #cbd5e1; --side-muted: #64748b;
  --r-sm: 8px; --r: 10px; --r-lg: 14px; --pill: 999px;
  --sh-sm: 0 1px 2px rgba(15,23,42,.06);
  --sh: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
  --sh-md: 0 6px 18px rgba(15,23,42,.08);
  --sh-lg: 0 16px 40px rgba(15,23,42,.16);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--ink); }

/* ---- Controls ---- */
button {
  font: inherit; font-weight: 600; cursor: pointer; border: 1px solid transparent;
  border-radius: var(--r-sm); padding: 9px 16px; background: var(--brand); color: #fff;
  transition: background .15s, box-shadow .15s, transform .05s; white-space: nowrap;
}
button:hover { background: var(--brand-700); }
button:active { transform: translateY(1px); }
button.ghost { background: #fff; color: var(--ink-2); border-color: var(--border-strong); }
button.ghost:hover { background: var(--surface-2); border-color: var(--muted-2); }
button.danger { background: var(--bad); }
button.danger:hover { background: #b91c1c; }
button.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 7px; }
button:disabled { opacity: .5; cursor: default; transform: none; }

input, select, textarea {
  font: inherit; width: 100%; padding: 9px 11px; color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100);
}
textarea { resize: vertical; min-height: 64px; }
input[type=file] { padding: 7px; background: var(--surface-2); }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 5px; letter-spacing: .01em; }

.field { margin-bottom: 12px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.row > div { flex: 1; min-width: 170px; }
/* "fit" columns hug their content (e.g. a button) — flex:0 alone kept the
   170px min-width and made wide buttons overflow/overlap; size to content. */
.row > div.fit { flex: 0 0 auto; min-width: 0; }
.muted { color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.err-text { color: var(--bad); font-size: 13px; margin-top: 8px; min-height: 16px; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* ============================ App shell ============================ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px; flex-shrink: 0; background: var(--side); color: var(--side-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 11px; padding: 20px 20px 16px; color: #fff;
}
.sidebar .brand .logo {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), #818cf8);
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 15px;
  box-shadow: 0 4px 12px rgba(79,70,229,.4);
}
.sidebar .brand .nm { font-weight: 700; font-size: 15px; line-height: 1.2; }
.sidebar .brand .nm small { display: block; font-weight: 500; font-size: 11px; color: var(--side-muted); }
.sidebar nav { padding: 8px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.sidebar nav button {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: transparent; color: var(--side-text); border: 0; border-radius: var(--r-sm);
  padding: 10px 12px; font-weight: 500; font-size: 14px;
}
.sidebar nav button:hover { background: var(--side-2); color: #fff; }
.sidebar nav button.active { background: var(--brand); color: #fff; box-shadow: var(--sh-sm); }
.sidebar nav button svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .9; }
.side-foot { padding: 14px 16px; border-top: 1px solid var(--side-2); }
.side-foot .u { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.side-foot .av {
  width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.side-foot .u .nm { font-size: 13px; color: #fff; font-weight: 600; line-height: 1.2; }
.side-foot .u .nm small { display: block; color: var(--side-muted); font-weight: 500; }
.side-foot button { width: 100%; background: var(--side-2); color: var(--side-text); border: 0; }
.side-foot button:hover { background: #334155; color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.topbar .menu-btn { display: none; background: transparent; color: var(--ink); border: 1px solid var(--border); padding: 6px 10px; }
.topbar .page-title { font-size: 17px; font-weight: 700; }
.topbar .spacer { flex: 1; }
.meter-pill {
  font-size: 12.5px; font-weight: 600; color: var(--brand-700); background: var(--brand-50);
  border: 1px solid var(--brand-100); padding: 5px 11px; border-radius: var(--pill);
}
.user-chip { font-size: 13px; color: var(--muted); }
.content { padding: 24px; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ============================ Cards / tiles ============================ */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 20px; margin-bottom: 18px; box-shadow: var(--sh-sm);
}
.card > h3 { margin: 0 0 4px; font-size: 15.5px; }
.card > .sub { margin: 0 0 16px; font-size: 13px; color: var(--muted); }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head h3 { margin: 0; flex: 1; font-size: 15.5px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px,1fr)); gap: 14px; margin-bottom: 20px; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 18px; box-shadow: var(--sh-sm); position: relative; overflow: hidden;
}
.tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border-strong); }
.tile .n { font-size: 27px; font-weight: 700; letter-spacing: -.02em; }
.tile .l { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-weight: 500; }
.tile.brand::before { background: var(--brand); } .tile.brand .n { color: var(--brand-700); }
.tile.warn::before { background: var(--warn); } .tile.warn .n { color: var(--warn); }
.tile.bad::before { background: var(--bad); } .tile.bad .n { color: var(--bad); }
.tile.ok::before { background: var(--ok); } .tile.ok .n { color: var(--ok); }

/* ---- Off-form response capture (review modal) ---- */
.capture {
  margin-top: 14px; border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface-2); padding: 10px 14px;
}
.capture > summary {
  cursor: pointer; font-weight: 600; font-size: 13px; color: var(--brand-700);
  list-style: none; user-select: none;
}
.capture > summary::before { content: '+ '; font-weight: 700; }
.capture[open] > summary::before { content: '– '; }

/* ============================ Tables ============================ */
.table-wrap { overflow-x: auto; border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
thead th {
  color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .04em; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td .sub { color: var(--muted); font-size: 12px; }

/* Dashboard table: keep ref / amount / dates / status / actions on one line
   (only the client-party name and the type cell are allowed to wrap). */
.dash-table td:first-child, .dash-table td:nth-child(4), .dash-table td:nth-child(5),
.dash-table td:nth-child(6), .dash-table td:nth-child(7), .dash-table td:nth-child(8) { white-space: nowrap; }
.dash-table td:nth-child(2) { min-width: 200px; }
.dash-table .type-kind { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---- Chips / status badges ---- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--pill);
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border);
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip.Draft { background: #f1f5f9; color: var(--muted); border-color: var(--border); }
.chip.Sent, .chip.Reminded { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-bd); }
.chip.Responded, .chip.UnderReview { background: var(--info-bg); color: var(--info); border-color: var(--info-bd); }
.chip.Accepted { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-bd); }
.chip.NeedsMoreInfo { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-bd); }
.chip.plain::before { display: none; }
.chip.msme { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-bd); }
.overdue { color: var(--bad); font-weight: 600; }

/* ---- Guide / Help page ---- */
.guide h4 { margin: 22px 0 8px; font-size: 14px; color: var(--ink); }
.guide p.sub { margin: 0 0 6px; }
.guide code {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 6px; font-size: 12.5px;
}
.guide .flow {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r);
  padding: 14px 16px; font-size: 12.5px; line-height: 1.5; overflow-x: auto; white-space: pre;
}
.guide .steps { margin: 4px 0 0; padding-left: 20px; }
.guide .steps li { margin-bottom: 8px; font-size: 13.5px; line-height: 1.5; }
.guide .table-wrap { margin: 4px 0 8px; border: 1px solid var(--border); }

/* ---- Guide / Help page — rich, colourful layout ---- */
.guide-rich { padding-top: 4px; }
.guide-rich > h3 { display: none; } /* replaced by the hero */

.g-hero {
  display: flex; gap: 18px; align-items: flex-start;
  background: linear-gradient(135deg, var(--brand-800), var(--brand) 55%, #6366f1);
  color: #fff; border-radius: var(--r-lg); padding: 22px 26px; margin: 2px 0 18px;
  box-shadow: var(--sh-md);
}
.g-hero .ico { font-size: 30px; line-height: 1; background: rgba(255,255,255,.16); border-radius: 12px; padding: 10px 13px; }
.g-hero h2 { margin: 0 0 7px; color: #fff; font-size: 20px; font-weight: 700; }
.g-hero p { margin: 0; color: #e0e7ff; font-size: 13.5px; line-height: 1.6; }
.g-hero code { background: rgba(255,255,255,.2); border-color: transparent; color: #fff; }

.g-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.g-quick span { font-size: 12.5px; font-weight: 600; padding: 6px 13px; border-radius: var(--pill);
  background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); }

/* accent palette — each section sets one of these */
.g-accent-brand  { --ac: #4f46e5; --ac-bg: #eef2ff; --ac-bd: #c7d2fe; }
.g-accent-info   { --ac: #2563eb; --ac-bg: #eff6ff; --ac-bd: #bfdbfe; }
.g-accent-ok     { --ac: #16a34a; --ac-bg: #f0fdf4; --ac-bd: #bbf7d0; }
.g-accent-warn   { --ac: #b45309; --ac-bg: #fffbeb; --ac-bd: #fde68a; }
.g-accent-violet { --ac: #7c3aed; --ac-bg: #f5f3ff; --ac-bd: #ddd6fe; }
.g-accent-teal   { --ac: #0d9488; --ac-bg: #f0fdfa; --ac-bd: #99f6e4; }
.g-accent-rose   { --ac: #e11d48; --ac-bg: #fff1f2; --ac-bd: #fecdd3; }

.g-sec { --ac: #4f46e5;
  position: relative; border: 1px solid var(--border); border-left: 4px solid var(--ac);
  border-radius: var(--r); background: var(--surface); box-shadow: var(--sh-sm);
  padding: 2px 18px 16px; margin: 0 0 14px;
}
.g-sec-h { display: flex; align-items: center; gap: 11px; margin: 15px 0 11px; }
.g-badge { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  font-weight: 800; font-size: 13.5px; color: #fff; background: var(--ac); box-shadow: var(--sh-sm); }
.g-sec-h h4 { margin: 0; font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.g-tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ac); background: var(--ac-bg); border: 1px solid var(--ac-bd); border-radius: var(--pill); padding: 2px 9px; }
.g-sec p.sub { color: var(--ink-2); font-size: 13px; }
.g-sec .flow { border-left: 3px solid var(--ac); }

/* colour-coded callouts */
.g-note, .g-tip, .g-warn, .g-danger, .g-key {
  border-radius: var(--r-sm); padding: 11px 14px; margin: 10px 0; font-size: 13px; line-height: 1.55; border: 1px solid; }
.g-note   { background: var(--info-bg); border-color: var(--info-bd); color: #1e40af; }
.g-tip    { background: var(--ok-bg);   border-color: var(--ok-bd);   color: #166534; }
.g-warn   { background: var(--warn-bg); border-color: var(--warn-bd); color: #92400e; }
.g-danger { background: var(--bad-bg);  border-color: var(--bad-bd);  color: #991b1b; }
.g-key    { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-800); }

/* confirmation-type cards */
.g-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 12px; margin: 10px 0 6px; }
.g-type { border: 1px solid var(--ac-bd); border-top: 3px solid var(--ac); border-radius: var(--r);
  background: var(--ac-bg); padding: 13px 15px; }
.g-type h5 { margin: 0 0 4px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.g-type .lbl { display: inline-block; font-size: 14px; font-weight: 800; color: var(--ac); margin-bottom: 7px; }
.g-type p { margin: 0 0 8px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.g-type .nat { font-style: italic; font-size: 12px; color: var(--ink-2);
  background: rgba(255,255,255,.65); border: 1px dashed var(--ac-bd); border-radius: 6px; padding: 6px 9px; }

/* richer tables inside the guide */
.guide-rich table thead th { background: var(--brand-50); color: var(--brand-800); }
.guide-rich tbody tr:nth-child(even) { background: var(--surface-2); }

/* ---- Sub-tabs (Settings) ---- */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.subtabs button {
  background: transparent; color: var(--muted); border: 0; border-bottom: 2px solid transparent;
  border-radius: 0; padding: 9px 14px; font-weight: 600; font-size: 13.5px;
}
.subtabs button:hover { color: var(--ink); background: transparent; }
.subtabs button.active { color: var(--brand-700); border-bottom-color: var(--brand); }

/* ---- Party picker (checkbox list) ---- */
.pick { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); padding: 6px; }
.pick label {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--ink); font-weight: 500; font-size: 13.5px; cursor: pointer;
}
.pick label:hover { background: #fff; }
.pick input { width: auto; }
.pick-tag { font-size: 11px; background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }

/* ---- Reports tab (filters + builder + preview) ---- */
.chkwrap { display: flex; flex-wrap: wrap; gap: 7px 16px; padding: 8px 0; }
.chkwrap.cols { max-height: 180px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; background: var(--surface-2); }
.chk { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; cursor: pointer; }
.chk input { width: auto; }
.rep-table th, .rep-table td { white-space: nowrap; font-size: 12.5px; }
.rep-table tbody tr:nth-child(even) { background: var(--surface-2); }
.check { display: flex; align-items: center; gap: 9px; }
.check input { width: auto; }

/* ---- Sender-email method chooser (Settings) ---- */
.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 4px; }
.methods .method {
  display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 13px 14px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface-2);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.methods .method:hover { border-color: var(--muted-2); }
.methods .method.sel { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px var(--brand-100); }
.methods .method input { width: auto; margin-top: 2px; }
.methods .method .mt b { display: block; font-size: 13.5px; color: var(--ink); font-weight: 600; }
.methods .method .mt small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.method-panel {
  margin-top: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2);
}
.g-status { font-size: 13.5px; font-weight: 600; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--border); background: #fff; }
.g-status.on { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-bd); }
.g-status.off { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-bd); }
@media (max-width: 620px) { .methods { grid-template-columns: 1fr; } }

/* ============================ Modal ============================ */
.modal-bg {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto; z-index: 100;
}
.modal { background: #fff; border-radius: var(--r-lg); padding: 24px; width: 660px; max-width: 100%; box-shadow: var(--sh-lg); }
.modal h3 { margin: 0; font-size: 16px; }
.kv { display: grid; grid-template-columns: 168px 1fr; gap: 9px 14px; margin: 16px 0; }
.kv > div:nth-child(odd) { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kv > div:nth-child(even) { font-size: 13.5px; }
.hist { max-height: 230px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r); padding: 4px; background: var(--surface-2); }
.hist .e { padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 12.5px; border-radius: 6px; }
.hist .e:last-child { border-bottom: 0; }

/* ============================ Toast ============================ */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r); font-size: 13.5px; font-weight: 500;
  box-shadow: var(--sh-lg); z-index: 200; transition: opacity .2s, transform .2s; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--bad); }
.toast.ok { background: var(--ok); }

/* ============================ Public / login pages ============================ */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 500px at 50% -10%, #e0e7ff 0%, var(--bg) 55%); }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 32px; width: 380px; max-width: 100%; box-shadow: var(--sh-md); }
.auth-card .logo {
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--brand), #818cf8); display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 19px; box-shadow: 0 6px 16px rgba(79,70,229,.35);
}
.auth-card h1 { font-size: 20px; margin: 0 0 4px; }
.auth-card p.sub { margin: 0 0 20px; color: var(--muted); font-size: 13.5px; }

.form-wrap { max-width: 680px; margin: 0 auto; padding: 32px 18px 48px; }
.form-head { text-align: center; margin-bottom: 22px; }
.form-head .logo {
  width: 52px; height: 52px; border-radius: 13px; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--brand), #818cf8); display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 21px; box-shadow: 0 8px 20px rgba(79,70,229,.32);
}
.form-head h1 { font-size: 22px; margin: 0 0 4px; }
.form-head .ref { display: inline-block; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--brand-700); background: var(--brand-50); border: 1px solid var(--brand-100); padding: 4px 12px; border-radius: var(--pill); }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--sh-sm); }
.notice { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: var(--r); padding: 14px 16px; font-size: 13.5px; margin: 0 0 18px; color: var(--ink-2); }
.notice.msme { background: var(--warn-bg); border-color: var(--warn-bd); }
.notice b { color: var(--ink); }
.foot-note { text-align: center; font-size: 12px; color: var(--muted); margin-top: 18px; }
.done { text-align: center; padding: 26px 16px 8px; }
.done .big { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center; font-size: 38px; }
.done .big.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-bd); }
.done .big.warn { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad-bd); }
.done h1 { font-size: 21px; margin: 0 0 8px; }

/* ============================ Public confirmation page ============================ */
.conf-wrap { max-width: 940px; margin: 0 auto; padding: 22px 18px 56px; }
.conf-topbar { display: flex; align-items: center; gap: 12px; padding: 10px 4px 18px; font-size: 18px; color: var(--ink); }
.conf-topbar .logo {
  width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), #818cf8);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px;
}
.conf-title { font-size: 22px; margin: 0 0 16px; }
.conf-head {
  display: grid; grid-template-columns: 1.3fr 1fr 1.1fr; gap: 18px 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 20px 24px; box-shadow: var(--sh-sm); margin-bottom: 18px;
}
.conf-head .ci { margin-bottom: 10px; }
.conf-head .ci span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.conf-head .ci b { font-size: 13px; color: var(--ink); font-weight: 600; word-break: break-word; }
.conf-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--sh-sm); }
.conf-h { font-size: 16px; margin: 0 0 8px; color: var(--ink); }
.conf-card .table-wrap { border: 1px solid var(--border); }
.conf-card .opt {
  display: flex; align-items: flex-start; gap: 9px; margin: 0 0 8px; padding: 11px 13px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface-2);
  font-weight: 500; color: var(--ink); cursor: pointer; font-size: 13.5px;
}
.conf-card .opt:hover { border-color: var(--muted-2); }
.conf-card .opt input { width: auto; margin-top: 2px; }
.conf-card input.ro, .conf-card input[readonly] { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.btn-dl {
  display: inline-block; background: var(--ink); color: #fff; padding: 9px 18px; border-radius: var(--r-sm);
  font-weight: 600; font-size: 13.5px; text-decoration: none;
}
.btn-dl:hover { background: #1e293b; text-decoration: none; }
.sign { margin-top: 22px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.sign .sig-name { font-family: 'Segoe Script', 'Brush Script MT', cursive; font-size: 26px; color: #1f2a44; margin: 2px 0 12px; }
.sign .sig-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.sign .sig-kv > div span { display: inline-block; min-width: 122px; color: var(--muted); font-size: 12px; }
.sign .sig-kv > div b { font-size: 12.5px; color: var(--ink); font-weight: 600; word-break: break-all; }

/* ============================ Responsive ============================ */
@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--sh-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .topbar .menu-btn { display: inline-flex; }
  .scrim { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 55; }
  .content { padding: 18px; }
  .conf-head { grid-template-columns: 1fr; gap: 4px 0; }
  .sign .sig-kv { grid-template-columns: 1fr; }
}
