/* RP Portal Fiscal. Tokens from context/design-system (brand RP: navy + red + cream, never gold). */
:root {
  --brand: #111168; --brand-2: #223A8C; --brand-light: #669BBA; --accent: #DF2020;
  --bg: #EDEADD; --bg-2: #F6F4EC; --surface: #FFFFFF; --ink: #15162B; --ink-soft: #4A4C66;
  --border: rgba(17,17,104,.12); --border-strong: rgba(17,17,104,.18);
  --ok: #1E7A4C; --ok-bg: #E4F3EA; --warn: #9A5B00; --warn-bg: #FBF0DC; --danger: #B31616; --danger-bg: #FBE4E4;
  --info-bg: #E6ECF7;
  --radius: 14px; --pill: 999px; --shadow: 0 1px 2px rgba(4,6,26,.06), 0 4px 16px rgba(4,6,26,.06);
  --shadow-hover: 0 2px 10px rgba(4,6,26,.18);
  --font-head: "Merriweather", Georgia, serif; --font-body: "Montserrat", system-ui, -apple-system, sans-serif;
  --max: 1140px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.55; }
h1, h2, h3 { font-family: var(--font-head); color: var(--brand); line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; font-weight: 900; } h2 { font-size: 1.2rem; font-weight: 700; } h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .8em; }
a { color: var(--brand-2); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand-light); outline-offset: 2px; border-radius: 6px; }
svg[aria-hidden="true"] { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-soft); } .small { font-size: .85rem; } .center { text-align: center; }
.hidden { display: none !important; }

