/* ============================================================
   Org Management Portal — stylesheet
   Modelled on Thebu Books. Supports light + dark mode.
   ============================================================ */

:root {
  --bg:       #f1f2f4;
  --surface:  #ffffff;
  --surface2: #f8f9fa;
  --ink:      #16181d;
  --mut:      #6b7280;
  --line:     #e3e5e8;
  --acc:      #1e3a5f;
  --acc2:     #2d5f9e;
  --acc-soft: #e8eef6;
  --acc-ink:  #ffffff;
  --pos:      #0e9f6e;
  --neg:      #e0483a;
  --amb:      #b7791f;
  --pos-s:    #e4f6ee;
  --neg-s:    #fdeceb;
  --amb-s:    #fdf3dd;
  --neu-s:    #eff0f2;
  --blue:     #1d4ed8;
  --blue-s:   #e7eefc;
  --side:     #111827;
  --side-ink: #9ca3af;
  --side-act: rgba(255,255,255,.08);
  --sh:       0 1px 2px rgba(17,19,24,.05), 0 10px 30px -14px rgba(17,19,24,.18);
  --r:        18px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1013; --surface: #1a1c21; --surface2: #14161a; --ink: #f1f2f4;
    --mut: #9ca3af; --line: #2a2d34; --acc: #93b4d9; --acc2: #6b96c7;
    --acc-soft: #1c2535; --acc-ink: #0f1013;
    --pos: #4fd1a1; --neg: #ff8a7e; --amb: #f1c36b;
    --pos-s: #0e2920; --neg-s: #2c1715; --amb-s: #2a2210;
    --neu-s: #22252b; --blue: #93b4ff; --blue-s: #15213f;
    --side: #09090b;
    --sh: 0 1px 2px rgba(0,0,0,.5), 0 10px 30px -14px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1013; --surface: #1a1c21; --surface2: #14161a; --ink: #f1f2f4;
  --mut: #9ca3af; --line: #2a2d34; --acc: #93b4d9; --acc2: #6b96c7;
  --acc-soft: #1c2535; --acc-ink: #0f1013;
  --pos: #4fd1a1; --neg: #ff8a7e; --amb: #f1c36b;
  --pos-s: #0e2920; --neg-s: #2c1715; --amb-s: #2a2210;
  --neu-s: #22252b; --blue: #93b4ff; --blue-s: #15213f;
  --side: #09090b;
  --sh: 0 1px 2px rgba(0,0,0,.5), 0 10px 30px -14px rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14.5px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(55% 38% at 85% -8%, color-mix(in srgb, var(--acc) 12%, transparent), transparent),
    radial-gradient(38% 28% at 0% 0%, color-mix(in srgb, var(--acc2) 9%, transparent), transparent);
}

h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: var(--ink); }
button { cursor: pointer; }
a { color: var(--acc); }

/* ============================================================
   LAYOUT
   ============================================================ */

.app {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 max(14px, env(safe-area-inset-right)) 80px max(14px, env(safe-area-inset-left));
}

/* ============================================================
   TOP NAV
   ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding: 10px 0;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  scrollbar-width: none;
  align-items: center;
}
.nav::-webkit-scrollbar { display: none; }

.nav-brand {
  flex: none;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--ink);
  padding: 6px 14px;
  white-space: nowrap;
}

.nv {
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--mut);
  padding: 7px 12px;
  border-radius: 11px;
  font-weight: 600;
  font-size: 13px;
}
.nv[aria-current="page"] {
  background: var(--ink);
  color: var(--bg);
}
.nv svg { flex: none; }

.nav-spacer { flex: 1; }

.nav-actions {
  display: flex;
  gap: 6px;
  flex: none;
  align-items: center;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */

.head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin: 10px 0 20px;
}
.head h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.035em;
}
.head .sub {
  color: var(--mut);
  font-size: 13px;
  margin-top: 3px;
}
.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 11px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: var(--sh);
  white-space: nowrap;
}
.btn.pri {
  background: linear-gradient(135deg, var(--acc), var(--acc2));
  color: var(--acc-ink);
  border-color: transparent;
  box-shadow: 0 8px 22px -8px rgba(30,58,95,.5);
}
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 9px; box-shadow: none; }
.btn.icon { padding: 8px; }
.btn.danger { color: var(--neg); background: var(--neg-s); border-color: var(--neg); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* ============================================================
   SELECT / INPUT
   ============================================================ */

.sel, select.in {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239ca3af' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 8px 32px 8px 13px;
  font-weight: 500;
  font-size: 13px;
  min-width: 120px;
  box-shadow: var(--sh);
}
select.in {
  background-color: var(--surface2);
  font-size: 14.5px;
  font-weight: 400;
  box-shadow: none;
  width: 100%;
  min-width: 0;
  padding: 10px 32px 10px 12px;
}
.in {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  min-width: 0;
}
textarea.in { resize: vertical; }
.in:focus-visible, .sel:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
input.in[type=date]{min-width:0;max-width:100%;box-sizing:border-box}

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--sh);
  min-width: 0;
}
.card h2 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.card .sub { color: var(--mut); font-size: 12.5px; margin-top: 2px; }

.sub-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px;
  margin-bottom: 10px;
  background: var(--surface2);
}

/* ============================================================
   GRID HELPERS
   ============================================================ */

.stack   { display: grid; gap: 14px; }
.cols    { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); }
.kpis    { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }

/* ============================================================
   HERO KPI CARD
   ============================================================ */

.hero {
  grid-column: 1 / -1;
  position: relative;
  overflow: hidden;
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, #1e3a5f, #2d5f9e 65%, #3b82f6);
}
.hero::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.hero .l  { font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; opacity: .8; font-weight: 600; }
.hero .v  { font-size: clamp(28px, 5.5vw, 44px); font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1.1; margin: 4px 0; }
.hero .p  { opacity: .75; font-size: 12.5px; }
.hero svg.spark { position: absolute; right: 16px; bottom: 14px; width: min(44%, 250px); height: 56px; opacity: .85; }

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

.kpi { display: flex; flex-direction: column; gap: 8px; }
.kpi .ic  { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; }
.kpi .l   { color: var(--mut); font-size: 12.5px; font-weight: 500; }
.kpi .v   { font-size: 22px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mini     { padding: 14px; border-radius: 13px; background: var(--surface2); border: 1px solid var(--line); }
.mini .l  { font-size: 12px; color: var(--mut); margin-bottom: 4px; }
.mini .v  { font-size: 20px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* ============================================================
   COLOUR HELPERS
   ============================================================ */

.pos { color: var(--pos); }
.neg { color: var(--neg); }
.amb { color: var(--amb); }
.bg-pos { background: var(--pos-s); color: var(--pos); }
.bg-neg { background: var(--neg-s); color: var(--neg); }
.bg-amb { background: var(--amb-s); color: var(--amb); }
.bg-acc { background: var(--acc-soft); color: var(--acc); }
.bg-neu { background: var(--neu-s); color: var(--mut); }
.t-pos  { border-top: 3px solid var(--pos); }
.t-neg  { border-top: 3px solid var(--neg); }
.t-amb  { border-top: 3px solid var(--amb); }
.t-blue { border-top: 3px solid var(--blue); }

/* ============================================================
   CHIPS / BADGES
   ============================================================ */

.chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  margin: 3px 3px 0 0;
}

/* ============================================================
   SEGMENT BUTTONS
   ============================================================ */

.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 99px;
  padding: 5px 13px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mut);
}
.seg button[aria-pressed="true"] {
  background: var(--acc-soft);
  color: var(--acc);
  border-color: var(--acc);
}

/* ============================================================
   ROWS (list items)
   ============================================================ */

.row {
  display: grid;
  grid-template-columns: 40px minmax(0,1fr) auto;
  gap: 2px 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row .av {
  width: 40px; height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}
.row b    { font-weight: 600; overflow-wrap: anywhere; }
.row small { display: block; color: var(--mut); font-size: 12.5px; overflow-wrap: anywhere; }
.row .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row .act { grid-column: 2 / -1; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.row .clk { cursor: pointer; }
.row .clk:hover b { text-decoration: underline; }

/* ============================================================
   PROGRESS BARS
   ============================================================ */

.bar { height: 7px; border-radius: 99px; background: var(--neu-s); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--acc), var(--acc2)); }
.bar.over > i { background: var(--neg); }

/* ============================================================
   CHECKLIST
   ============================================================ */

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.check:last-child { border-bottom: 0; }
.check input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--acc); flex: none; }
.check label  { flex: 1; font-size: 14px; }

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

