:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --text: #0f1b33;
  --muted: #5b6980;
  --line: #e1e6ef;
  --line-strong: #cbd3e1;
  --primary: #1a56db;
  --primary-hover: #1545b5;
  --primary-soft: #e8f0fe;
  --danger: #b3261e;
  --danger-soft: #fbeae8;
  --warn: #8a5a00;
  --warn-soft: #fff4d9;
  --info: #0e5a8a;
  --info-soft: #e5f3fb;
  --ok: #1f6b3b;
  --ok-soft: #e3f4e8;
  --navy: #0b1b3f;
  --navy-2: #13295c;
  --accent: #2ea3f2;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(11, 27, 63, 0.06), 0 1px 1px rgba(11, 27, 63, 0.04);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14.5px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 6px; }
p { margin: 0 0 10px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.boot, .loading { color: var(--muted); padding: 40px; text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.pre-wrap { white-space: pre-wrap; }
.neg { color: var(--danger); }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.row > .field { flex: 0 1 220px; }
.row > .field.grow { flex: 1 1 260px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.narrow { max-width: 760px; margin: 0 auto; }
.spinner { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border: 2px solid var(--line-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- controls */
input, select, textarea { font: inherit; color: inherit; width: 100%; padding: 8px 10px; background: #fff; border: 1px solid var(--line-strong); border-radius: 6px; min-height: 36px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(26, 86, 219, 0.35); outline-offset: 0; border-color: var(--primary); }
input:disabled, select:disabled { background: #eff2f7; color: var(--muted); }
input.invalid { border-color: var(--danger); background: var(--danger-soft); }
input[type='checkbox'] { width: auto; min-height: 0; margin-right: 8px; }
.check { display: flex; align-items: center; font-size: 14px; color: var(--text); }
.field { display: block; }
.field-label { display: block; font-size: 12.5px; font-weight: 600; color: #33405a; margin-bottom: 4px; }
.field-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.field-error { display: block; font-size: 12px; color: var(--danger); margin-top: 3px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: 14px; padding: 8px 14px; min-height: 36px; border-radius: 6px; border: 1px solid var(--line-strong); background: #fff; color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #eef2f8; text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1f19; }
.btn-danger-outline { color: var(--danger); border-color: #e2b4b0; }
.btn-danger-outline:hover { background: var(--danger-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.icon-btn:hover:not(:disabled) { background: #eceff6; color: var(--text); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }

/* ---------- alerts, badges, cards */
.alert { padding: 10px 14px; border-radius: var(--radius); margin: 0 0 14px; border: 1px solid; display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.alert-error { background: var(--danger-soft); border-color: #f0c4c0; color: #7a1a15; }
.alert-info { background: var(--info-soft); border-color: #c3e0f3; color: #0b3f63; }
.alert-warn { background: var(--warn-soft); border-color: #f0dcab; color: #5c3d00; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #eceff5; color: #3d4a60; vertical-align: 1px; white-space: nowrap; }
.badge-posted, .badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-draft, .badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-reversed { background: #eceff5; color: #555; text-decoration: line-through; }
.badge-reversal { background: var(--info-soft); color: var(--info); }
.badge-bad { background: var(--danger-soft); color: var(--danger); }
.badge-system { background: var(--primary-soft); color: var(--primary); }
.badge-cur { background: var(--info-soft); color: var(--info); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow-x: auto; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.card-list { display: grid; gap: 10px; margin-bottom: 18px; }
.company-card { display: flex; justify-content: space-between; align-items: center; color: var(--text); padding: 14px 18px; margin-bottom: 0; }
.company-card:hover { border-color: var(--primary); text-decoration: none; }
.empty { text-align: center; padding: 40px 20px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; padding: 14px 18px; }
.filters .field { flex: 0 1 180px; }
.filters .field.grow { flex: 1 1 240px; }
.onboarding { background: var(--primary-soft); border-color: #c7d7f7; }

/* ---------- layout */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 54px; background: linear-gradient(90deg, var(--navy), var(--navy-2)); color: #fff; box-shadow: inset 0 -2px 0 var(--primary); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 17px; letter-spacing: 0.12em; text-transform: uppercase; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; flex-shrink: 0; display: inline-block; background: url('/brand/cenqra-mark.svg') center / contain no-repeat; }
.topbar-mid { display: flex; align-items: center; gap: 10px; flex: 1; }
.company-switch { width: auto; min-width: 200px; max-width: 320px; background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.company-switch option { color: #000; }
.pill { font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, 0.2); padding: 2px 9px; border-radius: 999px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar .muted { color: rgba(255, 255, 255, 0.8); }
.topbar .btn { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.topbar .btn:hover { background: rgba(255, 255, 255, 0.22); }
.layout { display: flex; flex: 1; align-items: stretch; }
.sidebar { width: 224px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 54px; height: calc(100vh - 54px); overflow-y: auto; }
.nav-item { display: block; padding: 8px 12px; border-radius: 6px; color: var(--text); font-weight: 500; }
.nav-item:hover { background: #eef2f8; text-decoration: none; }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.nav-sub { padding-left: 22px; font-size: 14px; }
.nav-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); padding: 14px 12px 4px; }
.nav-foot { margin-top: auto; padding: 12px; font-size: 12.5px; border-top: 1px solid var(--line); }
.lock-note { color: var(--warn); font-weight: 600; margin-top: 4px; }
.main { flex: 1; min-width: 0; padding: 24px 28px 60px; max-width: 1280px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; max-width: 62ch; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; align-items: start; }

/* ---------- tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table.compact td { padding: 7px 14px; }
.table th.right, .table td.right { text-align: right; }
.table tfoot td { border-top: 2px solid var(--line-strong); background: #f8fafc; font-weight: 600; }
.row-link { cursor: pointer; }
.row-link:hover td { background: #f6f8fb; }
.code { font-variant-numeric: tabular-nums; color: var(--muted); width: 70px; }
.num, .num-input { font-variant-numeric: tabular-nums; }
.num-input { text-align: right; }
.inactive td { opacity: 0.55; }
.group-head { padding: 9px 14px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary); background: var(--primary-soft); border-bottom: 1px solid var(--line); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.pager-info { margin: 0 10px; color: var(--muted); font-size: 13px; }

.lines-table td { padding: 6px 8px; vertical-align: top; }
.lines-table th { padding: 8px; }
.lines-table .col-num, .table .col-num { width: 34px; text-align: center; }
.lines-table td:nth-child(2) { min-width: 260px; }
.lines-table .num-input { min-width: 120px; }
.total { font-weight: 700; }
.balance-bar { padding: 10px 14px; font-weight: 600; border-top: 1px solid var(--line); background: #f8fafc; }
.balance-bar.ok { background: var(--ok-soft); color: var(--ok); }
.balance-bar.off { background: var(--danger-soft); color: var(--danger); }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 70%, transparent); padding: 14px 0 6px; }

/* ---------- reports */
.report { padding: 0; overflow-x: auto; }
.report-head { padding: 22px 22px 12px; text-align: center; border-bottom: 1px solid var(--line); }
.report-company { font-weight: 700; font-size: 16px; }
.report-title { font-size: 20px; font-weight: 700; margin: 2px 0; }
.report-table td, .report-table th { border-bottom-color: #eff2f7; }
.report-table .section-head td { font-weight: 700; padding-top: 16px; color: var(--primary); border-bottom: 1px solid var(--line); }
.report-table .subtotal td { font-weight: 600; border-top: 1px solid var(--line-strong); }
.report-table .grand td { font-weight: 700; background: #f4f6fa; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.report-table .net td { font-size: 16px; background: var(--primary-soft); border-bottom: 3px double var(--primary); }
.report-table .band td { font-size: 15px; font-weight: 800; padding-top: 22px; background: #fff; border-bottom: 2px solid var(--text); }
.report-table .plain td { color: var(--muted); }
.pad { padding: 20px; }

/* ---------- dashboard */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); color: var(--text); display: block; }
.kpi-link:hover { border-color: var(--primary); text-decoration: none; }
.kpi-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.kpi-value { font-size: 24px; font-weight: 700; margin: 4px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpi-cur { font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi-sub { font-size: 12.5px; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.checks li:last-child { border-bottom: 0; }

/* ---------- settings */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 9px 16px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.plain-list { margin: 0; padding-left: 18px; }
.plain-list li { margin-bottom: 6px; }
.meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 20px; margin: 0; }
.meta dt { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.meta dd { margin: 2px 0 0; }

/* ---------- auth */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(1200px 500px at 15% -10%, #dbe8ff, transparent 60%), linear-gradient(160deg, #eaf2ff, var(--bg) 60%); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(11, 27, 63, 0.1); padding: 30px 28px; }
.auth-brand { display: flex; justify-content: center; margin: -4px 0 22px; }
.auth-logo { display: block; width: 100%; max-width: 260px; height: auto; }
.auth-card { border-top: 3px solid var(--primary); }
.auth-card h1 { margin-bottom: 4px; }
.auth-card form { margin-top: 18px; }
.auth-foot { margin: 18px 0 0; text-align: center; }

/* ---------- modal, toasts */
.modal-backdrop { position: fixed; inset: 0; background: rgba(11, 27, 63, 0.45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 480px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.modal-wide { max-width: 720px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 0 20px; }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 14px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px 16px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { padding: 10px 16px; border-radius: 8px; background: #1c2421; color: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); max-width: 360px; }
.toast-error { background: var(--danger); }

/* ---------- responsive + print */
@media (max-width: 980px) {
  .grid-2 { grid-template-columns: 1fr; }
  .layout { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; gap: 4px; }
  .nav-group, .nav-foot { display: none; }
  .nav-sub { padding-left: 12px; }
  .main { padding: 18px 14px 60px; }
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 14px; }
  .user-name { display: none; }
}
@media print {
  body { background: #fff; }
  .topbar, .sidebar, .no-print, .page-actions, .toasts, .sticky-actions { display: none !important; }
  .main { padding: 0; max-width: none; }
  .card, .report { box-shadow: none; border: 0; }
  .page-head { margin-bottom: 6px; }
}
.pad-top { padding-top: 60px; }

/* ---------- sales: sidebar groups, quick actions, documents */
.nav-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 8px 12px; border: 0; background: none; border-radius: 6px; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; }
.nav-toggle:hover { background: #eef2f8; }
.nav-toggle.has-active { color: var(--primary); }
.nav-toggle:focus-visible, .nav-item:focus-visible { outline: 2px solid rgba(26, 86, 219, 0.5); outline-offset: -2px; }
.chev { font-size: 12px; color: var(--muted); transition: transform 0.12s; display: inline-block; }
.chev.open { transform: rotate(90deg); }
.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-item.disabled { color: var(--muted); cursor: default; }
.nav-item.disabled:hover { background: none; }
.soon { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: #eceff5; border-radius: 999px; padding: 0 7px; margin-left: 4px; vertical-align: 1px; }
.badge-info { background: var(--info-soft); color: var(--info); }
.quick-strip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; }
.quick-strip .btn { padding: 7px 12px; }
.quick-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-right: 4px; }
.quick-menu { position: relative; }
.quick-pop { position: absolute; top: calc(100% + 6px); left: 0; min-width: 200px; background: #fff; color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); padding: 6px; z-index: 40; display: flex; flex-direction: column; }
.quick-item { padding: 8px 12px; border-radius: 6px; color: var(--text); font-weight: 500; white-space: nowrap; }
.quick-item:hover { background: #eef2f8; text-decoration: none; }
.quick-item.disabled { color: var(--muted); cursor: default; }
.quick-item.disabled:hover { background: none; }
.doc-lines td { padding: 6px 8px; vertical-align: top; }
.doc-lines td:nth-child(2) { min-width: 220px; }
.doc-lines td:nth-child(6) { min-width: 210px; }
.doc-lines td:nth-child(7) { min-width: 190px; }
.doc-lines .narrow-num { min-width: 70px; max-width: 90px; }
.doc-lines .line-amount { padding-top: 14px; white-space: nowrap; }
.inline-check { display: inline-flex; margin-left: 12px; font-size: 13px; color: var(--muted); }
.doc-sheet { padding: 26px 28px; overflow-x: auto; }
.doc-table { min-width: 560px; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.doc-title { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.doc-from { text-align: right; }
.doc-parties { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; }
.doc-meta { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
.doc-table { margin-bottom: 8px; }
.doc-table tfoot td { background: #fff; border-top: 0; font-weight: 500; }
.doc-table tfoot tr:first-child td { border-top: 2px solid var(--line-strong); }
.doc-notes { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: #33405a; }
.aging { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 14px; text-align: right; }
.aging-cell { background: #f8fafc; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.alloc-table td, .alloc-table th { vertical-align: middle; }
.alloc-table .num-input { min-width: 110px; }
.alloc-input { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.alloc-input .num-input { width: 130px; }
.alloc-ccy { min-width: 30px; text-align: left; }
.alloc-group + .alloc-group { border-top: 1px solid var(--line); }
.alloc-cross td { background: #f5f8fc; padding-top: 2px; padding-bottom: 2px; border-top: none; }
.alloc-cross-note td { background: #f5f8fc; padding-top: 0; padding-bottom: 8px; border-top: none; }
@media (max-width: 980px) {
  .nav-section { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav-toggle { width: auto; }
  .aging { grid-template-columns: repeat(2, 1fr); }
  .quick-pop { left: auto; right: 0; }
}
@media print {
  .quick-strip, .quick-menu, .filters, .alert-info { display: none !important; }
  .doc-sheet { padding: 0; overflow: visible; }
}

/* ---------- exchange-rate helpers */
.link-btn { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--primary); text-decoration: underline; cursor: pointer; }
.alert p { margin: 0 0 6px; }
.alert p:last-child { margin-bottom: 0; }
.alert-info:has(> p) { display: block; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; align-self: flex-end; padding-bottom: 8px; }
.filters .field:has(> select) { flex-basis: 230px; }

/* ---------- banking */
.bal { font-weight: 600; }
.narrow-form { max-width: 860px; }
.rate-hint { padding: 10px 14px; border-radius: 6px; background: var(--info-soft); color: #0b3f63; font-size: 13.5px; }
.rate-hint.off { background: var(--warn-soft); color: var(--warn); }

/* ---------- bank feed, reconciliation, rules */
.tick { font-size: 12px; font-weight: 600; color: var(--ok); white-space: nowrap; }
.feed-tabs { margin-bottom: 12px; }
.tab { background: none; border-top: 0; border-left: 0; border-right: 0; font: inherit; font-weight: 600; cursor: pointer; }
.tab-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: #eceff5; color: var(--muted); font-size: 12px; text-align: center; }
.tab.active .tab-count { background: var(--primary-soft); color: var(--primary); }
.tabs-tight { margin-bottom: 0; border-bottom: 0; }
.feed-table td { vertical-align: top; }
.feed-table .feed-mid { min-width: 260px; }
.feed-table .feed-desc { min-width: 200px; }
.feed-table td.num { white-space: nowrap; }
.feed-table td.col-num, .feed-table th.col-num { width: 34px; }
.line-open td { background: #f6f8fb; border-bottom: 0; }
.line-panel-row > td { padding: 0; background: #f6f8fb; }
.line-panel { padding: 8px 18px 16px; border-top: 1px solid var(--line); border-bottom: 2px solid var(--primary); }
.line-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; overflow-x: auto; }
.line-panel-what { margin: 0 0 10px; }
.sub-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 4px 0 4px; }
.ledger-line { line-height: 1.35; margin-top: 3px; }
.combo { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; margin-bottom: 6px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.scroll-box { max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.line-panel .table { background: #fff; }
.line-panel .table td { padding: 6px 10px; }
.line-panel tr.picked td { background: var(--primary-soft); }
.sum-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; position: sticky; bottom: 0; }
.sum-bar.ok { background: var(--ok-soft); border-color: #b9dfc4; }
.sum-bar.off { background: var(--warn-soft); border-color: #f0dcab; }
.sum-bar .btn { margin-left: auto; }
.extra-lines { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
.extra-lines summary { cursor: pointer; font-size: 13px; }
.book-lines td { vertical-align: middle; }
.book-lines select, .book-lines input { min-width: 120px; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; background: var(--primary-soft); border: 1px solid #c7d7f7; border-radius: var(--radius); }
.imports summary { cursor: pointer; font-weight: 600; }
.imports .table { margin-top: 10px; }
.dropzone { border-style: dashed; border-color: var(--line-strong); }
.dropzone.dragging { border-color: var(--primary); background: var(--primary-soft); }
.dropzone-label { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; flex-wrap: wrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dropzone-label:focus-within .btn { outline: 2px solid rgba(26, 86, 219, 0.5); }
.fading { opacity: 0.6; }
.table-wrap { overflow-x: auto; }
.raw-table td, .raw-table th { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.raw-table tr.is-header td { font-weight: 700; background: var(--primary-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; cursor: pointer; background: #fff; }
.chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.chip input { margin-right: 6px; }
.skipped { margin-bottom: 10px; }
.skipped summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.cond-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.cond-row select { width: auto; min-width: 140px; }
.cond-row input { flex: 1 1 200px; width: auto; }
.cond-row input.num-input { flex: 0 1 140px; }
.report-foot { padding: 4px 22px 16px; }
.report-table td { vertical-align: top; }
@media print {
  .line-panel, .bulk-bar { display: none !important; }
  .report-foot .alert { border: 0; padding: 0; }
}

/* ---------- VAT, corporate tax and cash flow reports */
button.chip { font: inherit; font-size: 13px; line-height: 1.3; }
button.chip:hover { border-color: var(--primary); }
button.chip:focus-visible { outline: 2px solid rgba(26, 86, 219, 0.5); outline-offset: 1px; }
.chip-static { cursor: default; }
.preset-chips { padding-top: 1px; }
.kpi-ok .kpi-value { color: var(--ok); }
.alert-ok { background: var(--ok-soft); border-color: #bfe0c9; color: #164d2a; }
.grid-2.equal { grid-template-columns: 1fr 1fr; }
.card.flush .card-head.pad { padding: 14px 18px 8px; margin: 0; }
.card.flush > p.pad, .card.flush > div.pad { padding: 10px 18px 14px; }
.card.flush > p.muted.pad { margin: 0; }
.mt { margin-top: 18px; }
.facts { margin: 0; display: grid; gap: 0; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; }
.vat-table .code, .report-table th.code { width: 56px; }
.vat-table tr.untracked td { color: var(--muted); }
.vat-table tr.untracked .num { color: #96a2b5; }
.sbr-check { margin-top: 12px; }
.sbr-hint { margin-left: 4px; }
.cf-warnings .alert { align-items: flex-start; }
.cf-warnings .alert p { margin: 4px 0 0; }
.cf-warn-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cf-section { margin-bottom: 8px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 22px 0 10px; }
.section-title h2 { margin: 0; }
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px; margin-bottom: 16px; }
.strip-value { font-size: 20px; font-weight: 700; margin-top: 2px; }
.ratios { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-bottom: 14px; }
.ratio-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0; }
.share { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.share-track { flex: 1; height: 8px; background: #edf0f6; border-radius: 4px; overflow: hidden; }
.share-bar { display: block; height: 100%; border-radius: 4px; }
.share-in { background: var(--primary); }
.share-out { background: #6b7890; }
.share-pct { width: 44px; text-align: right; font-size: 12.5px; color: var(--muted); }
.share-cell { width: 34%; }
.cf-table tr.opening td { background: #f8fafc; font-weight: 600; }
.cf-table tr.overdue td { background: #fffaf0; }
.cf-table tr.row-bad td { background: var(--danger-soft); }
.cf-table tr.row-warn td { background: var(--warn-soft); }
.cf-table tfoot td { font-weight: 700; }
tr.before-period td { color: var(--muted); }
.cf-foot { margin: 14px 2px 30px; max-width: 900px; }
.cf-chart-note { margin-top: 8px; }
.cf-chart { position: relative; outline: none; border-radius: 6px; }
.cf-chart:focus-visible { box-shadow: 0 0 0 2px rgba(26, 86, 219, 0.45); }
.cf-chart svg { display: block; width: 100%; height: auto; }
.cf-grid { stroke: var(--line); stroke-width: 1; }
.cf-zero { stroke: #97a3b6; stroke-width: 1; }
.cf-axis { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.cf-label { fill: var(--text); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cf-note { fill: var(--muted); font-size: 11.5px; }
.cf-area { fill: var(--primary); fill-opacity: 0.1; stroke: none; }
.cf-area-neg { fill: var(--danger); fill-opacity: 0.12; }
.cf-line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cf-min { stroke: var(--warn); stroke-width: 1.5; stroke-dasharray: 5 4; }
.cf-dot { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }
.cf-cross { stroke: var(--muted); stroke-width: 1; }
.cf-tip { position: absolute; transform: translate(12px, -100%); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: 0 4px 14px rgba(11, 27, 63, 0.16); padding: 8px 10px; pointer-events: none; white-space: nowrap; z-index: 2; }
.cf-tip-left { transform: translate(calc(-100% - 12px), -100%); }
.cf-tip-date { font-size: 12px; color: var(--muted); }
.cf-tip-value { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cf-tip-key { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cf-tip-key::before { content: ''; width: 14px; height: 2px; background: var(--primary); border-radius: 1px; }
@media (max-width: 980px) {
  .grid-2.equal { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .ratios { grid-template-columns: 1fr; }
  .share-cell { width: auto; }
}
@media print {
  .cf-tip, .preset-chips { display: none !important; }
  .summary-strip, .cf-section .card, .kpi { box-shadow: none; }
  .cf-table tr.row-bad td, .cf-table tr.row-warn td { background: none; }
}
.grid-2 > * { min-width: 0; }
.card.flush { overflow-x: auto; }
.cf-table { min-width: 560px; }
.table-wrap > .table { min-width: 440px; }

/* ---- custom roles and the danger zone (v0.7) ---- */
.badge-row { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.card.flush.inner { box-shadow: none; margin: 10px 0 0; }
.role-editor .areas { border: 0; padding: 0; margin: 0; min-width: 0; }
.role-editor .area-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.role-editor .area-desc { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }
.level-options { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.level-option { position: relative; display: inline-block; }
.level-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.level-option span { display: inline-block; padding: 5px 13px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; font-weight: 600; background: #fff; color: var(--text); }
.level-option input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.level-option input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.count-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 18px; margin: 0; }
.count-grid dt { font-size: 12.5px; color: var(--muted); }
.count-grid dd { margin: 0; font-size: 18px; font-weight: 700; }
.danger-zone { border-color: #e2b4b0; }
.deletion-banner { position: sticky; top: 54px; z-index: 10; margin-bottom: 16px; }
@media (max-width: 720px) {
  .role-editor .area-row { grid-template-columns: 1fr; }
  .level-options { justify-content: flex-start; }
  .deletion-banner { position: static; flex-wrap: wrap; }
}
.row-actions { justify-content: flex-end; flex-wrap: nowrap; gap: 6px; }
.role-editor .areas { margin-top: 6px; }
.role-editor .areas legend { padding: 0; margin-bottom: 4px; }

/* ---- PDFs, emails to customers and invoice details (v0.8) ---- */
.letterhead { text-align: right; max-width: 320px; }
.letterhead-logo { display: block; margin: 0 0 8px auto; max-height: 64px; max-width: 200px; object-fit: contain; }
.doc-bank { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.bank-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 20px; margin: 6px 0 0; }
.bank-list dt { font-size: 12px; color: var(--muted); }
.bank-list dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.logo-box { display: flex; align-items: center; justify-content: center; min-height: 96px; max-width: 320px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: #fff; }
.logo-box img { max-width: 100%; max-height: 90px; object-fit: contain; }
.mail-form .check { align-self: flex-start; padding-bottom: 0; }
.mail-form textarea { min-height: 170px; }
.attach-chip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg, #f6f8fb); }
.attach-type { display: inline-block; padding: 1px 7px; border-radius: 4px; background: var(--danger-soft); color: var(--danger); font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; }
.attach-chip .btn { margin-left: auto; }
.attach-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.attach-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg, #f6f8fb); }
.attach-link { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.attach-link:hover .attach-name { text-decoration: underline; }
.attach-name { overflow-wrap: anywhere; font-weight: 600; }
.attach-item .muted { margin-left: auto; }
.attach-item .icon-btn { margin-left: 4px; }
.mail-preview { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: #fff; }
.mail-head { display: grid; gap: 4px; margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.mail-head > div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
.mail-head dt { color: var(--muted); font-size: 13px; }
.mail-head dd { margin: 0; overflow-wrap: anywhere; }
.mail-body { line-height: 1.5; overflow-wrap: anywhere; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: -14px; margin: 16px -20px -14px; padding: 12px 20px; background: var(--surface, #fff); border-top: 1px solid var(--line); }
.email-row { cursor: pointer; }
.email-row:hover td { background: #f5f7fb; }
.email-detail td { background: #f8fafc; padding: 12px 16px; }
.email-detail .mail-body { margin-top: 8px; }
@media (max-width: 720px) {
  .letterhead { text-align: left; max-width: none; }
  .letterhead-logo { margin-left: 0; }
  .mail-head > div { grid-template-columns: 64px minmax(0, 1fr); }
  .modal-actions .btn { flex: 1; }
}
@media print {
  .letterhead, .doc-bank { break-inside: avoid; }
  .doc-bank { border-top-color: #999; }
}

/* ---- what is behind a figure (v0.9) ---- */
.drill-link { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: right; text-decoration: underline dotted var(--line-strong); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.drill-link.neg { color: var(--danger); }
.drill-link:hover { color: var(--primary); text-decoration-style: solid; }
.drill-link.neg:hover { color: var(--danger); }
.drill-link:focus-visible { outline: 2px solid rgba(26, 86, 219, 0.5); outline-offset: 2px; border-radius: 3px; }
.drill-hint { margin: 0 0 8px; }
.modal-drill { max-width: 1040px; }
.modal-drill .modal-body { padding-top: 10px; }
.drill-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.drill-figure { font-size: 20px; font-weight: 700; white-space: nowrap; }
.drill-figure .muted { font-weight: 400; }
.drill-table thead th { position: sticky; top: -10px; background: #fff; z-index: 1; box-shadow: 0 1px 0 var(--line); }
.drill-table .drill-group td { background: var(--primary-soft); font-weight: 700; border-top: 1px solid var(--line); }
.drill-table .drill-group .small { font-weight: 400; }
@media (max-width: 720px) {
  .hide-sm { display: none; }
  .table-wrap > .drill-table { min-width: 0; }
  .table.drill-table th, .table.drill-table td { padding-left: 6px; padding-right: 6px; }
  .table.drill-table th { white-space: normal; }
  .drill-table .nowrap { white-space: normal; }
  .modal-backdrop:has(.modal-drill) { padding: 8px; }
  .drill-meta { flex-direction: column; gap: 6px; }
}
@media print {
  .drill-link { text-decoration: none; }
}

/* ---- a transaction inside the panel, and its history (v1.0) ---- */
.row-link .link-btn { font-weight: 600; }
.txn-back { display: inline-block; margin-bottom: 10px; font-size: 13px; }
.txn-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.txn-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 17px; }
.txn-title .muted { font-size: 14px; }
.txn-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.txn-last { margin: 0 0 10px; }
.txn .tabs { margin-bottom: 14px; }
.txn-meta { margin-bottom: 12px; }
.txn-caption { caption-side: top; text-align: left; padding: 10px 0 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary); }
.txn-static { padding: 8px 0; font-weight: 600; }
.table-wrap > .txn-table { min-width: 0; }
.txn-table td, .txn-table th { vertical-align: middle; }
.txn-table select { min-width: 170px; }
.txn-table .num-input { min-width: 96px; text-align: right; }
.txn-table .narrow-num { min-width: 60px; max-width: 80px; }
.txn-edit .row { margin-bottom: 8px; }
.txn-edit .balance-bar { margin: 8px 0; }
.txn-edit .btn-row { margin-top: 12px; }
.history-list { list-style: none; margin: 0; padding: 0; }
.history-item { border-left: 3px solid var(--line-strong); margin: 0 0 4px 4px; padding: 4px 0 12px 14px; }
.history-item.current { border-left-color: var(--primary); }
.history-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.history-reason { margin-top: 4px; font-style: italic; }
.history-changes { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; }
.history-changes li { margin: 2px 0; }
.history-snapshot { margin-top: 6px; }
.history-snapshot summary { cursor: pointer; color: var(--primary); font-size: 13px; font-weight: 600; }
.history-snapshot .snapshot { margin-top: 6px; }
.history-actions { margin-top: 8px; }
.card-title { font-weight: 700; margin-bottom: 10px; }
@media (max-width: 720px) {
  .txn-head { flex-direction: column; gap: 8px; }
  .txn-actions .btn { flex: 1 1 auto; }
  .txn-table select { min-width: 0; width: 100%; max-width: 200px; }
  .txn-table .num-input { min-width: 0; width: 82px; }
  .txn-table .narrow-num { width: 54px; min-width: 0; }
  .txn-edit .row > .field { flex: 1 1 100%; }
  .txn .table.txn-table th, .txn .table.txn-table td { padding-left: 6px; padding-right: 6px; }
}

/* Shown when a new version was deployed while this page was open. */
.update-banner { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60; background: var(--ink, #0f1b33); color: #fff; padding: 10px 14px; border-radius: var(--radius); display: flex; gap: 12px; align-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: calc(100vw - 32px); }
.form-section { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.stack > .form-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.form-note { margin: -4px 0 0; }

/* ---------- payroll (v1.5) */
.badge-void { background: #eceff5; color: #555; }
.table tr.total-row td { font-weight: 700; border-top: 2px solid var(--line); }
.item-row { flex-wrap: wrap; align-items: flex-end; gap: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.item-row .check { padding-bottom: 10px; }
.card h4 { margin: 14px 0 6px; font-size: 14px; }
.modal.payslip-modal { max-width: 1000px; }
.payslip-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .payslip-grid { grid-template-columns: 1fr 1fr; } }

/* ---- v1.6: inventory, fixed assets and imports ---- */
.type-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.type-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; cursor: pointer; }
.type-card input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.type-card.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary) inset; }
.type-card.disabled { opacity: 0.55; cursor: not-allowed; }
.type-card:focus-within { outline: 2px solid rgba(26, 86, 219, 0.5); outline-offset: 1px; }
.section-toggle { font-weight: 600; text-align: left; }
.item-select { display: block; }
.item-select input { width: 100%; }
.input-bad { border-color: var(--danger) !important; }
.desc-cell { min-width: 220px; }
.desc-cell .item-select { margin-bottom: 4px; }
.desc-cell .item-select input { font-size: 13px; background: #fafbfd; }
.line-stock { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.line-stock select { width: auto; padding: 2px 6px; font-size: 12.5px; }
.item-code { font-weight: 600; margin-right: 2px; }
.grow-cell { min-width: 240px; }
.inline-select { width: auto; }
.card-head.pad { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.small-value { font-size: 16px; }
.level-options.left { justify-content: flex-start; }
.import-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.import-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 16px 52px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); }
.import-card:hover { border-color: var(--primary); text-decoration: none; }
.import-card.disabled { opacity: 0.6; pointer-events: none; }
.import-step { position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.step-head { display: flex; align-items: center; gap: 10px; }
.step-head h3 { margin: 0; }
.step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex: none; }
.import-rows { max-height: 480px; }
.import-rows td { vertical-align: top; }
.import-row-error td { background: #fdf3f2; }
.plain-list.tight li { margin-bottom: 2px; }
.ok-chip { border-color: #b9dfc4; background: var(--ok-soft); }
.bad-chip { border-color: #e2b4b0; background: #fdf3f2; }
@media (max-width: 720px) {
  .type-cards { grid-template-columns: 1fr; }
  .desc-cell { min-width: 180px; }
}
.card-section-title { font-weight: 700; font-size: 15px; margin: 0; }
.action-list { display: flex; flex-direction: column; margin: -4px -6px; }
.action-list .quick-item::after { content: '›'; float: right; color: var(--muted); }

/* ---------- UAE e-invoicing (v1.7) */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.ok-text { color: var(--ok); }
.einv-problems { margin: 6px 0 0; padding-left: 18px; }
.einv-problems li + li { margin-top: 3px; }
.einv-secret { background: #f2f4f9; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; margin: 4px 0; overflow-wrap: anywhere; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f6f8fb; }
.line-einv { display: flex; gap: 6px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.line-einv select { width: auto; min-height: 30px; padding: 4px 6px; font-size: 13px; }
.line-einv input { width: 150px; min-height: 30px; padding: 4px 6px; font-size: 13px; }
.line-einv .einv-label { font-size: 12px; color: var(--muted); }
.einv-card .table-scroll { overflow-x: auto; max-width: 100%; }
.einv-card .mono { overflow-wrap: anywhere; }
.einv-card td { vertical-align: top; }
.check input[type='radio'] { width: auto; min-height: 0; margin: 0; flex: 0 0 auto; }
.line-einv input { width: 110px; }

/* v1.8 account pages */
.center { text-align: center; margin: 0; }
a.user-name { text-decoration: none; }
a.user-name:hover { text-decoration: underline; }
.invite-link { display: flex; gap: 8px; align-items: center; }
.invite-link input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.alert.invite-box { display: block; }
.invite-box .invite-link { margin-top: 10px; }
