/* MyBooks.Africa — clean, calm, app-like interface (v1.3) */
[hidden] { display: none !important; }
:root {
  --canvas: #f5f5f7; --surface: #fff; --ink: #1d1d1f; --ink-2: #424245; --muted: #6e6e73; --faint: #86868b;
  --line: rgba(0, 0, 0, .08); --line-2: rgba(0, 0, 0, .12); --fill: #f0f0f2; --fill-2: #e8e8ed;
  --accent: #0b7a68; --accent-2: #096657; --tint: rgba(11, 122, 104, .10); --ring: rgba(11, 122, 104, .28);
  --pos: #1f8a4c; --neg: #d70015; --warn: #a35200;
  --r-lg: 18px; --r: 14px; --r-sm: 10px; --pill: 999px;
  --shadow: 0 1px 1px rgba(0, 0, 0, .02), 0 2px 10px rgba(0, 0, 0, .035);
  --pop: 0 10px 40px rgba(0, 0, 0, .14), 0 2px 8px rgba(0, 0, 0, .06);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--font); color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss01"; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
h1 { font-size: 32px; line-height: 1.12; font-weight: 700; letter-spacing: -.028em; margin: 0; }
h2 { font-size: 19px; line-height: 1.25; font-weight: 650; letter-spacing: -.015em; margin: 0 0 14px; }
h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 20px 0 8px; letter-spacing: 0; }
p { margin: 0 0 12px; }
small, .small { font-size: 12.5px; }
.muted { color: var(--muted); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt { margin-top: 20px; }
.big { font-size: 34px; font-weight: 650; letter-spacing: -.03em; margin: 6px 0 14px; font-variant-numeric: tabular-nums; }
.big small { font-size: 15px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
code { background: var(--fill); padding: 2px 6px; border-radius: 6px; font-size: 12.5px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
code.secret { word-break: break-all; display: inline-block; padding: 6px 10px; }
pre { background: var(--fill); padding: 12px 14px; border-radius: var(--r-sm); overflow: auto; font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.ic { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------------------------------------------------------------- app shell */
body.app { display: flex; min-height: 100vh; }
.side { width: 252px; flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 20;
  background: rgba(250, 250, 252, .78); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-right: 1px solid var(--line); }
.brand, .pub-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 17px; letter-spacing: -.02em; }
.brand { padding: 22px 22px 18px; }
.brand:hover, .pub-brand:hover { color: var(--ink); }
.brand-word b { font-weight: 700; }
.logo-dot { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(145deg, #13506b, #0b7a68 55%, #2a9a62); color: #fff; font-weight: 800; font-size: 11.5px; letter-spacing: .3px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.side nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.nav-item { position: relative; }
.nav-item > a { display: flex; align-items: center; gap: 11px; padding: 8px 11px; margin: 1px 0; color: var(--ink-2); border-radius: var(--r-sm); font-size: 14.5px; font-weight: 500; transition: background .15s var(--ease), color .15s; }
.nav-item > a .ic { color: var(--faint); transition: color .15s; }
.nav-item > a:hover { background: rgba(0, 0, 0, .045); color: var(--ink); }
.nav-item.active > a { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 0 0 1px var(--line); }
.nav-item.active > a .ic { color: var(--accent); }
.caret { margin-left: auto; width: 6px; height: 6px; border-right: 1.6px solid var(--faint); border-bottom: 1.6px solid var(--faint); transform: rotate(-45deg); }
.sub { display: block; visibility: hidden; opacity: 0; transform: translateX(-4px); position: absolute; left: calc(100% + 6px); top: -6px; min-width: 220px; padding: 6px; z-index: 30;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: var(--r); box-shadow: var(--pop); transition: opacity .15s var(--ease), transform .15s var(--ease), visibility .15s; }
.sub a { display: block; padding: 8px 12px; color: var(--ink); border-radius: 8px; font-size: 14px; }
.sub a:hover { background: var(--accent); color: #fff; }
.nav-item.has-sub:hover .sub, .nav-item.has-sub:focus-within .sub { visibility: visible; opacity: 1; transform: none; }
.side-foot { padding: 10px 12px 16px; border-top: 1px solid var(--line); }
.side-foot a { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 8px 11px; border-radius: var(--r-sm); font-size: 14px; }
.side-foot a:hover { background: rgba(0, 0, 0, .045); color: var(--ink); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 14px; padding: 12px 36px; min-height: 58px;
  background: rgba(245, 245, 247, .8); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
.top-company { font-weight: 600; letter-spacing: -.01em; }
.top-company small { color: var(--muted); font-weight: 400; margin-left: 8px; font-size: 13px; }
.top-user { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.top-help { color: var(--faint); display: inline-flex; }
.top-help:hover { color: var(--accent); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--fill-2); color: var(--ink-2); font-weight: 600; font-size: 12.5px; }
.burger { display: none; background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--ink); padding: 4px 6px; border-radius: 8px; }
.content { padding: 30px 36px 56px; flex: 1; width: 100%; max-width: 1320px; animation: enter .28s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.foot { text-align: center; color: var(--faint); font-size: 12px; padding: 18px; }
.banner { margin: 16px 36px 0; padding: 12px 16px; border-radius: var(--r); background: #fff4e5; color: #6b3d00; font-size: 14px; }
.banner.soft { background: var(--tint); color: #0a4d42; }
.banner a { font-weight: 600; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 24px; flex-wrap: wrap; }
.page-head h1 a { color: var(--accent); }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--accent); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- surfaces */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 24px 26px; margin-bottom: 20px; border: 1px solid rgba(0, 0, 0, .035); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.cards2 > .card { margin-bottom: 0; }
.cards2 + .card, .cards2 + .cards2, .kpis + .cards2 { margin-top: 20px; }
.cards2.wide-left { grid-template-columns: 1.6fr 1fr; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpis.small { margin: 6px 0 18px; gap: 10px; }
.kpi { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid rgba(0, 0, 0, .035); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.kpis.small .kpi { box-shadow: none; background: var(--fill); border: 0; }
.kpi span { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi b { font-size: 25px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpis.small .kpi b { font-size: 19px; }
.kpi small { color: var(--faint); }
.empty { text-align: center; padding: 34px 12px; color: var(--muted); }
.empty p { margin-bottom: 14px; }
.flash { padding: 12px 16px; border-radius: var(--r); margin-bottom: 16px; background: #e8f6ee; color: #135c33; font-size: 14px; animation: enter .25s var(--ease) both; }
.flash-error { background: #fdecee; color: #8f0011; }

/* ---------------------------------------------------------------- forms */
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.form > label, .form .grid3 > label { margin-bottom: 12px; }
input, select, textarea { font: inherit; font-size: 15px; color: var(--ink); width: 100%; min-width: 0; padding: 9px 12px; min-height: 40px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: #a1a1a6; }
input:hover, select:hover, textarea:hover { border-color: rgba(0, 0, 0, .2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--accent); flex: none; }
input[type=file] { padding: 7px; font-size: 13.5px; }
input[type=file]::file-selector-button { font: inherit; border: 0; background: var(--fill); padding: 6px 12px; border-radius: 8px; margin-right: 10px; cursor: pointer; color: var(--ink); }
input:disabled { background: var(--fill); color: var(--muted); }
textarea { resize: vertical; line-height: 1.45; }
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; font-weight: 400; }
.grid2, .grid3, .grid4 { display: grid; gap: 14px 18px; align-items: start; }
.grid2 { grid-template-columns: repeat(2, 1fr); }
.grid3 { grid-template-columns: repeat(3, 1fr); }
.grid4 { grid-template-columns: repeat(4, 1fr); }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.grid2 .span3 { grid-column: span 2; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 16px; margin: 0; }
legend { color: var(--ink-2); font-size: 13px; font-weight: 600; padding: 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { flex-direction: row !important; align-items: center; gap: 6px !important; border: 1px solid var(--line-2); border-radius: var(--pill); padding: 5px 12px; color: var(--ink) !important; font-weight: 500; cursor: pointer; }
.chip:has(input:checked) { background: var(--tint); border-color: var(--accent); }
.chip input { width: 15px; height: 15px; }
.hp { position: absolute; left: -9999px; }
.inline { display: inline; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form label { flex-direction: row; align-items: center; gap: 8px; }
.inline-form input, .inline-form select { width: auto; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.filters input[type=search] { max-width: 300px; padding-left: 36px; background: var(--fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2386868b' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l3.5 3.5'/%3E%3C/svg%3E") no-repeat 12px center; border-color: transparent; }
.filters input[type=search]:focus { background-color: var(--surface); }
.filters input, .filters select { width: auto; }
.filters label { flex-direction: row; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.logo-prev { max-height: 60px; max-width: 200px; display: block; margin: 6px 0; border-radius: 8px; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 550; line-height: 1; padding: 10px 16px; min-height: 38px;
  border-radius: var(--pill); border: 0; background: var(--fill-2); color: var(--ink); cursor: pointer; white-space: nowrap; transition: background .15s, transform .08s, box-shadow .15s; }
.btn:hover { background: #dcdce1; color: var(--ink); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); color: #fff; }
.btn-danger { background: #fdecee; color: var(--neg); }
.btn-danger:hover { background: #fbdadf; color: var(--neg); }
.btn-link, .btn-ghost { background: transparent; color: var(--accent); padding-left: 10px; padding-right: 10px; }
.btn-link:hover, .btn-ghost:hover { background: var(--tint); color: var(--accent-2); }
.btn-sm { font-size: 13px; padding: 7px 12px; min-height: 30px; }
.btn-lg { font-size: 16px; padding: 14px 24px; min-height: 48px; }
.btn-block { width: 100%; }
button.x { border: 0; background: none; color: var(--faint); font-size: 20px; cursor: pointer; line-height: 1; width: 28px; height: 28px; border-radius: 50%; }
button.x:hover { color: var(--neg); background: #fdecee; }

/* ---------------------------------------------------------------- tables */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 500; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl.small td { padding: 8px 10px; }
.tbl tfoot td { font-weight: 600; border-bottom: 0; border-top: 1px solid var(--line-2); padding-top: 14px; }
.tbl tfoot tr.grand td { font-size: 16px; border-top: 1px solid var(--ink); }
.tbl.hover tbody tr, tr[data-href] { transition: background .12s; }
.tbl.hover tbody tr:hover, tr[data-href]:hover { background: #f7f7f9; cursor: pointer; }
.tbl.hover tbody tr:hover td:first-child, tr[data-href]:hover td:first-child { border-radius: 10px 0 0 10px; }
.tbl.hover tbody tr:hover td:last-child, tr[data-href]:hover td:last-child { border-radius: 0 10px 10px 0; }
.tbl tr.current td { background: var(--tint); }
.tbl tr.muted td { color: var(--faint); }
.tbl.fin td { padding: 9px 12px; }
.tbl.fin tr.grp td { font-weight: 650; padding-top: 22px; border-bottom: 1px solid var(--line-2); }
.tbl.fin td.ind { padding-left: 28px; }
.tbl.fin tr.sum td { font-weight: 600; color: var(--ink-2); }
.tbl.fin tr.sub td { font-weight: 650; background: var(--fill); }
.tbl.fin tr.grand td { font-weight: 700; font-size: 16px; border-top: 1px solid var(--ink); border-bottom: 0; }
.tbl.checks td:first-child { width: 30px; font-size: 16px; }

/* segmented control tabs */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; margin: 0 0 20px; background: var(--fill-2); border-radius: 12px; }
.tabs a { padding: 7px 14px; color: var(--ink-2); border-radius: 9px; font-size: 13.5px; font-weight: 500; transition: background .15s, color .15s; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 0 0 .5px rgba(0, 0, 0, .04); }
.tabs-inline { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--fill); border-radius: 10px; }
.tabs-inline a { padding: 5px 12px; border-radius: 8px; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.tabs-inline a:hover { color: var(--ink); }
.tabs-inline a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.subtabs { margin-bottom: 16px; }

/* status pills */
.badge { display: inline-block; padding: 3px 10px; border-radius: var(--pill); font-size: 12px; font-weight: 600; background: var(--fill); color: var(--muted); white-space: nowrap; }
.b-draft { background: var(--fill); color: var(--muted); }
.b-sent, .b-confirmed, .b-open { background: #e5f0fd; color: #0a58b5; }
.b-partial { background: #fff1db; color: var(--warn); }
.b-accepted, .b-done, .b-delivered, .b-paid, .b-applied { background: #e3f5ea; color: var(--pos); }
.b-declined, .b-cancelled { background: var(--fill); color: var(--faint); text-decoration: line-through; }
.b-overdue { background: #fdecee; color: var(--neg); }

/* ---------------------------------------------------------------- dashboard */
.steps { margin: 0; padding-left: 20px; line-height: 1.6; }
.steps li { margin-bottom: 10px; padding-left: 4px; }
.steps li::marker { color: var(--faint); font-weight: 600; }
.steps li.done > a { text-decoration: line-through; color: var(--faint); }
.steps small { color: var(--muted); }
.chart { width: 100%; height: auto; }
.chart .grid { stroke: var(--line); }
.chart .axis { font-size: 11px; fill: var(--faint); font-family: var(--font); }
.bar-in, .lg-in { fill: #34c759; background: #34c759; }
.bar-out, .lg-out { fill: #ff6b5e; background: #ff6b5e; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.chart-legend .tot { margin-left: auto; font-size: 12.5px; }
.chart-legend .tot + .tot { margin-left: 0; }
.chart-legend .tot b { display: block; font-size: 19px; font-weight: 650; letter-spacing: -.02em; color: var(--ink); }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 5px 0; }

/* ---------------------------------------------------------------- documents */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.doc-side { position: sticky; top: 76px; padding: 18px 20px; }
.doc-side h3:first-child { margin-top: 0; }
.act, .doc-side .act { display: flex; align-items: center; text-align: left; background: none; border: 0; padding: 7px 10px; margin: 0 -10px; width: calc(100% + 20px); border-radius: 8px; color: var(--accent); font: inherit; font-size: 14px; cursor: pointer; }
.act:hover { background: var(--tint); }
.act.danger { color: var(--neg); }
.act.danger:hover { background: #fdecee; }
.doc-side form.inline { display: block; }
details.send summary { list-style: none; }
details.send summary::-webkit-details-marker { display: none; }
details.send form { padding: 8px 0 12px; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 10px 32px; margin-bottom: 18px; }
.doc-meta span { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 2px; }
.doc-text { color: var(--ink-2); background: var(--fill); padding: 12px 14px; border-radius: var(--r-sm); }
.qty-track { display: flex; gap: 22px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.qty-track .pos, .qty-track .pos b { color: var(--pos); }
.history { list-style: none; padding: 0; margin: 0; }
.history li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.history li:last-child { border: 0; }
.history small { color: var(--faint); }
dl.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
dl.dl dt { color: var(--muted); }
dl.dl dd { margin: 0; }
dl.dl.cols { grid-template-columns: max-content 1fr max-content 1fr; }
.quote { border-left: 3px solid var(--fill-2); padding: 4px 14px; color: var(--ink-2); }
.app-card .cards2 { margin-top: 12px; }
.app-docs { margin: 12px 0; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.doc-chip { background: var(--fill); border-radius: var(--r-sm); padding: 6px 12px; font-size: 13.5px; }

/* editor */
table.lines { width: 100%; border-collapse: collapse; }
table.lines th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 500; padding: 6px 6px 10px; border-bottom: 1px solid var(--line); }
table.lines td { padding: 12px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.lines td.drag { color: #c7c7cc; cursor: grab; width: 18px; padding-top: 20px; }
table.lines .ln-main { min-width: 260px; }
table.lines .ln-main select { margin-bottom: 8px; }
table.lines td:nth-child(3) { width: 110px; }
table.lines td:nth-child(4) { width: 120px; }
table.lines td:nth-child(5) { width: 84px; }
table.lines td:nth-child(6) { width: 220px; }
table.lines td:nth-child(6) select + select { margin-top: 8px; font-size: 13px; color: var(--muted); background-color: var(--fill); border-color: transparent; }
table.lines .ln-unit { margin-top: 8px; font-size: 13px; background: var(--fill); border-color: transparent; }
table.lines .ln-total { padding-top: 21px; font-weight: 600; width: 110px; }
tr.tpl { display: none; }
.totals { margin: 18px 0 0 auto; max-width: 380px; }
.totals > div { display: flex; justify-content: space-between; padding: 5px 0; }
.totals > #t-vats { display: block; padding: 0; }
.totals #t-vats div { display: flex; justify-content: space-between; padding: 4px 0; color: var(--muted); }
.totals .grand { border-top: 1px solid var(--ink); margin-top: 6px; padding-top: 10px; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.doc-form { padding-bottom: 12px; }
.sticky-actions { position: sticky; bottom: 14px; z-index: 5; display: flex; gap: 10px; align-items: center; padding: 10px; margin-top: 8px; width: max-content; max-width: 100%;
  background: rgba(255, 255, 255, .82); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-radius: var(--pill); box-shadow: var(--pop); }
details.card > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 10px; }
details.card > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(-45deg); transition: transform .2s var(--ease); }
details.card[open] > summary::before { transform: rotate(45deg); }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: 16px; }
.tbl.je input, .tbl.je select { font-size: 14px; padding: 7px 10px; min-height: 36px; }
.tbl.recon details { display: inline-block; }
.tbl.recon details > summary { list-style: none; }
.tbl.recon details > summary::-webkit-details-marker { display: none; }
.tbl.recon details[open] { display: block; margin-top: 10px; background: var(--fill); padding: 14px; border-radius: var(--r); }
.counter { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }

/* banking */
.bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.bank-card { display: flex; flex-direction: column; gap: 4px; color: var(--ink); margin: 0; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.bank-card:hover { color: var(--ink); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0, 0, 0, .08); }
.bank-card.inactive { opacity: .5; }
.bk-kind { font-size: 12.5px; color: var(--muted); }
.bank-card b { font-size: 17px; letter-spacing: -.01em; }
.bank-card small { color: var(--faint); }
.bk-bal { font-size: 28px; font-weight: 650; letter-spacing: -.03em; margin: 14px 0 8px; font-variant-numeric: tabular-nums; }
.bank-card .badge { align-self: flex-start; }

/* reports */
.rep-title { margin: 6px 0 16px; }
.rep-title h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.rep-title p { margin: 4px 0 0; color: var(--muted); }
.cards2.bs > div { min-width: 0; }

/* ---------------------------------------------------------------- public site */
body.bare { min-height: 100vh; display: flex; flex-direction: column; background: var(--canvas); }
.pub-nav { position: sticky; top: 0; z-index: 30; background: rgba(245, 245, 247, .78); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
.pub-inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 24px; min-height: 60px; position: relative; }
.pub-links { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.pub-links a { color: var(--ink-2); font-size: 14px; font-weight: 500; padding: 7px 12px; border-radius: var(--pill); }
.pub-links a:hover { color: var(--ink); background: rgba(0, 0, 0, .045); }
.pub-links a.pill { background: var(--ink); color: #fff; margin-left: 6px; }
.pub-links a.pill:hover { background: #000; }
.pub-toggle, .pub-burger { display: none; }
.bare-main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 40px 24px 64px; }
.bare-main > .flash { max-width: 520px; margin: 0 auto 16px; }
.pub-foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pub-foot .pub-inner { min-height: 72px; flex-wrap: wrap; }
.pub-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.pub-foot nav a { color: var(--muted); }
.pub-foot nav a:hover { color: var(--ink); }
.pub-foot .ver { margin-left: auto; color: var(--faint); font-size: 12px; }
.pub-brand.small { font-size: 15px; }
.pub-brand.small .logo-dot { width: 24px; height: 24px; font-size: 9.5px; border-radius: 7px; }

.auth-card, .auth-wide { background: var(--surface); border-radius: 22px; box-shadow: 0 2px 6px rgba(0, 0, 0, .04), 0 18px 50px rgba(0, 0, 0, .07); padding: 34px 34px 30px; width: 100%; max-width: 420px; }
.auth-wide { max-width: 760px; margin: 0 auto; }
.auth-card h2, .auth-wide h2 { font-size: 24px; letter-spacing: -.025em; margin-bottom: 8px; }
.auth-card form > label, .auth-wide form > label { margin-bottom: 14px; }
.auth-card .btn-lg { margin-top: 2px; }
.center-stage { min-height: 60vh; display: grid; place-items: center; }
.center-stage .auth-card { margin: 0 auto; }
.or { text-align: center; margin: 20px 0 12px; position: relative; color: var(--faint); font-size: 13px; }
.or::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.or span { background: var(--surface); padding: 0 12px; position: relative; }

.landing { display: grid; grid-template-columns: 1.25fr .9fr; gap: 56px; align-items: center; padding: 28px 0 40px; }
.hero h1 { font-size: clamp(42px, 6vw, 70px); line-height: 1.04; letter-spacing: -.038em; font-weight: 800; margin-bottom: 22px; }
.hero .lead { font-size: 19px; line-height: 1.5; color: var(--muted); max-width: 34em; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.lead { color: var(--muted); }

/* the document flow strip — the signature element */
.flow { margin: 8px 0 72px; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); padding: 26px; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.flow-step { position: relative; padding: 4px 22px; }
.flow-step + .flow-step { border-left: 1px solid var(--line); }
.flow-step .fs-kind { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.flow-step .fs-kind .ic { color: var(--accent); width: 17px; height: 17px; }
.flow-step .fs-no { font-size: 20px; font-weight: 650; letter-spacing: -.02em; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.flow-step .fs-amt { font-size: 14px; color: var(--ink-2); margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.flow-step::after { content: ""; position: absolute; right: -7px; top: 38%; width: 12px; height: 12px; border-top: 1px solid var(--line-2); border-right: 1px solid var(--line-2); transform: rotate(45deg); background: var(--surface); z-index: 1; }
.flow-step:nth-child(4)::after { display: none; }
.flow-cap { grid-column: 1 / -1; margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

.section { padding: 56px 0 8px; }
.section-title { font-size: clamp(30px, 4vw, 44px); line-height: 1.1; letter-spacing: -.035em; font-weight: 750; margin: 0 0 32px; max-width: 18em; }
.section-title .muted { color: var(--faint); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { background: var(--surface); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow); }
.f-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--tint); color: var(--accent); margin-bottom: 18px; }
.f-ic .ic { width: 21px; height: 21px; }
.feature h3 { font-size: 17px; color: var(--ink); font-weight: 650; letter-spacing: -.015em; margin: 0 0 8px; }
.feature p { color: var(--muted); margin: 0; font-size: 14.5px; }
.steps-row { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.steps-row li { counter-increment: s; padding-top: 18px; border-top: 2px solid var(--ink); }
.steps-row li::before { content: counter(s); display: block; font-size: 13px; color: var(--faint); font-weight: 600; margin-bottom: 8px; }
.steps-row b { display: block; font-size: 18px; letter-spacing: -.015em; margin-bottom: 6px; }
.steps-row span { color: var(--muted); font-size: 14.5px; }
.price-card { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); padding: 44px; text-align: center; max-width: 560px; margin: 24px auto 0; }
.price-card h2 { font-size: 26px; letter-spacing: -.025em; }
.price-big { font-size: 56px; font-weight: 800; letter-spacing: -.045em; line-height: 1; margin: 6px 0 12px; font-variant-numeric: tabular-nums; }
.price-big small { font-size: 18px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 6px; }
.price-card p { margin-bottom: 24px; }

/* checkout & misc public */
.checkout { text-align: center; }
.co-icon { font-size: 40px; line-height: 1; margin: 2px 0 14px; }
.co-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; }
.checkout pre { text-align: left; white-space: pre-wrap; }
.auth-wide fieldset small { display: block; margin-top: 6px; }
.auth-card .co-icon { text-align: center; }

/* guide */
.guide-hero { max-width: 720px; margin: 0 0 36px; }
.guide-hero h1 { font-size: clamp(34px, 4.5vw, 52px); letter-spacing: -.04em; line-height: 1.05; margin-bottom: 14px; font-weight: 800; }
.guide-hero .lead { font-size: 18px; }
.guide-body { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 36px; align-items: start; }
.guide-toc { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 1px; }
.guide-toc a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.guide-toc a .ic { color: var(--faint); width: 17px; height: 17px; }
.guide-toc a:hover { background: rgba(0, 0, 0, .045); color: var(--ink); }
.guide-sec { scroll-margin-top: 84px; padding: 28px 30px; }
.guide-sec h2 { font-size: 22px; letter-spacing: -.025em; display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.g-ic { width: 36px; height: 36px; border-radius: 11px; background: var(--tint); color: var(--accent); display: grid; place-items: center; flex: none; }
.g-steps { list-style: none; counter-reset: g; margin: 0; padding: 0; }
.g-steps li { counter-increment: g; display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.g-steps li:first-child { border-top: 0; padding-top: 0; }
.g-steps li::before { content: counter(g); grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; background: var(--fill); color: var(--ink-2); font-size: 12px; font-weight: 600; display: grid; place-items: center; margin-top: 1px; }
.g-steps b { font-weight: 600; }
.g-steps p { margin: 2px 0 0; color: var(--muted); font-size: 14.5px; }
.g-steps p b { color: var(--ink-2); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .doc-layout { grid-template-columns: 1fr; }
  .doc-side { position: static; }
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .side { position: fixed; left: 0; transform: translateX(-100%); transition: transform .28s var(--ease); background: rgba(250, 250, 252, .96); box-shadow: var(--pop); }
  .side.open { transform: none; }
  .sub { position: static; visibility: visible; opacity: 1; transform: none; box-shadow: none; background: none; backdrop-filter: none; padding: 0 0 6px 30px; min-width: 0; }
  .sub a { padding: 5px 10px; font-size: 13.5px; color: var(--ink-2); }
  .caret { display: none; }
  .burger { display: block; }
  .content { padding: 20px 16px 40px; }
  .top { padding: 10px 16px; }
  .top-email { display: none; }
  .banner { margin: 12px 16px 0; }
  h1 { font-size: 26px; }
  .cards2, .cards2.wide-left, .landing, .grid2, .grid3, .counter, .guide-body, .feature-grid, .steps-row { grid-template-columns: 1fr; }
  .span2, .span3, .grid2 .span3 { grid-column: auto; }
  .tbl { display: block; overflow-x: auto; }
  table.lines, table.lines tbody, table.lines tr, table.lines td { display: block; width: auto !important; }
  table.lines thead { display: none; }
  table.lines tr.ln { background: var(--fill); border-radius: var(--r); margin-bottom: 10px; padding: 8px; }
  table.lines td { border: 0; padding: 4px; }
  table.lines td.drag { display: none; }
  dl.dl.cols { grid-template-columns: max-content 1fr; }
  .guide-toc { position: static; flex-direction: row; flex-wrap: wrap; }
  .flow { grid-template-columns: 1fr 1fr; gap: 18px 0; }
  .flow-step:nth-child(3) { border-left: 0; }
  .flow-step::after { display: none; }
  .landing { gap: 32px; padding-top: 8px; }
  .pub-burger { display: grid; gap: 5px; margin-left: auto; cursor: pointer; padding: 10px; }
  .pub-burger span { display: block; width: 20px; height: 1.6px; background: var(--ink); border-radius: 2px; }
  .pub-links { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; align-items: stretch; padding: 10px 16px 16px; background: rgba(245, 245, 247, .97); border-bottom: 1px solid var(--line); }
  .pub-toggle:checked ~ .pub-links { display: flex; }
  .pub-links a.pill { margin: 6px 0 0; text-align: center; }
  .sticky-actions { width: auto; border-radius: var(--r); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- print (reports) */
@media print {
  .side, .top, .foot, .banner, .tabs, .filters, .head-actions, .sticky-actions, .btn, form.inline-form, .subtabs, nav, .pub-nav, .pub-foot { display: none !important; }
  body.app { display: block; background: #fff; }
  .content { padding: 0; max-width: none; animation: none; }
  .card { box-shadow: none; padding: 0; border: 0; }
  a { color: inherit; }
  .tbl td, .tbl th { padding: 4px 6px; font-size: 11.5px; }
}
