/* Theme tokens (values measured from the original) */
:root {
  color-scheme: light;
  --background: #e5e5e5;
  --foreground: #404040;
  --border: #d4d4d4;
  --inset: #ffffffbf;
  --primary-foreground: #0069a8;
  --link: rgba(0, 105, 168, 0.75);
  --accent: #fefdf4;
  --selection: #1447e6;
  --selection-foreground: #ffffff;
  --card: #ffffff;
  --card-border: #e5e5e5;
  --card-foreground: #171717;
  --card-foreground-50: rgba(23, 23, 23, 0.5);
  --card-foreground-75: rgba(23, 23, 23, 0.75);
  --muted: #f5f5f5;
  --muted-inset: #ffffffbf;
  --muted-shadow: rgba(0, 0, 0, 0.05);
  --muted-foreground: #525252;
  --muted-foreground-shadow: 1px 1px 0px #fff;
  --input: #ffffff;
  --input-border: #e5e5e5;
  --input-foreground: #171717;
  --row-alt: #fafafa;
  --summary-head: #fffef2;
  --neutral-300: #d4d4d4;
  --neutral-400: #a1a1a1;
  --neutral-500: #737373;
  --radius-md: 6px;
  --radius-lg: 8px;
  --prose: 65ch;
  --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
:root.dark {
  color-scheme: dark;
  --background: #44403b;
  --foreground: #d6d3d1;
  --border: #0c0a09;
  --inset: #ffffff26;
  --primary-foreground: #fee685;
  --link: rgba(254, 230, 133, 0.75);
  --accent: #1e1a4d;
  --selection: #973c08;
  --card: #1c1917;
  --card-border: #0c0a09;
  --card-foreground: #d6d3d1;
  --card-foreground-50: rgba(214, 211, 209, 0.5);
  --card-foreground-75: rgba(214, 211, 209, 0.75);
  --muted: #292524;
  --muted-inset: #ffffff26;
  --muted-shadow: rgba(0, 0, 0, 0.5);
  --muted-foreground: #d6d3d1;
  --muted-foreground-shadow: 1px 1px 0px #000;
  --input: #292524;
  --input-border: #0c0a09;
  --input-foreground: #d6d3d1;
  --row-alt: #22201e;
  --summary-head: #24211c;
}

/* Base */
*, ::before, ::after { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid; }
html { -webkit-text-size-adjust: 100%; tab-size: 4; line-height: 1.5; font-family: var(--font-sans); -webkit-tap-highlight-color: transparent; }
html:has(dialog:modal) { overflow: hidden; }
body { background-color: var(--background); color: var(--foreground); font-size: 14px; line-height: calc(1.25 / .875); min-height: 100vh; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--primary-foreground); }
b, strong { font-weight: bolder; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; background-color: transparent; border-radius: 0; }
button, select { text-transform: none; }
button, [role=button] { cursor: pointer; }
table { text-indent: 0; border-color: inherit; border-collapse: collapse; }
img, svg, iframe { display: block; vertical-align: middle; }
summary { display: list-item; }
hr { height: 2px; color: inherit; border-top-width: 1px; border-color: var(--border); box-shadow: inset 0 1px var(--inset); }
label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--muted-foreground); }
pre { font-family: var(--font-mono); font-size: 1em; white-space: pre-wrap; }
[hidden], .hidden { display: none !important; }
.fas, .fa-fw { text-align: center; width: 1.25em; }
.lang-glyph { display: inline-block; position: relative; width: 1.25em; height: 1em; vertical-align: -0.125em; font-weight: 700; line-height: 1; }
.lang-glyph::before { content: "\6587"; position: absolute; left: 0; top: -1px; font-size: 10px; }
.lang-glyph::after { content: "A"; position: absolute; right: -1px; bottom: -2px; font-size: 12px; }

