/* Brand palette and type from akruaconsulting.com: navy for ink and actions, AKRUA red as the
   accent (active tab, logo), Inter for text and Poppins for headings. Light only. */
:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --ink: #1c2b3a;
  --dim: #5b6b7b;
  --line: #e4e8ee;
  --line-soft: #eef1f5;
  --head: #f7f8fc;
  --navy: #0f2547;
  --navy-dark: #081627;
  --red: #c8202f;
  --red-dark: #a11724;
  --tint: #eef2f8;
  /* --blue is the action colour throughout; it now carries the brand navy. */
  --blue: #0f2547;
  --blue-dark: #081627;
  --link: #1f4f8f;
  --green: #2f8f4e;
  --green-dark: #23733d;
  --bad: #b42318;
  --warn: #b8860b;
  --amber-bg: #fdf6e3;
  --red-bg: #fdeceb;
  --green-bg: #eaf6ee;
  --radius: 10px;
  --shadow: 0 8px 30px rgba(15, 37, 71, .08);
  --display: Poppins, Inter, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

header {
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px; height: 60px;
  background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30; backdrop-filter: saturate(180%) blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; font: 600 14px var(--display); color: var(--navy); text-decoration: none; white-space: nowrap; }
.brand img { height: 22px; width: auto; display: block; }
.brand .brand-sep { width: 1px; height: 20px; background: var(--line); }
.sub { color: var(--dim); font-size: 12px; white-space: nowrap; }
/* The strapline is the first thing to go when the header runs out of room. */
@media (max-width: 1520px) { header .sub { display: none; } }
.topnav { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.topnav a, .topnav .navsoon { white-space: nowrap; }
.topnav a { font-size: 13.5px; font-weight: 500; color: var(--navy); text-decoration: none; }
.topnav a:hover, .topnav a.on { color: var(--red); }
.topnav .navsoon { font-size: 13px; color: var(--dim); cursor: not-allowed; user-select: none; }
.topnav .navsoon .soon { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; margin-left: 2px; vertical-align: 1px; }
/* The Inbox -> Bills flow sits next to the brand, not pushed right like the rest. */
.topnav-flow { margin-left: 8px; }
.flow-arrow { color: var(--dim); font-size: 12px; }

main { max-width: 1120px; margin: 0 auto; padding: 22px 20px 72px; }

.crumbs { margin-bottom: 6px; font-size: 13px; color: var(--dim); }
.crumbs a { color: var(--link); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

h1 { font: 700 24px/1.25 var(--display); color: var(--navy); margin: 2px 0 14px; }
h2 { font-size: 13px; font-weight: 600; margin: 22px 0 8px; color: var(--dim);
     text-transform: uppercase; letter-spacing: .05em; }
.headline { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.headline h1 { margin-bottom: 0; }
a { color: var(--link); }

/* Xero groups a bill's detail into one bordered white card. */
.card, form.vendor, .panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.filters { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.filters a {
  padding: 8px 15px; color: var(--dim); text-decoration: none; font-size: 13px;
  text-transform: capitalize; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.filters a.on { color: var(--navy); border-bottom-color: var(--red); font-weight: 600; }
.settingsnav { margin-bottom: 14px; }
.count { color: var(--dim); font-weight: 400; }
/* Search sits at the right end of the status tabs and narrows every tab's count too. */
.filters .search { margin-left: auto; display: flex; align-items: center; gap: 4px;
                   padding-bottom: 6px; }
.filters .search input { width: 260px; }
.filters .search a.clear { padding: 4px 6px; font-size: 16px; border: none; margin: 0; }

table { width: 100%; border-collapse: collapse; background: var(--panel);
        border: 1px solid var(--line); border-radius: var(--radius); }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); }
thead th { background: var(--head); font-size: 12px; font-weight: 600; color: var(--dim);
           border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--head); }
.num { text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

.chip { font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 600;
        text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
        background: #eceff1; color: var(--dim); }
.chip.ready  { background: var(--tint); color: var(--blue-dark); }
.chip.pushed { background: var(--green-bg); color: var(--green-dark); }
.chip.error  { background: var(--red-bg); color: var(--bad); }

/* The model's own per-field confidence (app.extract.FieldConfidence) -- "high" stays
   quiet since it needs no attention, "low" is the one that should catch the eye. */
.chip.conf-high   { background: var(--green-bg); color: var(--green-dark); }
.chip.conf-medium { background: var(--amber-bg); color: var(--warn); }
.chip.conf-low    { background: var(--red-bg); color: var(--bad); }

.banner { padding: 11px 14px; border-radius: var(--radius); margin: 12px 0; font-size: 13.5px;
          border: 1px solid var(--line); background: var(--panel); }
.banner.good { background: var(--green-bg); border-color: #cfe3ab; }
.banner.bad  { background: var(--red-bg); border-color: #f2c4c0; color: #93281d; }
.banner.warn { background: var(--amber-bg); border-color: #ecd9a0; color: #7a5c07; }

fieldset { border: none; padding: 0; margin: 0; }
fieldset[disabled] { opacity: .75; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 14px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--dim); }
label.block { margin-top: 16px; }
label.check { flex-direction: row; align-items: center; gap: 8px; margin-top: 14px;
              font-size: 13px; color: var(--ink); }
label.check input { width: auto; }
.hint { color: var(--dim); font-size: 11px; font-weight: 400; }

input, select, textarea {
  font: inherit; font-size: 13px; color: var(--ink); background: var(--panel);
  border: 1px solid #cfd6df; border-radius: 8px; padding: 6px 9px; width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(15,37,71,.12);
}
input[type=date] { min-height: 30px; }
input.num { text-align: right; }

.items td { padding: 4px 8px; border-bottom: 1px solid var(--line-soft); }
.items select.coa { max-width: 250px; }
/* A guessed account (several allowed, none certain -- see app.rules._best_account_guess)
   must never look identical to a confident match; it needs to catch the eye enough that
   skimming past it takes a deliberate choice, not an accident. */
.coa-guessed { border-color: var(--warn); background: var(--amber-bg); }
.guess-hint { color: var(--warn); font-size: 11px; margin-top: 2px; white-space: nowrap; }
.items tfoot th { background: var(--panel); border-top: 1px solid var(--line);
                  border-bottom: none; color: var(--ink); font-size: 13px;
                  text-transform: none; letter-spacing: 0; }
.rowtools { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 10px; }

button { font: inherit; cursor: pointer; }
button.link { background: none; border: none; color: var(--link); padding: 4px 0;
              font-size: 13px; }
button.link:hover { text-decoration: underline; }
button.primary, button.go {
  border: none; border-radius: 999px; padding: 9px 22px; font-size: 14px;
  font-weight: 600; color: #fff;
}
button.primary { background: var(--blue); }
button.primary:hover { background: var(--blue-dark); }
/* The push is this app's equivalent of Xero's green Approve. */
button.go { background: var(--green); }
button.go:hover { background: var(--green-dark); }

.actions { margin-top: 18px; }
.push { margin-top: 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.danger { margin-top: 22px; }
.danger button { color: var(--bad); }
.empty { color: var(--dim); }
.src, .rule-note { color: var(--dim); font-size: 12.5px; }
.src { margin-top: 18px; }
.err { color: var(--bad); }
.dim { color: var(--dim); font-size: 12.5px; }
table.files td { padding: 8px 12px; }

details.card summary { cursor: pointer; display: flex; align-items: center; gap: 10px;
                       flex-wrap: wrap; font-size: 14px; }
details.card summary::marker { color: var(--dim); }
details.card[open] summary { margin-bottom: 16px; padding-bottom: 12px;
                             border-bottom: 1px solid var(--line-soft); }
details.card form.vendor { border: none; padding: 0; margin: 0; }

@media (max-width: 640px) {
  main { padding: 16px 16px 60px; }
  .items select.coa { max-width: 100%; }
}

/* ---- AKRUA additions ---- */
.warnish { color: var(--warn); }
.subfilters select { width: auto; font-size: 12.5px; padding: 4px 6px; }
.btn-link, .rowdel button { cursor: pointer; }
.btn-link { display: inline-block; background: var(--blue); color: #fff; text-decoration: none;
            padding: 8px 18px; border-radius: 999px; font-weight: 600; font-size: 13px; }
.btn-link:hover { background: var(--blue-dark); }
.badge { background: var(--blue); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 11px; font-weight: 600; }
.panel h2:first-child { margin-top: 0; }
.headline { width: 100%; }
.headline .right { margin-left: auto; display: flex; gap: 16px; align-items: center; }
.filters { overflow-x: auto; }
.filters a { white-space: nowrap; }
.subfilters { display: flex; gap: 14px; margin: -6px 0 14px; font-size: 13px; }
.subfilters a { color: var(--dim); text-decoration: none; }
.subfilters a.on { color: var(--ink); font-weight: 600; }
tbody tr[data-href] { cursor: pointer; }
.chip.role-admin { background: var(--tint); color: var(--blue-dark); }
.chip.role-finance { background: var(--green-bg); color: var(--green-dark); }
.chip.gap { background: var(--amber-bg); color: var(--warn); }
.chip.ic { background: #efe8f7; color: #5b3f86; }
.chip.off { background: #eceff1; color: var(--dim); }
.chip.expired { background: var(--red-bg); color: var(--bad); }
/* Client type: PT (Indonesian company) / Individual / Foreign */
.chip.ctype { font-size: 10px; padding: 2px 7px; vertical-align: 2px; white-space: nowrap; }
.chip.ct-pt  { background: var(--tint); color: var(--blue-dark); }
.chip.ct-ind { background: var(--green-bg); color: var(--green-dark); }
.chip.ct-for { background: #fdeee4; color: #9a4a12; }
h2 .chip.ctype { margin-left: 4px; }
.who { margin-left: 14px; font-size: 12px; color: var(--dim); white-space: nowrap; }
.errors { margin: 0 0 14px; padding: 11px 14px 11px 32px; border-radius: var(--radius);
          background: var(--red-bg); border: 1px solid #f2c4c0; color: #93281d; font-size: 13.5px; }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.formgrid .full { grid-column: 1 / -1; }
.history td { font-size: 12.5px; vertical-align: top; }
.history .changes { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: var(--dim); overflow-wrap: anywhere; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input, .inline-form select { width: auto; }
.login-card { max-width: 380px; margin: 12vh auto 0; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
              padding: 10px; border: 1px solid #cfd6df; border-radius: 999px; background: #fff;
              color: var(--ink); text-decoration: none; font-weight: 600; }
.google-btn:hover { border-color: var(--blue); }
@media (max-width: 720px) {
  .formgrid { grid-template-columns: 1fr; }
  header { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 8px; }
  .topnav { margin-left: 0; flex-wrap: wrap; gap: 14px; }
  .who { margin-left: 0; }
  .hide-sm { display: none; }
}

/* ---- Payroll ---- */
main.full, main.wide { max-width: none; }
.pbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.pbar form { margin: 0; }
.spacer { flex: 1; }
.steps { display: flex; }
.step { padding: 4px 10px; font-size: 12px; color: var(--dim); border: 1px solid var(--line); background: var(--panel); }
.step:first-child { border-radius: 3px 0 0 3px; } .step:last-child { border-radius: 0 3px 3px 0; }
.step + .step { border-left: none; }
.step.done { color: var(--green-dark); background: var(--green-bg); }
.step.cur { color: #fff; background: var(--blue); border-color: var(--blue); font-weight: 600; }
.pconfirm { flex-direction: row; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 3px;
            background: var(--amber-bg); color: var(--warn); font-weight: 600; font-size: 13px; }
.pconfirm.ok { background: var(--green-bg); color: var(--green-dark); }
.pconfirm input { width: auto; }
button.primary:disabled, button.go:disabled { opacity: .45; cursor: not-allowed; }
.filters.sub { margin-bottom: 10px; }
.filters.nob { border-bottom: none; margin: 0; }
.gridwrap { overflow: auto; max-height: calc(100vh - 250px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.pgrid { border: none; border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.pgrid th, .pgrid td { padding: 4px 6px; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.pgrid thead th { position: sticky; top: 0; z-index: 2; white-space: normal; min-width: 86px; vertical-align: bottom; font-size: 11px; }
.pgrid thead tr.grp th { text-align: center; text-transform: uppercase; letter-spacing: .04em; font-size: 10.5px; border-bottom: none; height: 24px; }
.pgrid thead tr.cols th { top: 24px; }
.pgrid.report thead tr.cols th, .pgrid.emp thead tr.cols th { top: 0; }
.pgrid .g-earn { color: var(--blue-dark); }
.pgrid .stick { position: sticky; left: 0; z-index: 1; background: var(--panel); text-align: left; min-width: 96px; }
.pgrid .stick2 { position: sticky; left: 96px; z-index: 1; background: var(--panel); text-align: left; min-width: 210px; box-shadow: 1px 0 0 var(--line); white-space: normal; }
.pgrid thead .stick, .pgrid thead .stick2 { z-index: 3; background: var(--head); }
.pgrid .nm { font-weight: 600; } .pgrid .nm a { color: var(--ink); text-decoration: none; }
.pgrid td.in input { width: 100px; text-align: right; padding: 3px 5px; border: 1px solid transparent; background: #fbfcfd; font-size: 12.5px; }
.pgrid td.in input:focus { border-color: var(--blue); background: #fff; }
.pgrid td.in input:disabled { background: transparent; color: var(--ink); }
.pgrid td.chg input { background: #fff4c4; }
.pgrid td.saving input { opacity: .5; } .pgrid td.saved input { box-shadow: 0 0 0 2px var(--green); } .pgrid td.failed input { box-shadow: 0 0 0 2px var(--bad); }
.pgrid td.calc { background: #f6f8fa; } .pgrid td.thp { font-weight: 700; }
.pgrid td.er { background: #f4f1fa; }
.pgrid tr.excl td { opacity: .5; }
.pgrid tfoot td { position: sticky; bottom: 0; background: var(--panel); font-weight: 700; border-top: 2px solid var(--line); z-index: 1; }
.pgrid tfoot .stick, .pgrid tfoot .stick2 { z-index: 2; }
.pgrid .chip { font-size: 9.5px; padding: 1px 5px; }
.flag { color: var(--warn); font-weight: 800; cursor: help; margin-left: 2px; }
button.link.rm { color: var(--dim); } button.link.rm:hover { color: var(--bad); }
.danger-link { color: var(--bad) !important; }
.plegend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--dim); margin: 8px 0 14px; }
.plegend i { display: inline-block; width: 12px; height: 12px; border: 1px solid var(--line); border-radius: 2px; vertical-align: -2px; margin-right: 4px; }
.k-in { background: #fbfcfd; } .k-chg { background: #fff4c4; } .k-calc { background: #f6f8fa; } .k-er { background: #f4f1fa; }
.pchecks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.pcheck { display: flex; gap: 8px; border: 1px solid var(--line-soft); border-radius: 3px; padding: 7px 10px; font-size: 13px; }
.pcheck .ic { font-weight: 800; } .pcheck.ok .ic { color: var(--green-dark); } .pcheck.bad .ic { color: var(--bad); } .pcheck.warn .ic { color: var(--warn); }
.pcheck.bad { background: var(--red-bg); }
.card h2:first-child { margin-top: 0; }
.addjoiner { flex-wrap: wrap; }
.addjoiner input { width: 150px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 8px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.kpi .k { font-size: 12px; color: var(--dim); } .kpi .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
tr.strong td { font-weight: 700; }
.scrollx { overflow-x: auto; }
.bills { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); gap: 14px; }
.bill table td, .bill table th { padding: 6px 8px; font-size: 12.5px; }
.billhead { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
/* Step bills not yet approved: estimates, so greyed out with a dashed edge. */
.bill.est { border-style: dashed; background: #fafbfc; }
.bill.est table, .bill.est .billhead > b { color: var(--dim); }
.pcheck.est .ic { color: var(--dim); }
dl.meta { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; font-size: 12.5px; margin: 0 0 10px; }
dl.meta dt { color: var(--dim); } dl.meta dd { margin: 0; }
td input { font-size: 12.5px; padding: 4px 6px; }
@media (max-width: 720px) { .pgrid .stick2 { position: static; box-shadow: none; } .gridwrap { max-height: none; } }
.pnav a, .filters.sub a { text-transform: none; }

/* ---- Invoicing ---- */
.bgrid thead th { min-width: 108px; }
.bgrid td.bcell { background: #f6f8fa; }
.bgrid td.bcell a { color: var(--ink); text-decoration: none; }
.bgrid td.bcell.chg { background: #fff4c4; }
.bgrid td.chg.chg-up, .bgrid td.bcell.chg-up, .bgrid td.chg-up input { background: #dcf3dc; }
.bgrid td.chg.chg-down, .bgrid td.bcell.chg-down, .bgrid td.chg-down input { background: #fff1b8; }
.blegend { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--ink, #1f2328);
  background: #f6f8fa; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; margin: 10px 0; }
.blegend .lt { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.blegend .sw { display: inline-block; width: 16px; height: 16px; border-radius: 3px; vertical-align: -3px; margin-right: 6px; border: 1px solid rgba(0,0,0,.12); }
.blegend .sw-up { background: #dcf3dc; } .blegend .sw-down { background: #fff1b8; }
.bgrid tr.empty td { color: var(--dim); }
.bgrid tr.empty .nm a { color: var(--dim); font-weight: 500; }
.bgrid td.in input::placeholder { color: #b8c0c7; }
a.button { display: inline-block; padding: 7px 14px; border: 1px solid var(--navy); border-radius: 999px; background: #fff;
           color: var(--ink); text-decoration: none; font-weight: 600; font-size: 13px; }
a.button:hover { border-color: var(--red); color: var(--red); }
.kpi-inline { font-size: 13px; color: var(--dim); } .kpi-inline b { color: var(--ink); }
table.lines td { padding: 4px 4px; vertical-align: middle; }
table.lines select, table.lines input { font-size: 12.5px; padding: 4px 6px; }
.w-xs { width: 52px; } .w-s { width: 84px; } .w-m { width: 120px; } .w-desc { width: 320px; }
table.lines select[name=rtype] { min-width: 170px; } table.lines select[name=currency] { min-width: 72px; }
table.lines select[name=account_code] { min-width: 200px; max-width: 280px; } table.lines select[name=tax_type] { min-width: 130px; }
table.lines select[name=recurring] { min-width: 110px; }
.bhead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: -4px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.bhead h1 { margin: 0; font-size: 20px; }
.bhead select { width: auto; padding: 5px 8px; font-size: 13px; }
.bhead nav { display: flex; gap: 2px; flex-wrap: wrap; }
.bhead nav a { padding: 5px 12px; border-radius: 999px; text-decoration: none; color: var(--dim); font-size: 13px; font-weight: 600; white-space: nowrap; }
.bhead nav a:hover { background: var(--head); color: var(--ink); }
.bhead nav a.on { background: var(--navy); color: #fff; }
.bhead nav.minor a { font-weight: 500; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; background: #cfd5da; }
.dot.draft { background: var(--warn); } .dot.submitted { background: var(--blue); } .dot.approved { background: var(--green); }
.bhead nav a.on .dot { box-shadow: 0 0 0 1.5px #fff; }
.bbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; }
.bbar form { margin: 0; display: flex; align-items: center; gap: 6px; }
.bbar input[type=date] { width: auto; padding: 4px 6px; font-size: 13px; }
.bbar input.fx { width: 84px; padding: 4px 6px; font-size: 13px; text-align: right; }
.bbar button.primary, .bbar button.go { padding: 6px 16px; font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.seg a { padding: 4px 10px; font-size: 12.5px; text-decoration: none; color: var(--dim); background: var(--panel); }
.seg a + a { border-left: 1px solid var(--line); }
.seg a.on { background: var(--head); color: var(--ink); font-weight: 600; }
.bgrid .idr { display: block; font-size: 10.5px; color: var(--dim); line-height: 1.2; }
.bgrid td.in .idr { padding-right: 6px; }
.bgrid td.last { color: var(--dim); } .bgrid td.up { color: var(--green-dark); } .bgrid td.down { color: var(--bad); }
.bgrid th.sep, .bgrid td.sep { border-left: 2px solid var(--line); }
.addrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; font-size: 13px; }
.addrow select, .addrow input { width: auto; font-size: 13px; padding: 5px 8px; }
.addrow select[name=client_id] { max-width: 340px; }
.gridwrap.b { max-height: calc(100vh - 210px); }
.bgrid thead tr.cols th { top: 24px; }
.bgrid tr.sechead td { background: var(--head); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--ink); text-align: left; padding-top: 7px; }
.bgrid tr.subtotal td { font-weight: 700; background: #f6f8fa; border-bottom: 2px solid var(--line); }
.bgrid tr.subtotal .stick, .bgrid tr.subtotal .stick2 { background: #f6f8fa; }
.bgrid tfoot tr.wht td { font-weight: 500; color: var(--dim); position: static; }
.chip.tag { font-size: 9px; padding: 1px 4px; margin-right: 3px; vertical-align: 1px; }
.tag-xero { background: #e3f1fb; color: #0b5d8f; } .tag-qbo { background: #e6f4e0; color: #2d6a1f; } .tag-other { background: #eceff1; color: var(--dim); }

.bgrid th.notes, .bgrid td.notes { text-align: left; min-width: 200px; max-width: 260px; white-space: normal; }
.bgrid td.notes a { font-size: 12px; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 250px; }
.bgrid td.notes input.note { width: 240px; font-size: 12px; padding: 3px 5px; border: 1px solid transparent; background: #fbfcfd; }
.bgrid td.notes input.note:focus { border-color: var(--blue); background: #fff; }
.bgrid td.notes.saved input { box-shadow: 0 0 0 2px var(--green); }
.bgrid td.ar { min-width: 110px; } .bgrid .idr.overdue { color: var(--bad); font-weight: 600; }
.addrow form { margin: 0; }
.notebtn { border: none; background: none; color: #b8c0c7; cursor: pointer; padding: 0 3px; font-size: 13px; line-height: 1; }
.notebtn.has { color: var(--blue); }
.notebtn:hover { color: var(--blue-dark); }
.notepop { position: absolute; z-index: 20; width: 300px; background: #fff; border: 1px solid var(--line); border-radius: 6px;
           box-shadow: 0 6px 24px rgba(20, 30, 40, .16); padding: 10px 12px; display: grid; gap: 6px; font-size: 13px; }
.notepop[hidden] { display: none; }
.notepop textarea { width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; resize: vertical; }
.notepop .row { display: flex; gap: 10px; align-items: center; }
.notepop button.primary { padding: 6px 14px; font-size: 13px; }
.bgrid .idr.ends { color: var(--warn); }
.bhead a.setup-link { font-size: 13px; text-decoration: none; }
.bhead a.setup-link:hover { text-decoration: underline; }

/* Tags and the note icon sit at the left edge of a cell so the amounts stay right-aligned. */
.bgrid td.in, .bgrid td.bcell { position: relative; }
.bgrid td:has(.cellmeta:not(:empty)) { padding-left: 58px; }
.bgrid .cellmeta:empty { display: none; }
.bgrid .cellmeta { position: absolute; left: 4px; top: 6px; display: flex; gap: 2px; align-items: center; }
.bgrid .cellmeta .chip.tag { margin: 0; }
a.button.small { padding: 5px 11px; font-size: 12.5px; }
.parts { display: grid; gap: 4px; margin-bottom: 10px; }
.part { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; padding: 5px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; }
.part .pname { font-weight: 600; min-width: 150px; }
.part form { margin: 0; }
.part button.primary, .part button.go { padding: 5px 14px; font-size: 12.5px; }
.part .steps .step { padding: 2px 8px; font-size: 11.5px; }
.partline { margin-bottom: 3px; white-space: nowrap; }
.appfoot { text-align: center; padding: 18px 16px 26px; font-size: 12px; }
.appfoot a { color: var(--dim); text-decoration: none; } .appfoot a:hover { text-decoration: underline; }
.release h2 { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.release ul { margin: 0; padding-left: 20px; } .release li { margin: 4px 0; }
.chip.ptag { background: var(--tint); color: var(--blue-dark); }

/* Clients list: bulk JP/PIC assignment */
.subfilters .sep { border-left: 1px solid var(--line, #dde3e8); }
.bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 0 0 12px; padding: 8px 12px;
           background: var(--tint); border: 1px solid #cfe0f5; border-radius: 3px; font-size: 13px; }
.bulkbar label { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.bulkbar select { width: auto; font-size: 12.5px; padding: 4px 6px; }
table.clients td.tick, table.clients th.tick { width: 28px; padding-right: 0; }

/* Billing grid: "Brand / PT name", and the line-count chip sits with the other cell tags. */
.bgrid .nm .pt { display: block; font-weight: 400; color: var(--dim); font-size: 11.5px; max-width: 240px;
                 overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bgrid .cellmeta .chip.nlines { background: #eceff1; color: var(--ink); cursor: help; }
.bgrid .stick2 { max-width: 270px; }
.bgrid thead th { white-space: normal; }
/* Left-hand tags float in the cell, so the cell widens to fit however many there are. */
.bgrid td:has(.cellmeta:not(:empty)) { padding-left: 6px; }
.bgrid .cellmeta { position: static; float: left; margin: 1px 8px 0 0; }
.bgrid .cellmeta button.chip.nlines { border: 0; font: inherit; font-size: 11px; font-weight: 600; line-height: 1.4;
    background: #e3e8ec; color: var(--ink); padding: 1px 7px; border-radius: 3px; cursor: pointer; }
.bgrid .cellmeta button.chip.nlines:hover { background: #d3dae0; }
.linetip { position: absolute; z-index: 21; width: 360px; background: #fff; border: 1px solid var(--line); border-radius: 6px;
           box-shadow: 0 6px 24px rgba(20, 30, 40, .16); padding: 8px 12px; font-size: 12.5px; }
.linetip[hidden] { display: none; }
.linetip .h { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.linetip .ln { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-top: 1px solid var(--soft, #eef1f4); }
.linetip .ln:first-of-type { border-top: 0; }
.linetip .ln b { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
tfoot tr.total td { border-top: 2px solid var(--line); background: #f6f8fa; }
header .ver { font-size: 11px; font-weight: 600; color: var(--dim); text-decoration: none; background: var(--tint);
              padding: 2px 8px; border-radius: 999px; margin-left: -4px; }
header .ver:hover { color: var(--ink); }

/* Payroll payments */
table.payov td, table.payov th { padding: 7px 10px; white-space: nowrap; }
table.payov tr.on td { background: var(--tint); }
/* The folded payments overview: one compact line per entity. */
details.ovw { padding-top: 10px; padding-bottom: 10px; }
details.ovw[open] summary { margin-bottom: 8px; padding-bottom: 8px; }
table.payov.compact { width: 100%; }
table.payov.compact .stepcol { border-left: 1px solid var(--line); }
.sdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--line); }
.sdot.mid { background: var(--warn); } .sdot.ok { background: var(--green-dark); } .sdot.bad { background: var(--bad); }
td.dl { white-space: nowrap; font-weight: 500; }
details.ovw .legend { margin-top: 6px; font-size: 11.5px; } details.ovw .legend .sdot { margin-left: 10px; }
table.payov.compact td, table.payov.compact th { padding: 4px 10px; font-size: 12.5px; }
table.payov.compact .chip { font-size: 10.5px; }
table.paymatch td { vertical-align: top; }
form.officeform { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
form.officeform input { width: 140px; }
form.officeform input.w-xs { width: 90px; }
form.officeform .hint { flex-basis: 100%; }
pre.payload { max-height: 320px; overflow: auto; font-size: 11.5px; background: var(--head); padding: 8px; border: 1px solid var(--line-soft); }
ul.plist { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; }
button.undo { background: var(--panel); color: var(--bad); border: 1px solid #f2c4c0; padding: 7px 12px; border-radius: var(--radius); cursor: pointer; }
button.undo:hover { background: var(--red-bg); }
.card .actions { display: flex; gap: 14px; align-items: center; margin: 10px 0; }
.card .actions form { margin: 0; }

/* Rupiah figures: tabular digits so columns line up; subtotal rows ruled above. */
td.num, th.num, .kpi .v { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.money tr.strong td { border-top: 1px solid var(--line); font-weight: 700; }
table.money td.num { color: var(--ink); }

/* Two-step payroll */
.stepsep { color: var(--dim); padding: 0 4px; align-self: center; }
table.money tr.sub td { color: var(--dim); font-size: 13px; }
table.money tr.sub td:first-child { padding-left: 26px; }
.pgrid td.in.locked input { background: transparent; color: var(--dim); }
.pgrid .g-bonus { background: #f6f1fb; color: #5b3f86; }
.stagecard h2 .chip { margin-left: 8px; }

/* Invoicing: agree the month's FX rate before editing */
.fxagree { display: flex; align-items: center; gap: 16px; justify-content: space-between; margin: 10px 0;
  padding: 12px 14px; border: 1px solid #e3b341; background: #fff8e1; border-radius: 6px; font-size: 14px; }
.fxagree .rates { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 6px; font-size: 15px; }
.fxagree .warnline { margin-top: 6px; color: #7a4d00; font-size: 13px; }
.fxagreed { margin: 6px 0 10px; font-size: 12px; }
@media (max-width: 640px) { .fxagree { flex-direction: column; align-items: stretch; } }

/* Invoicing grid: foldable row sections and column bands */
.bgrid thead tr.grp th { background: var(--head); color: var(--ink); }
.bgrid thead th.band { border-left: 1px solid var(--line); }
.bandbtn, .secbtn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.bandbtn:focus-visible, .secbtn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }
.bandbtn:hover, .secbtn:hover { color: var(--blue); }
.bgrid .car { display: inline-block; width: 14px; font-size: 13px; line-height: 1; }
.bgrid tr.sechead td { cursor: default; border-top: 2px solid var(--line); }
.bgrid tr.sechead td:not(.stick) { text-align: right; text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.bgrid tbody.folded tr:not(.sechead) { display: none; }
.bgrid.fold-now .b-now, .bgrid.fold-cmp .b-cmp { display: none; }
.blegend .spacer { flex: 1; }

/* Invoicing: what needs action (top), clients left out (panel), Submit confirmation */
.issues:empty { display: none; }
.issues { display: grid; gap: 6px; margin: 8px 0 10px; }
.issue { display: flex; gap: 8px; align-items: baseline; padding: 7px 12px; border-radius: 5px; font-size: 13.5px; }
.issue.bad { background: #fdecea; border: 1px solid #f1aeb5; color: #7a1c1c; }
.issue.warn { background: #fff8e1; border: 1px solid #e3b341; color: #5c3d00; }
.issue .ic { font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.notbilled h2 .count { color: var(--dim); font-weight: 400; }
.nbtable { width: 100%; }
.nbtable td .pt { display: block; color: var(--dim); font-size: 11.5px; }
.nbtable .num { text-align: right; font-variant-numeric: tabular-nums; }
.nbtable .overdue { color: #b42318; }
dialog.leftout { max-width: 560px; width: calc(100% - 32px); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; }
dialog.leftout::backdrop { background: rgba(0,0,0,.35); }
dialog.leftout h3 { margin: 0 0 6px; }
dialog.leftout ul { list-style: none; padding: 0; margin: 10px 0 14px; max-height: 50vh; overflow: auto; }
dialog.leftout li { padding: 6px 0; border-bottom: 1px solid var(--line); }
dialog.leftout li .dim { display: block; margin-left: 24px; font-size: 12.5px; }
dialog.leftout .row { display: flex; gap: 12px; align-items: center; }
dialog.leftout li label { display: grid; grid-template-columns: 20px 1fr; gap: 1px 8px; align-items: start; margin: 0;
  text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; color: var(--ink); cursor: pointer; }
dialog.leftout li input[type=checkbox] { grid-row: span 2; width: 16px; height: 16px; margin: 2px 0 0; }
dialog.leftout li .dim { margin-left: 0; }

/* Per-invoice approval: part counts, the waiting-for-approval panel, row markers, CSV menu. */
.part .pcounts { display: flex; gap: 6px; flex-wrap: wrap; }
.chip.bad { background: var(--red-bg); color: var(--bad); }
.chip.pend { font-size: 11px; }
.chip.rowst { font-size: 11px; font-weight: 600; }
.part button.pfilter { font-family: inherit; border: 0; cursor: pointer; }
.part button.pfilter:hover { outline: 1px solid var(--blue); }
.part button.pfilter.picked { outline: 2px solid var(--blue); outline-offset: 1px; }
.chip.pend-new { background: var(--tint); color: var(--blue-dark); }
.chip.pend-changed { background: var(--amber-bg); color: var(--warn); }
.chip.pend-removed { background: var(--red-bg); color: var(--bad); }
.pendingcard h2 .count { color: var(--dim); font-weight: 400; }
.pendtable { width: 100%; }
.pendtable .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pendtable tr.st-removed td:nth-child(2) a { text-decoration: line-through; }
.pendtable .chg-list { margin: 2px 0 0; padding-left: 16px; color: var(--dim); font-size: 12px; }
.pendtable .returnform { display: flex; gap: 6px; align-items: center; margin: 0; }
.csvmenu { position: relative; }
.csvmenu summary { list-style: none; cursor: pointer; }
.csvmenu summary::-webkit-details-marker { display: none; }
.csvmenu .menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 230px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(0,0,0,.12); display: grid; }
.csvmenu .menu a { padding: 7px 12px; font-size: 13px; }
.csvmenu .menu a:hover { background: var(--head); }
.billhead .chip { margin-left: 6px; }
.billhead form { margin: 0; }
a.chip { text-decoration: none; }
th.c, td.c { text-align: center; }

/* Payroll header: title, tabs and month on one line; entity tabs with the numbered steps beside them. */
.phead { border-bottom: 1px solid var(--line); margin-bottom: 8px; gap: 20px; }
.phead h1 { font-size: 20px; }
.phead .pnav { align-self: flex-end; }
.phead .pnav a { padding: 10px 12px; }
/* Payroll tab groups: HR | Finance | records, each with a small label and a divider. */
.pnav .navgrp { align-self: center; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--dim); padding: 0 4px 0 6px; white-space: nowrap; }
.pnav .navgrp.sep { border-left: 1px solid var(--line); margin-left: 8px; padding-left: 14px; min-height: 18px; }
.ptabs { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.ptabs .filters a { padding: 7px 12px; }
.step .n { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-right: 5px;
           border-radius: 50%; font-size: 9.5px; font-weight: 700; line-height: 1; vertical-align: 1px;
           background: var(--line); color: var(--ink); }
.step.done .n { background: var(--green-dark); color: #fff; }
.step.cur .n { background: #fff; color: var(--blue); }
/* Salary input: column groups open from their header; group totals show the breakdown on hover. */
.gridbar { display: flex; align-items: center; gap: 12px; margin: 4px 0 6px; font-size: 12.5px; }
.pgrid th.gtoggle { cursor: pointer; user-select: none; }
.pgrid th.gtoggle:hover, .pgrid th.gtoggle:focus-visible { text-decoration: underline; outline: none; }
.pgrid .caret { font-size: 10px; }
.pgrid td.sum { cursor: help; }
.pgrid .dflag { display: inline-block; font-size: 9.5px; font-weight: 700; padding: 0 4px; margin-right: 3px; border-radius: 3px;
                background: var(--amber-bg); color: #7a5c07; vertical-align: 1px; }
.count-on { font-weight: 400; opacity: .85; }
.pgrid td.chg-up input { background: #dcf3dc; } .pgrid td.chg-down input { background: #fff1b8; }
.gridbar .blegend { margin: 0; gap: 14px; font-size: 12.5px; }
.pgrid th.sumhead { cursor: help; text-decoration: underline dotted var(--dim); text-underline-offset: 3px; }
.pgrid td.sum, .pgrid tfoot td.sumcol { font-weight: 600; }
.ptip { position: fixed; z-index: 50; min-width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
        box-shadow: 0 6px 18px rgba(0,0,0,.12); padding: 6px 10px; font-size: 12.5px; pointer-events: none; }
.ptip div { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0; }
.ptip div b { font-variant-numeric: tabular-nums; font-weight: 600; }
.ptip div.h { color: var(--dim); border-top: 1px solid var(--line); margin-top: 3px; padding-top: 4px; }
.retbox { position: relative; }
.retbox summary { list-style: none; cursor: pointer; color: var(--blue); font-size: 13px; }
.retbox summary::-webkit-details-marker { display: none; }
.retbox form { position: absolute; right: 0; top: 26px; z-index: 20; width: 320px; display: grid; gap: 8px; padding: 12px;
               background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.pgrid tr.sechead td { background: #eef2f6; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; text-align: left; }
.pgrid tr.sechead td.stick { position: sticky; left: 0; z-index: 1; }
.pgrid tr.subtotal td { background: #f6f8fa; font-weight: 600; border-bottom: 2px solid var(--line); }
.tergrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.tergrid h3 { margin: 0 0 6px; font-size: 13px; }
.tertable td, .tertable th { padding: 2px 8px; font-size: 12px; }

/* Search and sort on tables marked data-tools (base.html). */
.tabletools { display: flex; gap: 10px; align-items: center; margin: 0 0 8px; }
.tabletools input[type=search] { width: 260px; max-width: 100%; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { text-decoration: underline; }
th[data-sort=asc]::after { content: " ▲"; font-size: 10px; }
th[data-sort=desc]::after { content: " ▼"; font-size: 10px; }

/* Payroll: the Adjust box on a salary row (proration, BPJS this month, adjustment note). */
dialog.adjbox { max-width: 560px; width: calc(100% - 32px); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; text-align: left; white-space: normal; }
dialog.adjbox::backdrop { background: rgba(0,0,0,.35); }
dialog.adjbox h3 { margin: 0 0 12px; }
dialog.adjbox .adjgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
dialog.adjbox label { display: block; margin: 0 0 10px; font-weight: 500; }
dialog.adjbox label.check { display: flex; gap: 8px; align-items: baseline; font-weight: 400; }
dialog.adjbox input:not([type=checkbox]) { display: block; width: 100%; margin-top: 4px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; text-align: left; background: #fff; }
dialog.adjbox .row { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
td.rowact { white-space: nowrap; }
@media (max-width: 600px) { dialog.adjbox .adjgrid { grid-template-columns: 1fr; } }

/* Export CSV button on every table (base.html). */
.tabletools .exportbtn { margin-left: auto; padding: 5px 12px; font: inherit; font-size: 12.5px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink, inherit); cursor: pointer; }
.tabletools .exportbtn:hover { background: var(--head); }

/* Invoice list filters. */
.invfilters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin: 0 0 12px; }
.invfilters label { display: grid; gap: 3px; font-size: 12px; color: var(--dim); }
.invfilters select, .invfilters input { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13px; background: #fff; }
.bhead a.setup-link.on { color: var(--ink); font-weight: 600; }

/* Client page: totals above the transactions. */
.txsum { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0 0 10px; }
.txsum > div { display: grid; gap: 2px; }
.txsum .bad { color: var(--bad); }
body.exporting * { text-transform: none !important; }
body.exporting button:not(.secbtn):not(.bandbtn), body.exporting .car, body.exporting .count, body.exporting .cellmeta, body.exporting #grid .chip, body.exporting #grid .idr, body.exporting #grid td a.dim { display: none !important; }
.invtable td:nth-child(-n+2), .invtable td:nth-child(5) { white-space: nowrap; }

/* Entities > Invoicing setup: the invoice profile form. */
form.profile { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
form.profile h3 { margin: 0 0 10px; font-size: 14px; }
form.profile .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 14px; }
form.profile .grid2 .wide { grid-column: 1 / -1; }
table.suggested td { vertical-align: top; }
table.suggested td.pre { white-space: pre-line; max-width: 340px; }
table.suggested tr.differs td { background: var(--amber-bg); }
table.suggested tr.done td { color: var(--dim); }
table.suggested textarea, table.suggested input:not([type=checkbox]) { min-width: 260px; }
form.profile .grid2 div.label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--dim); }
form.profile label.check { align-items: baseline; }

/* Client page: sending an invoice (status, who it went to, Retry, Revise). */
.sendbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 8px; font-size: 13px; }
.sendbar form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.sendbar input[name=note] { width: 260px; }

/* Staff: List | Org chart switch. */
.viewswitch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--panel); }
.viewswitch a { padding: 5px 14px; font-size: 13px; color: var(--navy); text-decoration: none; }
.viewswitch a.on { background: var(--navy); color: #fff; }

/* Org chart (app/orgchart.py; laid out by the script in orgchart.html). Each rank is a horizontal
   stripe; entities, Group support and departments are framed areas; cards have one fixed size. */
.org-lede { margin: 0 0 10px; }
.org-gaps a { color: inherit; font-weight: 600; }
.org-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; font-size: 13px; }
.org-tools button { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px;
                    font: inherit; color: var(--navy); cursor: pointer; }
.org-tools button:hover { border-color: var(--navy); }
.org-tools .count { color: var(--dim); font-size: 11px; }
.org-tools .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }

.org-canvas { position: relative; height: calc(100vh - 250px); min-height: 480px; overflow: hidden; touch-action: none;
              border: 1px solid var(--line); border-radius: var(--radius); cursor: grab; user-select: none; background: #fff; }
.org-canvas.dragging { cursor: grabbing; }
.org-canvas.dragging a, .org-canvas.dragging button { pointer-events: none; }
.org-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.org-svg { position: absolute; left: 0; top: 0; overflow: visible; }
.org-svg .lane { fill: #fff; }
.org-svg .lane.odd { fill: #f6f8fb; }
.org-svg .edge { fill: none; stroke: #b8c2d0; stroke-width: 1.6; }
.org-svg .edge.dotted { stroke: var(--link); stroke-dasharray: 5 4; }
.org-lanes { position: absolute; left: 0; top: 0; bottom: 0; width: 128px; pointer-events: none; z-index: 3;
             background: var(--head); border-right: 1px solid var(--line); overflow: hidden; }
.org-lane-label { position: absolute; left: 12px; right: 10px; transform: translateY(-50%);
                  font: 600 11px/1.3 Inter, sans-serif; text-transform: uppercase; letter-spacing: .05em; color: var(--navy); }

.org-card { position: absolute; display: flex; flex-direction: column; gap: 1px; padding: 8px 11px; overflow: hidden;
            background: var(--panel); border: 1px solid #d5dce6; border-radius: var(--radius);
            text-decoration: none; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 37, 71, .08); }
.org-card:hover { border-color: var(--navy); }
.org-card.partner { border-top: 3px solid var(--red); }
.org-card.gap { border-style: dashed; border-color: var(--warn); background: var(--amber-bg); }
.org-name, .org-title, .org-dotted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-name { font-weight: 600; color: var(--navy); line-height: 1.3; }
.org-title { font-size: 12px; color: var(--dim); }
.org-title strong { color: var(--red); font-weight: 600; }
.org-meta { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--dim); margin-top: 2px; }
.org-meta .chip { font-size: 10px; padding: 1px 7px; }
.org-dotted { margin-top: auto; font-size: 11px; color: var(--link); }

.org-band { position: absolute; background: var(--navy); border-radius: var(--radius); }
.org-band-head { color: #fff; font-size: 12px; font-weight: 600; text-align: center; padding: 7px 12px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-band .org-card { position: absolute; }

.org-frame { position: absolute; border: 1.5px solid #cdd6e3; border-radius: 14px; background: rgba(238, 242, 248, .45); }
.org-frame .org-frame { background: rgba(255, 255, 255, .55); border-style: dashed; }
.org-frame-head { position: absolute; left: 10px; top: 6px; display: flex; gap: 8px; align-items: baseline; max-width: calc(100% - 20px);
                  background: none; border: none; padding: 0; font: 12px Inter, sans-serif; color: var(--navy); cursor: pointer; white-space: nowrap; }
.org-frame-head span { color: var(--dim); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.org-frame-head:hover strong { text-decoration: underline; }
.org-unit-shut { position: absolute; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px;
                 background: var(--navy); color: #fff; border: none; border-radius: var(--radius); font: 13px Inter, sans-serif; cursor: pointer; }
.org-unit-shut span { font-size: 11px; opacity: .8; }

.org-fold { position: absolute; transform: translateX(-50%); z-index: 2; min-width: 22px; height: 20px; padding: 0 7px;
            border-radius: 999px; border: 1px solid #c9d1dd; background: var(--panel); color: var(--navy);
            font-size: 11px; line-height: 18px; cursor: pointer; }
.org-fold:hover { border-color: var(--navy); }

@media print {
  header, .settingsnav, .viewswitch, .headline .btn-link, .org-lede, .org-tools, .org-fold, .org-gaps { display: none !important; }
  body { background: #fff; }
  .org-canvas { border: none; overflow: visible; min-height: 0; }
  .org-card { box-shadow: none; }
}

/* Local-only View as switcher (DEV_LOGIN=1). */
.viewas { display: inline; margin: 0; }
.viewas select { width: auto; font-size: 12px; max-width: 200px; padding: 2px 4px; border: 1px dashed var(--red); border-radius: 4px; background: var(--tint); color: var(--ink); }

/* Invoice lines: each line is a tbody with the main row and a smaller row of its Xero details. */
table.lines { width: 100%; }
table.lines input, table.lines select { width: auto; }
table.lines input.w-xs { width: 52px; } table.lines input.w-s { width: 84px; } table.lines input.w-m { width: 120px; }
table.lines td.desc { width: 100%; } table.lines td.desc input { width: 100%; min-width: 220px; box-sizing: border-box; }
table.lines tbody.line + tbody.line tr:first-child td { border-top: 1px solid #e5e7eb; }
table.lines tr.lineextra td { padding-top: 0; padding-bottom: 10px; border-top: 0; }
table.lines .extras { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
table.lines .extras label { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: 11.5px; color: var(--dim); white-space: nowrap; }
table.lines .extras label[hidden] { display: none; }
table.lines .extras select, table.lines .extras input { font-size: 12px; padding: 3px 6px; }
table.lines td.amt { white-space: nowrap; }
table.lines tbody.lockedline td { background: var(--tint); }

/* Grid side panel: a client's month as invoice cards (billing_run.html, _billing_panel.html). */
#sidepanel-veil { position: fixed; inset: 0; background: rgba(15, 23, 42, .25); z-index: 40; }
#sidepanel { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--bg, #f6f7f9); z-index: 41;
  overflow-y: auto; padding: 18px 20px 40px; box-shadow: -8px 0 24px rgba(15, 23, 42, .15); box-sizing: border-box; }
#sidepanel[hidden], #sidepanel-veil[hidden] { display: none; }
body.panel-open { overflow: hidden; }
#sidepanel .phead { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
#sidepanel .phead h2 { margin: 0; }
#sidepanel .pclose { font-size: 18px; }
.pform .pcard { background: var(--panel, #fff); border: 1px solid #e3e7ed; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.pform .pcard.locked { background: var(--tint); }
.pform .pcard.fresh { border-style: dashed; border-color: var(--red); }
.pform .pcardhead { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pform .pline { border-top: 1px solid #edf0f4; padding: 8px 0; }
.pform .pcardhead + .pline { border-top: 0; }
.pform .pmain { display: flex; align-items: center; gap: 6px; }
.pform .pmain input, .pform .pmain select { width: auto; font-size: 13px; padding: 5px 8px; }
.pform .pmain input[name=description] { flex: 1; min-width: 140px; }
.pform .pqty { width: 56px; } .pform .pprice { width: 120px; }
.pform .pamt { min-width: 110px; text-align: right; white-space: nowrap; }
.pform .prm { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; font-size: 11.5px; white-space: nowrap; }
.pform .prm input { width: auto; }
.pform .pmore { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 6px; }
.pform .pmore label { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: 11.5px; color: var(--dim); white-space: nowrap; }
.pform .pmore label[hidden] { display: none; }
.pform .pmore select, .pform .pmore input { width: auto; font-size: 12px; padding: 3px 6px; }
.pform .padd { margin-top: 4px; }
.pform .pactions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.pform .small { font-size: 12px; }
.pform .ptype { max-width: 170px; }
.pform .pcur { width: 70px; }
.pform label.tick { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; font-size: 12px; color: var(--ink); white-space: nowrap; margin: 0; }
.pform label.tick[hidden] { display: none; }
.pform label.tick input { width: auto; margin: 0; }
.pform .pmorebtn { font-size: 16px; line-height: 1; padding: 0 4px; color: var(--dim); text-decoration: none; }
.pform .pmorebtn.has { color: var(--red); }
.pform .pline.removing .pmain input, .pform .pline.removing .pmain select { text-decoration: line-through; opacity: .5; }
.pform .pmore { padding-left: 4px; }
.cardsbox .pform .pcard { border-color: #e3e7ed; }
#sidepanel { width: min(1140px, 100vw); }


/* Invoice header on the client page: wrap whole items, never words inside them. */
.billhead { flex-wrap: wrap; row-gap: 6px; }
.billhead > a, .billhead > b, .billhead > span, .billhead > form { white-space: nowrap; }
.billhead .chip { margin-left: 0; }
.sendbar:empty { display: none; }
.pform .pmore[hidden] { display: none; }
.pform .pmain .pqty { width: 52px; } .pform .pmain .pprice { width: 110px; } .pform .pmain .ptype { width: 150px; }
.pform .pmain input[name=description] { min-width: 180px; }
.pform .pmain label.tick[data-fxonly][hidden] { display: inline-flex; visibility: hidden; }
.pform .pmain label.tick { min-width: 52px; } .pform .pmain label.tick:first-of-type { min-width: 74px; }
.pform .pamt { min-width: 120px; }
.pform .pmain label.prm { min-width: 0; }

/* Staff record (user_edit.html): stacked cards, one column of sections, fields in a grid inside.
   Styles are scoped to .staff-form; selects drop the native look so they're 40px in Safari too. */
.staff-head { align-items: flex-start; max-width: 880px; }
.staff-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--dim); margin: -6px 0 12px; }
.staff-tags a { color: var(--link); text-decoration: none; }
.staff-form { display: block; min-width: 0; max-width: 880px; }
.staff-form .staff-sec { margin: 0 0 20px; padding: 22px 24px 24px; }
.staff-form .sec-head { margin: 0 0 18px; }
.staff-form .sec-head h2 { margin: 0; font: 600 17px/1.3 var(--display); color: var(--navy); text-transform: none; letter-spacing: 0; }
.staff-form .sec-head p { margin: 4px 0 0; font-size: 13.5px; color: var(--dim); }

.staff-form .formgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.staff-form .formgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.staff-form .status-row { margin-top: 18px; }
.staff-form label, .staff-form .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.staff-form .lbl { font-size: 13px; font-weight: 600; color: var(--ink); }
.staff-form .hint { font-size: 12.5px; line-height: 1.4; font-weight: 400; color: var(--dim); }
.staff-form .desc { min-height: 2.8em; }

.staff-form input:not([type=checkbox]):not([type=radio]), .staff-form select {
  -webkit-appearance: none; appearance: none; width: 100%; height: 40px; margin: 0; padding: 0 12px;
  font: 400 14px/normal Inter, -apple-system, sans-serif; color: var(--ink);
  background-color: #fff; border: 1px solid #b9c3cf; border-radius: 8px; }
.staff-form select { padding-right: 34px; text-overflow: ellipsis; background-repeat: no-repeat;
  background-position: right 12px center; background-size: 12px 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230f2547' stroke-width='1.6'/%3E%3C/svg%3E"); }
.staff-form input:hover, .staff-form select:hover { border-color: #8d99a8; }
.staff-form input:focus, .staff-form select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(15, 37, 71, .18); }
.staff-form :disabled { background-color: #f4f6fa; cursor: not-allowed; }
.staff-form .full input { max-width: 560px; }
.staff-form #emailField { max-width: 420px; }

/* Segmented choice: two radios that read as one control. */
.staff-form .seg { display: inline-flex; flex-wrap: wrap; gap: 4px; align-self: flex-start;
  padding: 4px; border: 1px solid #b9c3cf; border-radius: 10px; background: #f4f6fa; }
.staff-form .seg label { position: relative; display: block; margin: 0; }
.staff-form .seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.staff-form .seg span { display: block; padding: 8px 16px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--navy); white-space: nowrap; }
.staff-form .seg input:checked + span { background: var(--navy); color: #fff; box-shadow: 0 1px 2px rgba(15, 37, 71, .25); }
.staff-form .seg input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }
.staff-form .seg + .login-own, .staff-form .seg + .login-none { margin-top: 18px; }
form.no-login .login-own, form:not(.no-login) .login-none { display: none; }
.staff-form .note { margin: 18px 0 0; padding: 12px 14px; border-radius: 8px; background: #f4f6fa; font-size: 13.5px; color: #4a5868; }

/* Also reports to: removable chips, then an add picker. */
.staff-form .also { display: flex; flex-direction: column; gap: 6px; margin-top: 20px; }
.staff-form .chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.staff-form .pick { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 4px 0 12px;
  border: 1px solid #c9d3e0; border-radius: 999px; background: var(--tint); color: var(--navy); font-size: 14px; font-weight: 500; }
.staff-form .pick small { font-size: 11.5px; font-weight: 600; color: var(--dim); }
.staff-form .pick button { -webkit-appearance: none; appearance: none; width: 26px; height: 26px; padding: 0; border: 0;
  border-radius: 50%; background: transparent; color: var(--dim); font-size: 18px; line-height: 1; cursor: pointer; }
.staff-form .pick button:hover, .staff-form .pick button:focus-visible { background: #dde4ef; color: var(--bad); outline: none; }
.staff-form #alsoAdd { width: auto; min-width: 200px; max-width: 280px; height: 34px; border-style: dashed;
  border-radius: 999px; color: var(--link); font-weight: 500; }

/* Checkboxes with an explanation underneath. */
.staff-form .ticks { display: grid; gap: 14px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.staff-form label.check { display: grid; grid-template-columns: 18px 1fr; column-gap: 10px; align-items: start;
  margin: 0; font-weight: 400; cursor: pointer; }
.staff-form label.check input { width: 18px; height: 18px; margin: 2px 0 0; padding: 0; accent-color: var(--navy); cursor: pointer; }
.staff-form label.check strong { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }

/* Payroll employee: the partner-only fields show when Partner is ticked (payroll_employee_edit.html). */
.staff-form label.check.partner-tick { margin: 0 0 20px; }
.staff-form .partner-only { display: none; }
.staff-form .formgrid.partner-only { margin: 0 0 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line-soft); }
#empForm.is-partner .partner-only { display: grid; }
#empForm.is-partner span.partner-only { display: inline; }
.staff-form .staff-actions { display: flex; gap: 16px; align-items: center; margin: 4px 0 0; }

@media (max-width: 760px) {
  .staff-form .formgrid, .staff-form .formgrid.three { grid-template-columns: 1fr; }
  .staff-form .staff-sec { padding: 18px 16px 20px; }
}
@media (max-width: 640px) {
  .staff-form input:not([type=checkbox]):not([type=radio]), .staff-form select { font-size: 16px; }   /* iOS zooms below 16px */
  .staff-form .full input, .staff-form #emailField { max-width: none; }
  .staff-form #alsoAdd { width: 100%; max-width: none; }
}

/* Line rows on one grid so every card's columns line up. */
.pform .pmain { display: grid; grid-template-columns: minmax(180px, 1fr) 200px 56px 12px 120px 130px 84px 56px 92px 64px; gap: 6px; align-items: center; }
.pform .pmain.multi { grid-template-columns: minmax(180px, 1fr) 200px 56px 12px 120px 70px 130px 84px 56px 92px 64px; }
.pform .pmain > * { min-width: 0; }
.pform .pmain input, .pform .pmain select { width: 100%; box-sizing: border-box; }
.pform .pmain .pqty, .pform .pmain .pprice, .pform .pmain .ptype { width: 100%; max-width: none; }
.pform .pmain .times { text-align: center; }
.pform .pamt { min-width: 0; }
.pform .pmain label.tick { min-width: 0; }
.pform .pacct { font: inherit; font-size: 12px; color: var(--dim); background: none; border: 1px solid #dfe4ea; border-radius: 6px; padding: 4px 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pform .pacct.own { color: var(--red); border-color: var(--red); }
.pform .pacct.open { background: var(--tint); }
.pform .prmbtn { font-size: 12px; color: var(--dim); }
.pform .pline.removing .prmbtn { color: var(--red); font-weight: 600; }
.pform .pline.removing .pmain input, .pform .pline.removing .pmain select, .pform .pline.removing .pamt { text-decoration: line-through; opacity: .45; }
.pform .pmore { background: var(--tint); border-radius: 6px; padding: 6px 8px; margin-top: 6px; }
.pform .pcard .billhead { margin-bottom: 8px; }
.pform .pcard .sendbar { margin: -2px 0 8px; }
.pform .pdropinv { margin-left: 10px; font-size: 12px; }

/* Invoice progress: six dots (Draft → JP review → Approved → In Xero → Sent → Paid) and the current step. */
.iprog { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; white-space: nowrap; }
.iprog i { width: 14px; height: 4px; border-radius: 2px; background: #dfe4ea; }
.iprog i.done { background: #2e9e6a; }
.iprog i.now { background: var(--navy, #1b2b4b); width: 22px; }
.iprog .lbl { margin-left: 5px; font-weight: 600; color: var(--ink); }
.iprog .dim { font-size: 10.5px; }
.iprog em { font-style: normal; font-size: 10.5px; font-weight: 600; color: #a86a00; background: #fff4d6; border-radius: 4px; padding: 1px 5px; margin-left: 3px; }
.iprog.returned i.now { background: var(--red); } .iprog.returned em { color: var(--red); background: #fde8e8; }
.iprog.voided { color: var(--dim); text-decoration: line-through; }

/* Grid: + New invoice / + New client above the table, and each client's Edit button. */
.gridactions { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.gridactions .btn-link.small { font-size: 13px; }
.bgrid .nm a.editbtn, .bgrid .editbtn { float: right; margin: 1px 0 4px 10px; padding: 3px 10px; font-size: 11.5px; font-weight: 600; line-height: 1.3;
  color: #fff; background: var(--navy); border-radius: 999px; text-decoration: none; white-space: nowrap; }
.bgrid .nm a.editbtn:hover { background: var(--red); color: #fff; }
.bgrid .nm a.editbtn.view { color: var(--navy); background: transparent; border: 1px solid #b9c3cf; }
#sidepanel > label { max-width: 480px; }

/* Client record (client_edit.html): the Staff record's cards and fields (.staff-form), plus the email/no-email switch. */
#clientForm:not(.by-email) .by-email-only, #clientForm.by-email .no-email-only { display: none; }
#clientForm textarea { width: 100%; max-width: none; padding: 10px 12px; font: 400 14px/1.4 Inter, -apple-system, sans-serif;
  border: 1px solid #b9c3cf; border-radius: 8px; box-sizing: border-box; }
#clientForm textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(15, 37, 71, .18); }
#clientForm .full { grid-column: 1 / -1; }
.client-below { margin-top: 28px; }


/* Invoicing grid: one slim bar above the table (+ New invoice, + New client, Legend pop-up, Collapse all,
   Export CSV), and slimmer check messages. */
.bgridbar { gap: 10px; margin: 6px 0 8px; min-height: 34px; }
.bgridbar .btn-link.small, .bgridbar .primary.small { padding: 6px 14px; font-size: 13px; }
.bgridbar .dim { font-size: 12.5px; }
.bgridbar .exportbtn { margin-left: 0; }
.legendpop { position: relative; }
.legendpop summary { list-style: none; cursor: pointer; font-size: 12.5px; color: var(--link); padding: 4px 6px; border-radius: 6px; }
.legendpop summary::-webkit-details-marker { display: none; }
.legendpop summary::before { content: "ⓘ "; }
.legendpop[open] summary { background: var(--tint); }
.legendpop .pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 320px; display: grid; gap: 8px;
  padding: 12px 14px; background: var(--panel, #fff); border: 1px solid #dfe4ea; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12); font-size: 12.5px; color: var(--ink); }
.legendpop .sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; border: 1px solid rgba(0,0,0,.12); }
.legendpop .sw-up { background: #dcf3dc; } .legendpop .sw-down { background: #fff1b8; }
.issues { gap: 4px; margin: 6px 0; }
.issue { padding: 4px 10px; font-size: 12.5px; line-height: 1.35; border-radius: 6px; }

/* Waiting for approval: an invoice's lines as rows of the same table, under its row: description under What,
   the line's approved and current amounts under Approved and Now, so they add up to the invoice's totals. */
.pendtable .linestoggle { margin-left: 6px; font-size: 12.5px; }
.pendtable .pdflink { font-size: 12.5px; }
.pendtable tr.pline-row td { padding-top: 5px; padding-bottom: 5px; border-top: 0; font-size: 13px; background: #fafbfc; }
.pendtable tr.pline-row .pl-desc { padding-left: 14px; border-left: 2px solid #dfe4ea; }
.pendtable tr.pline-row .pl-desc .dim { display: block; font-size: 11.5px; }
.pendtable tr.pline-row .pl-amt { color: var(--ink); }
.pendtable tr.pline-row.m-new td { background: #f1faf1; } .pendtable tr.pline-row.m-changed td { background: #fffaeb; }
.pendtable tr.pline-row.m-removed .pl-desc, .pendtable tr.pline-row.m-removed .pl-amt { color: var(--dim); text-decoration: line-through; }
.pendtable tr.pline-row .chip { font-size: 10.5px; }
/* With the lines open, the one-line change summary would repeat them. */
.pendtable tr.lines-open .chg-list { display: none; }

/* Approving: Approve / Return on each waiting invoice, Return all / Approve all on each JP's bar, and the
   box that asks why when returning. */
/* The waiting list fits its card: long emails wrap, the actions stack, and anything still too wide scrolls inside the card. */
.tablewrap { overflow-x: auto; }
.pendtable td.goes { min-width: 255px; max-width: 300px; overflow-wrap: anywhere; }
.pendtable td.rowacts { text-align: right; width: 1%; }
.pendtable td.rowacts form, .pendtable td.rowacts > button { display: block; margin: 0 0 4px auto; white-space: nowrap; }
button.go.small, button.ghostbtn.small, .part button.go.small { padding: 5px 14px; font-size: 12.5px; border-radius: 999px; }
button.ghostbtn { background: transparent; color: var(--navy); border: 1px solid #b9c3cf; cursor: pointer; font-weight: 600; }
button.ghostbtn:hover { border-color: var(--navy); background: var(--tint); }
.part form { margin: 0; }
.part { gap: 8px; }
#returnbox { width: min(460px, 92vw); border: 1px solid #dfe4ea; border-radius: 12px; padding: 20px 22px; box-shadow: 0 16px 40px rgba(15, 23, 42, .2); }
#returnbox::backdrop { background: rgba(15, 23, 42, .3); }
#returnbox h3 { margin: 0 0 14px; font-size: 16px; color: var(--navy); }
#returnbox label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
#returnbox textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; font: 400 14px/1.4 Inter, sans-serif; border: 1px solid #b9c3cf; border-radius: 8px; }
#returnbox .row { display: flex; gap: 12px; align-items: center; margin-top: 16px; }

/* Side panel: client facts under the name, and the Last month / History cards (the panel's card language). */
#sidepanel .pfacts { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 12.5px; color: var(--ink); }
#sidepanel .pfacts b { font-weight: 600; color: var(--dim); margin-right: 3px; }
#sidepanel .pfacts a { color: var(--link); }
#sidepanel .psec { background: var(--panel, #fff); border: 1px solid #e3e7ed; border-radius: 10px; padding: 14px 16px; margin-top: 14px; }
#sidepanel .psec .sec-head { margin: 0 0 10px; }
#sidepanel .psec .sec-head h3 { margin: 0; font: 600 15px/1.3 var(--display); color: var(--navy); }
#sidepanel .psec .sec-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--dim); }
#sidepanel .plist { width: 100%; border-collapse: collapse; font-size: 13px; }
#sidepanel .plist td { padding: 6px 0; border-bottom: 1px solid #edf0f4; vertical-align: top; }
#sidepanel .plist td .dim { display: block; font-size: 11.5px; }
#sidepanel .plist td.num { text-align: right; white-space: nowrap; padding-left: 16px; }
#sidepanel .plist tfoot td { border-bottom: 0; font-weight: 600; }
#sidepanel .phist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
#sidepanel .phist li { display: grid; grid-template-columns: 96px 1fr; gap: 10px; }
#sidepanel .phist .when { color: var(--dim); font-size: 12px; white-space: nowrap; }
#sidepanel .phist .dim { display: block; font-size: 12px; }
#sidepanel .pcard .billhead .dim { font-size: 12px; }
.pform .pactions button:disabled, .pform .pactions button:disabled:hover { opacity: .4; cursor: not-allowed; box-shadow: none; }


/* Header room: the local View as switcher already names who you are, so the name/role label goes; on narrower
   screens the gaps tighten and the "soon" tags drop, so Sign out always fits. */
.topnav:has(.viewas) .who { display: none; }
.viewas select { max-width: 170px; }
@media (max-width: 1440px) {
  .topnav { gap: 14px; }
  .topnav .navsoon .soon { display: none; }
}
@media (max-width: 1200px) { .topnav .navsoon { display: none; } }

/* Confirmation box for data-confirm buttons (base.html): the page stays still. */
.confirmbox { width: min(440px, 92vw); border: 1px solid #dfe4ea; border-radius: 12px; padding: 20px 22px; box-shadow: 0 16px 40px rgba(15, 23, 42, .2); }
.confirmbox::backdrop { background: rgba(15, 23, 42, .3); }
.confirmbox h3 { margin: 0 0 8px; font-size: 16px; color: var(--navy); }
.confirmbox p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.confirmbox .row { display: flex; gap: 12px; align-items: center; margin-top: 18px; }
.confirmbox button.primary.danger { background: var(--bad, #b42318); }
.pagetitle { margin: 4px 0 6px; font: 600 20px/1.3 var(--display); color: var(--navy); text-transform: none; letter-spacing: 0; }

/* Page headline buttons: compact, the secondary one outlined. Export CSV can sit at the end of a filter row. */
.headline .right .btn-link.small { padding: 7px 16px; font-size: 13px; }
.btn-link.ghost { background: transparent; color: var(--navy); border: 1px solid #b9c3cf; }
.btn-link.ghost:hover { border-color: var(--navy); background: var(--tint); color: var(--navy); }
.headline { margin-bottom: 12px; }
.subfilters { align-items: center; }
.subfilters .exportbtn { margin-left: auto; padding: 4px 12px; font: inherit; font-size: 12.5px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); cursor: pointer; }
.org-card.noopen { cursor: default; }

/* Org chart cards: four short lines (name, title, ID, dotted line) always fit the fixed card height. */
.org-card { padding: 7px 11px; gap: 0; }
.org-name { font-size: 13px; line-height: 18px; }
.org-title { line-height: 17px; }
.org-meta { line-height: 16px; margin-top: 1px; }
.org-dotted { line-height: 16px; margin-top: auto; }


/* Payroll grid: Edit / View per employee opens the side panel (_payroll_panel.html), as in Invoicing. */
.pgrid .nm a.editbtn { float: right; margin: 1px 0 4px 10px; padding: 3px 10px; font-size: 11.5px; font-weight: 600; line-height: 1.3;
  color: #fff; background: var(--navy); border-radius: 999px; text-decoration: none; white-space: nowrap; }
.pgrid .nm a.editbtn:hover { background: var(--red); color: #fff; }
.pgrid .nm a.editbtn.view { color: var(--navy); background: transparent; border: 1px solid #b9c3cf; }
#sidepanel.paypanel { width: min(760px, 100vw); }
.paypanel .phead h2 .chip { vertical-align: middle; margin-left: 4px; }
.paypanel .psec h4 { margin: 16px 0 6px; font: 600 13px/1.3 var(--display); color: var(--navy); }
.paypanel .plist th { font-size: 11.5px; font-weight: 600; color: var(--dim); text-align: left; padding: 0 0 4px; border-bottom: 1px solid #e3e7ed; }
.paypanel .plist th.num { text-align: right; padding-left: 16px; }
.paypanel .plist th .dim { display: block; font-weight: 400; }
.paypanel .plist tr.pgroup td { padding-top: 12px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); }
.paypanel .plist tr.sub td { font-weight: 600; border-top: 1px solid #cfd6df; }
.paypanel .pinputs td.num { width: 150px; }
.paypanel .pinputs td.num.dim { width: 120px; }
.paypanel .pinputs input { width: 140px; text-align: right; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; }
.paypanel .pinputs input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(15, 37, 71, .15); }
.paypanel .pinputs td.chg-up input, .paypanel .pinputs td.chg-up:not(:has(input)) { background: #dcf3dc; }
.paypanel .pinputs td.chg-down input, .paypanel .pinputs td.chg-down:not(:has(input)) { background: #fff1b8; }
.paypanel .pmonths td.chg-up { background: #dcf3dc; } .paypanel .pmonths td.chg-down { background: #fff1b8; }
.paypanel td.saving input { opacity: .5; } .paypanel td.saved input { box-shadow: 0 0 0 2px var(--green); } .paypanel td.failed input { box-shadow: 0 0 0 2px var(--bad); }
.paypanel .pbuild { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; align-items: start; }
.paypanel .pscroll { overflow-x: auto; }
.paypanel .pissues { margin: 0 0 10px; padding: 10px 12px 10px 28px; border-radius: 8px; background: #fff4e5; color: #7a4b00; font-size: 13px; }
.paypanel .padjust .adjgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.paypanel .padjust label { display: block; margin: 0 0 10px; font-size: 13px; font-weight: 600; }
.paypanel .padjust label.check { display: flex; gap: 8px; align-items: baseline; font-weight: 400; }
.paypanel .padjust input:not([type=checkbox]) { display: block; width: 100%; margin-top: 4px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; box-sizing: border-box; }
.paypanel .padjust .row { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
@media (max-width: 640px) { .paypanel .pbuild, .paypanel .padjust .adjgrid { grid-template-columns: 1fr; } }
.paypanel .phead h2 { font: 600 20px/1.3 var(--display); text-transform: none; letter-spacing: 0; color: var(--navy); }
.paypanel .plist tr.sub td { font-size: 13px; color: var(--ink); background: transparent; }
.paypanel .pbpjs td { padding: 4px 0; }
#sidepanel.paypanel .pbpjs td.num .dim { display: inline; margin-left: 4px; font-size: 11px; }

/* Payroll: the HR checker's walkthrough (_payroll_review.html) and the rows it lists. */
.card.review { margin: 0 0 14px; padding: 16px 18px; border-left: 4px solid var(--line); }
.card.review.live { border-left-color: var(--warn, #c98a00); }
.card.review.done { border-left-color: var(--green); }
.review .rhead { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.review .rhead h2 { margin: 0; font: 600 17px/1.3 var(--display); color: var(--navy); text-transform: none; letter-spacing: 0; }
.review .rhead h2 .dim { font: 400 13.5px var(--body, inherit); }
.review .rhead p { margin: 4px 0 0; font-size: 13px; max-width: 720px; }
.review .rstat { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; font-size: 13px; }
.review .rcount b { font-size: 16px; }
.review .rfilter { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--dim); cursor: pointer; }
.review .rsecs { display: grid; gap: 6px; margin-top: 12px; }
.review .rsec { border: 1px solid #e3e7ed; border-radius: 8px; background: #fff; }
.review .rsec > summary { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; list-style: none; font-size: 13.5px; }
.review .rsec > summary::-webkit-details-marker { display: none; }
.review .rsec > summary::after { content: '▸'; margin-left: auto; color: var(--dim); }
.review .rsec[open] > summary::after { content: '▾'; }
.review .rmark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 700;
  background: #eef1f5; color: var(--navy); flex: none; }
.review .rsec.ticked .rmark, .review.done.logged .rmark, .review .rsec.empty .rmark { background: #dcf3dc; color: #1f7a1f; }
.review .rsec.empty > summary { color: var(--dim); }
.review .rsec.ticked > summary b { color: var(--dim); }
.review .rhint { margin: 0 12px 8px 44px; font-size: 12.5px; }
.review .ritems { margin: 0 12px 10px 44px; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; }
.review .ritems li { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 8px; border-radius: 6px; }
.review .ritems li.rflag { background: #fff4e5; }
.review .ritems a { color: var(--link); text-decoration: none; font-weight: 600; }
.review .rtick { display: flex; gap: 8px; align-items: center; margin: 0 12px 12px 44px; padding: 8px 12px; border-radius: 8px;
  background: #f4f6fa; font-size: 13px; font-weight: 600; cursor: pointer; width: fit-content; }
.review .rtick input { width: 18px; height: 18px; accent-color: var(--navy); }
.pgrid .chip.review { background: #fff4e5; color: #7a4b00; }
.pgrid.review-only tbody tr[data-code]:not([data-review]) { display: none; }
@media (max-width: 640px) { .review .rstat { align-items: flex-start; } .review .rhint, .review .ritems, .review .rtick { margin-left: 12px; } }
.review label.rtick, .review label.rfilter { flex-direction: row; }
.review .rtick input, .review .rfilter input { display: inline-block; margin: 0; flex: none; }
.review label.rtick { color: var(--ink); }
.review .rfilter { white-space: nowrap; }
.review .ritems li.rflag, .review .ritems li.rflag span { color: #6b4300; }
.review .rhead > div:first-child { flex: 1 1 380px; }
.review .rhead > .spacer { display: none; }
.review .rstat { flex: 0 0 auto; }
.review .rfilter input, .review .rtick input { width: 16px; height: 16px; padding: 0; }
/* Payroll: Return to HR asks why in a centred box (as Invoicing's #returnbox). */
dialog.returnbox { width: min(460px, 92vw); border: 1px solid #dfe4ea; border-radius: 12px; padding: 20px 22px; box-shadow: 0 16px 40px rgba(15, 23, 42, .2); text-align: left; white-space: normal; }
dialog.returnbox::backdrop { background: rgba(15, 23, 42, .3); }
dialog.returnbox h3 { margin: 0 0 8px; font-size: 16px; color: var(--navy); }
dialog.returnbox p { margin: 0 0 14px; font-size: 13px; }
dialog.returnbox label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
dialog.returnbox textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; font: 400 14px/1.4 Inter, sans-serif; border: 1px solid #b9c3cf; border-radius: 8px; }
dialog.returnbox .row { display: flex; gap: 12px; align-items: center; margin-top: 16px; }
button.btn-outline { padding: 8px 16px; border: 1px solid #b9c3cf; border-radius: 999px; background: #fff; color: var(--navy); font-weight: 600; font-size: 13.5px; }
button.btn-outline:hover { border-color: var(--bad); color: var(--bad); }

/* Payroll: company cost per person vs last month, for the approver (_payroll_costcmp.html). */
.card.costcmp { margin: 0 0 14px; padding: 16px 18px; border-left: 4px solid var(--navy); }
.costcmp .rhead { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.costcmp .rhead > div:first-child { flex: 1 1 380px; }
.costcmp h2 { margin: 0; font: 600 17px/1.3 var(--display); color: var(--navy); text-transform: none; letter-spacing: 0; }
.costcmp .rhead p { margin: 4px 0 0; font-size: 13px; max-width: 720px; }
.costcmp .ccsum { display: flex; gap: 22px; flex-wrap: wrap; }
.costcmp .ccsum div { display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; }
.costcmp .ccsum b { font-size: 17px; color: var(--ink); white-space: nowrap; }
.costcmp .ccsum .up b, .costcmp td.up { color: #a33a00; } .costcmp .ccsum .down b, .costcmp td.down { color: #1f7a1f; }
.costcmp .cctable { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.costcmp .cctable th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--dim); padding: 6px 10px; border-bottom: 1px solid #e3e7ed; }
.costcmp .cctable td { padding: 7px 10px; border-bottom: 1px solid #eef1f5; vertical-align: top; }
.costcmp .cctable .num { text-align: right; white-space: nowrap; }
.costcmp .cctable small { font-size: 11px; opacity: .8; }
.costcmp .cctable a { color: var(--link); text-decoration: none; font-weight: 600; }
.costcmp .cctable td.why { color: var(--dim); font-size: 12.5px; }
.costcmp .cctable tr.same td { color: var(--dim); }
.costcmp .cctable tr.left td { background: #fff4e5; }
.costcmp .cctable tfoot td { font-weight: 600; border-top: 1px solid #cfd6df; border-bottom: 0; }
.costcmp.hide-same tr.same { display: none; }
.costcmp #cc-same { margin-top: 8px; }
.costcmp .cctable td:first-child { min-width: 190px; }
.costcmp .cctable td.why { min-width: 220px; }
.costcmp .cctable tr.ccsec td { padding-top: 14px; font-weight: 600; color: var(--navy); background: #f6f8fb; border-bottom: 1px solid #e3e7ed; }
.costcmp .cctable tr.ccsec td .dim { font-weight: 400; }
.costcmp .cctable .chip { font-size: 10px; vertical-align: middle; }

/* Payment files / Pay bills (2026-10-04): a one-line Xero status per step and simple tables. */
.xline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; margin: 10px 0 4px; }
.xline form { margin: 0; }
.xline.ok::before { content: "✓"; color: var(--green-dark); font-weight: 800; }
.xline.bad { color: var(--bad); } .xline.bad::before { content: "✕"; font-weight: 800; }
table.pfiles td, table.paymatch td { vertical-align: top; }
tr.dimrow td { color: var(--dim); font-size: 12.5px; }
details.more > summary { cursor: pointer; color: var(--blue); font-size: 13px; margin-top: 8px; }
details.more[open] > summary { margin-bottom: 8px; }
.xline.wait::before { content: "…"; color: var(--warn); font-weight: 800; }
.hrdone { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-top: 10px; font-size: 13px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; background: var(--amber-bg); }
.hrdone.ok { background: var(--green-bg); }
.hrdone form { margin: 0; }
.hrform { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.hrform label { display: flex; align-items: center; gap: 6px; }
.hrform input:not([type=checkbox]) { width: 200px; }
.bid { font-size: 12.5px; }
/* HR's "payments loaded" flag in the step bar: amber while it's HR's turn. */
.step.pay.cur { background: var(--amber-bg); color: #7a5c07; border-color: #ecd9a0; font-weight: 600; }
.step.pay.cur .n { background: none; color: inherit; }
.step.pay .n { font-size: 11px; }
.hrform label.tick { flex-direction: row; font-weight: 500; }
.hrform label:not(.tick) { flex-direction: column; align-items: flex-start; gap: 2px; font-size: 12px; color: var(--dim); }
/* Payroll step bar: one row per flow (1 Salary, 2 Bonus & PPh 21); each pill says who does it, the row ends with whose turn it is. */
.flow { flex-basis: 100%; display: grid; gap: 4px; margin: 2px 0 8px; }
.flowrow { display: flex; align-items: center; flex-wrap: wrap; gap: 0; font-size: 12px; }
.flowrow.idle { opacity: .55; }
.flowtag { display: inline-flex; align-items: baseline; gap: 6px; min-width: 210px; padding: 4px 10px; margin-right: 8px;
           background: var(--blue); color: #fff; border-radius: 3px; font-weight: 600; }
.flowtag b { font-size: 11px; background: #fff; color: var(--blue); border-radius: 50%; width: 16px; height: 16px;
             display: inline-flex; align-items: center; justify-content: center; align-self: center; }
.flowtag small { font-weight: 400; opacity: .75; font-size: 11px; }
.flowrow.idle .flowtag { background: var(--dim); }
.flowrow.idle .flowtag b { color: var(--dim); }
.fstep { padding: 4px 10px; color: var(--dim); border: 1px solid var(--line); background: var(--panel); border-radius: 3px; white-space: nowrap; }
.fstep em { font-style: normal; font-weight: 700; }
.fstep .n { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-right: 5px;
            border-radius: 50%; font-size: 9.5px; font-weight: 700; background: var(--line); color: var(--ink); vertical-align: 1px; }
.fstep.done { color: var(--green-dark); background: var(--green-bg); border-color: #cfe6d6; }
.fstep.done .n { background: var(--green-dark); color: #fff; }
.fstep.cur { color: #fff; background: var(--blue); border-color: var(--blue); font-weight: 600; box-shadow: 0 0 0 2px rgba(15, 37, 71, .18); }
.fstep.cur .n { background: #fff; color: var(--blue); }
.fstep.pay.cur { background: var(--amber-bg); color: #7a5c07; border-color: #ecd9a0; box-shadow: 0 0 0 2px #f4e7bf; }
.fstep.pay.cur .n { background: #7a5c07; color: #fff; }
.fsep { color: var(--dim); padding: 0 5px; }
.fnow { margin-left: 10px; padding: 3px 9px; border-radius: 10px; font-weight: 700; font-size: 11.5px; background: var(--blue); color: #fff; }
.fnow.ok { background: var(--green-bg); color: var(--green-dark); }
.fnow.wait { background: none; color: var(--dim); font-weight: 400; font-style: italic; }
/* Payroll header: entity tabs (with whose turn it is) above the step bar, then the page tabs. */
.phead .setup a { padding: 6px 10px; font-size: 13px; }
.entbar { border-bottom: 1px solid var(--line); margin-bottom: 8px; flex-wrap: wrap; }
.entbar a { padding: 7px 12px; }
.entbar .who { font-size: 10.5px; color: var(--dim); border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; margin-left: 2px; }
.entbar .yourturn { font-size: 10.5px; font-weight: 700; color: #fff; background: var(--blue); border-radius: 8px; padding: 1px 7px; margin-left: 2px; }
.pnav.pages { border-bottom: 1px solid var(--line); margin: 2px 0 12px; }
.pnav.pages a { padding: 8px 12px; }
.fnow.you { background: var(--amber-bg); color: #7a5c07; border: 1px solid #ecd9a0; }
details.banner.fold > summary { cursor: pointer; font-weight: 600; }
details.banner.fold[open] > summary { margin-bottom: 6px; }
button.go.slim { padding: 5px 14px; font-size: 12.5px; white-space: nowrap; }   /* Pay bills: Mark paid on one line */
/* Salary report, one entity: months side by side, sized to the numbers instead of the page. */
table.money.fitw { width: auto; min-width: 640px; }
table.money.fitw td.num, table.money.fitw th.num { min-width: 130px; }
table.money td.num.up { color: var(--green-dark); } table.money td.num.down { color: var(--warn); }   /* same colours as the salary input legend */
.rsplit { display: grid; grid-template-columns: auto minmax(360px, 1fr); gap: 28px; align-items: start; }
@media (max-width: 1100px) { .rsplit { grid-template-columns: 1fr; } }
table.money.movers { width: 100%; }
/* Step 2 for the JP: bonus & pay card; the company cost card folds below it. */
.costcmp.hide-same tbody.quiet tr.ccsec { display: none; }
details.ccfold { margin: -4px 0 14px; }
details.ccfold > summary { cursor: pointer; padding: 8px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; font-size: 13px; color: var(--dim); }
details.ccfold > summary b { color: var(--ink); }
details.ccfold[open] > summary { margin-bottom: 8px; }
.chip.ctype.ic { background: #efe8f7; color: #5b3f86; }

/* Invoicing flow bar (v0.28.0): payroll's step pills, with a count per step; a step with invoices filters the grid. */
.bflow { margin: 4px 0 10px; }
.bflow button.fstep { font: inherit; cursor: pointer; }
.bflow button.fstep:hover { border-color: var(--blue); }
.bflow .fstep.picked { outline: 2px solid var(--blue); outline-offset: 1px; }
.bflow .fcount { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: rgba(15, 37, 71, .1);
  font-weight: 700; text-align: center; }
.bflow .fstep.cur .fcount { background: rgba(255, 255, 255, .25); }
.bflow .fwho.you { background: var(--amber-bg); color: #7a5c07; border-radius: 8px; padding: 0 6px; }
.bflow .fshowall { margin-left: 10px; font-size: 12px; }
tr.stage-out { display: none; }
.pendingcard, #grid { scroll-margin-top: 140px; }
.bflow.filtering { position: sticky; top: 60px; z-index: 25; background: var(--bg); padding: 6px 0; box-shadow: 0 4px 6px -6px rgba(15, 37, 71, .35); }
.pills a .turn { font-size: 10.5px; font-weight: 600; margin-left: 4px; opacity: .8; }
.pills a .yourturn { font-size: 10.5px; font-weight: 700; color: #fff; background: var(--blue); border-radius: 8px; padding: 1px 7px; margin-left: 4px; }

/* Clients / Staff export & import (table_import.html) */
.importhow { margin: 8px 0 14px; padding-left: 20px; color: var(--dim); }
.importhow li { margin: 3px 0; }
.importreview td { vertical-align: top; }
.importdiff, .importerr { margin: 0; padding: 0; list-style: none; }
.importdiff li, .importerr li { margin: 1px 0; }
.importdiff .old { color: var(--dim); text-decoration: line-through; }
.importerr li { color: var(--warn); }
.importfile input[type=file] { flex: 0 1 420px; }
.importfile button { white-space: nowrap; }

/* Invoice emails (v0.30.0): the results box after approval, the Approve-all summary, the card's Email box, the Sent tab */
.sendbox { padding: 12px 16px; margin: 10px 0; }
.sendbox.bad { border-color: #f2c4c0; }
.sendbar { height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; margin: 8px 0; }
.sendbar i { display: block; height: 100%; width: 0; background: var(--green); transition: width .25s; }
.sendrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 4px 0; font-size: 13px; }
.sendrow form { margin-left: auto; }
dialog.approvesum .sumrow { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
dialog.approvesum .sumrow .n { font: 600 20px var(--display); min-width: 28px; color: var(--navy); line-height: 1.1; }
dialog.approvesum .sumrow.bad, dialog.approvesum .sumrow.bad .n { color: var(--bad); }
dialog.approvesum .sumrow ul { margin: 3px 0 0; padding-left: 16px; max-height: 30vh; overflow: auto; color: var(--dim); font-size: 12.5px; list-style: disc; }
dialog.approvesum .sumrow li { padding: 0; border: none; }
td.goes { font-size: 12.5px; max-width: 260px; }
.emailstrip { background: var(--head); border-top: 1px solid var(--line); padding: 10px 12px 12px; border-radius: 0 0 var(--radius) var(--radius); }
.emailstrip h3 { margin: 0 0 6px; font: 600 12px Inter, sans-serif; letter-spacing: .05em; text-transform: uppercase; color: var(--navy); display: flex; gap: 8px; align-items: center; }
.emailstrip h3 a { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: auto; }
.emailstrip .kv { display: grid; grid-template-columns: 62px 1fr; gap: 4px 10px; font-size: 12.5px; align-items: baseline; }
.emailstrip .kv > b { color: var(--dim); font-weight: 500; }
.emailstrip .who { display: inline-flex; gap: 4px; margin: 0 6px 2px 0; }
.emailstrip .who small { color: var(--dim); font-size: 11px; }
.emailstrip .att { display: inline-block; font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; background: #fff; margin-right: 4px; }
.emailstrip .mprev { margin-top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; color: var(--dim); max-height: 76px; overflow: hidden; white-space: pre-line; }
.emailstrip .personal { display: block; margin-top: 8px; font-size: 12px; color: var(--dim); }
.emailstrip .personal input { width: 100%; margin-top: 3px; }
.emailstrip .warns { margin-top: 8px; display: grid; gap: 4px; }
.emailstrip .warns div { font-size: 12.5px; background: var(--amber-bg); color: #7a5c07; border-radius: 6px; padding: 5px 9px; }
.chip.warn { background: var(--amber-bg); color: var(--warn); }
.sentfilters { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.sentfilters a { padding: 5px 11px; font-size: 12.5px; color: var(--dim); text-decoration: none; }
.sentfilters a.on { background: var(--tint); color: var(--navy); font-weight: 600; }
iframe.mailview { width: 100%; min-height: 70vh; border: 1px solid var(--line); border-radius: var(--radius); background: #eef1f5; }
.phchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.phchips button { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--tint); border: 1px solid transparent; color: var(--navy); }
dl.maildl { display: grid; grid-template-columns: 80px 1fr; gap: 4px 12px; font-size: 13px; margin: 0 0 14px; }
dl.maildl dt { color: var(--dim); } dl.maildl dd { margin: 0; }
pre.mailtext { white-space: pre-wrap; font: 12.5px/1.5 ui-monospace, Menlo, monospace; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.emailtpl { margin: 14px 0; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.emailtpl h3 { margin: 0 0 4px; font-size: 14px; }
.emailtpl .tplgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.emailtpl .tplgrid label { display: block; margin-bottom: 10px; }
.emailtpl .tplgrid textarea, .emailtpl .tplgrid input { width: 100%; }
.emailtpl .tplprev .row { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.emailtpl .tplsubj { font-weight: 600; margin-bottom: 6px; }
.emailtpl iframe.mailview { min-height: 520px; }
@media (max-width: 900px) { .emailtpl .tplgrid { grid-template-columns: 1fr; } }
.kvx { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; font-size: 13.5px; align-items: baseline; }
