:root {
  --bg: #f5f6f8; --panel: #fff; --text: #16191f; --muted: #667085; --line: #e4e7ec;
  --accent: #1f4e79; --accent-soft: #e8f0f8; --ok: #067647; --ok-soft: #ecfdf3;
  --warn: #b54708; --warn-soft: #fffaeb; --err: #b42318; --err-soft: #fef3f2;
  --radius: 10px; --side: 232px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; color: var(--text); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; margin: 0 0 1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: .95rem; margin: 1.25rem 0 .5rem; }
code { background: #f2f4f7; padding: 1px 5px; border-radius: 4px; font-size: .85em; }
.muted { color: var(--muted); } .small { font-size: .82rem; } .nowrap { white-space: nowrap; }
.r { text-align: right; } .c { text-align: center; }
[hidden] { display: none !important; }

.shell { display: flex; min-height: 100vh; background: linear-gradient(to right, #101828 var(--side), var(--bg) var(--side)); }
.sidebar { width: var(--side); background: #101828; color: #d0d5dd; padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.1rem; padding: 4px 10px 18px; }
.brand.big { color: var(--text); font-size: 1.4rem; padding: 0 0 8px; }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #2e90fa, #1f4e79); color: #fff; font-weight: 800; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.sidebar nav a { color: #d0d5dd; padding: 8px 10px; border-radius: 7px; }
.sidebar nav a:hover { background: #1d2939; text-decoration: none; color: #fff; }
.sidebar nav a.on { background: #1d2939; color: #fff; font-weight: 600; }
.navlabel { text-transform: uppercase; font-size: .7rem; letter-spacing: .08em; color: #667085; padding: 14px 10px 4px; }
.content { flex: 1; padding: 28px 32px 60px; max-width: 1280px; min-width: 0; }
.bare { min-height: 100vh; display: grid; place-items: center; padding: 16px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.card.narrow { max-width: 520px; }
.login { width: 100%; max-width: 420px; padding: 36px 32px 28px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: var(--text); }
.auth-brand .logo { width: 48px; height: 48px; border-radius: 12px; font-size: 1.5rem; }
.auth-intro { text-align: center; margin: 28px 0 24px; }
.auth-intro h1 { font-size: 1.5rem; margin: 0 0 8px; }
.auth-intro p { margin: 0; color: var(--muted); line-height: 1.5; }
.auth-email { display: flex; flex-direction: column; gap: 2px; align-items: center; padding: 10px 12px; margin-bottom: 14px; border-radius: 8px; background: #f9fafb; border: 1px solid var(--line); }
.auth-foot { text-align: center; color: var(--muted); font-size: .82rem; margin: 18px 0 0; }
.button.google { width: 100%; justify-content: center; gap: 10px; margin: 6px 0 4px; }
.or { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; color: var(--muted); font-size: .8rem; } .or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.head h1 { margin-bottom: .3rem; } .head p { margin-top: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid2.wide-left { grid-template-columns: 2fr 1fr; }
.grid2 > .card { margin-bottom: 0; } .grid2 { margin-bottom: 18px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--muted); font-size: .85rem; }
.tile span { display: block; font-size: 1.6rem; font-weight: 700; color: var(--text); }
a.tile:hover { border-color: var(--accent); text-decoration: none; }
.tile.accent span { color: var(--accent); } .tile.warn span { color: var(--warn); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 8px 8px; border-bottom: 1px solid var(--line); }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
table.dense td { padding: 6px 8px; }
tr.dim td { color: #98a2b3; }
tfoot td { border: 0; padding: 6px 8px; } tfoot tr.total td { font-weight: 700; font-size: 1.05rem; }
table.lines td:first-child { width: 55%; } table.lines textarea { min-height: 0; } input.num { width: 90px; text-align: right; }
ul.plain { list-style: none; padding: 0; margin: 0; } ul.plain li { padding: 4px 0; }

label { display: block; font-size: .85rem; font-weight: 600; color: #344054; margin-bottom: 12px; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; font: inherit; font-size: .92rem; color: var(--text); background: #fff; border: 1px solid #d0d5dd; border-radius: 8px; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b2ccff; border-color: #84adff; }
textarea { resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: #f9fafb; color: #475467; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.cols.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 12px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; margin: 0; }
label.check.top { margin-top: 28px; }
.logo-field { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 4px; }
.logo-field > div:last-child { flex: 1; }
.logo-preview { width: 200px; height: 84px; border: 1px dashed #d0d5dd; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 8px; background: #fff; flex: none; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
form.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
form.inline input, form.inline select, form.inline textarea { width: auto; margin: 0; flex: 1 1 160px; }
form.inline input.short { flex: 0 1 130px; }
form.add { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select { width: auto; margin: 0; }

button, .button { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .9rem; font-weight: 600; padding: 8px 14px; border-radius: 8px; border: 1px solid #d0d5dd; background: #fff; color: #344054; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: #f9fafb; text-decoration: none; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover { background: #173b5c; }
.danger { color: var(--err); border-color: #fda29b; } .danger:hover { background: var(--err-soft); }
button.small, .button.small { padding: 4px 10px; font-size: .8rem; }
button.big { padding: 12px 20px; font-size: 1rem; margin-top: 14px; }
button.wide, .button.wide { width: 100%; justify-content: center; }
button.link { border: 0; background: none; padding: 0; color: #98a2b3; font-weight: 500; font-size: .85rem; }
button.link:hover { color: #fff; background: none; text-decoration: underline; }
.card button.link { color: var(--muted); } .card button.link:hover { color: var(--text); }
.content > form > button.danger { margin-bottom: 18px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; font-size: .9rem; }
.flash.ok { background: var(--ok-soft); border-color: #abefc6; color: var(--ok); }
.flash.warn { background: var(--warn-soft); border-color: #fedf89; color: var(--warn); }
.flash.error { background: var(--err-soft); border-color: #fecdca; color: var(--err); }
.pill, .badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #f2f4f7; color: #344054; white-space: nowrap; }
.pill.draft { background: var(--accent-soft); color: var(--accent); }
.pill.sent, .pill.imported { background: var(--ok-soft); color: var(--ok); }
.pill.void, .pill.error, .pill.dismissed { background: var(--err-soft); color: var(--err); }
.pill.pending, .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.connected { background: var(--ok-soft); color: var(--ok); }
.pill.broken { background: var(--err-soft); color: var(--err); }
.pill.paid { background: var(--ok); color: #fff; }
table.statements td, table.statements th { padding-left: 4px; padding-right: 4px; }
a.stmt { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); text-decoration: none; }
td.in { color: var(--ok); font-weight: 600; } .overdue { color: var(--err); font-weight: 600; }
.badge { background: var(--accent-soft); color: var(--accent); }

.file { padding: 14px 18px; } .filehead { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.file form.inline { margin-bottom: 6px; }
.mail { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.mailhead { background: #f9fafb; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: .88rem; display: grid; gap: 4px; }
.mailhead .subject { font-weight: 700; font-size: 1rem; }
.mailbody { padding: 16px; white-space: pre-wrap; line-height: 1.55; font-size: .93rem; }
.attachments { padding: 0 16px 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.attach { background: #f2f4f7; border-radius: 6px; padding: 4px 10px; font-size: .82rem; }
/* Send to CPA */
.ziptree { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; }
.zipname { font-weight: 600; margin-bottom: 6px; }
.folder { margin: 8px 0 4px 10px; }
.foldername { font-weight: 600; margin-bottom: 4px; }
.account { margin: 0 0 8px 22px; display: grid; gap: 4px; }
.monthchips { display: flex; flex-wrap: wrap; gap: 2px; }
.chip { display: inline-block; min-width: 30px; text-align: center; font-size: .72rem; padding: 2px 4px; border-radius: 5px; background: #f2f4f7; color: #98a2b3; }
.chip.have { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.chip.have:hover { text-decoration: none; background: #d1fadf; }
.chip.missing { background: var(--err-soft); color: var(--err); font-weight: 600; }
.field-help { margin: -6px 0 10px; }
.flash.reminder { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.flash.reminder .actions a { font-weight: 600; }
.flash.reminder button.link { color: inherit; text-decoration: underline; background: none; border: 0; padding: 0; font-weight: 600; }
.reminder-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; }
.reminder-row:last-child { border-bottom: 0; }
.reminder-row label { margin: 0; font-size: .82rem; }
.reminder-row label.grow { flex: 1; min-width: 180px; }
.reminder-row label.check { padding-bottom: 8px; }
.reminder-row select, .reminder-row input { margin: 4px 0 0; width: auto; flex: none; }
.reminder-row label.grow input { width: 100%; }
.reminder-row .pill { margin-bottom: 10px; }
.reminder-row button { margin-bottom: 2px; }
.pair { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
input.tiny { width: 64px !important; }
.reminder-row strong.grow { flex: 1; min-width: 200px; padding-bottom: 8px; }
.reminder-row strong.grow .muted { font-weight: 400; }
.reminder-history { margin: 6px 0 0; padding-left: 1.1rem; }
details summary { cursor: pointer; }
details.card summary { list-style: none; } details.card[open] summary { margin-bottom: 10px; }
details > summary { font-size: .85rem; margin-bottom: 10px; }
code.insert { cursor: pointer; } code.insert:hover { background: var(--accent-soft); }
.pdf iframe { width: 100%; height: 900px; border: 0; }

/* Top bar: search, settings, notifications, account menu */
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin: -8px 0 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.topbar .ico { flex: none; }
.search { position: relative; flex: 0 1 340px; margin: 0; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #98a2b3; pointer-events: none; }
.search input { margin: 0; height: 40px; padding: 8px 34px 8px 38px; border-radius: 10px; background: #fff; }
.search .hint { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 600 .72rem/1 ui-monospace, monospace; color: #98a2b3; border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; }
.search input:focus + .hint, .search input:not(:placeholder-shown) ~ .hint { display: none; }
.iconbtn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #475467; cursor: pointer; list-style: none; }
.iconbtn:hover, .menu[open] > .iconbtn, .iconbtn.on { border-color: #84adff; color: var(--accent); text-decoration: none; }
.iconbtn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: #f04438; box-shadow: 0 0 0 2px #fff; }
.menu { position: relative; }
.menu > summary { list-style: none; } .menu > summary::-webkit-details-marker { display: none; }
.avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, #2e90fa, #1f4e79); color: #fff; font-weight: 700; font-size: .9rem; cursor: pointer; letter-spacing: .02em; }
.menu[open] > .avatar, .avatar:hover { box-shadow: 0 0 0 3px #b2ccff; }
.dropdown { position: absolute; right: 0; top: calc(100% + 10px); z-index: 20; min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(16, 24, 40, .12); padding: 8px; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: #475467; font: inherit; font-weight: 500; font-size: .95rem; text-align: left; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: #f2f4f7; color: var(--text); text-decoration: none; }
.dropdown form { margin: 0; }
.dropdown .who { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.dropdown .who .badge { align-self: flex-start; margin-top: 4px; }
.dropdown.notices { min-width: 280px; } .dropdown.notices p { margin: 8px 12px; }
.dropdown.notices a { display: block; }
ul.results li { padding: 6px 0; border-bottom: 1px solid var(--line); } ul.results li:last-child { border: 0; }
.prose ul { padding-left: 1.2rem; line-height: 1.6; }

/* Time off */
.cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.calhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.calhead h2 { margin: 0; }
.calhead .filters { margin: 0; align-items: center; }
.calwrap { overflow-x: auto; }
table.cal { table-layout: fixed; min-width: 860px; }
table.cal th, table.cal td { padding: 0; text-align: center; border-bottom: 1px solid var(--line); }
table.cal th { font-size: .72rem; letter-spacing: 0; padding: 4px 0 6px; color: #475467; }
table.cal th span { display: block; font-size: .62rem; color: #98a2b3; font-weight: 500; }
table.cal th.who, table.cal td.who { width: 160px; text-align: left; padding: 8px 8px 8px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .88rem; }
table.cal th.r, table.cal td.r { width: 52px; text-align: right; padding-right: 4px; font-size: .85rem; }
table.cal td { height: 34px; border-left: 1px solid #f2f4f7; vertical-align: middle; }
table.cal .we { background: #f6f7f9; }
table.cal th.today { color: var(--accent); }
table.cal th.today::after { content: ""; display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); margin: 2px auto 0; }
table.cal td.today { box-shadow: inset 0 0 0 1px #b2ccff; }
table.cal td.off { background: #2e90fa; border-left-color: #2e90fa; }
table.cal td.off.we { background: #84c5ff; border-left-color: #84c5ff; }
.legend { margin: 10px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); }
.legend .sw.off { background: #2e90fa; border-color: #2e90fa; } .legend .sw.we { background: #f6f7f9; margin-left: 10px; }

@media (max-width: 900px) {
  .topbar { margin-top: 0; }
  .search { flex: 1 1 auto; }
  .shell { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .navlabel { display: none; }
  .content { padding: 18px 16px 40px; }
  .grid2, .grid2.wide-left, .cols, .cols.four, .cols.three { grid-template-columns: 1fr; }
  .tiles.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table { display: block; overflow-x: auto; }
  table.cal { display: table; }
}

@media (max-width: 900px) { .shell { background: var(--bg); } }

/* Dashboards: charts, legends and bar lists */
:root { --series-1: #2a78d6; --series-2: #eb6834; --series-muted: #c5ccd6; }
.charthead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.charthead h2 { margin: 0; }
.legend { display: flex; gap: 16px; list-style: none; margin: 0; padding: 0; font-size: .82rem; color: var(--muted); flex-wrap: wrap; }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.legend i.marker { height: 0; width: 16px; border-top: 2px dashed #475467; border-radius: 0; }
i.series-1, .fill.series-1 { background: var(--series-1); } i.series-2 { background: var(--series-2); }
i.series-muted, .fill.series-muted { background: var(--series-muted); }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
svg.chart .grid { stroke: #eef0f3; stroke-width: 1; } svg.chart .grid.base { stroke: #d0d5dd; }
svg.chart .tick { fill: var(--muted); font-size: 12px; } svg.chart .tick.ref { font-size: 11px; }
svg.chart .series-1 { fill: var(--series-1); } svg.chart .series-2 { fill: var(--series-2); } svg.chart .series-muted { fill: var(--series-muted); }
/* Spending categories: fixed slots 3-8 of the same validated palette (a category keeps its color). */
:root { --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948; }
i.series-3, .fill.series-3, svg.chart .series-3 { background: var(--series-3); fill: var(--series-3); }
i.series-4, .fill.series-4, svg.chart .series-4 { background: var(--series-4); fill: var(--series-4); }
i.series-5, .fill.series-5, svg.chart .series-5 { background: var(--series-5); fill: var(--series-5); }
i.series-6, .fill.series-6, svg.chart .series-6 { background: var(--series-6); fill: var(--series-6); }
i.series-7, .fill.series-7, svg.chart .series-7 { background: var(--series-7); fill: var(--series-7); }
i.series-8, .fill.series-8, svg.chart .series-8 { background: var(--series-8); fill: var(--series-8); }
.fill.series-2 { background: var(--series-2); }
ol.advice { margin: 0; padding-left: 1.2rem; display: grid; gap: 14px; }
ol.advice li strong { display: block; } ol.advice p { margin: 4px 0 0; line-height: 1.5; }
.saving { font-weight: 600; color: var(--ok); white-space: nowrap; }
form.inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
form.inline select { margin: 0; padding: 4px 6px; font-size: .82rem; width: auto; }
form.inline button { padding: 4px 8px; font-size: .78rem; }
pre.payload { max-height: 320px; overflow: auto; background: #f9fafb; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: .75rem; }
svg.chart .marker { stroke: #475467; stroke-width: 2; stroke-dasharray: 4 3; }
svg.chart .series-line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; }
svg.chart .dot { fill: var(--series-1); stroke: #fff; stroke-width: 2; }
svg.chart .hit { fill: transparent; }
svg.chart .col:hover .hit { fill: rgba(16, 24, 40, .04); }
ul.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.barlabel { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; margin-bottom: 4px; }
.barlabel span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track { display: flex; gap: 2px; height: 10px; background: #f2f4f7; border-radius: 99px; overflow: hidden; }
.track .fill { height: 100%; } .track .fill:first-child { border-radius: 99px 0 0 99px; }
.tile .small { font-size: .8rem; margin-top: 4px; color: var(--muted); }
.tiles.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tiles.six .tile span { font-size: 1.35rem; }
.tile .delta { font-style: normal; font-weight: 600; }
.delta { font-weight: 600; } .delta.up { color: var(--ok); } .delta.down { color: var(--err); }
details.explain summary { font-size: .9rem; font-weight: 600; margin: 0; } details.explain ul { margin: 10px 0 0; padding-left: 1.2rem; line-height: 1.6; }
label.payout { margin-top: 14px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 8px 14px; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
tr.group td { background: #f9fafb; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: 6px; padding-bottom: 6px; }

/* App settings */
.settings { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-tabs { display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; position: sticky; top: 16px; }
.settings-tabs a { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: 7px; color: var(--text); }
.settings-tabs a:hover { background: #f9fafb; text-decoration: none; }
.settings-tabs a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.settings-tabs .state { font-size: .74rem; font-weight: 500; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.settings-tabs .state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #d0d5dd; }
.settings-tabs .state.ok::before { background: #17b26a; } .settings-tabs .state.warn::before { background: #f79009; }
.settings-body { max-width: 720px; }
.setting { margin-bottom: 4px; }
.setting .hint { margin: -6px 0 12px; }
.setting label.check.small { margin: -4px 0 12px; font-size: .8rem; color: var(--muted); }
.setting.locked input, .setting.locked select { background: #f9fafb; color: var(--muted); }
ol.steps { margin: 0 0 12px; padding-left: 20px; line-height: 1.6; } ol.steps li { margin-bottom: 4px; }
ol.steps code { word-break: break-all; }
@media (max-width: 900px) { .settings { grid-template-columns: 1fr; } .settings-tabs { position: static; } }
details.setup-google { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 4px 0 6px; }
details.setup-google > summary { font-weight: 600; margin: 0; } details.setup-google[open] > summary { margin-bottom: 8px; }
details.setup-google code { word-break: break-all; }

/* two-factor sign-in */
.qr { margin: 10px 0 6px; }
.qr svg { width: 180px; height: 180px; display: block; background: #fff; padding: 6px; border-radius: 6px; border: 1px solid var(--line, #e4e7ec); }
pre.recovery-codes { font-size: 1rem; line-height: 1.7; background: #f2f4f7; padding: 12px 16px; border-radius: 6px; columns: 2; }

/* audit log */
.audit-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.audit-filters label { margin: 0; }
.audit-changes { font-size: .8rem; margin: 4px 0 0; }
.audit-changes td { padding: 2px 8px 2px 0; border: 0; }

/* Exports */
fieldset.exports { margin: 6px 0 14px; }
fieldset.exports legend { font-weight: 600; margin-bottom: 8px; }
fieldset.exports label.check { align-items: flex-start; margin-bottom: 8px; }
fieldset.exports label.check input { margin-top: 4px; }
.cpa-exports { display: flex; gap: 8px; flex-wrap: wrap; }
.pill.appr-approved { background: var(--ok-soft); color: var(--ok); }
.pill.appr-pending { background: var(--warn-soft); color: var(--warn); }
.pill.appr-rejected { background: var(--err-soft); color: var(--err); }
.pill.appr-draft { background: var(--accent-soft); color: var(--accent); }
.approval { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.approval form.inline { display: flex; margin: 0; flex: 1 1 360px; justify-content: flex-end; }

/* Expense receipts */
figure.receipt { margin: 0 0 16px; }
figure.receipt img { display: block; max-width: 100%; max-height: 640px; border: 1px solid var(--line); border-radius: 8px; }
figure.receipt iframe { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 8px; }
figure.receipt figcaption { margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
h2.inline { display: inline; }
@media (max-width: 900px) { figure.receipt iframe { height: 420px; } }
/* client portal */
.portal-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.portal-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); }
.portal-brand:hover { text-decoration: none; }
.portal-who { display: flex; align-items: center; gap: 12px; text-align: right; }
.portal-who > span { display: flex; flex-direction: column; }
.portal-who form { margin: 0; }
.portal-main { max-width: 1000px; margin: 0 auto; padding: 24px 16px 48px; }
.portal-invoice-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.portal-invoice-head h1 { margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.portal-invoice-head p { margin: 0; }
form.inline { display: inline; margin: 0 0 0 8px; }
.pre-line { white-space: pre-line; }
@media (max-width: 700px) {
  .portal-top { padding: 10px 16px; }
  .portal-who .muted { display: none; }
  .portal-table thead { display: none; }
  .portal-table tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .portal-table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 0; text-align: right; }
  .portal-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .8rem; text-align: left; }
  .portal-table tfoot td[colspan] { display: none; }
}
.tiles.compact span { font-size: 1.3rem; white-space: nowrap; }