/* Utilities */
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-xs { font-size: 12px; line-height: 16px; }
.text-sm { font-size: 14px; line-height: 20px; }
.text-base { font-size: 16px; line-height: 24px; }
.text-lg { font-size: 18px; line-height: 28px; }
.text-xl { font-size: 20px; line-height: 28px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-n300 { color: var(--neutral-300); }
.text-n400 { color: var(--neutral-400); }
.text-n500 { color: var(--neutral-500); }
.nowrap { white-space: nowrap; }
.w-full { width: 100%; }
.w-0 { width: 0; }
.w-px { width: 1px; }
.block { display: block; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; }
.space-y-4 > * + * { margin-top: 16px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-5 { margin-bottom: 20px; }
.mt-8 { margin-top: 32px; }
.me-2 { margin-inline-end: 8px; }
.me-3 { margin-inline-end: 12px; }
.ms-2 { margin-inline-start: 8px; }
.p-0 { padding: 0; } .p-2 { padding: 8px; } .p-4 { padding: 16px; } .p-6 { padding: 24px; } .p-8 { padding: 32px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.max-w-prose { max-width: var(--prose); }
.align-top { vertical-align: top; }
.opacity-25 { opacity: .25; }
.opacity-50 { opacity: .5; }
.opacity-75 { opacity: .75; }
.text-shadow { text-shadow: var(--muted-foreground-shadow); }
.tabular { font-variant-numeric: tabular-nums; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.dim-link { color: var(--foreground); opacity: .25; }
.dim-link:hover { color: var(--foreground); opacity: .5; }
.error-text { color: #e7000b; font-weight: 600; }

/* Top bar */
.topbar { padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; box-shadow: inset 0 1px var(--inset); overflow-x: auto; }
.topbar-nav { display: flex; gap: 8px; font-weight: 600; }
.lang > summary { opacity: .5; white-space: nowrap; cursor: pointer; }
.lang > summary:hover { opacity: .75; }
.theme-toggle { color: var(--foreground); opacity: .5; cursor: pointer; }
.theme-toggle:hover { opacity: 1; }
.navbar-item { border-radius: var(--radius-lg); padding: 4px 16px; white-space: nowrap; color: var(--card-foreground-50); border: 1px solid transparent; }
.navbar-item:hover { background-color: var(--card); color: var(--card-foreground-75); }
.navbar-item.active { color: var(--card-foreground-75); background-color: var(--card); border-color: var(--border); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .05); }
.navbar-item i { opacity: .75; margin-inline-end: 12px; }

/* Page body */
.page { padding-bottom: 8px; }
.version { padding: 16px; font-weight: 600; text-align: center; color: var(--neutral-400); }

/* Cards */
.card { display: flex; flex-direction: column; border: 1px solid var(--card-border); border-radius: var(--radius-lg); color: var(--card-foreground); background-color: var(--card); }
.card > :not(:last-child) { border-bottom: 1px solid var(--card-border); }
.card > :first-child { border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg); }
.card > :last-child { border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); }
.card-body { padding: 8px 24px; box-shadow: inset 0 1px var(--muted-inset); }
.card-body.p-8 { padding: 32px; }
.card-body.p-6 { padding: 24px; }
.card-header { padding: 16px 24px; box-shadow: inset 0 1px var(--muted-inset); background-color: var(--muted); color: var(--muted-foreground); }
.card-title { font-size: 16px; line-height: 24px; font-weight: 600; color: var(--muted-foreground); opacity: .25; text-shadow: var(--muted-foreground-shadow); }
.card-inset { padding: 16px 24px; box-shadow: inset 0 2px 4px var(--muted-shadow); background-color: var(--muted); color: var(--muted-foreground); }
.card-shadow { box-shadow: 0 4px 6px -1px var(--muted-shadow); }

/* Buttons */
.btn { cursor: pointer; border-radius: var(--radius-md); border: 1px solid var(--input-border); padding: 6px 16px; font-size: 14px; line-height: 1.5; font-weight: 600; white-space: nowrap; background-color: var(--input); color: var(--input-foreground); vertical-align: middle; user-select: none; text-decoration: none; }
.btn:hover { color: var(--input-foreground); background-color: color-mix(in oklab, var(--input), var(--input-border)); }
.btn:focus { outline: none; box-shadow: 0 0 0 4px rgba(212, 212, 212, .25); }
.btn:active { box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, .05); }
.btn:disabled { pointer-events: none; opacity: .65; }
.btn-primary { color: #fff; background-color: #428bca; border-color: #357ebd; box-shadow: inset 0 1px #ffffff80; }
.btn-primary:hover { color: #fff; background-color: #3276b1; border-color: #285e8e; }
.btn-primary:focus { box-shadow: inset 0 1px #ffffff80, 0 0 0 4px rgba(43, 127, 255, .25); }
.btn-success { color: #fff; background-color: #5cb85c; border-color: #4cae4c; box-shadow: inset 0 1px #ffffff80; }
.btn-success:hover { color: #fff; background-color: #47a447; border-color: #398439; }
.btn-success:focus { box-shadow: inset 0 1px #ffffff80, 0 0 0 4px rgba(0, 199, 88, .25); }
.btn-danger { color: #fff; background-color: #d9534f; border-color: #d43f3a; box-shadow: inset 0 1px #ffffff80; }
.btn-danger:hover { color: #fff; background-color: #d2322d; border-color: #ac2925; }
.btn-danger:focus { box-shadow: inset 0 1px #ffffff80, 0 0 0 4px rgba(251, 44, 54, .25); }
.btn-sm { padding: 2px 12px; font-weight: 400; border-radius: 4px; }
.spin { margin-inline-end: 8px; }

/* Forms */
.form-control, .form-select { display: block; width: 100%; border-radius: var(--radius-md); border: 1px solid var(--input-border); padding: 6px 8px; font-size: 14px; line-height: 1.5; font-weight: 400; background-color: var(--input); color: var(--input-foreground); appearance: none; }
.form-control:focus, .form-select:focus { outline: none; border-color: #51a2ff; box-shadow: 0 0 0 4px rgba(43, 127, 255, .25); }
.form-control::placeholder { color: var(--input-foreground); opacity: .5; }
.form-control[readonly] { cursor: default; }
.form-select { padding-inline-end: 32px; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 8px center; background-size: 12px 10px; height: 35px; }
.form-file::file-selector-button { margin-inline-end: 8px; padding: 6px 16px; border: 1px solid var(--input-border); border-radius: var(--radius-md); background: var(--input); color: var(--input-foreground); font: inherit; cursor: pointer; }

/* Dropdowns */
.dropdown { position: relative; }
.dropdown > summary { list-style-position: inside; }
.dropdown > .btn { display: list-item; }
.dropdown-menu { position: absolute; inset-inline-start: 0; z-index: 50; margin-top: 8px; display: flex; flex-direction: column; border-radius: var(--radius-md); border: 1px solid var(--border); padding: 8px 0; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1); color: var(--card-foreground); background-color: var(--card); }
.dropdown-menu.px-2 { padding-left: 8px; padding-right: 8px; }
.dropdown-menu hr { margin: 8px 0; }
.dropdown-item { display: block; padding: 8px 32px; text-align: start; white-space: nowrap; color: var(--card-foreground); }
.dropdown-item:hover { background-color: var(--selection); color: var(--selection-foreground); }
.lang-item { width: 100%; cursor: pointer; }
.lang-item.current { font-weight: 700; }

/* Lists (businesses, users, extensions) */
.list-head-title { font-weight: 600; font-size: 18px; line-height: 28px; color: var(--neutral-400); padding: 0 12px; text-shadow: var(--muted-foreground-shadow); }
.list-head-title.bold { font-weight: 700; text-shadow: none; }
.list-table td { vertical-align: middle; }
.biz-link { display: block; font-weight: 600; padding: 8px; font-size: 14px; }
.ext-btn { display: block; cursor: pointer; font-weight: 600; padding: 8px; font-size: 14px; color: var(--link); text-align: start; }
.ext-btn:hover { color: var(--primary-foreground); }
.ext-dialog { margin: 0 0 0 auto; margin-inline-start: 96px; width: auto; height: 100vh; max-width: none; max-height: none; border: 0; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25); background: var(--card); color: var(--card-foreground); transform: translateX(0); transition: transform .3s ease-out; inset: 0; }
.ext-dialog::backdrop { background: rgba(0, 0, 0, .1); }
@starting-style { .ext-dialog[open] { transform: translateX(100%); } }
.ext-dialog .inner { padding: 48px; max-width: 720px; font-weight: 400; }
.ext-dialog h2 { font-size: 24px; line-height: 32px; margin-bottom: 16px; }
.empty-note { color: var(--neutral-300); font-size: 20px; line-height: 28px; font-weight: 700; text-align: center; padding: 16px; }
.sessions th { text-align: start; font-weight: 700; padding: 4px 0; }
.sessions td { padding: 0; height: 35px; }

/* Business workspace */
.biz-wrap { }
.biz-header { background-color: var(--muted); border: 1px solid var(--border); box-shadow: inset 0 1px var(--muted-inset); overflow-x: auto; }
.biz-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 16px; }
.biz-close { color: var(--muted-foreground); opacity: .25; font-size: 20px; line-height: 28px; }
.biz-close:hover { color: var(--muted-foreground); opacity: .5; }
.biz-name { font-size: 18px; line-height: 28px; font-weight: 700; white-space: nowrap; color: var(--muted-foreground); text-shadow: var(--muted-foreground-shadow); }
.biz-main { display: flex; flex-direction: column; }
.sidebar { display: flex; overflow-x: auto; }
.tab { position: relative; display: flex; justify-content: space-between; font-weight: 600; padding: 8px 12px; gap: 16px; border-inline-end: 1px solid var(--border); border-bottom: 1px solid var(--border); background-color: var(--muted); box-shadow: inset 0 1px var(--muted-inset); }
.tab.active { background-color: var(--card); box-shadow: none; }
.tab-label { display: flex; gap: 12px; align-items: center; }
.tab-icon { color: var(--muted-foreground); opacity: .25; }
.tab-count { background-color: var(--input); border: 1px solid var(--input-border); color: rgba(23, 23, 23, .6); font-size: 12px; line-height: 16px; white-space: nowrap; padding: 0 8px; border-radius: 4px; font-variant-numeric: tabular-nums; align-self: center; }
:root.dark .tab-count { color: rgba(214, 211, 209, .6); }
.tab-count.zero { opacity: .5; }
.tab-tip { display: none; position: absolute; z-index: 100; left: 88px; padding: 2px 8px; background: #171717; color: #fff; border-radius: 4px; white-space: nowrap; filter: drop-shadow(0 1px 2px rgba(0,0,0,.1)); }
.sidebar-fill { border-color: var(--border); }
.sidebar-fill .customize { font-weight: 600; }
.biz-content { background-color: var(--card); border-color: var(--border); border-inline-end: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 14px; }
.icon-btn { cursor: pointer; display: block; }
.icon-btn i { opacity: .25; }
.icon-btn:hover i { opacity: .5; }
.summary-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.sum-head { background-color: var(--summary-head); }
.sum-head-row { display: flex; justify-content: space-between; font-weight: 600; font-size: 18px; }
.sum-table td { padding: 4px; }
.sum-table td:first-child { padding-left: 0; }
.sum-table td.amt { font-weight: 600; white-space: nowrap; text-align: right; width: 1px; font-variant-numeric: tabular-nums; }
.sum-net { display: flex; justify-content: space-between; font-weight: 600; font-size: 18px; }
.underline { text-decoration: underline; }
.observer-bar { display: none; }
:root.observer .observer-bar { display: block; }
:root.observer .obscure { filter: blur(4px); }
:root.observer .obscure:hover { filter: none; transition: filter .15s; }
:root.observer .mask-on { display: none; }
:root:not(.observer) .mask-off { display: none; }

/* Data tables inside a business */
.card-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 20px; }
.card-table th { border-inline-end: 1px solid var(--card-border); border-top: 1px solid var(--card-border); padding: 12px; text-align: start; font-weight: 600; color: color-mix(in oklab, var(--muted-foreground) 75%, transparent); background-color: var(--muted); box-shadow: inset 0 1px var(--muted-inset); }
.card-table thead tr:first-child th { border-top-width: 0; }
.card-table th:last-child, .card-table td:last-child { border-inline-end-width: 0; }
.card-table th i { font-size: 16px; line-height: 24px; color: var(--muted-foreground); opacity: .25; text-shadow: var(--muted-foreground-shadow); }
.card-table td { border-inline-end: 1px solid var(--card-border); border-top: 1px solid var(--card-border); padding: 12px; box-shadow: inset 0 1px var(--muted-inset); }
.card-table tbody tr:nth-child(odd) { background-color: var(--row-alt); }
.card-table .text-center { text-align: center; }
.card-table .text-right { text-align: right; }
.list-tools { display: flex; align-items: center; gap: 16px; }
.adv-q { color: #999; font-size: 12px; cursor: pointer; }
.report-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.report-col { display: flex; flex-direction: column; gap: 32px; }
.report-card .card-header { padding: 20px 24px; }
.report-card .card-title { font-size: 16px; }
.report-link { display: block; padding: 8px 24px; }

/* Compact sidebar mode */
:root.compact .tab-text, :root.compact .tab-count, :root.compact .sidebar-fill .customize { display: none; }

/* ≥ 1024px: desktop layout */
@media (min-width: 64rem) {
  .topbar { padding-left: 32px; padding-right: 32px; overflow: visible; }
  .page { padding-left: 32px; padding-right: 32px; }
  .lang-cols { columns: 4; }
  .biz-header { overflow: visible; }
  .biz-main { flex-direction: row; }
  .sidebar { flex-direction: column; overflow: visible; }
  .tab { border-inline-start: 1px solid var(--border); }
  .tab.active { border-inline-end-color: var(--card); }
  .sidebar-fill { border-inline-end: 1px solid var(--border); flex-grow: 1; padding-bottom: 128px; padding-top: 24px; }
  .biz-content { padding: 24px 24px 128px; gap: 16px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root.compact .tab:hover .tab-tip { display: block; }
}
@media (max-width: 63.999rem) {
  .table-scroll { overflow-x: auto; }
  .sidebar-fill { display: none; }
}
@media (max-width: 40rem) {
  .list-head { flex-wrap: wrap; }
}

/* ---------- Receipts & sales invoices ---------- */
.btn-outline { background-color: transparent; border-color: var(--input-border); }
.btn-outline:hover { background-color: var(--input); }
.card-form { padding: 16px 24px 24px; box-shadow: inset 0 1px var(--muted-inset); background-color: color-mix(in oklab, var(--card), var(--muted)); color: var(--muted-foreground); }
.doc-form { padding: 0; }
.doc-form .form-fields { padding: 16px 24px 24px; }
.doc-form > .card-header { border-top: 1px solid var(--card-border); border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); }
.doc-form label { margin-bottom: 8px; }
.input-group { display: inline-flex; align-items: stretch; }
.input-group > * { border-radius: 0; }
.input-group > :first-child { border-top-left-radius: var(--radius-md); border-bottom-left-radius: var(--radius-md); }
.input-group > :last-child { border-top-right-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }
.input-group > :not(:first-child) { margin-inline-start: -1px; }
.input-group-text { display: flex; align-items: center; padding: 0 8px; white-space: nowrap; font-weight: 400; color: var(--input-foreground); background-color: var(--muted); border: 1px solid var(--input-border); }
.input-group .form-control, .input-group .form-select { width: auto; }
input[type=checkbox] { accent-color: #1447e6; width: 16px; height: 16px; }
.form-control.num { text-align: right; width: 100px; }
.line-table { border-collapse: separate; border-spacing: 4px 4px; margin: 0 -4px; }
.line-table th { text-align: start; font-weight: 600; color: var(--muted-foreground); padding: 0 4px; white-space: nowrap; }
.line-table td { vertical-align: middle; }
.line-table .form-select { min-width: 140px; }
.line-table tfoot td { padding-top: 4px; }
.line-no { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 35px; padding: 0 6px; border: 1px solid var(--input-border); border-radius: var(--radius-md); background: var(--input); color: var(--input-foreground); font-weight: 700; }
.line-total { display: inline-flex; align-items: center; justify-content: flex-end; min-width: 52px; height: 35px; padding: 0 10px; border: 1px solid var(--input-border); border-radius: var(--radius-md); background: var(--muted); color: var(--input-foreground); font-variant-numeric: tabular-nums; }
.line-total.grand { font-weight: 700; background: var(--input); }
.line-remove { width: 37px; height: 35px; border: 1px solid var(--input-border); border-radius: var(--radius-md); background: var(--input); color: var(--neutral-400); cursor: pointer; }
.line-remove:hover { color: #e7000b; }
.btn-add { font-weight: 400; padding: 2px 12px; }
.btn-add i { width: auto; margin-inline-end: 6px; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 !important; color: var(--card-foreground) !important; cursor: pointer; }
.status-badge { display: inline-block; padding: 1px 10px; border-radius: 4px; color: #fff; font-weight: 600; white-space: nowrap; }
.status-badge.overdue { background: #e7000b; }
.status-badge.paid { background: #00c950; }
.status-badge.due { background: #428bca; }
.where-bar { display: flex; align-items: center; gap: 8px; color: var(--muted-foreground); }
.where-bar .btn { cursor: default; font-weight: 400; padding: 4px 8px; }
.toggle { display: inline-block; width: 22px; height: 14px; border-radius: 7px; background: var(--neutral-300); position: relative; margin-inline-end: 12px; }
.toggle span { position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle.on { background: #428bca; }
.toggle.on span { left: 10px; }
.total-row td { font-weight: 600; background: var(--muted); }
.vsep { width: 1px; align-self: stretch; background: var(--border); margin: 0 4px; }
.btn-group { display: inline-flex; align-items: stretch; }
.btn-group > * { border-radius: 0; }
.btn-group > :first-child { border-top-left-radius: var(--radius-md); border-bottom-left-radius: var(--radius-md); }
.btn-group > :last-child { border-top-right-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }
.btn-group > :not(:first-child) { margin-inline-start: -1px; }
.nav-btn { padding: 6px 22px; }
.nav-btn.disabled { opacity: .5; cursor: default; pointer-events: none; }
.nav-pos { display: flex; align-items: center; padding: 0 8px; color: var(--neutral-400); font-weight: 600; white-space: nowrap; }
.doc-wrap { padding: 24px; overflow-x: auto; }
.doc-paper { background: #fff; color: #000; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 1.45; padding: 36px 36px 48px; max-width: 1000px; min-width: 560px; margin: 0 auto; }
.doc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; }
.doc-top h1 { font-size: 32px; line-height: 1.2; font-weight: 700; margin-top: 30px; }
.doc-logo { width: 110px; height: 110px; border-radius: 12px; background: linear-gradient(135deg, #2f855a, #1c4532); color: #fff; font: 700 56px/110px Arial, sans-serif; text-align: center; }
.doc-meta { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.doc-meta-right { display: flex; gap: 20px; }
.doc-kv { text-align: right; }
.doc-biz { border-inline-start: 1px solid #000; padding-inline-start: 20px; }
.doc-party { font-weight: 700; font-size: 14px; margin-bottom: 18px; }
.doc-desc { margin-bottom: 18px; }
.doc-sub { color: #555; }
.doc-table { width: 100%; border-collapse: collapse; }
.doc-table th, .doc-table td { border: 1px solid #000; padding: 5px 10px; text-align: left; }
.doc-table th { font-weight: 700; }
.doc-table .r { text-align: right; }
.doc-table .c { text-align: center; }
.doc-table td.noborder { border: 0; }
.doc-foot { margin-top: 24px; color: #555; }
@media print {
  body { background: #fff; }
  body * { visibility: hidden; }
  .doc-paper, .doc-paper * { visibility: visible; }
  .doc-paper { position: absolute; left: 0; top: 0; width: 100%; max-width: none; min-width: 0; padding: 0; }
}

/* ---------- All business sections ---------- */
.set-title { font-weight: 700; color: var(--card-foreground); margin-bottom: 4px; }
.status-badge.cancelled { background: var(--neutral-400); }
.report-paper .doc-top { margin-bottom: 20px; }
.report-paper h1 { font-size: 26px; }
.report-paper .doc-table td, .report-paper .doc-table th { padding: 4px 10px; }
.card-table th[colspan] { text-align: start; }
.doc-form .form-fields > .flex > div { min-width: 0; }
@media (max-width: 40rem) {
  .doc-form .form-fields { padding: 16px; }
  .line-table .form-select { min-width: 120px; }
}

/* ---------- Attachments, email, access ---------- */
.attach-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--card-border); }
.attach { display: inline-flex; align-items: center; gap: 6px; }
.attach .icon-btn i { opacity: .4; }
.attach-new { cursor: pointer; }
.cur { color: var(--neutral-500); font-weight: 400; font-size: 12px; }
.biz-access .check { font-weight: 400; }
@media print { .attach-bar { display: none; } }