.form {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}
.fld { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--mut); min-width: 0; }
.fld.full { grid-column: 1 / -1; }
.calc { background: var(--acc-soft); border-radius: 13px; padding: 14px 16px; line-height: 1.75; }

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

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 6px; border-bottom: 1px solid var(--line); font-size: 13.5px; text-align: left; }
th { font-size: 11px; color: var(--mut); text-transform: uppercase; letter-spacing: .06em; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }

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

.note     { font-size: 12.5px; color: var(--mut); }
.empty    { padding: 26px; text-align: center; color: var(--mut); border: 1.5px dashed var(--line); border-radius: 14px; font-size: 13.5px; }
.banner   { background: var(--amb-s); color: var(--amb); border-radius: 13px; padding: 11px 14px; font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.banner.info   { background: var(--blue-s); color: var(--blue); }
.banner.danger { background: var(--neg-s); color: var(--neg); }
.lnk { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--acc); text-decoration: underline; }

/* ============================================================
   DRAWER (slide-in panel)
   ============================================================ */

.scrim  { position: fixed; inset: 0; background: rgba(6,8,24,.52); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 50; animation: fade .18s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); z-index: 51; overflow-y: auto; padding: 22px max(18px, env(safe-area-inset-right)) 36px 20px; box-shadow: -20px 0 60px -20px rgba(0,0,0,.4); animation: slide .22s ease-out; }

/* ============================================================
   MODAL (centred overlay)
   ============================================================ */

.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(680px, 94vw); max-height: 90vh; overflow: auto; background: var(--surface); border-radius: 20px; padding: 20px; z-index: 51; box-shadow: 0 20px 60px -10px rgba(0,0,0,.35); }
.modal img { max-width: 100%; border-radius: 12px; display: block; }
.modal-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ============================================================
   TOAST
   ============================================================ */

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-size: 13px; font-weight: 600; z-index: 60; box-shadow: var(--sh); pointer-events: none; }

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

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 36px; width: 100%; max-width: 420px; box-shadow: var(--sh); }
.auth-logo { font-size: 22px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 8px; }
.auth-sub  { color: var(--mut); font-size: 13px; margin-bottom: 28px; }
.auth-err  { background: var(--neg-s); color: var(--neg); border-radius: 10px; padding: 10px 14px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }

/* ============================================================
   SUBSCRIPTION LOCK SCREEN
   ============================================================ */

.lock-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lock-card { background: var(--surface); border: 1px solid var(--neg); border-radius: 22px; padding: 40px; max-width: 480px; text-align: center; box-shadow: var(--sh); }
.lock-icon { font-size: 48px; margin-bottom: 16px; }
.lock-card h2 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.lock-card p  { color: var(--mut); font-size: 14px; margin-bottom: 20px; }

/* ============================================================
   SUPER ADMIN PANEL
   ============================================================ */

.admin-panel { border: 2px solid var(--amb); border-radius: var(--r); padding: 20px; background: var(--amb-s); }
.admin-panel h3 { font-size: 14px; font-weight: 700; color: var(--amb); margin-bottom: 14px; }

/* ============================================================
   DOCUMENT SHEET  (invoice / quote print layout)
   ============================================================ */

