/* ============================================================
   AraCore Comply App — design system
   Palette: marine ink + ledger paper + audit gold
   Type: Sora (display) · Public Sans (body) · Spline Sans Mono (figures)
   ============================================================ */

:root {
  --ink: #122a47;
  --ink-2: #0c1f36;
  --brand: #1f4e79;
  --brand-bright: #2e75b6;
  --paper: #f2f5f8;
  --surface: #ffffff;
  --line: #dde5ed;
  --muted: #5b7186;
  --gold: #dea53c;
  --gold-soft: #fbf3e2;
  --green: #2e8b6e;
  --green-soft: #e6f4ee;
  --red: #c0452f;
  --red-soft: #faeae6;
  --blue-soft: #e8f1fa;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(18, 42, 71, .06), 0 8px 24px -12px rgba(18, 42, 71, .12);
  --font-display: 'Sora', sans-serif;
  --font-body: 'Public Sans', sans-serif;
  --font-mono: 'Spline Sans Mono', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -.01em; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
a { color: var(--brand-bright); }

.num, td.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ============================ AUTH ============================ */

.auth-body { background: var(--ink-2); }
.auth-split { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }

.auth-brand {
  color: #e9eef5; padding: 56px; display: flex; align-items: center;
  background:
    radial-gradient(1100px 500px at -10% -20%, rgba(46,117,182,.35), transparent 60%),
    radial-gradient(800px 600px at 110% 110%, rgba(222,165,60,.18), transparent 55%),
    var(--ink-2);
}
.auth-brand-inner { max-width: 520px; }
.auth-brand h1 { font-size: 34px; line-height: 1.25; margin: 34px 0 30px; font-weight: 600; }
.auth-brand h1 span { color: var(--gold); }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.auth-points li { padding-left: 18px; position: relative; color: #b9c7d6; line-height: 1.5; }
.auth-points li::before { content: ''; position: absolute; left: 0; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.auth-points b { color: #fff; }
.auth-foot { margin-top: 36px; font-size: 12.5px; color: #8aa0b6; border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px; }

.auth-panel { display: flex; align-items: center; justify-content: center; background: var(--paper); padding: 32px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--paper); border-radius: 10px; padding: 5px; margin-bottom: 22px; }
.auth-tab { border: 0; background: transparent; padding: 9px; border-radius: 7px; font-weight: 600; color: var(--muted); }
.auth-tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(18,42,71,.12); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.auth-card label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
.auth-card label small { font-weight: 400; }
.auth-card input, .auth-card select { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; color: var(--ink); }
.auth-card input:focus, .auth-card select:focus { outline: 2px solid var(--brand-bright); outline-offset: 1px; border-color: transparent; }
.hint { font-size: 12px; color: var(--muted); margin: 12px 0 0; }
.auth-msg { margin-top: 16px; padding: 11px 13px; border-radius: 9px; font-size: 13px; line-height: 1.45; }
.auth-msg.error { background: var(--red-soft); color: var(--red); }
.auth-msg.success { background: var(--green-soft); color: var(--green); }
.auth-msg.locked { background: var(--gold-soft); color: #8a6320; border: 1px solid #ecd9ad; }
.demo-creds { margin-top: 20px; border-top: 1px dashed var(--line); padding-top: 14px; display: grid; gap: 5px; }
.demo-creds span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.demo-creds code { font-family: var(--font-mono); font-size: 12px; color: var(--brand); }

/* ============================ SHELL ============================ */

.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--ink-2); color: #cfdae6; padding: 20px 14px;
  display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.logo { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: #fff; display: flex; align-items: center; gap: 9px; padding: 4px 8px; }
.logo em { font-style: normal; font-weight: 500; color: #8aa0b6; font-size: 13px; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-bright), var(--brand)); color: #fff; font-size: 15px;
}

.client-switch { padding: 0 8px; }
.client-switch label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: #7e94aa; margin-bottom: 5px; }
.client-switch select { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.07); color: #fff; }
.client-switch option { color: var(--ink); }

.nav { display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 9px; text-align: left;
  background: transparent; color: #b6c5d4; font-size: 14px; font-weight: 500;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(46,117,182,.28); color: #fff; }
.nav-ic { width: 18px; text-align: center; opacity: .85; }
.nav-sep { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: #7e94aa; padding: 14px 12px 4px; }

.erp-card { margin-top: auto; background: linear-gradient(150deg, rgba(222,165,60,.16), rgba(222,165,60,.05)); border: 1px solid rgba(222,165,60,.35); border-radius: 12px; padding: 14px; font-size: 12.5px; }
.erp-card b { color: #f3d9a4; display: block; margin-bottom: 4px; }
.erp-card p { margin: 0 0 10px; color: #b9c7d6; line-height: 1.4; }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px 8px 4px; border-top: 1px solid rgba(255,255,255,.1); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-bright); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none; }
.user-meta { min-width: 0; flex: 1; }
.user-meta b { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 11.5px; color: #8aa0b6; }
.icon-btn { border: 0; background: transparent; color: #8aa0b6; font-size: 16px; padding: 6px; border-radius: 7px; }
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { padding: 28px 34px 60px; min-width: 0; }
.loading { color: var(--muted); padding: 60px; text-align: center; }

/* ========================= PAGE CHROME ========================= */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 600; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 9px; padding: 9px 14px; font-weight: 600; font-size: 13.5px;
  transition: background .12s, border-color .12s;
}
.btn:hover { border-color: var(--brand-bright); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-bright); border-color: var(--brand-bright); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #2c2008; }
.btn-gold:hover { filter: brightness(1.06); }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); background: var(--red-soft); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 7px; text-decoration: none; display: inline-block; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand-bright); }
.btn-ghost:hover { background: var(--blue-soft); }

/* ===================== SIGNATURE: DEADLINE RAIL ===================== */

.rail-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px 8px; box-shadow: var(--shadow); margin-bottom: 22px; }
.rail-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.rail-head h2 { font-size: 14px; font-weight: 600; }
.rail-head span { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.rail { position: relative; height: 92px; }
.rail-line { position: absolute; left: 0; right: 0; top: 58px; height: 2px; background: linear-gradient(90deg, var(--brand) 0%, var(--line) 100%); border-radius: 2px; }
.rail-today { position: absolute; top: 40px; width: 2px; height: 36px; background: var(--gold); }
.rail-today::after { content: 'today'; position: absolute; top: 38px; left: -16px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.rail-tick { position: absolute; top: 52px; transform: translateX(-50%); cursor: pointer; }
.rail-dot { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px currentColor; background: currentColor; }
.rail-tick .rail-label {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: 11px; font-family: var(--font-mono);
  color: var(--muted); background: var(--surface); padding: 1px 4px; border-radius: 4px;
}
.rail-tick:hover .rail-label { color: var(--ink); font-weight: 500; }
.rail-tick.s-overdue { color: var(--red); }
.rail-tick.s-due_soon { color: var(--gold); }
.rail-tick.s-upcoming { color: var(--brand-bright); }
.rail-empty { color: var(--muted); font-size: 13px; padding: 26px 0; }

/* ============================ CARDS ============================ */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.card .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; margin-bottom: 8px; display: flex; justify-content: space-between; }
.card .v { font-family: var(--font-mono); font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.card .v small { font-size: 12px; color: var(--muted); }
.card .d { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.card.alert { border-color: #eccfc7; background: linear-gradient(180deg, #fff, var(--red-soft)); }
.card.alert .v { color: var(--red); }
.card.good .v { color: var(--green); }

.grid-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; margin-bottom: 22px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.panel h2 { font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.panel .assumption, .assumption { font-size: 12px; color: var(--muted); background: var(--blue-soft); border-radius: 8px; padding: 9px 11px; margin-top: 12px; line-height: 1.45; }
.chart-box { position: relative; height: 240px; }

.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }

/* ============================ TABLES ============================ */

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); background: #f8fafc; white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid #edf1f6; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fafc; }
td.num, th.num { text-align: right; white-space: nowrap; }
td .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.t-actions { white-space: nowrap; text-align: right; }
.t-actions button { margin-left: 4px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; font-family: var(--font-mono); padding: 3px 9px; border-radius: 99px; letter-spacing: .02em; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.upcoming { background: var(--blue-soft); color: var(--brand-bright); }
.pill.due_soon { background: var(--gold-soft); color: #97701f; }
.pill.overdue { background: var(--red-soft); color: var(--red); }
.pill.submitted { background: var(--green-soft); color: var(--green); }
.pill.active { background: var(--green-soft); color: var(--green); }
.pill.inactive { background: #eef1f5; color: var(--muted); }
.pill.prospect { background: var(--blue-soft); color: var(--brand-bright); }
.pill.sale { background: var(--green-soft); color: var(--green); }
.pill.expense { background: var(--red-soft); color: var(--red); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters select, .filters input { padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }

.totals-strip { display: flex; gap: 22px; flex-wrap: wrap; margin: 14px 2px 0; font-size: 13px; color: var(--muted); }
.totals-strip b { font-family: var(--font-mono); color: var(--ink); font-weight: 500; }

/* ============================ FORMS / MODAL ============================ */

#modal-root:empty { display: none; }
.modal-back { position: fixed; inset: 0; background: rgba(12, 31, 54, .5); display: grid; place-items: center; z-index: 50; padding: 20px; backdrop-filter: blur(2px); }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; box-shadow: 0 24px 64px -16px rgba(12,31,54,.4); }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 0; }
.modal-h h2 { font-size: 16px; }
.modal-x { border: 0; background: transparent; font-size: 18px; color: var(--muted); padding: 4px 8px; border-radius: 6px; }
.modal-x:hover { background: var(--paper); color: var(--ink); }
.modal-b { padding: 18px 22px 22px; }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.f-grid .full { grid-column: 1 / -1; }
.f { display: block; }
.f span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.f input, .f select, .f textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; }
.f input:focus, .f select:focus, .f textarea:focus { outline: 2px solid var(--brand-bright); outline-offset: 1px; border-color: transparent; }
.f-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding-top: 22px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal .err { color: var(--red); background: var(--red-soft); border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-top: 14px; }

/* ERP upsell modal flavor */
.upsell-modal .modal-b { text-align: center; padding-top: 6px; }
.upsell-ic { font-size: 34px; margin: 8px 0 10px; }
.upsell-modal p { color: var(--muted); line-height: 1.55; }

/* ============================ MESSAGES ============================ */

.chat-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; height: calc(100vh - 170px); min-height: 420px; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.bubble { max-width: 70%; padding: 11px 14px; border-radius: 13px; line-height: 1.5; font-size: 13.5px; }
.bubble .who { font-size: 11px; font-weight: 700; margin-bottom: 3px; opacity: .75; }
.bubble .when { display: block; font-size: 10.5px; font-family: var(--font-mono); opacity: .6; margin-top: 5px; }
.bubble .file-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 12.5px; font-weight: 600; }
.bubble.mine { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.bubble.mine a { color: #cfe4f7; }
.bubble.theirs { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-input { display: flex; gap: 8px; padding: 14px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-input textarea { flex: 1; resize: none; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; height: 44px; max-height: 120px; }

/* ============================ NOTES ============================ */

.note { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand-bright); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow); }
.note.done { opacity: .55; border-left-color: var(--green); }
.note.late { border-left-color: var(--red); }
.note-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.note-body { line-height: 1.5; white-space: pre-wrap; }
.note-meta { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.tag { background: var(--blue-soft); color: var(--brand); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }

/* ============================ MISC ============================ */

#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 99; box-shadow: var(--shadow); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--red); }

.empty { text-align: center; color: var(--muted); padding: 46px 20px; }
.empty b { display: block; color: var(--ink); font-family: var(--font-display); margin-bottom: 6px; font-size: 15px; }

:focus-visible { outline: 2px solid var(--brand-bright); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ============================ RESPONSIVE ============================ */

@media (max-width: 980px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand { padding: 36px 28px; }
  .grid-2 { grid-template-columns: 1fr; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .nav { display: flex; flex-wrap: wrap; }
  .erp-card { display: none; }
  .user-chip { border: 0; margin-left: auto; }
  .main { padding: 18px 16px 50px; }
  .bubble { max-width: 88%; }
  .f-grid[style*="repeat("] { grid-template-columns: 1fr 1fr !important; }
}

/* destructive confirm button */
.btn-delete { background: var(--red); border-color: var(--red); color: #fff; }
.btn-delete:hover:not(:disabled) { filter: brightness(.92); }
.btn-delete:disabled { opacity: .45; cursor: not-allowed; }

/* sign-in page: text links & sub-pane titles */
.link-btn { display: block; margin: 14px auto 0; background: none; border: 0; padding: 4px; font: inherit; font-size: 13.5px; color: var(--blue, #1f5fa8); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.pane-title { font-family: 'Sora', sans-serif; font-size: 18px; margin: 2px 0 8px; color: var(--ink); }
.access-link-box { display: flex; gap: 8px; margin: 10px 0 6px; }
.access-link-box input { flex: 1; font-family: 'Spline Sans Mono', monospace; font-size: 12.5px; }
.access-list { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.access-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); }
.access-list li:first-child { border-top: 0; }
.access-list li .grow { flex: 1; min-width: 0; }
.access-list .sub { display: block; color: var(--muted); font-size: 12.5px; }

.auth-tabs[hidden] { display: none; }
#tab-forgot .hint, #tab-access .hint { margin-bottom: 14px; }

.f input:disabled, .f select:disabled { opacity: .45; cursor: not-allowed; }

/* Statement of account card (Billing > Statement and the client's Statement page) */
.st-wrap{display:flex;gap:28px;align-items:flex-start;flex-wrap:wrap}
.st-card{width:390px;max-width:100%;background:#fff;border-radius:18px;overflow:hidden;box-shadow:0 6px 24px rgba(15,31,55,.12);border:1px solid var(--line);font-family:'Public Sans',system-ui,sans-serif;color:#14213d}
.st-head{background:linear-gradient(135deg,#0f2440,#1f4e79);color:#fff;padding:20px 22px 18px}
.st-head small{display:block;opacity:.75;font-size:11.5px;letter-spacing:.08em;text-transform:uppercase}
.st-head b{display:block;font-family:'Sora',sans-serif;font-size:19px;margin:4px 0 2px}
.st-head span{font-size:13px;opacity:.85}
.st-sec{padding:14px 22px 4px}
.st-sec h4{margin:0 0 4px;font-size:11.5px;letter-spacing:.07em;text-transform:uppercase;color:#56657a;display:flex;justify-content:space-between}
.st-sec.late h4{color:#b23a2a}
.st-row{display:flex;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid #eef1f5}
.st-row:last-child{border-bottom:0}
.st-row b{display:block;font-size:14.5px} .st-row span{display:block;font-size:12px;color:#6a778a;margin-top:1px}
.st-amt{font-family:'Spline Sans Mono',monospace;font-size:14.5px;white-space:nowrap;font-weight:500}
.st-sec.late .st-amt{color:#b23a2a}
.st-total{margin:10px 16px 0;padding:14px 16px;border-radius:12px;background:#fdf3dc;display:flex;justify-content:space-between;align-items:center}
.st-total.ok{background:#e4f4ec}
.st-total small{display:block;font-size:11.5px;letter-spacing:.07em;text-transform:uppercase;color:#7a5a12}
.st-total.ok small{color:#1d6b46}
.st-total b{font-family:'Spline Sans Mono',monospace;font-size:22px}
.st-foot{padding:12px 22px 18px;font-size:12.5px;color:#56657a;line-height:1.5}
.st-pay{margin-top:8px;padding:10px 12px;background:#f4f7fa;border-radius:10px;white-space:pre-line;color:#14213d}
.st-side{flex:1;min-width:260px;max-width:440px}
.st-side .btn{margin:0 6px 8px 0;white-space:nowrap;text-decoration:none;display:inline-flex}
.st-side textarea{width:100%;min-height:84px;margin-top:6px;font-weight:400;padding:10px 12px;border:1px solid var(--line);border-radius:9px;font:inherit;font-size:13.5px;resize:vertical}
.st-future-note{margin-top:14px;padding:10px 12px;border-radius:10px;background:#eef3f9;font-size:12.5px;color:var(--muted);line-height:1.5}
.st-future-note b{color:var(--ink)}
.st-side .panel .st-row b .pill{font-weight:600}

/* Monthly returns (staff landing page) */
.wl-month .btn { min-width: 40px; justify-content: center; }
.wl-month .btn:disabled { opacity: .5; cursor: default; }
.wl-bar { display: inline-block; width: 70px; height: 6px; border-radius: 4px; background: #e3e9f0; overflow: hidden; vertical-align: middle; margin-right: 8px; }
.wl-bar i { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.wl-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.chip b { font-family: 'Spline Sans Mono', monospace; font-weight: 500; color: var(--muted); margin-left: 3px; }
.chip.on { background: var(--brand, #1f4e79); border-color: var(--brand, #1f4e79); color: #fff; }
.chip.on b { color: #cfe0f2; }
.wl-group { margin-bottom: 18px; padding: 0; overflow: hidden; }
.wl-gh { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.wl-gh h2 { margin: 0; font-size: 16px; }
.wl-gh span { font-size: 12.5px; color: var(--muted); }
.wl-gprog { display: flex; align-items: center; white-space: nowrap; }
.wl-gprog b { font-family: 'Spline Sans Mono', monospace; font-size: 13px; font-weight: 500; }
.wl-carry { border-color: #f1c7bd; }
.wl-carry .wl-gh { background: #fdf1ee; }
.wl-carry .wl-gh h2 { color: var(--red); }
.wl-table { width: 100%; border-collapse: collapse; }
.wl-table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 9px 20px; background: #f8fafc; font-weight: 600; }
.wl-table td { padding: 10px 20px; border-top: 1px solid #eef1f5; vertical-align: middle; font-size: 14px; }
.wl-table td .sub { display: block; font-size: 12px; color: var(--muted); }
.wl-table tr.wl-done td { color: var(--muted); }
.wl-table td.muted { color: var(--muted); font-size: 13px; }
.link-cell { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; }
.link-cell:hover { color: var(--brand-bright); text-decoration: underline; }
@media (max-width: 700px) { .wl-table th:nth-child(2), .wl-table td:nth-child(2) { display: none; } .wl-table td, .wl-table th { padding: 9px 12px; } }
@media (max-width: 700px) { .wl-cards { grid-template-columns: 1fr 1fr !important; gap: 10px; } .wl-cards .card { padding: 14px; } .wl-cards .card .v { font-size: 24px; } .wl-bar { width: 44px; } }

/* Bills: cancelled rows, edit dialog, fee split */
.pill.cancelled { background: #eceff3; color: #6a778a; }
tr.bill-cancelled td { color: #9aa5b4; }
tr.bill-cancelled td.mono { text-decoration: line-through; }
tr.bill-cancelled td:last-child, tr.bill-cancelled td:nth-last-child(2) { text-decoration: none; }
.bill-edit-extra { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.bill-edit-extra .btn-danger:only-child { margin-left: auto; }
.bp-split { position: absolute; left: 0; top: 100%; margin-top: 3px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.f:has(.bp-split) { position: relative; }
#bp-amount { margin-bottom: 0; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll td .sub.why { white-space: normal; max-width: 170px; }
.f-grid:has(.bp-split) { margin-bottom: 20px; }

/* Return stage bar */
.stg-wrap { display: inline-flex; align-items: center; gap: 2px; position: relative; }
.stg { display: inline-flex; flex-direction: column; gap: 5px; min-width: 190px; padding: 5px 7px; border-radius: 8px; border: 0; background: none; font: inherit; text-align: left; color: inherit; }
button.stg { cursor: pointer; }
button.stg:hover { background: #eef3f9; }
button.stg:disabled { opacity: .6; cursor: progress; }
.stg-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; font-weight: 600; color: #14213d; white-space: nowrap; }
.stg-top em { font-style: normal; font-weight: 500; color: #6a778a; font-family: 'Spline Sans Mono', monospace; font-size: 11.5px; }
.stg-bar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; }
.stg-bar i { height: 7px; border-radius: 3px; background: #e3e9f0; }
.stg-bar i.on { background: #2f6db3; }
.stg-bar i.cur { background: #2f6db3; box-shadow: 0 0 0 2px #cfe0f5; }
.stg.wait .stg-bar i.on { background: #d9902a; }
.stg.wait .stg-bar i.cur { background: #d9902a; box-shadow: 0 0 0 2px #f7e2c2; }
.stg.wait .stg-top { color: #9a5d0e; }
.stg.done .stg-bar i { background: #1d7a4f; box-shadow: none; }
.stg.done .stg-top { color: #1d7a4f; }
.stg.ro { cursor: default; }
.stg-back { position: absolute; left: -20px; top: 50%; transform: translateY(-50%); width: 20px; height: 26px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s; padding: 0; }
.stg-wrap:hover .stg-back, .stg-back:focus { opacity: 1; }
.stg-back:hover { color: var(--ink); border-color: #b8c4d3; }
@media (hover: none) { .stg-back { opacity: 1; position: static; transform: none; } }
.stg-tip { position: absolute; background: #14213d; color: #fff; font-size: 12px; padding: 6px 10px; border-radius: 7px; white-space: nowrap; z-index: 60; box-shadow: 0 4px 14px rgba(0,0,0,.2); pointer-events: none; }
.stg-flash { animation: stgfl 1.2s ease; }
@keyframes stgfl { 0% { background: #dbe8f7; } 100% { background: transparent; } }
#f-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Income report drill-down */
.in-row { cursor: pointer; }
.in-row:hover td { background: #f3f7fc; }
.in-drill { color: var(--muted); font-weight: 600; margin-left: 4px; }
.in-row:hover .in-drill { color: var(--brand-bright); }
.modal.modal-wide { width: min(1000px, calc(100vw - 32px)); max-width: none; }
.dr-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.dr-cards > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #fbfcfe; }
.dr-cards small { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dr-cards b { display: block; white-space: nowrap; font-family: 'Spline Sans Mono', monospace; font-size: 17px; font-weight: 500; margin: 2px 0; }
.dr-cards b.red { color: var(--red); } .dr-cards b.green { color: var(--green); }
.dr-cards span { font-size: 12px; color: var(--muted); }
.dr-scroll { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.dr-scroll .wl-table th { position: sticky; top: 0; z-index: 1; }
.wl-table td.num, .wl-table th.num { text-align: right; white-space: nowrap; }
@media (max-width: 700px) { .dr-cards { grid-template-columns: 1fr 1fr; } }

.dr-scroll .wl-table td { white-space: nowrap; padding: 9px 14px; }
.dr-scroll .wl-table th { padding: 9px 14px; }
.dr-scroll .wl-table td:first-child { white-space: normal; min-width: 180px; }

.dr-sort { cursor: pointer; user-select: none; }
.dr-sort:hover { color: var(--ink); }
.dr-sort.on { color: var(--ink); }
.dr-sort span { font-size: 9px; }

a.link-cell { text-decoration: none; display: inline-block; }
.link-cell .ext { font-size: 11px; color: var(--muted); opacity: 0; transition: opacity .15s; }
.link-cell:hover .ext { opacity: 1; }

/* Client picker: type to search */
.cc { position: relative; }
.cc input { width: 100%; padding: 8px 28px 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.07); color: #fff; font: inherit; font-size: 14px; }
.cc input::placeholder { color: #8ea3b8; }
.cc input:focus { outline: none; border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.12); }
.cc-caret { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #9fb2c6; font-size: 12px; cursor: pointer; }
.cc-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 80; margin: 0; padding: 4px; list-style: none; max-height: 340px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(10,25,45,.25); }
.cc-list li { padding: 7px 10px; border-radius: 7px; font-size: 13.5px; color: var(--ink); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-list li b { background: #fff1c7; font-weight: 600; border-radius: 2px; }
.cc-list li.hi { background: #e8f0fa; }
.cc-list li.cur { font-weight: 600; }
.cc-list li.cur::before { content: '✓ '; color: var(--brand-bright); }
.cc-list li.none { color: var(--muted); cursor: default; }

/* VAT & Corporate Tax tracker */
.tx-card { text-align: left; font: inherit; cursor: pointer; border: 1px solid var(--line); }
.tx-card:hover { border-color: #b8c8dc; }
.tx-card.on { border-color: var(--brand-bright); box-shadow: 0 0 0 2px rgba(47,109,179,.18); }
.tx-card .v small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; font-family: 'Public Sans', sans-serif; }
.tx-when { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 6px; font-family: 'Public Sans', sans-serif; }
.tx-empty { padding: 18px 20px; color: var(--muted); font-size: 14px; }
.tx-sep { width: 1px; background: var(--line); margin: 2px 6px; align-self: stretch; }

/* Late payers: balanced columns, clickable rows */
.lp-table { width: 100%; table-layout: fixed; }
.lp-table col.c-client { width: 25%; } .lp-table col.c-team { width: 11%; } .lp-table col.c-contact { width: 19%; }
.lp-table col.c-n { width: 8%; } .lp-table col.c-due { width: 13%; } .lp-table col.c-amt { width: 11%; } .lp-table col.c-go { width: 44px; }
.lp-table td { vertical-align: middle; overflow: hidden; text-overflow: ellipsis; }
.lp-table td:first-child b, .lp-table td .sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-table td.num, .lp-table td.mono { white-space: nowrap; }
.lp-row { cursor: pointer; }
.lp-row:hover td, .lp-row:focus td { background: #f3f7fc; }
.lp-row:focus { outline: none; }
.lp-go { color: var(--muted); font-size: 18px; text-align: right; padding-right: 14px !important; }
.lp-row:hover .lp-go { color: var(--brand-bright); }
@media (max-width: 900px) { .lp-table { table-layout: auto; min-width: 760px; } }
/* Generate filings dialog */
.gen-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 12px; }
.gen-quick > span { font-size: 12.5px; color: var(--muted); margin-right: 2px; }

.lp-table td.lp-go { overflow: visible; text-overflow: clip; }
/* Returns table: keep filing / period / due readable instead of squeezed onto several lines */
#f-table td:nth-child(1) { min-width: 150px; }
#f-table td:nth-child(2), #f-table td:nth-child(3) { white-space: nowrap; }
#f-table td:nth-child(3) .sub { white-space: nowrap; }
#f-table td:nth-child(6) { max-width: 180px; }
#f-table .stg { min-width: 150px; }

/* Corporate Tax page */
.ct-table tr.ct-month td { background: #f3f6fa; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #3b4b61; padding: 8px 20px; }
.ct-table tr.ct-month td span { font-family: 'Spline Sans Mono', monospace; font-weight: 500; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.ct-table td.ct-due { white-space: nowrap; }
.ct-table td.mono { white-space: nowrap; }

/* ===== Tasks ===== */
.tk-card { text-align: left; font: inherit; cursor: pointer; border: 1px solid var(--line); }
.tk-card:hover { border-color: #b8c8dc; }
.tk-cards { grid-template-columns: repeat(5, 1fr) !important; }
.tk-row { cursor: pointer; }
.tk-row:hover td { background: #f3f7fc; }
.tk-row.tk-late td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.tk-title { display: block; font-weight: 600; }
.tk-table td { vertical-align: middle; }
.tk-when .sub.late { color: var(--red); font-weight: 600; } .tk-when .sub.soon { color: #9a5d0e; }
.tk-ass { width: 100%; max-width: 180px; font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink); cursor: pointer; }
.tk-ass:hover, .tk-ass:focus { border-color: var(--line); background: #fff; }
.tk-st { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tk-st.todo { background: #eef2f7; color: #43536a; }
.tk-st.in_progress { background: #e3eefb; color: #1f5b9e; }
.tk-st.waiting_client, .tk-st.waiting_gov { background: #fdf0d9; color: #94590c; }
.tk-st.done { background: #e2f3ea; color: #1d6b46; }
.tk-st.cancelled { background: #eceff3; color: #7a8698; text-decoration: line-through; }
.tk-prio { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tk-prio i { width: 9px; height: 9px; border-radius: 50%; background: #b9c3cf; }
.tk-prio.urgent { color: #b23a2a; } .tk-prio.urgent i { background: #d8432f; box-shadow: 0 0 0 3px #fbe1dc; }
.tk-prio.high { color: #a35a0b; } .tk-prio.high i { background: #e08a1e; }
.tk-prio.normal i { background: #4f86c6; } .tk-prio.low i { background: #c5ced9; }
/* detail */
.tk-detail { display: grid; grid-template-columns: 1fr 270px; gap: 22px; }
.tk-meta { color: var(--muted); font-size: 13px; margin: -4px 0 10px; display: flex; gap: 10px; align-items: center; }
.tk-filing { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.tk-desc { background: #f6f8fb; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; }
.tk-h { margin: 14px 0 8px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tk-thread { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.tk-msg { border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; background: #fff; max-width: 92%; }
.tk-msg.mine { align-self: flex-end; background: #eef4fc; border-color: #d6e4f5; }
.tk-msg.internal { background: #fff8e8; border-color: #f1dfb0; }
.tk-msg-h { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; margin-bottom: 3px; }
.tk-msg-h span { color: var(--muted); font-size: 11.5px; }
.tk-msg-h em { font-style: normal; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #94590c; background: #fdf0d9; padding: 1px 6px; border-radius: 4px; }
.tk-msg-b { font-size: 14px; line-height: 1.45; white-space: normal; word-wrap: break-word; }
.tk-compose { margin-top: 10px; }
.tk-compose textarea { width: 100%; font: inherit; font-size: 14px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; }
.tk-compose > div { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.tk-side { border-left: 1px solid var(--line); padding-left: 18px; }
.tk-side .f { margin-bottom: 10px; }
.tk-ext { margin: -4px 0 8px; }
.tk-del { color: var(--red); }
.tk-log { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; max-height: 210px; overflow-y: auto; }
.tk-log h4 { margin: 0 0 6px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tk-log div { font-size: 12.5px; color: #43536a; margin-bottom: 6px; line-height: 1.4; }
.tk-log div span { display: block; color: var(--muted); font-size: 11px; }
.tk-ro { display: grid; gap: 12px; }
.tk-ro small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 3px; }
@media (max-width: 760px) { .tk-detail { grid-template-columns: 1fr; } .tk-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; } .tk-cards { grid-template-columns: 1fr 1fr !important; } }
/* performance bar */
.pf-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: #eef1f5; width: 200px; }
.pf-bar i { display: block; height: 100%; } .pf-bar i.e { background: #1d7a4f; } .pf-bar i.o { background: #6cbf94; } .pf-bar i.l { background: #d8432f; }

/* Client details page */
.ci-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.ci-grid .panel h2 { margin: 0 0 12px; font-size: 16px; }
.ci-side { display: grid; gap: 18px; }
.ci-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 6px; }
.ci-actions .hint { color: #9a5d0e; }
.ci-facts { display: grid; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.ci-facts small { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ci-tag { display: inline-block; background: #eef3f9; border-radius: 6px; padding: 2px 8px; margin: 0 4px 4px 0; font-size: 12.5px; }
.ci-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.ci-stats div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #fbfcfe; }
.ci-stats b { display: block; font-family: 'Spline Sans Mono', monospace; font-size: 20px; font-weight: 500; }
.ci-stats span { font-size: 12px; color: var(--muted); }
.ci-stats .warn b { color: #9a5d0e; } .ci-stats .bad b { color: var(--red); }
.ci-by td, .ci-by th { padding: 7px 10px !important; }
.ci-am { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-bright); background: #e8f0fa; padding: 1px 6px; border-radius: 4px; margin-left: 4px; }
@media (max-width: 1000px) { .ci-grid { grid-template-columns: 1fr; } }
.cf-handover[hidden] { display: none !important; }
