:root {
    --navy: #0b1220; --ink: #1c2430; --muted: #5c6878; --line: #dfe4ea; --bg: #f3f6f9; --card: #ffffff;
    --accent: #0f7c89; --accent-dark: #0b5f69; --green: #1f8a4c; --red: #b3261e; --amber: #8a5a00;
    --radius: 10px;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.5; }
a { color: var(--accent-dark); }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
.muted, .hint { color: var(--muted); }
.hint { display: block; font-size: .85rem; font-weight: 400; margin-top: 2px; }

.devbar { background: #fff4d6; color: var(--amber); padding: 6px 16px; font-size: .85rem; text-align: center; }
/* ---------- app shell: sidebar + top bar ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 232px; flex: none; background: linear-gradient(180deg, #0c5565 0%, #0a4250 100%); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: hidden; }
.brand { flex: none; display: block; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.55rem; letter-spacing: .02em; padding: 22px 22px 18px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand b { font-weight: 700; }
.brand .mark { width: 34px; height: auto; flex: none; }
.brand span { color: #8fe3c6; font-weight: 500; }
.brand.dark { color: var(--navy); padding: 28px 0 0; justify-content: center; }
.brand.dark span { color: var(--accent); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 18px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.35) transparent; }
.nav a { display: flex; align-items: center; gap: 14px; color: #d7eef2; text-decoration: none; padding: 13px 22px; font-weight: 600; border-left: 4px solid transparent; }
.nav a svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.on { background: rgba(255,255,255,.16); color: #fff; border-left-color: #f2b84b; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; min-height: 64px; }
.top .co { font-weight: 700; font-size: 1.05rem; color: var(--accent-dark); }
.who { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.who form { margin: 0; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; box-sizing: border-box; border-radius: 50%; background: #e8f4f6; border: 2px solid var(--accent); color: var(--accent-dark); font-weight: 700; text-decoration: none; font-size: .8rem; }
.linkbtn { background: none; border: 0; color: var(--accent-dark); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; cursor: pointer; padding: 2px; margin-left: 6px; border-radius: 50%; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover .avatar, .usermenu[open] .avatar { background: #d3ebef; }
.usermenu .uname { font-weight: 600; color: var(--ink); }
.usermenu .caret { width: 10px; height: 6px; fill: var(--muted); }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(16,40,60,.16); padding: 6px 0; z-index: 20; }
.menuhead { padding: 10px 16px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.menuhead span { color: var(--muted); font-size: .85rem; }
.usermenu .menu a, .usermenu .menu button { display: block; width: 100%; text-align: left; padding: 9px 16px; color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: #eef3f6; }
.usermenu .menu form { margin: 4px 0 0; border-top: 1px solid var(--line); padding-top: 4px; }
.page { max-width: 1240px; width: 100%; margin: 0 auto; padding: 26px 28px 40px; flex: 1; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 20px; }
.plainwrap { min-height: 100vh; display: flex; flex-direction: column; }
.plainwrap .page { max-width: 560px; }
.pagehead { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.pagehead h1 { margin: 0; }

/* ---------- dashboard ---------- */
.tiles.three { grid-template-columns: repeat(3, 1fr); }
.dashgrid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.dashgrid .card, .balances .card { margin: 0; }
.balances { margin-top: 16px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid-l { stroke: #e3e8ee; stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.bar.inc, .sw.inc { fill: #0f8fa3; background: #0f8fa3; }
.bar.exp, .sw.exp { fill: #f08a7a; background: #f08a7a; }
.legend { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-left: 8px; }
.hbars { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.hbars li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; }
.hb-name { font-size: .85rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-val { font-size: .85rem; font-variant-numeric: tabular-nums; color: var(--muted); grid-row: 1; grid-column: 2; }
.hb { grid-column: 1 / -1; width: 100%; height: 8px; }
.hb-track { fill: #eef2f6; } .hb-fill { fill: #f08a7a; }
.rows { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 10px 0 0; }
.rows dt { color: var(--muted); } .rows dd { margin: 0; font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }

.notice { padding: 10px 14px; border-radius: var(--radius); margin: 12px 0; border: 1px solid; }
.notice ul { margin: 6px 0 0 18px; padding: 0; }
.notice.ok { background: #e8f6ee; border-color: #b6e0c7; color: #145a33; }
.notice.bad { background: #fdeceb; border-color: #f2bdb9; color: #7a1913; }
.notice.info { background: #e9f3f5; border-color: #bcd9de; color: #0b4a53; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 16px 0; box-shadow: 0 1px 3px rgba(16,40,60,.06); }
.cardhead, .titlebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.titlebar { margin-bottom: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.titlebar .actions { margin-top: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.linkcard { text-decoration: none; color: var(--ink); display: block; }
.linkcard:hover { border-color: var(--accent); }
.linkcard p { margin: 0; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 16px 0; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; box-shadow: 0 1px 3px rgba(16,40,60,.06); }
.tile span { display: block; color: var(--ink); font-size: 1.05rem; font-weight: 600; }
.tile strong { font-size: 1.9rem; font-variant-numeric: tabular-nums; }
.tile.pos strong { color: var(--green); }
.tile.neg strong { color: var(--red); }

.btn { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 6px; text-decoration: none; cursor: pointer; font: inherit; line-height: 1.2; }
.btn:hover { border-color: var(--accent); }
.btn.primary { font-weight: 600; background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }

table.grid { width: 100%; border-collapse: collapse; background: var(--card); }
.card table.grid { margin-top: 4px; }
.grid th, .grid td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.grid th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f6f9fb; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid .code { width: 80px; white-space: nowrap; color: var(--muted); }
.grid tr.off td { color: #8a94a3; }
.grid tfoot td { font-weight: 700; background: #fafbfc; }
.report .sect td { font-weight: 700; background: #eef2f6; }
.report .sub td { font-weight: 600; border-top: 1px solid #c5ccd6; }
.tag { display: inline-block; font-size: .72rem; padding: 1px 7px; border-radius: 10px; background: #e7ebf0; color: var(--muted); margin-left: 6px; }

.filters { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin: 12px 0 16px; }
.filters label, .formrow label { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); gap: 3px; }
.formrow { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.formrow .grow { flex: 1; min-width: 220px; }
input, select { font: inherit; padding: 7px 9px; border: 1px solid #c5ccd6; border-radius: 6px; background: #fff; color: var(--ink); max-width: 100%; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lines input, .lines select { width: 100%; }
.lines .amt { text-align: right; min-width: 110px; }
.balance { font-weight: 600; }
.balance[data-state="ok"] { color: var(--green); }
.balance[data-state="bad"] { color: var(--red); }
.balance[data-state="empty"] { color: var(--muted); font-weight: 400; }

.authbox, .formbox { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; max-width: 460px; }
.authbox { margin: 40px auto; }
.formbox { margin-top: 12px; }
.formbox.wide { max-width: 820px; }
.formbox .formrow label { font-weight: 600; color: var(--ink); }
.formbox h2 { margin-top: 18px; }
.stub { max-width: 720px; }
.stubhead { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
input.amt { width: 100%; min-width: 80px; text-align: right; }
.authbox label, .formbox label { display: block; font-weight: 600; margin: 12px 0; }
.authbox input, .formbox input:not([type=checkbox]), .formbox select { display: block; width: 100%; margin-top: 4px; font-weight: 400; }
.formbox textarea { display: block; width: 100%; margin-top: 4px; font-weight: 400; font-family: inherit; font-size: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; box-sizing: border-box; resize: vertical; }
label.check { display: flex; align-items: baseline; gap: 8px; }
.field-error, .errors { color: var(--red); font-size: .85rem; font-weight: 400; display: block; }
.errors ul { margin: 0 0 8px 18px; padding: 0; }
.empty { color: var(--muted); padding: 20px; text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 12px; color: var(--muted); }
.facts { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; margin: 0 0 12px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.inline { display: inline-flex; gap: 10px; align-items: end; margin: 0; flex-wrap: wrap; }
.inline label { font-size: .85rem; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 10px 0 14px; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.steps li { margin: 6px 0; }

.menubtn { display: none; background: none; border: 0; padding: 8px; margin-left: -8px; border-radius: 8px; cursor: pointer; color: var(--accent-dark); }
.menubtn svg { width: 26px; height: 26px; fill: currentColor; display: block; }
.menubtn:hover { background: #eef3f6; }
.scrim { display: none; }
@media (max-width: 980px) {
    .dashgrid { grid-template-columns: 1fr; }
    .shell { display: block; }
    .menubtn { display: inline-flex; }
    .top { gap: 10px; }
    .top .co { flex: 1; }
    /* the menu slides in from the left over the page */
    .side { position: fixed; top: 0; left: 0; bottom: 0; width: 260px; max-width: 84vw; height: auto; z-index: 40; transform: translateX(-102%); transition: transform .2s ease; overflow: hidden; box-shadow: none; }
    body.nav-open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
    body.nav-open { overflow: hidden; }
    body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(10,20,30,.45); z-index: 30; }
    .main { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
@media (max-width: 720px) {
    .tiles.three { grid-template-columns: 1fr; }
    .top { padding: 0 14px; }
    .page { padding: 16px 12px 32px; }
    .grid { font-size: .9rem; }
    .lines thead { display: none; }
    .facts { grid-template-columns: 1fr; }
}
@media print {
    .top, .side, .foot, .filters, .actions, .devbar, .notice.info, .titlebar .actions { display: none !important; }
    body { background: #fff; }
    .page { padding: 0; max-width: none; }
}

.tag.low, .tag.bad { background: #fdeceb; color: var(--red); }
.tag.warn { background: #fff3d6; color: #8a5a00; }

/* ---------- top bar buttons: search, notifications, help, account ---------- */
.tb { position: relative; }
.iconbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: none; color: #5c6878; cursor: pointer; padding: 0; text-decoration: none; }
.iconbtn:hover, .iconbtn[aria-expanded="true"] { background: #eef3f6; color: var(--accent-dark); }
.iconbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.badge { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; box-sizing: border-box; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: .68rem; font-weight: 700; text-align: center; border: 2px solid #fff; line-height: 13px; }
.badge[hidden] { display: none; }
.poppanel { position: absolute; right: 0; top: calc(100% + 8px); width: 380px; max-width: 92vw; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(16,40,60,.16); z-index: 30; padding: 14px; border: 2px solid #5d5d5d; }
.poppanel::before { content: ""; position: absolute; right: 14px; top: -8px; width: 14px; height: 14px; background: #fff; border-left: 2px solid #4d4d4d; border-top: 2px solid #4d4d4d; transform: rotate(45deg); border-radius: 3px 0 0 0; }
.poppanel[hidden] { display: none; }
.searchpanel form { display: flex; gap: 8px; }
.searchpanel input { flex: 1; min-width: 0; }
.searchpanel .hint { margin: 8px 0 0; font-size: .8rem; }
.bellpanel { padding: 0; width: 400px; }
.pophead { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.notices { max-height: 70vh; overflow: auto; }
.notices .pad { padding: 18px 16px; margin: 0; }
.notice-item { display: block; padding: 11px 16px 11px 34px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; position: relative; }
.notice-item:last-child { border-bottom: 0; }
.notice-item:hover { background: #eef3f6; }
.notice-item::before { content: ""; position: absolute; left: 16px; top: 17px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.notice-item.warn::before { background: var(--red); }
.notice-item strong { display: block; font-size: .92rem; }
.notice-item span { display: block; font-size: .82rem; color: var(--muted); }
.hits { list-style: none; margin: 0; padding: 0; }
.hits li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.hits li:last-child { border-bottom: 0; }
.filters .grow { flex: 1; min-width: 220px; }
.filters .grow input { width: 100%; box-sizing: border-box; }
.helpgrid { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.helptoc { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 2px; }
.helptoc h2 { margin: 0 0 6px; font-size: 1rem; }
.helptoc a { padding: 5px 0; text-decoration: none; }
.helpgrid section[id] { scroll-margin-top: 12px; }
kbd { border: 1px solid #c5ccd6; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: #f6f9fb; font: inherit; font-size: .85em; }
@media (max-width: 880px) { .helpgrid { grid-template-columns: 1fr; } .helptoc { position: static; } }
@media (max-width: 600px) {
    .top { padding: 0 10px; }
    .top .co { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
    .iconbtn { width: 34px; height: 34px; }
    .tb { position: static; }
    .poppanel, .bellpanel { position: fixed; left: 8px; right: 8px; top: 66px; width: auto; max-width: none; }
}
@media print { .tb, .iconbtn { display: none !important; } }

/* ---------- free trial bar ---------- */
.trialbar { background: #e8f4f6; color: var(--accent-dark); border-bottom: 1px solid var(--line); padding: 7px 28px; font-size: .88rem; }
.trialbar.soon { background: #fdeceb; color: var(--red); }
.trialbar a { color: inherit; font-weight: 600; }
@media (max-width: 600px) { .trialbar { padding: 7px 14px; } }
@media print { .trialbar { display: none !important; } }

/* ---------- plans ---------- */
.plans-title { margin-top: 28px; }
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.plan { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 20px; display: flex; flex-direction: column; }
.plan h3 { margin: 0 0 6px; font-size: 1.05rem; letter-spacing: .02em; }
.plan .price { margin: 0; } .plan .price strong { font-size: 1.9rem; }
.plan p.muted { margin: 2px 0 12px; font-size: .85rem; }
.plan ul { margin: 0 0 16px; padding-left: 18px; flex: 1; font-size: .9rem; }
.plan li { margin: 5px 0; }
.plan.popular { border-color: var(--accent); box-shadow: 0 2px 10px rgba(15,124,137,.18); }
.plan.current { border: 2px solid var(--green); }
.plan .here { margin: 0; font-weight: 700; color: var(--green); }
.plan .btn { text-align: center; }
.ribbon { position: absolute; top: -11px; left: 18px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; padding: 2px 10px; border-radius: 10px; letter-spacing: .04em; text-transform: uppercase; }
@media (max-width: 1100px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .plans { grid-template-columns: 1fr; } }
.nav a .tag { margin-left: auto; background: rgba(255,255,255,.18); color: #fff; font-size: .62rem; padding: 0 6px; letter-spacing: .03em; }

/* ---------- bank balance check ---------- */
.recon .rows { margin: 8px 0; }
.recon.ok { border-color: var(--green); }
.recon.bad { border-color: var(--red); }
.recon [data-state="ok"] { color: var(--green); font-weight: 700; }
.recon [data-state="bad"] { color: var(--red); font-weight: 700; }

/* ---------- platform admin ---------- */
.adminforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 20px; }
.adminforms h3 { margin: 0 0 10px; font-size: 1rem; }
.adminforms .formrow { align-items: flex-end; }
a.tile { text-decoration: none; color: inherit; }

/* paying by card */
.payform { margin: 0 0 8px; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.payform .btn { width: 100%; }
.payform .fine { font-size: .78rem; margin: 0 0 2px; }
.keepform{margin-top:.5rem}

.rowicons{white-space:nowrap;text-align:right}
.iconbtn{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;margin-left:.25rem;border:1px solid var(--line,#d8dee4);border-radius:8px;background:#fff;color:#334155;text-decoration:none}
.iconbtn:hover,.iconbtn:focus-visible{background:#f1f5f9;border-color:#94a3b8}
.iconbtn.danger{color:#b42318;border-color:#f0c4c0}
.iconbtn.danger:hover,.iconbtn.danger:focus-visible{background:#fdecea;border-color:#b42318}

/* plan page: Monthly / Yearly switch (radio buttons, no script) */
.billing-plans .vh { position: absolute; opacity: 0; width: 1px; height: 1px; }
.billtoggle { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 20px; }
.billtoggle .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--card); padding: 3px; }
.billtoggle label { padding: 7px 24px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--muted); margin: 0; }
#bill-month:checked ~ .billtoggle label[for="bill-month"], #bill-year:checked ~ .billtoggle label[for="bill-year"] { background: var(--accent); color: #fff; }
#bill-month:focus-visible ~ .billtoggle label[for="bill-month"], #bill-year:focus-visible ~ .billtoggle label[for="bill-year"] { outline: 2px solid var(--ink); outline-offset: 2px; }
.savehint { color: var(--green); font-weight: 700; }
#bill-month:checked ~ .plans .only-year, #bill-year:checked ~ .plans .only-month { display: none; }
.plan .per { color: var(--muted); font-size: .9rem; }

/* public invoice page */
.paypage { max-width: 760px; margin: 24px auto; padding: 0 16px; }
.paypage h1 .muted { font-size: 1rem; font-weight: 400; }
.paypage .big { font-size: 1.05rem; padding: 12px 22px; }
.payinstr { white-space: pre-line; }

/* short screens: tighter menu so every item fits, and the menu scrolls if it still does not */
@media (max-height: 900px) { .nav a { padding-top: 9px; padding-bottom: 9px; } }
@media (max-height: 700px) { .nav a { padding-top: 6px; padding-bottom: 6px; } .brand { padding-top: 14px; padding-bottom: 10px; } }

/* receipts and documents */
.attach { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.attach li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.attach-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.attach-thumb { width: 56px; height: 56px; object-fit: cover; border: 1px solid #d5dbe3; border-radius: 6px; background: #fff; }
.attach-pdf { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border: 1px solid #d5dbe3; border-radius: 6px; background: #fdecec; color: #b42318; font-weight: 700; font-size: 13px; }
.attach-name { word-break: break-all; }
.attach-form { margin-top: 8px; }

/* Budgets */
.budget-scroll { overflow-x: auto; margin-bottom: 12px; }
table.budget input.cell { width: 6.2em; text-align: right; padding: 4px 6px; }
table.budget th, table.budget td { white-space: nowrap; }
table.budget td:first-child { min-width: 14em; }
table.budget tr.sect td:first-child { min-width: 0; }
.num.neg { color: #b42318; }
tr.flag-over td, tr.flag-under td { background: #fff8f1; }
.filters label:has(input[size="4"]) { display: inline-flex; align-items: center; gap: 6px; flex-direction: row; }
.filters input[size="4"] { width: 5em; display: inline-block; }

/* Dashboard alerts */
.card.alerts { margin-bottom: 16px; }
.alerts h2 { margin: 0 0 8px; font-size: 1rem; }
.alerts ul { list-style: none; margin: 0; padding: 0; }
.alerts li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line, #e4e9ef); }
.alerts li:first-child { border-top: 0; }
.alerts li > div { flex: 1; }
.alerts .dot { width: 10px; height: 10px; border-radius: 50%; background: #1f7a8c; flex: none; }
.alerts li.warn .dot { background: #d9822b; }

[data-fx-row][hidden] { display: none; }
.fxnote { font-size: .85rem; color: var(--muted, #5b6472); min-height: 1.2em; }
.feedrow { align-items: center; }
.inlinelabel { display: inline-flex; gap: .4rem; align-items: center; margin-right: .5rem; }

.langform { display: inline; margin-left: .75rem; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }

.rulebox { display: block; font-size: .8rem; color: var(--muted, #5b6b78); margin-top: 4px; font-weight: 400; }
.rulebox input { width: auto; margin-right: 4px; }

.qrbox { margin: 10px 0; padding: 8px; background: #fff; border: 1px solid var(--line, #d7e0e6); border-radius: 8px; display: inline-block; line-height: 0; }
.secretkey { font-size: 1.05rem; letter-spacing: .08em; word-break: break-all; }
.backupcodes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; max-width: 360px; }
.backupcodes code { font-size: 1.15rem; letter-spacing: .06em; }
ol.steps > li { margin-bottom: 14px; }
@media print { .backupcodes { grid-template-columns: 1fr; } }

/* ---- design pass 1: grouped menu, even control heights, spacing ---- */
.nav .navhead { display: block; margin: 14px 22px 4px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.14); color: #8fc3cc; font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.nav a + .navhead { margin-top: 10px; }
.nav a { padding-top: 10px; padding-bottom: 10px; }
.nav a.on { box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
@media (max-height: 900px) { .nav a { padding-top: 7px; padding-bottom: 7px; } .nav .navhead { margin-top: 8px; padding-top: 8px; } }
@media (max-height: 700px) { .nav a { padding-top: 5px; padding-bottom: 5px; } }
input:not([type=checkbox]):not([type=radio]), select, .btn:not(.small) { min-height: 38px; box-sizing: border-box; }
.btn { display: inline-flex; align-items: center; justify-content: center; }
.formrow, .filters { align-items: flex-end; }
table.grid + .hint, .card > .hint:last-child, .card .grid + .hint { margin-top: 12px; padding-top: 4px; }
.tile.neg { border-left: 4px solid var(--red); }
.tile.pos { border-left: 4px solid var(--green); }


/* =====================================================================
   Design pass 2: one icon set, pill buttons, inset inputs, icon tiles,
   user menu and bell, paper-style invoice form, script callouts
   ===================================================================== */
@font-face { font-family: "Caveat"; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/caveat-700.woff2) format("woff2"); }
:root {
  --radius: 14px; --ink-dark: #0b2a36; --pill-shadow: 0 2px 5px rgba(11,42,54,.18);
  --inset: inset 0 1px 3px rgba(11,42,54,.22);
  --tone-teal: #0f7c89; --tone-teal-bg: #e3f2f4; --tone-green: #1f8a4c; --tone-green-bg: #e4f5ec;
  --tone-amber: #a86a00; --tone-amber-bg: #fff1d2; --tone-red: #b3261e; --tone-red-bg: #fdeceb;
  --tone-blue: #2a5fc1; --tone-blue-bg: #e6eefc; --tone-violet: #6a4bc2; --tone-violet-bg: #eee9fb;
--i-money: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%229%22/%3E%3Cpath d=%22M14.5 9.2c-.4-1-1.4-1.5-2.6-1.5-1.5 0-2.5.8-2.5 1.9 0 2.7 5.2 1.3 5.2 4 0 1.2-1.1 2-2.7 2-1.3 0-2.3-.6-2.7-1.7M12 6.2v1.5M12 16.3v1.5%22/%3E%3C/svg%3E");
--i-clock: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%229%22/%3E%3Cpath d=%22M12 7v5l3.5 2%22/%3E%3C/svg%3E");
--i-doc: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M7 3h7l5 5v13H7z%22/%3E%3Cpath d=%22M14 3v5h5M10 13h6M10 17h6%22/%3E%3C/svg%3E");
--i-alert: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 3.5 22 20H2z%22/%3E%3Cpath d=%22M12 10v4.5M12 17.5h.01%22/%3E%3C/svg%3E");
--i-box: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3.5 7.5 12 3l8.5 4.5v9L12 21l-8.5-4.5z%22/%3E%3Cpath d=%22M3.5 7.5 12 12l8.5-4.5M12 12v9%22/%3E%3C/svg%3E");
--i-people: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%229%22 cy=%228%22 r=%223.5%22/%3E%3Cpath d=%22M2.5 20c0-3.6 2.9-6 6.5-6s6.5 2.4 6.5 6%22/%3E%3Cpath d=%22M16 4.7a3.5 3.5 0 0 1 0 6.6M18 14.3c2.2.8 3.5 2.7 3.5 5.7%22/%3E%3C/svg%3E");
--i-up: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 17l6-6 4 4 8-8%22/%3E%3Cpath d=%22M15 7h6v6%22/%3E%3C/svg%3E");
--i-down: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 7l6 6 4-4 8 8%22/%3E%3Cpath d=%22M15 17h6v-6%22/%3E%3C/svg%3E");
--i-bank: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 9.5 12 4l9 5.5M5 10v8M9.5 10v8M14.5 10v8M19 10v8M3 20h18%22/%3E%3C/svg%3E");
--i-check: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%229%22/%3E%3Cpath d=%22m8 12.5 3 3 5-6%22/%3E%3C/svg%3E");
--i-user: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%228%22 r=%224%22/%3E%3Cpath d=%22M4.5 20.5c0-4 3.4-6.5 7.5-6.5s7.5 2.5 7.5 6.5%22/%3E%3C/svg%3E");
--i-lock: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%225%22 y=%2210.5%22 width=%2214%22 height=%2210%22 rx=%222%22/%3E%3Cpath d=%22M8 10.5V8a4 4 0 0 1 8 0v2.5M12 15v2%22/%3E%3C/svg%3E");
--i-gear: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%223%22/%3E%3Cpath d=%22M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z%22/%3E%3C/svg%3E");
--i-star: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z%22/%3E%3C/svg%3E");
--i-bolt: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M13 2.5 5 13.5h6l-1 8 8-11h-6z%22/%3E%3C/svg%3E");
--i-out: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M9 4H5a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h4M16 8l4 4-4 4M20 12H9%22/%3E%3C/svg%3E");
--i-shield: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 3 4.5 6v6c0 4.5 3.2 7.7 7.5 9 4.3-1.3 7.5-4.5 7.5-9V6z%22/%3E%3Cpath d=%22m9 12 2 2 4-4%22/%3E%3C/svg%3E");
--i-card: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%223%22 y=%225.5%22 width=%2218%22 height=%2213%22 rx=%222.5%22/%3E%3Cpath d=%22M3 10h18M7 15h3%22/%3E%3C/svg%3E");
--i-bell: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M6 17V11a6 6 0 0 1 12 0v6l1.5 2h-15zM10 21h4%22/%3E%3C/svg%3E");
--i-repeat: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 11V9a3 3 0 0 1 3-3h12l-3-3M20 13v2a3 3 0 0 1-3 3H5l3 3%22/%3E%3C/svg%3E");
--i-chev: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22m9 5 7 7-7 7%22/%3E%3C/svg%3E");
--i-receipt: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M6 3h12v18l-3-2-3 2-3-2-3 2z%22/%3E%3Cpath d=%22M9 8h6M9 12h6%22/%3E%3C/svg%3E");
--i-info: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%229%22/%3E%3Cpath d=%22M12 11v5.5M12 7.5h.01%22/%3E%3C/svg%3E");
--i-plus: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 5v14M5 12h14%22/%3E%3C/svg%3E");
--i-dash: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%223.5%22 y=%223.5%22 width=%227%22 height=%228%22 rx=%221.5%22/%3E%3Crect x=%2213.5%22 y=%223.5%22 width=%227%22 height=%225%22 rx=%221.5%22/%3E%3Crect x=%2213.5%22 y=%2211.5%22 width=%227%22 height=%229%22 rx=%221.5%22/%3E%3Crect x=%223.5%22 y=%2214.5%22 width=%227%22 height=%226%22 rx=%221.5%22/%3E%3C/svg%3E");
}
.ic { display: inline-block; width: 20px; height: 20px; flex: none; vertical-align: -4px; background-color: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.ic-money { --ic: var(--i-money); } .ic-clock { --ic: var(--i-clock); } .ic-doc { --ic: var(--i-doc); } .ic-alert { --ic: var(--i-alert); }
.ic-box { --ic: var(--i-box); } .ic-people { --ic: var(--i-people); } .ic-up { --ic: var(--i-up); } .ic-down { --ic: var(--i-down); }
.ic-bank { --ic: var(--i-bank); } .ic-check { --ic: var(--i-check); } .ic-user { --ic: var(--i-user); } .ic-lock { --ic: var(--i-lock); }
.ic-gear { --ic: var(--i-gear); } .ic-star { --ic: var(--i-star); } .ic-bolt { --ic: var(--i-bolt); } .ic-out { --ic: var(--i-out); }
.ic-shield { --ic: var(--i-shield); } .ic-card { --ic: var(--i-card); } .ic-bell { --ic: var(--i-bell); } .ic-repeat { --ic: var(--i-repeat); }
.ic-chev { --ic: var(--i-chev); } .ic-receipt { --ic: var(--i-receipt); } .ic-info { --ic: var(--i-info); } .ic-plus { --ic: var(--i-plus); } .ic-dash { --ic: var(--i-dash); }
.ic-badge { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border-radius: 50%;
  background: var(--tone-teal-bg); color: var(--tone-teal); }
.ic-badge .ic { width: 20px; height: 20px; vertical-align: 0; }

/* ---------- cards ---------- */
.card, .tile, .formbox, .authbox, .empty { border-radius: var(--radius); }
.card, .tile { box-shadow: 0 1px 2px rgba(16,40,60,.05), 0 4px 14px rgba(16,40,60,.05); }
a.tile, .linkcard { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
a.tile:hover, .linkcard:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(16,40,60,.06), 0 10px 22px rgba(16,40,60,.1); }

/* ---------- summary tiles with an icon badge ---------- */
.tile[class*="ic-"] { position: relative; padding: 18px 22px 18px 82px; min-height: 92px; display: flex; flex-direction: column; justify-content: center;
  --tone: var(--tone-teal); --tonebg: var(--tone-teal-bg); }
.tile[class*="ic-"]::before { content: ""; position: absolute; left: 22px; top: 50%; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%; background: var(--tonebg); }
.tile[class*="ic-"]::after { content: ""; position: absolute; left: 34px; top: 50%; width: 20px; height: 20px; margin-top: -10px; background-color: var(--tone);
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.tile.ic-money { --ic: var(--i-money); } .tile.ic-clock { --ic: var(--i-clock); --tone: var(--tone-blue); --tonebg: var(--tone-blue-bg); }
.tile.ic-doc { --ic: var(--i-doc); --tone: var(--tone-violet); --tonebg: var(--tone-violet-bg); }
.tile.ic-alert { --ic: var(--i-alert); --tone: var(--tone-amber); --tonebg: var(--tone-amber-bg); }
.tile.ic-box { --ic: var(--i-box); --tone: var(--tone-blue); --tonebg: var(--tone-blue-bg); }
.tile.ic-people { --ic: var(--i-people); --tone: var(--tone-violet); --tonebg: var(--tone-violet-bg); }
.tile.ic-up { --ic: var(--i-up); --tone: var(--tone-green); --tonebg: var(--tone-green-bg); }
.tile.ic-down { --ic: var(--i-down); --tone: var(--tone-amber); --tonebg: var(--tone-amber-bg); }
.tile.ic-bank { --ic: var(--i-bank); --tone: var(--tone-teal); --tonebg: var(--tone-teal-bg); }
.tile.ic-check { --ic: var(--i-check); --tone: var(--tone-green); --tonebg: var(--tone-green-bg); }
.tile.neg { --tone: var(--tone-red); --tonebg: var(--tone-red-bg); }
.tile.pos { --tone: var(--tone-green); --tonebg: var(--tone-green-bg); }
.tile span { font-size: .95rem; font-weight: 600; color: var(--muted); }
.tile strong { font-size: 1.9rem; line-height: 1.2; color: var(--ink); }
.tile.neg, .tile.pos { border-left: 1px solid var(--line); }

/* ---------- pill buttons ---------- */
.btn { border: 1.5px solid var(--ink-dark); border-radius: 999px; padding: 8px 20px; font-weight: 700; font-size: .85rem; letter-spacing: .03em; text-transform: uppercase;
  color: var(--ink-dark); background: #fff; box-shadow: var(--pill-shadow); transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.btn:hover { border-color: var(--ink-dark); background: #f3f8f9; box-shadow: 0 3px 8px rgba(11,42,54,.22); transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(11,42,54,.2); }
.btn.primary { background: var(--accent); border-color: var(--accent-dark); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.small { padding: 4px 14px; font-size: .75rem; }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.danger:hover { background: #fdeceb; border-color: var(--red); }
.btn[disabled] { opacity: .5; box-shadow: none; cursor: not-allowed; transform: none; }

/* ---------- inputs: rounded with a small inset shadow ---------- */
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select { border: 1px solid #b7c1cc; border-radius: 999px; padding: 7px 16px; box-shadow: var(--inset); background-color: #fff; }
select { padding-right: 34px; }
textarea { font: inherit; border: 1px solid #b7c1cc; border-radius: 18px; padding: 10px 16px; box-shadow: var(--inset); background: #fff; color: var(--ink); max-width: 100%; }
input::placeholder, textarea::placeholder { color: #aab3be; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: var(--inset), 0 0 0 3px rgba(15,124,137,.18); }
input[type=date] { padding-right: 12px; }
.lines input, .lines select { border-radius: 999px; }
table.budget input.cell { border-radius: 12px; }

/* ---------- top bar: plain icon buttons, no borders ---------- */
.who .iconbtn, .who .tb .iconbtn { border: 0; background: transparent; box-shadow: none; border-radius: 50%; width: 40px; height: 40px; margin: 0; color: #4b5a6b; }
.who .iconbtn:hover, .who .iconbtn[aria-expanded="true"] { background: #eaf1f4; color: var(--accent-dark); }
.who .iconbtn .badge { top: 2px; right: 2px; }

/* ---------- user menu ---------- */
.usermenu .menu { top: calc(100% + 12px); min-width: 270px; padding: 6px 0 8px; border: 2px solid #5d5d5d; border-radius: 12px; box-shadow: 0 10px 28px rgba(16,40,60,.2); }
.usermenu .menu::before { content: ""; position: absolute; right: 14px; top: -8px; width: 14px; height: 14px; background: #fff; border-left: 2px solid #4d4d4d; border-top: 2px solid #4d4d4d; transform: rotate(45deg); border-radius: 3px 0 0 0; }
.menuhead { flex-direction: row; align-items: center; gap: 12px; padding: 12px 16px 14px; margin: 0 8px 6px; border-bottom: 1px solid var(--line); position: relative; }
.menuhead > div { display: flex; flex-direction: column; min-width: 0; }
.menuhead strong { font-size: 1.02rem; color: var(--ink-dark); }
.menuhead .avatar { flex: none; font-size: .85rem; background: #fff; border-color: #d9d77a; }
.usermenu .menu a, .usermenu .menu button { display: flex; align-items: center; gap: 16px; padding: 11px 24px; color: #2c3a4a; font-size: 1rem; }
.usermenu .menu a .ic, .usermenu .menu button .ic { width: 22px; height: 22px; color: #66788d; vertical-align: 0; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: #eef5f7; color: var(--ink-dark); }
.usermenu .menu a:hover .ic, .usermenu .menu button:hover .ic { color: var(--accent-dark); }
.usermenu .menu form { margin: 6px 0 0; border-top: 1px solid var(--line); padding-top: 6px; }

/* ---------- notifications ---------- */
.bellpanel { border-radius: 12px; border-color: #cdd6df; top: calc(100% + 12px); border: 2px solid #5d5d5d; box-shadow: 0 10px 28px rgba(16,40,60,.2); }
.bellpanel::before { content: ""; position: absolute; right: 14px; top: -8px; width: 14px; height: 14px; background: #fff; border-left: 2px solid #4d4d4d; border-top: 2px solid #4d4d4d; transform: rotate(45deg); border-radius: 3px 0 0 0; }
.pophead { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.notice-item { display: flex; align-items: flex-start; gap: 14px; padding: 14px 18px; }
.notice-item::before { content: none; }
.notice-item .ic-badge { width: 38px; height: 38px; }
.notice-item.warn .ic-badge { background: var(--tone-red-bg); color: var(--tone-red); }
.notice-text { display: block; min-width: 0; }
.notice-text strong { display: block; color: var(--ink-dark); }
.notice-text span { display: block; font-size: .85rem; color: var(--muted); }

/* ---------- friendly script callouts ---------- */
.script, .savehint, .notice.ok, .notice.info { font-family: "Caveat", "Segoe Script", "Bradley Hand", cursive; }
.notice.ok, .notice.info { font-size: 1.3rem; line-height: 1.25; font-weight: 700; }
.savehint { font-size: 1.5rem; font-weight: 700; color: var(--accent-dark); transform: rotate(-3deg); display: inline-block; margin-left: 10px; }
.script { font-size: 1.4rem; font-weight: 700; color: var(--accent-dark); }

/* ---------- status pills ---------- */
.pill { display: inline-block; padding: 2px 11px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #e7ebf0; color: #4b5a6b; }
.pill.s-paid { background: var(--tone-green-bg); color: var(--tone-green); }
.pill.s-open, .pill.s-sent, .pill.s-accepted { background: var(--tone-blue-bg); color: var(--tone-blue); }
.pill.s-overdue, .pill.s-declined { background: var(--tone-red-bg); color: var(--tone-red); }
.pill.s-void, .pill.s-cancelled { background: #eceff3; color: #7a8696; }
.pill.s-partial, .pill.s-partly { background: var(--tone-amber-bg); color: var(--tone-amber); }
.grid tbody tr { transition: background .1s ease; }
.grid tbody tr:hover td { background: #f5fafb; }
.empty { padding: 34px 20px; }
.tabs a.on { border-bottom-width: 3px; }

/* ---------- dashboard quick actions ---------- */
.quick { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 14px 0 6px; }
.quick .btn .ic { width: 18px; height: 18px; vertical-align: -4px; margin-right: 8px; }
.welcome { color: var(--muted); }

/* ---------- paper-style invoice form ---------- */
.invgrid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; margin-top: 10px; }
.paper { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px 30px; box-shadow: 0 1px 2px rgba(16,40,60,.05), 0 8px 24px rgba(16,40,60,.07); }
.paperhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.papertitle { display: flex; align-items: center; gap: 14px; }
.papertitle > div { display: flex; flex-direction: column; }
.papertitle strong { font-size: 1.4rem; color: var(--ink-dark); line-height: 1.2; }
.paperbill { display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(130px, 1fr) minmax(130px, 1fr) minmax(130px, auto); gap: 16px; align-items: start; margin-bottom: 22px; }
.paperbill label, .sidepanel label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); font-weight: 600; margin: 0; }
.paperbill label select, .paperbill label input, .sidepanel label select, .sidepanel label input { color: var(--ink); font-weight: 400; font-size: 1rem; width: 100%; }
.small { font-size: .85rem; font-weight: 400; }
.amountdue { text-align: right; display: flex; flex-direction: column; }
.amountdue span { font-size: .85rem; color: var(--muted); font-weight: 600; }
.amountdue strong { font-size: 1.8rem; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--ink-dark); }
.paperlines { border-top: 2px solid var(--ink-dark); }
.paperlines th { background: transparent; }
.paperlines td { vertical-align: middle; padding: 6px 8px; }
.paperlines td input { width: 100%; }
.paperlines td.num input { text-align: right; }
.paperlines th:nth-child(2), .paperlines td:nth-child(2) { width: 140px; }
.paperlines th:nth-child(3), .paperlines td:nth-child(3) { width: 100px; }
.paperlines th:nth-child(4), .paperlines td:nth-child(4) { width: 130px; }
.paperlines .linetotal { font-weight: 600; }
.paperlines tr[hidden] { display: none; }
.addline { display: block; width: 100%; margin: 12px 0 4px; padding: 11px; background: #fbfdfe; border: 1.5px dashed #b7c9d1; border-radius: 12px; color: var(--accent-dark); font: inherit; font-weight: 700; cursor: pointer; }
.addline:hover { background: #eef7f9; border-color: var(--accent); }
.addline[hidden] { display: none; }
.invtotals { display: grid; grid-template-columns: 1fr 140px; gap: 6px 14px; width: min(100%, 360px); margin: 22px 0 18px auto; }
.invtotals dt { text-align: right; color: var(--muted); } .invtotals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.invtotals .strong { font-weight: 700; color: var(--ink-dark); font-size: 1.15rem; padding-top: 8px; border-top: 1px solid var(--line); }
.notefield { margin-top: 8px; font-size: .85rem; color: var(--muted); font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.notefield input { width: 100%; font-weight: 400; font-size: 1rem; color: var(--ink); }
.sidepanel { padding: 4px 4px 0; display: flex; flex-direction: column; gap: 14px; }
.sidepanel h2 { font-size: 1.3rem; margin: 0; color: var(--ink-dark); }
.sidepanel > p { margin: -10px 0 0; }
.setrow { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.setrow > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.setrow strong { color: var(--ink-dark); } .setrow .muted { font-size: .85rem; }
.setrow .ic-chev { width: 18px; height: 18px; color: #8896a6; vertical-align: 0; }
.setrow:hover { background: #f3f9fa; }
.setrow:first-of-type { margin-top: 6px; }

@media (max-width: 1000px) { .invgrid { grid-template-columns: 1fr; } .paperbill { grid-template-columns: 1fr 1fr; } .amountdue { text-align: left; } }
@media (max-width: 560px) { .paper { padding: 20px 16px; } .paperbill { grid-template-columns: 1fr; } .tile[class*="ic-"] { padding-left: 76px; } }
@media print { .tile::before, .tile::after { display: none; } .tile[class*="ic-"] { padding-left: 22px; } }
.notice-item .ic-badge { display: inline-flex; color: var(--tone-teal); }
.notice-item.warn .ic-badge { color: var(--tone-red); }
@media (max-width: 700px) {
  .paperlines, .paperlines tbody { display: block; }
  .paperlines thead { display: none; }
  .paperlines tr { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .paperlines td { display: block; padding: 0; border: 0; width: auto !important; }
  .paperlines td:first-child { grid-column: 1 / -1; }
  .paperlines td.linetotal { min-width: 70px; }
}

/* dropdowns: the arrow sits inside the pill with the same gap as the date picker's calendar icon */
select:not([multiple]) { -webkit-appearance: none; appearance: none; padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c2430' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 14px 14px; }

/* form rows: fields line up along their top edge, so a hint under one field no longer pushes its neighbours out of line */
.formrow { align-items: flex-start; }
.adminforms .formrow { align-items: flex-end; }

/* bank import: connected-bank rows and the connect row line up on one centre line */
.formrow.feedrow { align-items: center; }
.feedrow form.inline { display: flex; align-items: center; gap: 12px; margin: 0; }
.feedrow .inlinelabel { flex-direction: row; align-items: center; gap: 8px; margin: 0; color: var(--ink); font-size: .95rem; }
.formrow.connectrow { align-items: flex-end; }

/* more icons, report cards, year links, switches, filter lines */
:root {
--i-cal: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%223.5%22 y=%225%22 width=%2217%22 height=%2215.5%22 rx=%222.5%22/%3E%3Cpath d=%22M3.5 10h17M8 3v4M16 3v4%22/%3E%3C/svg%3E");
--i-chart: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M5 20V11M12 20V4M19 20v-6M3 20h18%22/%3E%3C/svg%3E");
--i-book: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M5 4h11a3 3 0 0 1 3 3v13H8a3 3 0 0 1-3-3z%22/%3E%3Cpath d=%22M5 17a3 3 0 0 1 3-3h11%22/%3E%3C/svg%3E");
--i-scale: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 4v16M7 20h10M5 8h14M5 8l-3 7a3 3 0 0 0 6 0zM19 8l-3 7a3 3 0 0 0 6 0z%22/%3E%3C/svg%3E");
--i-target: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%229%22/%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%225%22/%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%22.8%22/%3E%3C/svg%3E");
--i-archive: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%223%22 y=%224%22 width=%2218%22 height=%225%22 rx=%221%22/%3E%3Cpath d=%22M5 9v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9M10 13h4%22/%3E%3C/svg%3E");
--i-list: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M8 6h13M8 12h13M8 18h13M3.5 6h.01M3.5 12h.01M3.5 18h.01%22/%3E%3C/svg%3E");
--i-percent: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M19 5 5 19%22/%3E%3Ccircle cx=%227%22 cy=%227%22 r=%222.5%22/%3E%3Ccircle cx=%2217%22 cy=%2217%22 r=%222.5%22/%3E%3C/svg%3E");
}
.ic-cal { --ic: var(--i-cal); }
.ic-chart { --ic: var(--i-chart); }
.ic-book { --ic: var(--i-book); }
.ic-scale { --ic: var(--i-scale); }
.ic-target { --ic: var(--i-target); }
.ic-archive { --ic: var(--i-archive); }
.ic-list { --ic: var(--i-list); }
.ic-percent { --ic: var(--i-percent); }
.ic-badge.t-green { background: var(--tone-green-bg); color: var(--tone-green); }
.ic-badge.t-blue { background: var(--tone-blue-bg); color: var(--tone-blue); }
.ic-badge.t-violet { background: var(--tone-violet-bg); color: var(--tone-violet); }
.ic-badge.t-amber { background: var(--tone-amber-bg); color: var(--tone-amber); }
.linkcard { position: relative; }
.linkcard .ic-badge { margin-bottom: 12px; width: 44px; height: 44px; }
.linkcard h2 { margin-bottom: 6px; }
a.yearlink { display: inline-flex; align-items: center; gap: 10px; }
a.yearlink .ic { width: 18px; height: 18px; color: var(--accent); vertical-align: 0; }
.formrow.filterline { align-items: flex-end; }
.filterline .hint { align-self: flex-end; margin: 0; line-height: 38px; }

/* checkboxes in forms become switches */
label.check { display: grid; grid-template-columns: 46px 1fr; column-gap: 14px; row-gap: 2px; align-items: center; font-weight: 600; margin: 14px 0; cursor: pointer; }
label.check .hint { grid-column: 2; font-weight: 400; }
label.check input[type=checkbox] { -webkit-appearance: none; appearance: none; position: relative; display: block; width: 46px; height: 26px; margin: 0; padding: 0; border-radius: 999px; border: 0;
  background: #c3ccd6; box-shadow: inset 0 1px 3px rgba(11,42,54,.3); cursor: pointer; transition: background .18s ease; }
label.check input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(11,42,54,.35); transition: transform .18s ease; }
label.check input[type=checkbox]:checked { background: var(--accent); }
label.check input[type=checkbox]:checked::after { transform: translateX(20px); }
label.check input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.formbox label.check input[type=checkbox] { display: block; width: 46px; margin: 0; }

/* ---- help and feedback page ---- */
.contactgrid{display:grid;grid-template-columns:minmax(0,2fr) minmax(290px,1fr);gap:18px;align-items:start}
@media (max-width:820px){.contactgrid{grid-template-columns:1fr}}
.contactform label{display:block;margin-top:14px}
.contactform textarea{width:100%;margin-top:6px}
.contactform .actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.kindpick{border:0;padding:0;margin:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(172px,1fr));gap:10px}
.kindpick legend,.stars legend{font-weight:600;padding:0;margin-bottom:8px}
.kindpick .kind{margin:0;display:block;cursor:pointer}
.kindpick .kind input{position:absolute;opacity:0;pointer-events:none}
.kindpick .kind span{display:flex;align-items:center;gap:7px;white-space:nowrap;font-size:.95em;padding:11px 9px;border:1.5px solid var(--line,#d9dee7);border-radius:12px;background:#fff;font-weight:600}
.kindpick .kind input:checked+span{border-color:var(--ink-dark,#1f3550);box-shadow:0 2px 0 var(--ink-dark,#1f3550);background:#f4f7fb}
.kindpick .kind input:focus-visible+span{outline:2px solid #2f6fb3;outline-offset:2px}
.stars{border:0;padding:0;margin:16px 0 0}
.starrow{display:inline-flex;flex-direction:row-reverse;gap:4px}
.starrow input{position:absolute;opacity:0;pointer-events:none}
.starrow label{margin:0;width:34px;height:34px;cursor:pointer;background:#c9d1dc;-webkit-mask:var(--i-starfill) center/contain no-repeat;mask:var(--i-starfill) center/contain no-repeat}
.starrow input:checked~label,.starrow label:hover,.starrow label:hover~label{background:#e9a824}
.starrow input:focus-visible+label{outline:2px solid #2f6fb3;outline-offset:2px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.contactways h2{margin-top:0}
.ways{list-style:none;margin:0 0 12px;padding:0;display:grid;gap:14px}
.ways li{display:flex;gap:12px;align-items:flex-start}
.ways .ic{flex:none;width:22px;height:22px;margin-top:2px}
.ways strong{display:block}
.ways a{overflow-wrap:anywhere}
.small{font-size:.9em}
.fbitem{border-top:1px solid var(--line,#e3e7ee);padding:14px 0}
.fbitem:first-child{border-top:0}
.fbitem .fbhead{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:6px}
.fbitem .fbmsg{white-space:pre-wrap;margin:6px 0}
.fbitem.done{opacity:.6}
.kindtag{font-size:.8em;font-weight:700;text-transform:uppercase;letter-spacing:.04em;padding:2px 8px;border-radius:999px;background:#e4ebf5}
.kindtag.k-problem{background:#fde7e4}.kindtag.k-idea{background:#fff3d6}.kindtag.k-praise{background:#e2f3e8}
.starsout{color:#e9a824;letter-spacing:2px}

.starrow{--i-starfill:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath fill=%22%23000%22 d=%22m12 2.5 2.9 6 6.6.9-4.8 4.6 1.2 6.5L12 17.4l-5.9 3.1 1.2-6.5L2.5 9.4l6.6-.9z%22/%3E%3C/svg%3E")}

/* inventory: categories and product pictures */
.catbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip { display: inline-block; padding: 5px 12px; border: 1px solid #d5dbe3; border-radius: 16px; background: #fff; color: inherit; text-decoration: none; font-size: .9rem; white-space: nowrap; }
.chip:hover { border-color: #9aa7b6; }
.chip.on { background: var(--blue, #1f5fbf); border-color: var(--blue, #1f5fbf); color: #fff; }
.tag.cat { text-decoration: none; background: #e6f0fb; color: #1f4f8f; }
.prod-thumb { width: 36px; height: 36px; object-fit: cover; border: 1px solid #d5dbe3; border-radius: 6px; background: #fff; vertical-align: middle; margin-right: 8px; }
.prod-pic { display: block; width: 160px; height: 160px; object-fit: cover; border: 1px solid #d5dbe3; border-radius: 8px; background: #fff; margin: 6px 0 10px; }
.prod-pic.big { width: 220px; height: 220px; margin: 12px 0; }
.pic-field { display: grid; gap: 4px; margin: 10px 0; }
.pic-label { font-weight: 600; }

/* picture drop zone */
.formbox label.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; margin: 4px 0; padding: 26px 16px; min-height: 190px; text-align: center; cursor: pointer;
  font-weight: 400; background: #cbdbe0; border: 1px solid #b9ccd2; border-radius: 4px; color: #17394a; outline: 1px dashed #8fa4a9; outline-offset: -8px; }
.formbox label.dropzone:hover, .formbox label.dropzone.over { background: #c1d4da; }
.formbox label.dropzone:focus-within { box-shadow: 0 0 0 3px rgba(15,124,137,.25); }
.formbox .dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; opacity: 0; cursor: pointer; box-shadow: none; border: 0; }
.dz-icon { width: 54px; height: 54px; background-color: #94b0b5; -webkit-mask: var(--i-drop) center / contain no-repeat; mask: var(--i-drop) center / contain no-repeat; }
.dz-text { font-size: 1.05rem; }
.dz-text b { font-weight: 700; }
.dz-preview { max-width: 140px; max-height: 120px; object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid #b9ccd2; }
.dz-preview[hidden] { display: none; }
.dropzone.has-file .dz-icon { display: none; }
:root { --i-drop: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 54 54%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%225%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M27 3v34M13 24l14 14 14-14M4 32v14h46V32%22/%3E%3C/svg%3E"); }

/* Reports page: grouped report cards and starred favourites */
:root { --i-starfill: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath fill=%22%23000%22 d=%22m12 2.5 2.9 6 6.6.9-4.8 4.6 1.2 6.5L12 17.4l-5.9 3.1 1.2-6.5L2.5 9.4l6.6-.9z%22/%3E%3C/svg%3E"); }
.ic-starfill { --ic: var(--i-starfill); }
.rep-group { margin: 28px 0 12px; font-size: 1.25rem; color: var(--ink-dark); }
.rep-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rep-card { position: relative; display: flex; align-items: flex-start; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(16,40,60,.05), 0 4px 14px rgba(16,40,60,.05); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.rep-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(16,40,60,.06), 0 10px 22px rgba(16,40,60,.1); }
.rep-link { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 14px; padding: 16px 4px 16px 16px; text-decoration: none; color: var(--ink); }
.rep-link:hover { transform: none; box-shadow: none; border-color: transparent; }
.rep-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rep-text strong { color: var(--ink-dark); font-size: 1.02rem; }
.rep-text .muted { font-size: .9rem; }
.rep-card form, .rep-fav form { margin: 0; }
.rep-star { flex: none; width: 38px; height: 38px; margin: 8px 8px 0 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; cursor: pointer; color: #8896a6; }
.rep-star .ic { width: 22px; height: 22px; vertical-align: 0; }
.rep-star:hover { background: #eef5f7; color: #e9a824; }
.rep-star.on { color: #e9a824; }
.rep-star:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rep-favs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.rep-fav { display: flex; align-items: center; gap: 6px; min-height: 76px; padding: 10px 6px 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(16,40,60,.05), 0 4px 14px rgba(16,40,60,.05); }
.rep-fav .rep-star { margin: 0; }
.rep-favlink { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink-dark); }
.rep-favlink strong { font-size: .95rem; line-height: 1.25; }
.rep-fav.empty-slot { border-style: dashed; box-shadow: none; background: transparent; gap: 12px; }
.rep-fav.empty-slot .ic-badge { background: #eef2f6; color: #a3afbd; }
.rep-fav.empty-slot .muted { font-size: .88rem; }
.ic-badge.t-teal { background: var(--tone-teal-bg); color: var(--tone-teal); }
@media (max-width: 820px) { .rep-grid { grid-template-columns: 1fr; } }
@media print { .rep-star { display: none; } }

/* Dashboard: favourite reports card */
:root {
--i-eye: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z%22/%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%223%22/%3E%3C/svg%3E");
--i-print: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M7 9V3h10v6M7 17H4a1 1 0 0 1-1-1v-6a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-3%22/%3E%3Crect x=%227%22 y=%2214%22 width=%2210%22 height=%227%22 rx=%221%22/%3E%3C/svg%3E");
}
.ic-eye { --ic: var(--i-eye); } .ic-print { --ic: var(--i-print); }
.quickcard { margin-top: 16px; }
.quickcard .cardhead { margin-bottom: 4px; }
.quicktable th.rowicons { text-align: right; }
.quicktable td { vertical-align: middle; }
.quickname { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; color: var(--ink-dark); }
.quickname:hover { color: var(--accent-dark); }
.quickname .ic-badge { width: 34px; height: 34px; }
.quickname .ic-badge .ic { width: 18px; height: 18px; }
.quicktable .iconbtn .ic { width: 18px; height: 18px; vertical-align: 0; }