.sheet {
  position: relative;
  background: #fff;
  color: #1f2227;
  font-size: 12.5px;
  line-height: 1.5;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.sheet .s-wm  { position: absolute; inset: 0; width: 100%; height: 100%; color: #111827; opacity: .045; pointer-events: none; }
.sheet .s-in  { position: relative; z-index: 1; padding: 34px 36px 24px; }
.sheet .s-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.sheet .s-from { min-width: 0; color: #4b5563; }
.sheet .s-co  { font-size: 15px; font-weight: 800; color: #111827; letter-spacing: -.01em; margin-top: 8px; }
.sheet .s-to  { text-align: right; min-width: 0; color: #4b5563; }
.sheet .s-kind { font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: #111827; line-height: 1.05; }
.sheet .s-subj { margin: 6px 0 0 auto; display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #6b7280; padding-bottom: 4px; border-bottom: 2px solid #9ca3af; }
.sheet .s-bill { margin-top: 12px; }
.sheet .s-bill b, .sheet .s-ref b { color: #111827; }
.sheet .s-ref  { margin-top: 10px; }
.sheet .pre    { white-space: pre-line; }
.sheet .muted  { color: #6b7280; }
.sheet .s-rule { height: 3px; background: #111827; margin: 22px 0 14px; border-radius: 2px; }
.sheet .s-tbl  { border-collapse: separate; border-spacing: 0; }
.sheet .s-tbl th { background: #1f2227; color: #fff; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding: 10px 12px; border: 0; }
.sheet .s-tbl th:first-child { border-radius: 6px 0 0 6px; }
.sheet .s-tbl th:last-child  { border-radius: 0 6px 6px 0; }
.sheet .s-tbl td { padding: 10px 12px; border: 0; color: #1f2227; }
.sheet .s-tbl tbody tr:nth-child(odd) td { background: #f4f5f6; }
.sheet .s-tbl tbody tr:last-child td { border-bottom: 2px solid #1f2227; }
.sheet .s-sub  { display: flex; justify-content: flex-end; gap: 36px; padding: 10px 12px 0; color: #4b5563; font-variant-numeric: tabular-nums; }
.sheet .s-totwrap { display: flex; justify-content: flex-end; margin-top: 10px; }
.sheet .s-total { display: flex; justify-content: space-between; align-items: baseline; gap: 26px; min-width: 240px; padding: 10px 14px; border-radius: 7px; background: #1f2227; color: #fff; font-weight: 800; letter-spacing: .02em; }
.sheet .s-total b { font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sheet .s-pay  { margin-top: 20px; padding: 12px 14px; border: 1px solid #e5e7eb; border-radius: 8px; background: rgba(246,247,248,.85); }
.sheet .s-ph   { font-size: 13px; font-weight: 800; letter-spacing: .08em; color: #111827; margin-bottom: 8px; }
.sheet .s-grid { display: grid; grid-template-columns: 1fr; gap: 3px; font-size: 11.5px; color: #4b5563; }
.sheet .s-grid b { color: #111827; }
.sheet .s-note { margin-top: 14px; font-size: 12px; }
.sheet .s-foot { margin-top: 26px; padding-top: 10px; border-top: 1px solid #e5e7eb; color: #9ca3af; font-size: 11px; text-align: center; line-height: 1.6; }
.sheet .s-thx  { color: #4b5563; font-weight: 700; font-size: 12px; }

/* ============================================================
   PAYSLIP SHEET
   ============================================================ */

.payslip {
  background: #fff;
  color: #1f2227;
  font-size: 12.5px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 32px 36px 28px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.payslip .ps-head   { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.payslip .ps-title  { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: #111827; }
.payslip .ps-co     { font-size: 13px; font-weight: 700; color: #111827; margin-top: 4px; }
.payslip .ps-period { font-size: 12px; color: #6b7280; }
.payslip .ps-rule   { height: 3px; background: #1e3a5f; border-radius: 2px; margin: 12px 0; }
.payslip .ps-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; margin: 14px 0; }
.payslip .ps-label  { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: .07em; }
.payslip .ps-val    { font-size: 13.5px; font-weight: 600; color: #111827; }
.payslip .ps-tbl    { width: 100%; border-collapse: collapse; margin: 14px 0; }
.payslip .ps-tbl th { background: #1e3a5f; color: #fff; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding: 9px 12px; text-align: left; }
.payslip .ps-tbl th:last-child { text-align: right; }
.payslip .ps-tbl td { padding: 9px 12px; border-bottom: 1px solid #e5e7eb; font-size: 13px; }
.payslip .ps-tbl td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.payslip .ps-tbl .ps-net td { font-weight: 800; font-size: 14px; background: #f4f5f6; }
.payslip .ps-bank   { margin-top: 18px; padding: 12px 14px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 12px; color: #4b5563; }
.payslip .ps-bank b { color: #111827; }
.payslip .ps-foot   { margin-top: 20px; padding-top: 10px; border-top: 1px solid #e5e7eb; font-size: 11px; color: #9ca3af; text-align: center; }

/* ============================================================
   LEGEND
   ============================================================ */

.legend { display: grid; gap: 8px; font-size: 13px; }
.legend div { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.legend span.d { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* ============================================================
   SPARK (mini inline chart)
   ============================================================ */

svg.spark { display: block; overflow: visible; }

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes slide { from { transform: translateX(28px); opacity: 0; } }
@keyframes fade  { from { opacity: 0; } }
@keyframes pop   { from { transform: translate(-50%,-50%) scale(.92); opacity: 0; } }

/* ============================================================
   PRINT
   ============================================================ */

@media print {
  body * { visibility: hidden; }
  .sheet, .sheet *, .payslip, .payslip * { visibility: visible !important; }
  .sheet, .payslip { position: fixed !important; inset: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; padding: 20px !important; }
  .modal, .scrim, .nav, .btn, .modal-bar { display: none !important; }
}

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

@media (max-width: 600px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .hero .v { font-size: 28px; }
  .sheet .s-in { padding: 20px 18px 16px; }
  .payslip { padding: 20px 18px; }
}

/* ===== Thebu shell + overview (ported from the Thebu app) ===== */
.ab-hero{background:linear-gradient(135deg,#1f2227,#111827);color:#fff;border:0}
.ab-hero svg{display:block;margin-bottom:16px}
.ab-hero h2{font-size:clamp(20px,3.4vw,28px);font-weight:800;letter-spacing:-.03em;line-height:1.2;max-width:26ch;color:#fff}
.ab-hero p{margin-top:12px;color:#c4c9d4;max-width:70ch}
.ab-h{font-size:15px;font-weight:700;margin:0 0 10px}
.ab-grid{display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr))}
.ab-list{list-style:none;margin:12px 0 0;padding:0;display:grid;gap:10px}
.ab-list li{padding-left:14px;border-left:3px solid var(--line)}
.ab-tree{margin-top:16px;display:flex;flex-direction:column;align-items:stretch}
.ab-parent{align-self:center;text-align:center;padding:14px 22px;border-radius:14px;background:var(--ink);color:var(--bg);display:flex;flex-direction:column;gap:3px;max-width:100%}
.ab-parent b{font-size:15px;letter-spacing:.02em;overflow-wrap:anywhere}
.ab-parent span{font-size:12px;opacity:.75}
.ab-stem{width:2px;height:22px;background:var(--line);align-self:center}
.ab-kids{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr));position:relative;padding-top:14px;border-top:2px solid var(--line)}
.ab-kids>div{padding:14px;border:1px solid var(--line);border-radius:14px;background:var(--surface2);display:flex;flex-direction:column;gap:4px}
.ab-kids span{font-size:12.5px;color:var(--mut)}
.bg-blue{background:var(--blue-s);color:var(--blue)}
.ab-ic{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;margin-bottom:10px}
.ab-kids>div:nth-child(1){border-top:3px solid var(--blue)}.ab-kids>div:nth-child(2){border-top:3px solid var(--pos)}.ab-kids>div:nth-child(3){border-top:3px solid var(--amb)}.ab-kids>div:nth-child(4){border-top:3px solid var(--neg)}
.ab-hero{background:radial-gradient(70% 100% at 100% 0%,rgba(59,130,246,.30),transparent 62%),linear-gradient(135deg,#1f2227,#111827);display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:28px;align-items:center;padding:28px}
.ab-hero h2{max-width:none;font-size:clamp(24px,3.6vw,36px);line-height:1.12}
.ab-hero h2 span{background:linear-gradient(90deg,#93c5fd,#60a5fa);-webkit-background-clip:text;background-clip:text;color:transparent}
.ab-hero p{font-size:14.5px;line-height:1.65;color:#c4c9d4;max-width:60ch}
.ab-hero p b{color:#fff}
.ab-hr{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.ab-t{display:flex;flex-direction:column;gap:3px;padding:14px;border-radius:16px;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.1)}
.ab-t b{color:#fff;font-size:14px}
.ab-t>span:last-child{font-size:12px;color:#aeb6c6;line-height:1.4}
@media (max-width:820px){.ab-hero{grid-template-columns:1fr;padding:22px}}

/* sidebar shell */
.shell{display:block}
.side{position:sticky;top:0;z-index:30;display:flex;gap:4px;align-items:center;overflow-x:auto;padding:10px 14px;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(14px);scrollbar-width:none}
.side::-webkit-scrollbar{display:none}
.side-brand{flex:none;display:flex;align-items:center;gap:10px;padding:2px 8px 2px 0}
.side-brand img{height:34px;width:auto;display:block}
.side-brand .sb-ico{font-size:22px}
.side-brand .sb-name{font-weight:800;letter-spacing:-.02em;white-space:nowrap}
.side-nav{display:contents}
.side-foot{display:contents}
.side .nv{position:relative}
.side .nv[disabled]{opacity:.45;cursor:not-allowed}
.nv-lock{margin-left:auto;font-style:normal;font-size:11px}
.main{min-width:0;padding:0 max(14px,env(safe-area-inset-right)) 60px max(14px,env(safe-area-inset-left))}
.main .app{max-width:1360px;margin:0 auto;padding:0}
.topbar{display:flex;align-items:center;gap:14px;margin:8px 0 16px;padding:16px 20px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--sh)}
.tb-ico{width:46px;height:46px;border-radius:14px;background:var(--ink);color:var(--bg);display:grid;place-items:center;flex:none}
.tb-txt{min-width:0;flex:1}
.tb-txt h1{font-size:24px;font-weight:800;letter-spacing:-.03em;line-height:1.15}
.tb-txt p{color:var(--mut);font-size:13px;margin-top:1px}
.tb-btn{flex:none;width:40px;height:40px;border-radius:12px;border:1px solid var(--line);background:var(--surface2);display:grid;place-items:center;color:var(--ink)}
/* the page's own big title is replaced by the header card */
.main .app>.head h1{display:none}
.main .app>.head{margin-top:0}
@media (min-width:940px){
  .shell{display:grid;grid-template-columns:252px minmax(0,1fr);gap:0 24px;align-items:start;padding-left:16px}
  .side{position:sticky;top:16px;margin-top:16px;height:calc(100vh - 32px);flex-direction:column;align-items:stretch;overflow-y:auto;padding:18px 12px;border-radius:24px;background:var(--side);gap:3px;box-shadow:var(--sh);backdrop-filter:none}
  .side-brand{padding:4px 8px 18px}
  .side-brand img{height:auto;width:100%;max-width:190px}
  .side-brand .sb-name{color:#fff;font-size:16px}
  .side-nav{display:flex;flex-direction:column;gap:3px;flex:1}
  .side-foot{display:block;padding-top:8px;border-top:1px solid rgba(255,255,255,.08)}
  .side .nv{width:100%;color:var(--side-ink);padding:11px 12px;border-radius:13px;text-align:left}
  .side .nv:hover:not([disabled]){background:var(--side-act);color:#fff}
  .side .nv[aria-current="page"]{background:var(--side-act);color:#fff;box-shadow:inset 3px 0 0 var(--acc2)}
  .topbar{margin-top:16px}
}
@media (max-width:939px){.topbar{padding:12px 14px}.tb-txt h1{font-size:20px}.side .nv span{white-space:nowrap}.side-foot .nv{white-space:nowrap}}

/* company logos */
.logo-tile{width:110px;height:72px;border-radius:14px;background:#fff;border:1px solid var(--line);display:grid;place-items:center;overflow:hidden;flex:none;padding:8px}
.logo-tile img{max-width:100%;max-height:56px;width:auto;height:auto;object-fit:contain;display:block}
.logo-tile.big img{max-height:72px}
.logo-tile.big{width:132px;height:88px}
.co-hero{display:flex;align-items:center;gap:18px;margin-bottom:14px;padding:18px 20px}
.sb-logo{width:100%;max-width:190px;height:72px;border-radius:14px;background:#fff;display:flex;align-items:center;justify-content:center;padding:8px;overflow:hidden}
.sb-logo img{max-width:100%;max-height:56px;width:auto;height:auto;object-fit:contain;display:block}
@media (min-width:940px){.side-brand:has(.sb-logo){flex-direction:column;align-items:flex-start;gap:10px}}
@media (max-width:939px){.sb-logo{width:auto;height:34px;padding:3px 8px;max-width:none}}

/* sidebar: keep each label on one line next to the Upgrade pill */
.side .nv span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
a.btn{text-decoration:none}

/* logo tiles hug the logo (no empty white bands around square or tall images) */
.sb-logo{width:fit-content;max-width:100%;height:auto;padding:6px}
.sb-logo img{max-width:178px;max-height:84px}
.logo-tile{width:auto;height:auto;min-width:72px;min-height:72px;padding:6px}
.logo-tile img{max-width:220px;max-height:84px}
.logo-tile.big{width:auto;height:auto;min-width:96px;min-height:88px}
.logo-tile.big img{max-width:240px;max-height:100px}
@media (max-width:939px){.sb-logo{height:auto;padding:3px 6px}.sb-logo img{max-height:28px;max-width:140px}}

/* key/value panel (support details, sign-in details) and error banner */
.dl-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:16px 20px;margin-top:18px;padding:16px;background:var(--surface2);border:1px solid var(--line);border-radius:16px}
.dl-grid .k{font-size:10.5px;letter-spacing:.07em;text-transform:uppercase;color:var(--mut);font-weight:600;margin-bottom:2px}
.dl-grid .v{font-weight:600;overflow-wrap:anywhere}
.banner.bad{background:var(--neg-s);color:var(--neg)}
.form.wide{grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr))}

/* ===== public site: landing, pricing, sign-up, privacy ===== */
.pub{min-height:100vh;display:flex;flex-direction:column}
.pub-in{max-width:1120px;margin:0 auto;padding:0 20px;width:100%}
.pub-head{position:sticky;top:0;z-index:40;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(14px);border-bottom:1px solid var(--line)}
.pub-head .pub-in{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:12px;padding-bottom:12px}
.pub-brand{display:flex;align-items:center;gap:10px;color:var(--ink);text-decoration:none;font-size:17px;letter-spacing:-.02em}
.pub-nav{display:flex;align-items:center;gap:6px}
.pub-nav a{color:var(--mut);text-decoration:none;font-weight:600;font-size:14px;padding:8px 12px;border-radius:10px}
.pub-nav a:hover,.pub-nav a[aria-current="page"]{color:var(--ink);background:var(--neu-s)}
.pub-nav a.btn{color:var(--acc-ink)}
.pub-main{flex:1}
.pub-hero{padding:64px 0 48px;text-align:center;background:radial-gradient(60% 80% at 50% -10%,color-mix(in srgb,var(--blue) 22%,transparent),transparent)}
.pub-hero.small{padding:44px 0 8px}
.pub-hero h1{font-size:clamp(30px,5.4vw,52px);font-weight:800;letter-spacing:-.04em;line-height:1.08;max-width:18ch;margin:14px auto}
.pub-hero.small h1{max-width:none}
.pub-hero p{font-size:clamp(15px,2vw,18px);color:var(--mut);max-width:60ch;margin:0 auto}
.pub-pill{display:inline-block;font-size:12.5px;font-weight:700;padding:5px 12px;border-radius:99px;background:var(--blue-s);color:var(--blue)}
.pub-cta{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin-top:24px}
.pub-cta .btn.lg,.btn.lg{padding:13px 22px;font-size:15px;border-radius:14px}
.pub-small{font-size:12.5px;color:var(--mut);margin-top:12px}
.pub-sec{padding:48px 0}
.pub-sec.alt{background:var(--surface2);border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.pub-sec h2{font-size:clamp(22px,3.4vw,32px);font-weight:800;letter-spacing:-.03em;text-align:center;margin-bottom:8px}
.pub-sub{text-align:center;color:var(--mut);margin-bottom:24px}
.pub-grid{display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));margin-top:24px}
.pub-feat{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:20px;box-shadow:var(--sh)}
.pub-feat span{font-size:28px;display:block;margin-bottom:8px}
.pub-feat h3{font-size:16px;font-weight:700;margin-bottom:4px}
.pub-feat p{color:var(--mut);font-size:14px}
.pub-steps{display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));margin-top:24px}
.pub-steps>div{padding:6px 4px}
.pub-steps b{display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:var(--ink);color:var(--bg);margin-bottom:10px}
.pub-steps h3{font-size:16px;margin-bottom:4px}
.pub-steps p{color:var(--mut);font-size:14px}
.pub-plans{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr));align-items:stretch;margin-top:8px}
.pub-plan{position:relative;display:flex;flex-direction:column;gap:10px;background:var(--surface);border:1px solid var(--line);border-radius:22px;padding:26px 22px;box-shadow:var(--sh)}
.pub-plan.featured{border:2px solid var(--blue);background:linear-gradient(180deg,var(--blue-s),var(--surface) 55%)}
.pub-badge{position:absolute;top:-12px;left:22px;font-size:11.5px;font-weight:700;padding:4px 10px;border-radius:99px;background:var(--blue);color:#fff}
.pub-plan h3{font-size:18px;font-weight:800}
.pub-price{display:flex;align-items:baseline;gap:8px}
.pub-price b{font-size:38px;font-weight:800;letter-spacing:-.04em}
.pub-price span{color:var(--mut);font-size:14px}
.pub-blurb{color:var(--mut);font-size:14px}
.pub-plan ul{list-style:none;margin:6px 0 10px;padding:0;display:grid;gap:7px;flex:1;font-size:14px}
.pub-plan li{color:var(--ink)}
.pub-plan .btn{width:100%;justify-content:center}
.pub-ask{text-align:center;font-size:13px}
.pub-compare{overflow-x:auto;margin-top:14px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:6px 14px}
.pub-compare td,.pub-compare th{white-space:nowrap}
.pub-faq{max-width:720px}
.pub-faq details{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:14px 16px;margin-top:10px}
.pub-faq summary{cursor:pointer;font-weight:700}
.pub-faq p{margin-top:8px;color:var(--mut);font-size:14px}
.pub-form{max-width:520px;margin:0 auto;padding:28px}
.pub-form h1{font-size:24px;font-weight:800;letter-spacing:-.03em}
.pub-doc{max-width:720px}
.pub-doc h1{font-size:30px;font-weight:800;letter-spacing:-.03em}
.pub-doc h2{font-size:18px;text-align:left;margin:22px 0 6px}
.pub-doc p{color:var(--mut);margin-bottom:8px}
.pub-foot{border-top:1px solid var(--line);padding:22px 0;font-size:13px;color:var(--mut)}
.pub-foot .pub-in{display:flex;gap:10px 24px;flex-wrap:wrap;justify-content:space-between}
.pub-foot a{color:var(--mut)}
.pub .auth-wrap{min-height:auto;padding:36px 16px}
@media (max-width:560px){.pub-nav a:not(.btn){display:none}.pub-hero{padding:44px 0 32px}}
.pub-plan ul{align-content:start}

.pub-mark{width:34px;height:34px;border-radius:10px;background:linear-gradient(135deg,#1e3a5f,#2d5f9e);color:#fff;display:grid;place-items:center;flex:none}
.pub-feat-btn{margin-top:12px}
.modal.wide-modal{width:min(820px,94vw)}
.pub-plans.picker{grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));margin-top:6px}
.modal .pub-plan{box-shadow:none}

/* help page */
.help-toc{display:flex;flex-wrap:wrap;gap:6px}
.help-toc a{text-decoration:none}
.help-sec{margin-bottom:14px;scroll-margin-top:16px}
.help-sec h2{margin-bottom:8px}
.help-body p{margin:8px 0}
.help-body ol,.help-body ul{margin:8px 0;padding-left:22px;display:grid;gap:6px}
.help-body code{font-family:ui-monospace,Menlo,monospace;font-size:12.5px;background:var(--neu-s);padding:1px 6px;border-radius:6px}
.help-body .note{margin-top:10px}
.help-sec.important{border:2px solid var(--amb);background:linear-gradient(180deg,var(--amb-s),var(--surface) 70%)}
.help-flag{display:inline-block;vertical-align:middle;margin-left:8px;font-size:11px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;padding:3px 9px;border-radius:99px;background:var(--amb);color:#1a1200}

/* ===== phone navigation: hamburger menu (app + public pages) ===== */
.hb,.pub-hb{display:none;width:44px;height:44px;border-radius:12px;border:1px solid var(--line);background:var(--surface);color:var(--ink);align-items:center;justify-content:center;flex:none;padding:0}
.side-scrim{display:none}
.only-mobile{display:none}
@media (max-width:939px){
  .side{overflow:visible;flex-wrap:nowrap;justify-content:space-between;padding:8px 14px}
  .hb{display:inline-flex;margin-left:auto}
  .side-brand{min-width:0}
  .side-brand img{max-width:60vw}
  .side-nav,.side-foot{display:none}
  .side.open{backdrop-filter:none;-webkit-backdrop-filter:none} /* a blur on the bar would trap the full-screen backdrop inside the bar, so taps outside the menu would miss it */
  .side.open .hb:not(.side-theme){position:relative;z-index:3} /* keep the close (X) above the dimmed backdrop; the theme toggle stays dimmed */
  .side.open .side-theme{display:none} /* hide the greyed-out theme toggle while the menu is open */
  .only-mobile{display:flex}
  .side-scrim{display:block;position:fixed;inset:0;background:rgba(6,8,24,.55);backdrop-filter:blur(2px);z-index:1}
  .side.open .side-nav{display:flex;flex-direction:column;gap:2px;position:fixed;top:64px;left:10px;right:10px;z-index:2;background:var(--side);border:1px solid rgba(255,255,255,.08);border-radius:18px;padding:8px;max-height:calc(100vh - 84px);max-height:calc(100dvh - 84px);overflow-y:auto;box-shadow:0 24px 60px -20px rgba(0,0,0,.6)}
  .side.open .side-nav .nv{width:100%;justify-content:flex-start;padding:9px 14px;font-size:15px;color:#e5e7eb;border-radius:12px}
  .side.open .side-nav .nv[aria-current="page"]{background:rgba(255,255,255,.1);color:#fff;box-shadow:inset 3px 0 0 var(--acc2)}
  .side.open .side-nav .nv:hover{background:rgba(255,255,255,.08)}
  .side.open .side-nav .nv.locked,.side.open .side-nav .nv[disabled]{opacity:.5}
  .side.open .side-nav .nv.only-mobile{margin-top:6px;border-top:1px solid rgba(255,255,255,.08);border-radius:0 0 12px 12px}
}
@media (max-width:700px){
  .pub-hb{display:inline-flex}
  .pub-head .pub-in{position:relative}
  .pub-nav{display:none}
  .pub-head.open .pub-nav{display:flex;flex-direction:column;align-items:stretch;gap:4px;position:absolute;top:100%;left:12px;right:12px;margin-top:6px;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:10px;box-shadow:var(--sh)}
  .pub-head.open .pub-nav a{display:block!important;padding:13px 14px;font-size:15px}
  .pub-head.open .pub-nav a.btn{text-align:center;margin-top:4px}
}
@media (max-width:939px) and (max-height:700px){.side.open .side-nav .nv{padding:7px 14px;font-size:14px}}

/* Thebu overview on phones: top bar shows icon + title + theme button + menu; no header card */
.side-title{display:none}
.sb-ic{width:34px;height:34px;border-radius:11px;background:var(--ink);color:var(--bg);display:grid;place-items:center;flex:none}
.sb-t{font-size:17px;letter-spacing:-.02em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:939px){
  .side.compact .side-brand{display:none}
  .side.compact .side-title{display:flex;align-items:center;gap:10px;margin-right:auto;min-width:0}
  .side.compact .hb{margin-left:0}
  .side.compact .side-theme{margin-right:8px}
  .shell.compact-home .topbar{display:none}
}

/* phones: feature cards two across */
@media (max-width:700px){
  .pub-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .pub-feat{padding:14px}
  .pub-feat span{font-size:24px;margin-bottom:6px}
  .pub-feat h3{font-size:14px;line-height:1.25}
  .pub-feat p{font-size:12.5px;line-height:1.45}
  .pub-feat-btn{width:100%;justify-content:center}
}

/* phones: the whole public site, compact */
@media (max-width:700px){
  .pub-plans{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .pub-plan{padding:16px 12px;border-radius:18px;gap:8px}
  .pub-plan.featured{grid-column:1/-1}
  .pub-plan h3{font-size:15px}
  .pub-price{flex-wrap:wrap;gap:2px 6px}
  .pub-price b{font-size:26px}
  .pub-price span{font-size:12px}
  .pub-blurb{font-size:12.5px}
  .pub-plan ul{font-size:12.5px;gap:5px}
  .pub-plan .btn{padding:9px 8px;font-size:13px}
  .pub-ask{font-size:12px}
  .pub-badge{left:14px;font-size:10.5px}
  .pub-plans.picker{grid-template-columns:1fr}
  .pub-plans.picker .pub-plan.featured{grid-column:auto}
  .pub-sec{padding:30px 0}
  .pub-sec h2{font-size:22px}
  .pub-hero{padding:36px 0 28px}
  .pub-hero.small{padding:30px 0 4px}
  .pub-steps{grid-template-columns:1fr;gap:14px;margin-top:16px}
  .pub-steps>div{display:grid;grid-template-columns:38px 1fr;column-gap:12px;align-items:start;padding:0}
  .pub-steps b{grid-row:1/3;margin:0}
  .pub-steps h3{margin:0;font-size:15px}
  .pub-steps p{font-size:13px}
  .pub-faq details{padding:12px 14px}
  .pub-compare{padding:4px 8px}
  .pub-compare td,.pub-compare th{padding:9px 6px;font-size:12.5px}
  .pub-foot .pub-in{flex-direction:column;gap:8px}
}
@media (max-width:700px){
  .pub-compare td,.pub-compare th{white-space:normal;padding:9px 4px;font-size:12px;line-height:1.25;vertical-align:middle}
  .pub-compare th{font-size:10px;letter-spacing:.03em}
  .pub-compare td:first-child,.pub-compare th:first-child{width:34%}
  .pub-compare table{table-layout:fixed;width:100%}
}
.pub-money small{display:block;font-size:10.5px;color:var(--mut);line-height:1.1}

/* phone Overview bar (Thebu): the logo instead of an icon and title */
.side-logo{display:none}
@media (max-width:939px){
  .side.compact .side-title{display:none}
  .side.compact .side-logo{display:flex;align-items:center;margin-right:auto;min-width:0}
  .side.compact .side-logo img{height:34px;width:auto;max-width:56vw;display:block}
}

/* help page on phones: dropdown instead of a wall of chips, collapsible topics */
.help-jump,.help-all{display:none}
@media (max-width:700px){
  .help-toc{display:none}
  .help-jump{display:block;width:100%;margin-top:4px}
  .help-all{display:flex;gap:8px;margin-top:10px}
  .help-sec.acc{padding:0;margin-bottom:10px}
  .help-head{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;text-align:left;background:none;border:0;padding:16px;font-size:15px;font-weight:700;color:var(--ink);letter-spacing:-.01em}
  .help-chev{flex:none;color:var(--mut);font-size:16px}
  .help-sec.acc .help-body{padding:0 16px 16px;border-top:1px solid var(--line);padding-top:12px}
  .help-body{font-size:14px}
  .help-body table{font-size:12.5px}
  .help-body th,.help-body td{padding:8px 4px}
  .help-flag{font-size:10px;padding:2px 7px;margin-left:6px}
}

/* help topics: colour by area */
.tone-blue{--tone:#3b82f6}.tone-green{--tone:#10b981}.tone-violet{--tone:#8b5cf6}.tone-teal{--tone:#14b8a6}
.tone-orange{--tone:#f97316}.tone-amber{--tone:#f59e0b}.tone-rose{--tone:#f43f5e}.tone-indigo{--tone:#6366f1}
.help-toc{gap:8px}
.help-toc a.chip{margin:0;padding:6px 12px;font-size:12.5px;font-weight:600;color:var(--ink);
  background:color-mix(in srgb,var(--tone) 18%,transparent);border:1px solid color-mix(in srgb,var(--tone) 55%,transparent)}
.help-toc a.chip:hover{background:color-mix(in srgb,var(--tone) 30%,transparent)}
.help-toc a.chip.is-important{background:color-mix(in srgb,var(--tone) 35%,transparent);border-color:var(--tone)}
.help-sec{border-left:5px solid var(--tone,var(--line))}
.help-sec h2,.help-head{display:flex;align-items:center;gap:10px}
.help-ico{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:11px;font-size:18px;flex:none;
  background:color-mix(in srgb,var(--tone,var(--line)) 22%,transparent);margin-right:10px}
.help-head .help-ico{margin-right:0}
.help-head>span:first-child{display:flex;align-items:center;gap:10px;min-width:0}
.help-sec.important{border-left-width:5px}
@media (max-width:700px){.help-ico{width:30px;height:30px;font-size:16px}}
.help-toc a.chip{display:inline-flex;align-items:center;gap:7px}

/* public header: theme + menu buttons */
.pub-tools{display:flex;align-items:center;gap:8px}
.pub-theme{width:44px;height:44px;border-radius:12px;border:1px solid var(--line);background:var(--surface);color:var(--ink);display:inline-flex;align-items:center;justify-content:center;padding:0;cursor:pointer}
.pub-nav{margin-left:auto}
@media (min-width:701px){.pub-tools{order:3}.pub-theme{width:38px;height:38px}}

/* Thebu logo: white text on dark bars, dark text on light bars (the desktop sidebar is dark in both themes) */
.side img.logo-on-light{display:none!important}
@media (max-width:939px){
  :root[data-theme="light"] .side img.logo-on-dark{display:none!important}
  :root[data-theme="light"] .side img.logo-on-light{display:block!important;height:34px;width:auto;max-width:56vw}
}

/* phone menus: about half width, tucked under the button (no empty space) */
@media (max-width:939px){
  .side.open .side-nav{left:auto;right:10px;width:min(320px,calc(100vw - 20px))}
}
@media (max-width:700px){
  .pub-head.open .pub-nav{left:auto;right:12px;width:min(300px,calc(100vw - 24px))}
}

/* phone menu: compact rows so the whole list fits without scrolling on most phones */
@media (max-width:939px){
  .side.open .side-nav .nv{padding:8px 12px;font-size:14.5px}
  .side.open .side-nav .nv.only-mobile{margin-top:4px}
}
@media (max-width:939px) and (max-height:760px){
  .side.open .side-nav .nv{padding:6px 12px;font-size:14px}
}

/* phones: the dark/light button lives in the top bar on every page (next to the menu button) */
@media (max-width:939px){
  .side .side-theme{margin-left:auto;margin-right:8px}
  .side .hb:not(.side-theme){margin-left:0}
  .tb-btn{display:none}
}

/* document preview */
.docview{position:fixed;inset:0;z-index:90;background:#0b0c10;display:flex;flex-direction:column}
.docview-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:10px 14px;color:#fff}
.docview-title{font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1 1 200px}
.docview-actions{display:flex;gap:8px;flex-wrap:wrap}
.docview-body{flex:1;min-height:0;padding:0 12px 12px;display:flex}
.docview-body iframe{width:100%;height:100%;border:0;background:#fff;border-radius:10px}
.docview-body img{max-width:100%;max-height:100%;margin:auto;object-fit:contain;border-radius:10px;background:#fff}
@media (max-width:700px){.docview-bar{padding:8px 10px}.docview-body{padding:0 6px 6px}}


/* ===== Employees and payslips (same look as the Thebu app) ===== */
.ps-live{display:flex;gap:18px;flex-wrap:wrap;justify-content:flex-end;margin:16px 0;padding:12px 14px;border-radius:14px;background:var(--surface2);border:1px solid var(--line)}
.ps-live b{font-variant-numeric:tabular-nums}
.sheet.pslip{border-radius:6px;border:1px solid #cfd3d9;font-size:12px;color:#1f2227}
.pslip .pl-in{padding:24px 26px 18px}
.sheet.pslip{width:100%;max-width:794px;margin:0 auto;aspect-ratio:210/297;overflow:visible;display:flex;flex-direction:column;font-size:13px}
.pslip .pl-in{flex:1;display:flex;flex-direction:column;padding:38px 42px 26px}
.sheet.pslip.px{font-size:11.5px;line-height:1.35;border-radius:2px}
.px .pl-in{padding:34px 36px 22px}
.px-box{border:1px solid #1f2227;margin-bottom:18px;padding:6px 8px}
.px-top{display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap}
.px-cn{font-size:17px;letter-spacing:-.01em;color:#111827}
.px-doc{font-size:11px;font-weight:700;letter-spacing:.14em;color:#4b5563}
.px-co{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-top:8px}
.px-logo{flex:none;padding:6px 8px 0}
.px-emp{display:grid;grid-template-columns:1fr 1fr;gap:4px 18px;padding:8px}
.px-kv{display:grid;grid-template-columns:200px minmax(0,1fr);gap:8px;padding:1px 0}
.px-co .px-kv{grid-template-columns:290px minmax(0,1fr)}
.px-emp .px-kv{grid-template-columns:140px minmax(0,1fr)}
.px-kv span{font-weight:700;color:#111827}
.px-kv b{font-weight:600;overflow-wrap:anywhere}
.px-wrap{overflow-x:auto;margin-top:6px}
.px-t{min-width:500px;border:1px solid #cfd3d9}
.px-r{display:grid;grid-template-columns:minmax(0,1fr) 78px 120px 120px;gap:8px;padding:2px 8px;font-variant-numeric:tabular-nums}
.px-r span:nth-child(2),.px-r span:nth-child(3){text-align:right}
.px-r span:nth-child(4){text-align:center}
.px-h{background:#d8d8d8;font-weight:700;color:#111827}
.px-sum{background:#e6edfb;font-weight:700}
.px-netrow{display:flex;justify-content:flex-end;margin:8px 0 14px}
.px-net{display:grid;grid-template-columns:140px 110px;background:#fbe3a3;font-weight:700;border:1px solid #e3c470}
.px-net span,.px-net b{text-align:right;padding:3px 8px}
.px-low{display:grid;grid-template-columns:.7fr 1.6fr;gap:16px;margin-top:6px;align-items:start}
.px-r2{display:grid;grid-template-columns:minmax(0,1fr) 64px;gap:8px;padding:2px 8px}
.px-r4{display:grid;grid-template-columns:minmax(0,1fr) 110px 120px;gap:8px;padding:2px 8px;font-variant-numeric:tabular-nums}
.px-r2 span:nth-child(2),.px-r4 span:nth-child(2){text-align:right}
.px-r4 span:nth-child(3){text-align:center}
.px-t2,.px-t4{min-width:0}
.px-notes{margin-top:8px;border:1px solid #cfd3d9;padding:6px 8px}
.px-currency{margin-top:12px;font-size:10px;color:#6b7280}
.px-foot{display:flex;justify-content:space-between;gap:12px;margin-top:auto;padding-top:14px;font-size:11px;color:#374151}
.ps-who{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-top:12px;padding:10px 14px;border:1px solid var(--line);border-radius:14px;background:var(--surface2)}
.cp{position:relative;min-width:0}
.cp-d{font-size:11px;color:var(--mut);margin-top:3px;line-height:1.3}
.cp-list{position:fixed;z-index:80;overflow:auto;background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:0 24px 60px -18px rgba(0,0,0,.45);padding:6px}
.cp-g{padding:8px 10px 4px;font-size:10.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--mut)}
.cp-o{display:grid;grid-template-columns:50px minmax(0,1fr);gap:8px;width:100%;text-align:left;border:0;background:transparent;padding:7px 10px;border-radius:9px;font-size:12.5px;cursor:pointer;align-items:baseline;color:var(--ink)}
.cp-o:hover,.cp-o.on{background:var(--acc-soft)}
.cp-o b{font-variant-numeric:tabular-nums}
.cp-e{padding:10px;color:var(--mut);font-size:12.5px}
.cp-x{color:var(--neg);grid-template-columns:1fr}
.cp-foot{padding:8px 10px 4px;font-size:10.5px;color:var(--mut);border-top:1px solid var(--line);margin-top:4px}
.est{margin-top:18px;padding:14px;border:1px solid var(--line);border-radius:16px;background:var(--surface2)}
.est-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px;align-items:end}
.est-res{display:grid;gap:5px;font-size:13px}
.est-res div{display:flex;justify-content:space-between;gap:12px;font-variant-numeric:tabular-nums}
.est-res .big{font-size:16px;font-weight:800;padding-top:8px;margin-top:4px;border-top:1px solid var(--line)}
.bracket-note{grid-column:1/-1;padding:10px 12px;border:1px dashed var(--line);border-radius:12px;background:var(--surface2);line-height:1.5}
.card,.tbl2,.px-wrap,.nav,.drawer,.lb-body,textarea,.sheet,.nav.open{touch-action:pan-x pan-y}
.px-fit-in{width:794px;transform-origin:top left}
.px-fitbar{display:flex;justify-content:flex-end;margin-bottom:8px}
@media print{.sheet.pslip{max-width:none;aspect-ratio:auto;min-height:275mm}}
@media print{.px-fit{height:auto!important;overflow:visible!important}.px-fit-in{transform:none!important;width:auto!important}.px-fitbar{display:none}}

/* tax brackets page (from the Thebu app) */
.guide{margin:10px 0 0;padding-left:22px;line-height:1.65}
.guide li{margin:8px 0}

/* invoices and deadlines (from the Thebu app) */
.sheet .s-subj-line{margin:8px 0 0 auto;width:90px;border-bottom:2px solid #9ca3af}
.payform{grid-column:1/-1;display:grid;gap:12px;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) auto;align-items:end;margin-top:8px;padding:14px;border:1px solid var(--line);border-radius:16px;background:var(--surface2)}
@media(max-width:720px){.payform{grid-template-columns:1fr;align-items:stretch}.payform .btn{flex:1 1 auto;justify-content:center}}

/* record finances: drawer, details, attachments (from the Thebu app) */
.top-stats{display:flex;border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--surface2)}
.top-stats>div{padding:7px 16px;border-left:1px solid var(--line);display:flex;flex-direction:column}
.top-stats>div:first-child{border-left:0}
.top-stats span{font-size:10.5px;letter-spacing:.07em;text-transform:uppercase;color:var(--mut);font-weight:600}
.top-stats b{font-size:14px;font-variant-numeric:tabular-nums;white-space:nowrap}
.top-f{flex-basis:100%;display:flex;gap:8px;flex-wrap:wrap;align-items:center;padding-top:14px;border-top:1px solid var(--line)}
.dt-amt{font-size:34px;font-weight:800;letter-spacing:-.04em;font-variant-numeric:tabular-nums;margin:6px 0 4px}
.att{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.att .th{border:1px solid var(--line);border-radius:16px;overflow:hidden;background:var(--surface2)}
.att .pic{aspect-ratio:4/3;display:grid;place-items:center;cursor:pointer;background:var(--neu-s);overflow:hidden}
.att .pic img{width:100%;height:100%;object-fit:cover;display:block}
.att .nm{font-size:11.5px;font-weight:600;padding:8px 10px 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.att .ac{display:flex;gap:4px;flex-wrap:wrap;padding:8px 10px 10px}
.lb{position:fixed;inset:0;z-index:80;background:rgba(8,9,12,.92);display:flex;flex-direction:column;animation:fade .15s}
.lb-bar{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;padding:12px 16px;color:#fff}
.lb-nm{font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:60vw}
/* document viewer: photos can be pinched to zoom; a phone shows them fitted to the screen */
.lb,.lb-body{touch-action:pan-x pan-y pinch-zoom}
.drawer.wide{width:min(640px,100vw)}
.lb-body{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:0 16px 16px}

/* Month by month: the three boxes open a detail panel */
button.mini{font:inherit;color:inherit;text-align:left;cursor:pointer;width:100%;display:block}
button.mini:hover{border-color:var(--acc)}
button.mini.on{outline:2px solid var(--acc);outline-offset:1px}
.mini .more{margin-top:6px;font-size:11.5px;color:var(--mut)}
.mdet{margin-top:12px;padding:14px;border-radius:14px;background:var(--surface2);border:1px solid var(--line)}
.mdet h4{margin:14px 0 4px;font-size:13px}

/* who is signed in: avatar + small menu in the top bar */
.who-av{flex:none;width:34px;height:34px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-weight:800;background:var(--acc);color:#fff}
.who-tx{min-width:0;display:flex;flex-direction:column;line-height:1.25}
.who-tx b{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.who-tx small{font-size:11.5px;color:var(--mut)}
.um{position:relative;flex:none}
.um-btn{width:40px;height:40px;border-radius:12px;border:1px solid var(--line);background:var(--surface2);display:grid;place-items:center;padding:0;cursor:pointer}
.um-pop{position:absolute;right:0;top:calc(100% + 8px);z-index:60;min-width:240px;max-width:min(320px,86vw);background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:16px;box-shadow:0 18px 50px -12px rgba(0,0,0,.45);padding:8px}
.um-who{display:flex;align-items:center;gap:10px;padding:8px 8px 10px;border-bottom:1px solid var(--line);margin-bottom:6px;min-width:0}
.um-pop button{display:block;width:100%;text-align:left;padding:10px 12px;border:0;background:transparent;color:inherit;font:inherit;border-radius:10px;cursor:pointer}
.um-pop button:hover{background:var(--surface2)}
.um-pop .um-out{border-top:1px solid var(--line);border-radius:0 0 10px 10px;margin-top:4px}
.side.compact .um{margin-right:8px}
.side.open .um{display:none}

.who-img{object-fit:cover;background:#fff}

/* the account button sits in the top bar next to the dark/light and menu buttons on phones, and in the page header on computers (same on every company) */
@media (max-width:939px){
  .side .um{margin-left:auto;margin-right:8px}
  .side .side-theme{margin-left:0}
  .topbar .um{display:none}
}
@media (min-width:940px){.side .um{display:none}}

/* generic Overview (any company that is not Thebu): same dark hero with the company's tools as tiles */
.co-hero2{margin-bottom:14px}
.co-hero2 .logo-tile.big{width:84px;height:64px}
.ab-t{font:inherit;text-align:left;cursor:pointer;color:inherit}
.ab-t:hover{background:rgba(255,255,255,.12)}
.ab-emoji{font-size:24px;line-height:1;margin-bottom:4px}
.ab-more{border-style:dashed}
.ab-name{font-size:26px;font-weight:800;letter-spacing:-.03em;color:#fff;margin-bottom:14px;overflow-wrap:anywhere}

/* document styles */
.style-opt{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border:1px solid var(--line);border-radius:12px;margin-bottom:8px;cursor:pointer;background:var(--surface2)}
.style-opt.on{border-color:var(--acc);outline:1px solid var(--acc)}
.style-opt input{margin-top:4px}
.style-opt small{display:block;color:var(--mut);font-size:12px;margin-top:2px}
/* invoices and quotes: Modern and Minimal */
.sheet.tpl-modern{border-top:8px solid #1d4ed8}
.sheet.tpl-modern .s-kind{color:#1d4ed8}
.sheet.tpl-modern .s-rule{background:#1d4ed8}
.sheet.tpl-modern .s-tbl th{background:#1d4ed8;color:#fff}
.sheet.tpl-modern .s-tbl tbody tr:nth-child(odd) td{background:#eff6ff}
.sheet.tpl-modern .s-tbl tbody tr:last-child td{border-bottom:2px solid #1d4ed8}
.sheet.tpl-modern .s-total{background:#1d4ed8;color:#fff}
.sheet.tpl-modern .s-ph{color:#1d4ed8}
.sheet.tpl-minimal .s-wm{display:none}
.sheet.tpl-minimal .s-kind{font-weight:300;letter-spacing:.14em}
.sheet.tpl-minimal .s-rule{height:1px;background:#9ca3af}
.sheet.tpl-minimal .s-tbl th{background:none;color:#111827;border-bottom:1px solid #111827;border-radius:0}
.sheet.tpl-minimal .s-tbl tbody tr:nth-child(odd) td{background:none}
.sheet.tpl-minimal .s-tbl td{border-bottom:1px solid #e5e7eb}
.sheet.tpl-minimal .s-tbl tbody tr:last-child td{border-bottom:1px solid #111827}
.sheet.tpl-minimal .s-total{background:none;color:#111827;border-top:1px solid #111827;border-bottom:1px solid #111827;border-radius:0}
/* payslips: Compact and Simple */
.sheet.pslip.tpl-compact{font-size:10.5px;line-height:1.25}
.sheet.pslip.tpl-compact .pl-in{padding:22px 26px 16px}
.sheet.pslip.tpl-compact .px-box{margin-bottom:10px;padding:4px 6px}
.sheet.pslip.tpl-compact .px-r,.sheet.pslip.tpl-compact .px-r2,.sheet.pslip.tpl-compact .px-r4{padding:1px 8px}
.sheet.pslip.tpl-simple .px-h,.sheet.pslip.tpl-simple .px-sum,.sheet.pslip.tpl-simple .px-net{background:none}
.sheet.pslip.tpl-simple .px-h,.sheet.pslip.tpl-simple .px-sum{border-top:1px solid #111827;border-bottom:1px solid #111827}
.sheet.pslip.tpl-simple .px-net{border:2px solid #111827}
.sheet.pslip.tpl-simple .px-t,.sheet.pslip.tpl-simple .px-notes,.sheet.pslip.tpl-simple .px-box{border-color:#111827}

/* invoices: Branded, Letterhead, Bold, Elegant */
.sheet.tpl-branded .s-from img{max-width:240px!important;max-height:110px!important;margin-bottom:14px!important}
.sheet.tpl-branded .s-co{font-size:21px;text-transform:uppercase;letter-spacing:.01em;margin-bottom:6px}
.sheet.tpl-branded .s-subj,.sheet.tpl-branded .s-subj-line{border-bottom-color:#34c79a}
.sheet.tpl-branded .s-wm{opacity:.05}
.sheet.tpl-letterhead .s-top{flex-direction:column;align-items:center;text-align:center;gap:14px}
.sheet.tpl-letterhead .s-from,.sheet.tpl-letterhead .s-to{text-align:center}
.sheet.tpl-letterhead .s-from img{margin-left:auto!important;margin-right:auto!important}
.sheet.tpl-letterhead .s-subj,.sheet.tpl-letterhead .s-subj-line{margin-left:auto;margin-right:auto}
.sheet.tpl-letterhead .s-rule{height:1px;background:#6b7280}
.sheet.tpl-bold .s-kind{font-size:48px;letter-spacing:-.04em}
.sheet.tpl-bold .s-rule{height:6px;background:#111827;border-radius:0}
.sheet.tpl-bold .s-tbl th{background:#e5e7eb;color:#111827}
.sheet.tpl-bold .s-total{background:#111827;color:#fff}
.sheet.tpl-elegant{font-family:Georgia,"Times New Roman",serif}
.sheet.tpl-elegant .s-kind{font-weight:600;letter-spacing:.08em;color:#7c5a10}
.sheet.tpl-elegant .s-rule{height:2px;background:#b88a2b}
.sheet.tpl-elegant .s-tbl th{background:#f6efe0;color:#5a4208}
.sheet.tpl-elegant .s-tbl tbody tr:nth-child(odd) td{background:#fcf9f1}
.sheet.tpl-elegant .s-tbl tbody tr:last-child td{border-bottom:2px solid #b88a2b}
.sheet.tpl-elegant .s-total{background:#7c5a10;color:#fff}

/* more invoice styles */
.sheet.tpl-corporate{border-left:14px solid #1e3a5f}
.sheet.tpl-corporate .s-kind{color:#1e3a5f;text-transform:uppercase;letter-spacing:.06em}
.sheet.tpl-corporate .s-co{text-transform:uppercase}
.sheet.tpl-corporate .s-rule{background:#1e3a5f}
.sheet.tpl-corporate .s-tbl th{background:#1e3a5f;color:#fff;text-transform:uppercase}
.sheet.tpl-corporate .s-total{background:#1e3a5f;color:#fff}
.sheet.tpl-soft{border-radius:18px}
.sheet.tpl-soft .s-rule{height:2px;background:#6ee7b7}
.sheet.tpl-soft .s-tbl th{background:#d1fae5;color:#065f46;border-radius:8px}
.sheet.tpl-soft .s-tbl tbody tr:nth-child(odd) td{background:#f0fdf4}
.sheet.tpl-soft .s-total{background:#d1fae5;color:#065f46;border-radius:12px}
.sheet.tpl-soft .s-kind{color:#065f46}
.sheet.tpl-ledger .s-tbl{border-collapse:collapse;border:1px solid #111827}
.sheet.tpl-ledger .s-tbl th{background:#f3f4f6;color:#111827;border:1px solid #111827;border-radius:0}
.sheet.tpl-ledger .s-tbl td{border:1px solid #9ca3af}
.sheet.tpl-ledger .s-tbl tbody tr:nth-child(odd) td{background:none}
.sheet.tpl-ledger .s-total{background:#f3f4f6;color:#111827;border:2px solid #111827;border-radius:0}
.sheet.tpl-ledger .s-rule{height:1px;background:#111827}
/* more payslip styles */
.sheet.pslip.tpl-modern .px-cn,.sheet.pslip.tpl-modern .px-doc{color:#1d4ed8}
.sheet.pslip.tpl-modern .px-h{background:#1d4ed8;color:#fff}
.sheet.pslip.tpl-modern .px-sum{background:#dbeafe}
.sheet.pslip.tpl-modern .px-net{background:#1d4ed8;color:#fff;border-color:#1d4ed8}
.sheet.pslip.tpl-boxed .px-box,.sheet.pslip.tpl-boxed .px-t,.sheet.pslip.tpl-boxed .px-notes{border:2px solid #111827}
.sheet.pslip.tpl-boxed .px-h{background:#e5e7eb}
.sheet.pslip.tpl-boxed .px-net{border:2px solid #111827;background:#fff}
.sheet.pslip.tpl-elegant{font-family:Georgia,"Times New Roman",serif}
.sheet.pslip.tpl-elegant .px-cn{color:#7c5a10}
.sheet.pslip.tpl-elegant .px-h{background:#f6efe0;color:#5a4208}
.sheet.pslip.tpl-elegant .px-sum{background:#fcf9f1}
.sheet.pslip.tpl-elegant .px-net{background:#f1e3bd;border-color:#b88a2b}
/* Overview hero: the company logo is shown big on a white card that fits the logo (not squeezed into a small tile) */
.ab-hl>.logo-tile.big{display:inline-flex;align-items:center;justify-content:center;width:auto;height:auto;min-width:0;max-width:100%;padding:14px 20px;margin-bottom:18px}
.ab-hl>.logo-tile.big img{display:block;height:auto;width:auto;max-height:150px;max-width:min(100%,420px);object-fit:contain}

/* Overview header: the company logo takes the place of the grid icon */
.tb-ico.tb-logo{width:auto;min-width:46px;max-width:150px;height:52px;padding:5px 10px;background:#fff;border:1px solid var(--line)}
.tb-ico.tb-logo img{display:block;height:100%;width:auto;max-width:130px;object-fit:contain}
/* header logo tile: keep the logo inside the tile (it was spilling out on phones) */
.tb-ico.tb-logo{display:flex;align-items:center;justify-content:center;width:auto;min-width:56px;max-width:132px;height:52px;padding:6px 10px;overflow:hidden;flex:none}
.tb-ico.tb-logo img{display:block;height:auto;width:auto;max-height:38px;max-width:110px;object-fit:contain}

/* profile photo: bigger in the account menu, and a full-screen viewer */
.um-photo{flex:none;width:56px;height:56px;border-radius:50%;padding:0;border:2px solid var(--line);overflow:hidden;cursor:zoom-in;background:#fff;display:block}
.um-photo img{display:block;width:100%;height:100%;object-fit:cover}
.um-pop .um-photo{padding:0;width:56px}
.pv{position:fixed;inset:0;z-index:120;background:rgba(8,9,12,.92);display:flex;flex-direction:column;animation:fade .15s}
.pv-bar{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px 16px;color:#fff}
.pv-nm{font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:60vw}
.pv-body{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:0 16px 24px}
.pv-body img{max-width:min(92vw,640px);max-height:80vh;border-radius:16px;object-fit:contain;background:#fff}

/* ---- Fleet & Workshop Portal additions ---- */
.rtbl{width:100%;border-collapse:collapse;font-size:13px;font-variant-numeric:tabular-nums}
.rtbl th{text-align:left;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--mut);padding:8px 10px;border-bottom:1px solid var(--line);white-space:nowrap}
.rtbl td{padding:8px 10px;border-bottom:1px solid var(--line);vertical-align:top}
.rtbl .rtot td{font-weight:800}
.chip-x{border:0;background:transparent;color:inherit;padding:0 2px;cursor:pointer;font-size:15px;line-height:1}
.chip-x.danger{font-size:11px;font-weight:700}
@media print{
  .side,.topbar,.no-print,.toast,.scrim,.drawer{display:none!important}
  .shell,.main{display:block!important;padding:0!important;margin:0!important}
  body{background:#fff!important;color:#000!important}
  .card{box-shadow:none!important;border:1px solid #ccc!important;background:#fff!important;color:#000!important;break-inside:avoid}
  .rtbl th,.rtbl td{color:#000!important;border-color:#bbb!important}
}

/* Ticket chat conversation */
.call-chat{display:flex;flex-direction:column;gap:10px;margin:8px 0 14px}
.chat-message{max-width:82%;display:flex;flex-direction:column;align-items:flex-start}
.chat-message.mine{align-self:flex-end;align-items:flex-end}
.chat-message.theirs{align-self:flex-start}
.chat-meta{display:flex;gap:8px;align-items:center;margin-bottom:4px;font-size:12px}
.chat-meta small{display:inline!important}
.chat-bubble{padding:10px 12px;border-radius:14px 14px 14px 4px;background:var(--surface2);border:1px solid var(--line);white-space:pre-wrap;overflow-wrap:anywhere}
.chat-message.mine .chat-bubble{border-radius:14px 14px 4px 14px;background:color-mix(in srgb,var(--acc) 12%,var(--surface));border-color:color-mix(in srgb,var(--acc) 35%,var(--line))}

/* ticket reply box: text and Send side by side, pinned to the bottom of the drawer */
.composer{position:sticky;bottom:0;z-index:2;margin-top:16px;padding:12px 0 6px;background:var(--surface);border-top:1px solid var(--line)}
.composer-row{display:flex;gap:8px;align-items:flex-end}
.composer-row textarea{flex:1;min-width:0;resize:vertical}
.composer-send{flex:none;white-space:nowrap}