/* Header */
.topbar { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar-in { max-width: var(--max); margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 12px 20px; }
.logo { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: #fff; }
.logo b { font-family: var(--font-head); font-weight: 900; font-size: 1.05rem; letter-spacing: .2px; white-space: nowrap; }
.logo span { font-size: .8rem; opacity: .8; }
.logo .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; transform: translateY(-1px); }
.topnav { display: flex; gap: 4px; margin-left: 12px; }
.topnav a { color: rgba(255,255,255,.82); text-decoration: none; padding: 8px 12px; border-radius: var(--pill); font-weight: 500; font-size: .92rem; position: relative; }
.topnav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.topnav a svg { display: none; }
.topnav a[aria-current="page"] { color: var(--brand); background: #fff; font-weight: 600; }
.spacer { flex: 1; }
.lang { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: var(--pill); padding: 6px 10px; font-size: .85rem; }
.lang option { color: var(--ink); }
.linkbtn { background: none; border: 0; color: rgba(255,255,255,.85); cursor: pointer; font-size: .85rem; padding: 6px 8px; }
.linkbtn:hover { color: #fff; text-decoration: underline; }
.badge-dot { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; margin-left: 4px; }

/* Bottom nav (mobile) */
.bottomnav { display: none; }
@media (max-width: 760px) {
  .topnav { display: none; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--border-strong); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; text-decoration: none; color: var(--ink-soft); font-size: .68rem; font-weight: 600; position: relative; min-height: 56px; }
  .bottomnav a svg { width: 22px; height: 22px; }
  .bottomnav a[aria-current="page"] { color: var(--brand); }
  .bottomnav a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
  .bottomnav .badge-dot { position: absolute; top: 4px; right: calc(50% - 22px); margin: 0; }
  main.page { padding-bottom: 96px !important; }
  .topbar-in { padding: 10px 14px; }
  .logo span { display: none; }
  .logo b { font-size: .98rem; }
  #logout { display: none; }
  .hero .big { font-size: 1.8rem; }
}
.mobile-only { display: none; }
@media (max-width: 760px) { .mobile-only { display: block; } }

/* Layout */
main.page { max-width: var(--max); margin: 0 auto; padding: 24px 20px 48px; }
.page-head { margin-bottom: 18px; }
.page-head p { color: var(--ink-soft); max-width: 680px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1.25fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 20px; }
.card h2 { margin-bottom: 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }

/* Hero deadline card */
.hero { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%); color: #fff; border: 0; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.06); }
.hero h2, .hero .eyebrow { color: #fff; } .hero .eyebrow { opacity: .75; }
.hero .big { font-family: var(--font-head); font-size: 2.1rem; font-weight: 900; line-height: 1.1; margin: 4px 0 6px; }
.hero .sub { opacity: .9; }
.hero .chip { background: rgba(255,255,255,.14); color: #fff; }
.hero .btn-primary { margin-top: 14px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--pill); font-size: .78rem; font-weight: 600; background: var(--bg-2); color: var(--ink-soft); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.danger { background: var(--danger-bg); color: var(--danger); } .chip.info { background: var(--info-bg); color: var(--brand-2); }
.chip.new { background: var(--accent); color: #fff; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--pill); padding: 11px 20px; font-weight: 600; font-size: .92rem; cursor: pointer; border: 1px solid transparent; text-decoration: none; min-height: 44px; transition: box-shadow .15s, transform .05s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { box-shadow: var(--shadow-hover); background: #C91B1B; }
.btn-secondary { background: var(--surface); color: var(--brand); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--brand); }
.btn-ghost { background: transparent; color: var(--brand); padding: 8px 12px; min-height: 36px; }
.btn-ghost:hover { background: var(--bg-2); }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: .82rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; color: var(--ink); }
.list .meta { font-size: .82rem; color: var(--ink-soft); }
.list .actions { display: flex; gap: 6px; flex-shrink: 0; }
.doc-icon { width: 42px; height: 42px; border-radius: 10px; background: var(--info-bg); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; font-weight: 800; font-size: .7rem; letter-spacing: .02em; }
.doc-icon.inv { background: var(--bg-2); }
@media (max-width: 560px) { .list > li { flex-wrap: wrap; } .list .actions { width: 100%; justify-content: flex-end; } }
.year-sep { font-family: var(--font-head); font-weight: 700; color: var(--brand); margin: 18px 0 2px; font-size: 1.05rem; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: .88rem; }
.field .hint { font-size: .8rem; color: var(--ink-soft); }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--border-strong); border-radius: 10px; padding: 11px 12px; background: #fff; min-height: 44px; }
textarea.input { min-height: 120px; resize: vertical; }
.input:focus { border-color: var(--brand-2); outline: none; box-shadow: 0 0 0 3px rgba(34,58,140,.15); }
.row { display: flex; gap: 12px; flex-wrap: wrap; } .row > .field { flex: 1; min-width: 180px; }
.err-text { color: var(--danger); font-size: .85rem; margin-top: 4px; }

/* Dropzone */
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 28px 16px; text-align: center; background: var(--bg-2); transition: border-color .15s, background .15s; cursor: pointer; }
.dropzone.drag { border-color: var(--brand-2); background: var(--info-bg); }
.dropzone svg { width: 34px; height: 34px; color: var(--brand-2); }
.dropzone .linklike { color: var(--brand-2); text-decoration: underline; font-weight: 600; background: none; border: 0; cursor: pointer; padding: 0; }
.filelist { margin: 12px 0 0; padding: 0; list-style: none; text-align: left; }
.filelist li { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; padding: 6px 10px; background: #fff; border-radius: 8px; margin-top: 6px; border: 1px solid var(--border); }

/* Alerts / toasts */
.alert { border-radius: 12px; padding: 12px 14px; font-size: .9rem; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.alert.ok { background: var(--ok-bg); color: var(--ok); } .alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.danger { background: var(--danger-bg); color: var(--danger); } .alert.info { background: var(--info-bg); color: var(--brand-2); }
.alert a { color: inherit; font-weight: 600; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-hover); z-index: 100; max-width: calc(100% - 32px); font-size: .9rem; }
@media (max-width: 760px) { #toast { bottom: 84px; } }

/* Skeleton & states */
.skel { background: linear-gradient(90deg, #EEE 25%, #F6F6F6 37%, #EEE 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; border-radius: 8px; height: 14px; margin: 10px 0; }
.skel.h { height: 26px; width: 50%; } .skel.w60 { width: 60%; } .skel.w80 { width: 80%; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.empty { text-align: center; padding: 28px 12px; color: var(--ink-soft); }
.empty svg { width: 40px; height: 40px; color: var(--brand-light); margin-bottom: 8px; }

/* Steps */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; display: flex; gap: 12px; padding: 8px 0; align-items: flex-start; }
.steps li::before { content: counter(s); flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--info-bg); color: var(--brand); font-weight: 700; font-size: .8rem; display: grid; place-items: center; }

/* FAQ */
details.faq { border-bottom: 1px solid var(--border); }
details.faq summary { cursor: pointer; padding: 14px 4px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--accent); font-weight: 700; font-size: 1.2rem; line-height: 1; }
details.faq[open] summary::after { content: "–"; }
details.faq .ans { padding: 0 4px 14px; color: var(--ink-soft); }
.video { aspect-ratio: 16 / 9; background: var(--bg-2); border-radius: 10px; display: grid; place-items: center; color: var(--ink-soft); font-size: .85rem; overflow: hidden; margin-bottom: 10px; }
.video iframe { width: 100%; height: 100%; border: 0; }
.cal { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cal div { background: var(--bg-2); border-radius: 8px; padding: 8px; text-align: center; font-size: .8rem; }
.cal b { display: block; font-size: 1.1rem; color: var(--brand); font-family: var(--font-head); }
.cal div.me { background: var(--brand); color: #fff; } .cal div.me b { color: #fff; }

/* Chat */
.thread { display: flex; flex-direction: column; gap: 12px; margin: 12px 0 18px; }
.bubble { max-width: 82%; padding: 12px 14px; border-radius: 14px; background: var(--bg-2); white-space: pre-wrap; word-wrap: break-word; }
.bubble.mine { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.bubble.theirs { align-self: flex-start; border-bottom-left-radius: 4px; border: 1px solid var(--border); background: #fff; }
.bubble .who { font-size: .75rem; font-weight: 700; opacity: .75; margin-bottom: 4px; }
.bubble .when { font-size: .7rem; opacity: .65; margin-top: 6px; }
.bubble .orig { margin-top: 8px; padding-top: 8px; border-top: 1px dashed currentColor; font-size: .85rem; opacity: .85; }
.bubble .toggle { background: none; border: 0; color: inherit; text-decoration: underline; font-size: .75rem; cursor: pointer; padding: 0; margin-top: 6px; opacity: .8; }
.suggest { background: var(--info-bg); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.suggest a { display: block; padding: 4px 0; font-weight: 600; cursor: pointer; }

/* Login */
.login-wrap { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 24px 16px; }
.login-card { max-width: 440px; width: 100%; }
.login-card h1 { font-size: 1.5rem; }

/* Tables (team) */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); padding: 10px 10px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr.clickable { cursor: pointer; } .tbl tr.clickable:hover td { background: var(--bg-2); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border-radius: 12px; border: 1px solid var(--border); padding: 14px 16px; }
.stat b { display: block; font-family: var(--font-head); font-size: 1.6rem; color: var(--brand); }
.stat span { font-size: .8rem; color: var(--ink-soft); }
.stat.alert-stat b { color: var(--accent); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { border: 1px solid var(--border-strong); background: var(--surface); padding: 8px 14px; border-radius: var(--pill); cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--ink-soft); }
.tabs button[aria-selected="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: 980px; width: calc(100% - 24px); box-shadow: 0 20px 60px rgba(4,6,26,.35); }
dialog::backdrop { background: rgba(21,22,43,.45); }
dialog .dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 2; }
dialog .dlg-body { padding: 18px 20px; max-height: 75vh; overflow: auto; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; font-size: .88rem; }
.kv dt { color: var(--ink-soft); } .kv dd { margin: 0; font-weight: 500; }
.proposal { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: #fff; }
.proposal.bad { border-color: var(--accent); }
.proposal .row > .field { min-width: 110px; margin-bottom: 6px; }
.proposal .input { min-height: 36px; padding: 6px 8px; font-size: .85rem; }

/* ---------------- v2 components ---------------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.page-head .chips { margin-top: 4px; }
.chip svg { width: 14px; height: 14px; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.nowrap { white-space: nowrap; }

/* header: mobile menu, compact desktop nav */
.iconbtn { background: transparent; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 10px; width: 40px; height: 36px; display: none; align-items: center; justify-content: center; cursor: pointer; position: relative; }
.iconbtn .badge-dot { position: absolute; top: -6px; right: -6px; margin: 0; }
.menu { position: absolute; right: 12px; top: 100%; background: var(--surface); border-radius: 12px; box-shadow: 0 12px 32px rgba(4,6,26,.25); min-width: 210px; padding: 6px; z-index: 40; display: flex; flex-direction: column; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; padding: 12px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .92rem; background: none; border: 0; text-align: left; cursor: pointer; position: relative; }
.menu a:hover, .menu button:hover { background: var(--bg-2); }
.menu a[aria-current="page"] { color: var(--brand); background: var(--info-bg); }
.menu .badge-dot { margin-left: auto; }
.topbar { position: sticky; }
.topbar-in { position: relative; }
@media (max-width: 760px) { .iconbtn:not(.hidden) { display: inline-flex; } }
@media (min-width: 761px) { .menu { display: none !important; } }
.topnav a, #logout { white-space: nowrap; }
.topnav a .badge-dot { vertical-align: 1px; }
@media (min-width: 761px) and (max-width: 1440px) {
  .logo span { display: none; }
  .topnav { margin-left: 6px; gap: 2px; }
  .topnav a { padding: 8px 10px; font-size: .88rem; }
}
@media (min-width: 761px) and (max-width: 1080px) {
  .topnav a { padding: 7px 7px; font-size: .82rem; }
  #logout { font-size: .8rem; }
}

/* home */
.hero-info { margin-top: 10px; }
.hero-note { display: block; font-size: .86rem; line-height: 1.45; background: rgba(255,255,255,.12); padding: 8px 12px; border-radius: 10px; }
.paycard .big { font-family: var(--font-head); font-size: 1.7rem; font-weight: 900; color: var(--brand); line-height: 1.15; margin: 2px 0 6px; }
.dots { list-style: none; padding: 0; margin: 4px 0 10px; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.dots li { display: flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--ink-soft); }
.dots li span { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; background: #fff; }
.dots li span svg { width: 12px; height: 12px; }
.dots li.done { color: var(--ink); }
.dots li.done span { background: var(--ok); border-color: var(--ok); color: #fff; }
.dots li.cur { color: var(--brand); font-weight: 700; }
.dots li.cur span { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(223,32,32,.15); }

/* tax year grid */
.ygrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
@media (min-width: 1100px) { .card .ygrid { grid-template-columns: repeat(12, 1fr); } .grid-2 .card .ygrid { grid-template-columns: repeat(6, 1fr); } }
.yt { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 2px 6px; border-radius: 10px; background: var(--bg-2); color: var(--ink-soft); text-decoration: none; border: 1px solid transparent; min-height: 64px; }
.yt .m { font-weight: 700; font-size: .78rem; text-transform: capitalize; }
.yt .y { font-size: .62rem; opacity: .8; }
.yt .s { font-weight: 800; font-size: .9rem; line-height: 1; margin-top: 2px; }
.yt .s svg { width: 16px; height: 16px; }
.yt.filed, .yt.rectified { background: var(--ok-bg); color: var(--ok); }
.yt.rectified { border-color: var(--ok); }
.yt.open { background: var(--info-bg); color: var(--brand-2); }
.yt.missing { background: var(--warn-bg); color: var(--warn); }
/* client side: a month not loaded yet is neutral (not an alarm) */
.ygrid.soft .yt.missing { background: var(--bg-2); color: var(--ink-soft); }
.ygrid.soft .yt.missing .s { font-weight: 400; }
.ylegend.soft .missing i { background: var(--border-strong); }
.yt.not_required { opacity: .6; }
a.yt:hover { border-color: var(--ok); box-shadow: var(--shadow); }
.ylegend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: .78rem; color: var(--ink-soft); }
.ylegend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--bg-2); }
.ylegend .filed i { background: var(--ok); } .ylegend .open i { background: var(--brand-2); } .ylegend .missing i { background: var(--warn); } .ylegend .not_required i { background: var(--border-strong); }

/* declaration detail (breakdown + supporting docs) */
.list > li.detail { display: block; padding: 0 0 14px; }
.detail-in { background: var(--bg-2); border-radius: 12px; padding: 14px 16px; display: grid; gap: 16px; grid-template-columns: 1.3fr 1fr; }
@media (max-width: 760px) { .detail-in { grid-template-columns: 1fr; } }
.bd h3, .support h3 { font-size: .95rem; margin-bottom: 8px; }
table.bdt { width: 100%; border-collapse: collapse; font-size: .88rem; margin-bottom: 8px; }
.bdt th { text-align: left; font-weight: 500; padding: 6px 8px 6px 0; color: var(--ink); }
.bdt td { text-align: right; padding: 6px 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bdt tr { border-bottom: 1px dashed var(--border-strong); }
.bdt tr.minus td { color: var(--ok); }
.bdt tr.plus td { color: var(--danger); }
.bdt tr.total th, .bdt tr.total td { font-weight: 800; color: var(--brand); border-top: 2px solid var(--brand); }
.bdt tr.credit th, .bdt tr.credit td { color: var(--ok); font-weight: 600; border-bottom: 0; }
ul.mini { list-style: none; padding: 0; margin: 4px 0 10px; }
ul.mini li { padding: 4px 0; font-size: .86rem; }
ul.mini a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; word-break: break-all; }
ul.mini svg { width: 15px; height: 15px; }

/* payments */
.pay { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-top: 12px; background: #fff; }
.pay-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.pay .title { font-weight: 700; } .pay .meta { font-size: .82rem; color: var(--ink-soft); }
.pay .amount { font-family: var(--font-head); font-weight: 900; font-size: 1.25rem; color: var(--brand); white-space: nowrap; }
.payform { margin-top: 12px; border-top: 1px dashed var(--border-strong); padding-top: 12px; }

/* notices & timeline */
.notice { border-bottom: 1px solid var(--border); padding: 14px 0; }
.notice:last-child { border-bottom: 0; }
.notice h3 { margin: 8px 0 4px; }
.notice.unread h3::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 2px; }
.notice .nbody { white-space: pre-wrap; color: var(--ink); margin: 0 0 6px; }
.notice .orig { font-size: .85rem; color: var(--ink-soft); background: var(--bg-2); border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; margin-top: 6px; }
.toggle-orig { background: none; border: 0; padding: 0; color: var(--brand-2); text-decoration: underline; font-size: .78rem; cursor: pointer; }
.nform { margin-top: 10px; background: var(--bg-2); border-radius: 12px; padding: 12px; }
ol.tl { list-style: none; padding: 0; margin: 0 0 10px; position: relative; }
ol.tl li { display: flex; gap: 12px; padding: 0 0 18px; position: relative; }
ol.tl li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 2px; width: 2px; background: var(--border-strong); }
ol.tl li.done:not(:last-child)::before { background: var(--ok); }
ol.tl .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border-strong); background: #fff; flex-shrink: 0; display: grid; place-items: center; }
ol.tl .dot svg { width: 15px; height: 15px; }
ol.tl li.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
ol.tl li.cur .dot, ol.tl li.filed .dot { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(223,32,32,.12); }
ol.tl .title { font-weight: 700; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
ol.tl .meta { font-size: .82rem; color: var(--ink-soft); margin-top: 2px; }
ol.stepper { list-style: none; padding: 0; margin: 6px 0 0; display: flex; gap: 6px; flex-wrap: wrap; }
ol.stepper li { flex: 1; min-width: 120px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
ol.stepper li span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 1px solid var(--border-strong); font-size: .72rem; flex-shrink: 0; }
ol.stepper li span svg { width: 13px; height: 13px; }
ol.stepper li.done { background: var(--ok-bg); color: var(--ok); } ol.stepper li.done span { background: var(--ok); color: #fff; border-color: var(--ok); }
ol.stepper li.cur { background: var(--info-bg); color: var(--brand); } ol.stepper li.cur span { border-color: var(--brand); }
ol.stepper li.bad { background: var(--danger-bg); color: var(--danger); }

/* invoices search, help schedule */
.searchbar { position: relative; margin-bottom: 10px; }
.searchbar svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); width: 18px; height: 18px; }
.searchbar .input { padding-left: 38px; }
.small-tabs { margin-bottom: 4px; }
.small-tabs button { padding: 5px 11px; font-size: .78rem; }
.tabs button[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
ol.sched { list-style: none; padding: 0; margin: 0; }
ol.sched li { display: grid; grid-template-columns: 170px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
ol.sched li:last-child { border-bottom: 0; }
ol.sched b { color: var(--brand); font-size: .84rem; }
@media (max-width: 560px) { ol.sched li { grid-template-columns: 1fr; gap: 2px; } }

.tbl.compact th, .tbl.compact td { padding: 8px 6px; }
.okmark { color: var(--ok); font-weight: 800; }
@media (max-width: 560px) { .card-head { flex-wrap: wrap; } }
