:root {
  --navy: #102b35;
  --navy-deep: #0a222b;
  --teal: #087f72;
  --teal-dark: #05665c;
  --teal-pale: #eaf6f1;
  --page: #f3f7f6;
  --ink: #17343e;
  --muted: #60747b;
  --line: #dfe9e6;
  --white: #fff;
  --red: #b33d45;
  --shadow: 0 4px 20px rgb(16 43 53 / 3%);
  --radius: 17px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
body { margin: 0; min-width: 320px; font-size: 14px; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:disabled { opacity: .48; cursor: not-allowed; }
a { color: var(--teal-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #e7ad45;
  outline-offset: 3px;
}
svg { display: inline-block; flex-shrink: 0; vertical-align: middle; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.22; }
h1 { margin-bottom: 10px; font-size: clamp(27px, 2.7vw, 36px); font-weight: 650; letter-spacing: -1.2px; }
h2 { font-size: 19px; letter-spacing: -.35px; }
h3 { font-size: 16px; letter-spacing: -.2px; }
.app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100dvh; padding: 31px 18px 20px; background: var(--navy); color: #dbe8e8; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 11px; margin-bottom: 44px; }
.brand { text-decoration: none; }
.brand-mark > span { font-size: 10px; line-height: 1; margin-top: -12px; letter-spacing: -.4px; }
.brand-caption { letter-spacing: .2px; text-transform: none; }
.sidebar-foot .build-note .small { display: block; margin-top: 4px; }
.sidebar-foot .build-note .activity-dot { display: inline-block; width: 6px; height: 6px; background: #8ae4b5; vertical-align: middle; margin-right: 7px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 42px; flex-shrink: 0; border: 1px solid #75c8ac; border-radius: 12px 12px 12px 3px; background: #174e4e; color: #b8f2d6; font-size: 15px; font-weight: 800; letter-spacing: -1px; }
.brand-mark svg { width: 23px; height: 23px; }
.brand-name { display: block; color: #fff; font-size: 21px; line-height: 1.2; font-weight: 700; letter-spacing: -.5px; }
.brand-caption { display: block; margin-top: 4px; color: #a5bcc1; font-size: 11px; letter-spacing: 1.1px; text-transform: uppercase; }
.nav-list { display: flex; flex-direction: column; gap: 7px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 45px; padding: 11px 14px; border: 0; border-radius: 9px; background: transparent; color: #b8cbd0; text-align: left; font-weight: 500; transition: background .16s ease, color .16s ease; }
.nav-item svg { width: 19px; height: 19px; opacity: .9; }
.nav-item:hover { background: #1a3b44; color: #fff; }
.nav-item.active { background: #235047; color: #d9ffe9; }
.nav-item.active::before { position: absolute; left: 0; width: 3px; height: 17px; border-radius: 3px; background: #9cdbb6; content: ""; }
.nav-item button { border: 0; background: none; color: inherit; text-align: left; }
.sidebar-foot { margin-top: auto; padding: 30px 11px 2px; }
.build-note { padding: 15px 13px; margin-bottom: 19px; border: 1px solid #35515a; border-radius: 11px; color: #b2c9cd; font-size: 11px; line-height: 1.65; }
.build-note strong { display: block; margin-bottom: 3px; color: #e3efed; font-size: 12px; font-weight: 600; }
.user-avatar, .avatar { display: inline-grid; place-items: center; width: 37px; height: 37px; flex-shrink: 0; border-radius: 11px; background: #deeee7; color: #27665b; font-size: 12px; font-weight: 700; }
.sidebar-foot .user-avatar { background: #36545c; color: #dfeded; }
.workspace { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 91px; padding: 18px 36px; border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 86%); }
.admin-switch { display: flex; align-items: center; gap: 12px; min-width: 0; }
.admin-label { display: block; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.admin-switch select { max-width: 240px; min-height: 31px; padding: 0 24px 0 0; border: 0; background-color: transparent; color: var(--ink); font-weight: 650; }
.topbar-actions, .page-actions, .action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.period-select { min-height: 39px; max-width: 210px; padding: 8px 31px 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #425f67; font-size: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 10px 16px; border: 1px solid transparent; border-radius: 9px; background: white; line-height: 1.3; font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .15s ease, box-shadow .15s ease, transform .15s ease; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { border-color: var(--teal); background: var(--teal); color: #fff; box-shadow: 0 2px 3px rgb(8 127 114 / 9%); }
.btn-primary:hover { border-color: var(--teal-dark); background: var(--teal-dark); }
.btn-secondary { border-color: #d7e3df; background: #fff; color: #345a5e; }
.btn-secondary:hover { border-color: #afcbc1; background: #f7fbf9; }
.btn-quiet { padding-right: 10px; padding-left: 10px; background: transparent; color: var(--teal-dark); }
.btn-quiet:hover { background: var(--teal-pale); }
.btn-danger { border-color: #edcdd0; background: #fff8f8; color: #a3343f; }
.btn-danger:hover { background: #fcebed; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 7px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.icon-btn:hover { background: #edf5f1; }
.icon-btn svg { width: 18px; height: 18px; }
.mobile-brand { display: none; }
#content { max-width: 1560px; padding: 32px 36px 40px; margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.eyebrow { margin-bottom: 9px; color: #5b8279; font-size: 10px; font-weight: 700; letter-spacing: 1.65px; text-transform: uppercase; }
.subtitle { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.demo-notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; margin-bottom: 23px; border: 1px solid #d5e6dd; border-radius: 10px; background: #eef7f2; color: #486b60; font-size: 11px; line-height: 1.6; }
.demo-notice svg { width: 16px; height: 16px; margin-top: 1px; }
.demo-notice p { margin: 0; }
.demo-notice strong { color: #2e594d; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 23px; }
.stat-card { position: relative; min-width: 0; padding: 21px 20px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 17px; color: #587078; font-size: 12px; font-weight: 500; }
.stat-value { margin-bottom: 8px; color: #183c40; font-size: clamp(22px, 2.3vw, 30px); font-weight: 650; letter-spacing: -1px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-detail { color: #72847f; font-size: 10px; }
.stat-icon { display: inline-grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; background: #eef6f2; color: #538579; }
.stat-icon svg { width: 16px; height: 16px; }
.positive { color: #18774f !important; }
.negative { color: #b3444a !important; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 22px; margin-bottom: 23px; }
.panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 23px 17px; }
.panel-title { margin-bottom: 4px; color: #23434a; font-size: 15px; font-weight: 650; letter-spacing: -.2px; }
.panel-subtitle { margin: 0; color: #78898d; font-size: 11px; }
.chart-wrap { padding: 4px 20px 16px; overflow: hidden; }
.chart-wrap svg { display: block; width: 100%; height: auto; min-height: 160px; overflow: visible; }
.chart-wrap svg text { font-family: inherit; }
.chart-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; color: #657a7f; font-size: 10px; }
.chart-legend { padding: 0 24px 20px; }
.chart-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 3px; background: var(--teal); }
.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.table-wrap > table { min-width: 570px; }
th { padding: 11px 22px; border-top: 1px solid #edf2f0; border-bottom: 1px solid #e8efec; background: #f8faf9; color: #6e8488; font-size: 9px; font-weight: 650; letter-spacing: .7px; text-transform: uppercase; white-space: nowrap; }
td { padding: 15px 22px; border-bottom: 1px solid #edf2ef; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfc; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.cell-title { display: block; margin-bottom: 2px; color: #29464e; font-weight: 600; }
.cell-subtitle { display: block; color: #7c8d91; font-size: 10px; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 25px; padding: 3px 9px; border-radius: 6px; font-size: 10px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.pill.green, .pill-green { background: #eaf6ee; color: #287a4f; }
.pill.amber, .pill-amber { background: #fff3d9; color: #8b6016; }
.pill.blue, .pill-blue { background: #eaf2fc; color: #3c6390; }
.pill.red, .pill-red { background: #fbecee; color: #a3454d; }
.pill.neutral, .pill-neutral { background: #edf2f1; color: #677f80; }
.action-row { gap: 5px; }
.action-row .btn { min-height: 34px; padding: 7px 9px; font-size: 10px; }
.list-row { display: flex; align-items: center; gap: 11px; padding: 15px 22px; border-top: 1px solid #eef3f0; }
.list-row > div:not(.activity-dot):not(.avatar) { flex: 1; min-width: 0; }
.list-row p { margin: 0; }
.activity-dot { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 9px; background: #eff6f2; color: #568a76; }
.activity-dot svg { width: 15px; height: 15px; }
.quick-actions { display: grid; gap: 10px; padding: 0 20px 20px; }
.quick-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 1px solid #e4ede8; border-radius: 10px; background: #fbfdfb; color: #325651; text-align: left; }
.quick-card:hover { border-color: #bbd7ca; background: #f1f9f4; }
.quick-card strong { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; }
.quick-card small { color: #728980; font-size: 10px; }
.empty-state { padding: 45px 24px; color: #6e8584; text-align: center; }
.empty-state h3 { margin: 12px 0 8px; color: #3c625a; }
.empty-state p { max-width: 400px; margin: 0 auto 15px; font-size: 12px; }
.filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.panel > .filter-bar { padding: 20px 22px 0; }
.search-input, .filter-select { min-height: 40px; padding: 9px 12px; border: 1px solid #dce7e2; border-radius: 8px; background: #fff; color: #395a5e; font-size: 12px; }
.search-input { flex: 1; min-width: 170px; max-width: 370px; }
.search-input::placeholder { color: #869793; }
.tab-pills { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.tab-pills button { min-height: 32px; padding: 7px 12px; border: 0; border-radius: 6px; background: transparent; color: #6c8283; font-size: 11px; }
.tab-pills button.active, .tab-pills button[aria-selected="true"] { background: #edf7f0; color: #176a52; font-weight: 600; }
.split-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr); gap: 22px; align-items: start; }
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.contact-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.contact-card .avatar { width: 43px; height: 43px; margin-bottom: 17px; }
.contact-card h3 { margin: 0 0 6px; font-size: 15px; }
.contact-card p { margin: 4px 0; color: #738581; font-size: 12px; }
.contact-card .action-row { margin-top: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 6px; color: #4c686c; font-size: 11px; font-weight: 600; }
.field input, .field textarea, .field select, .line-input { display: block; width: 100%; min-height: 41px; padding: 9px 11px; border: 1px solid #d8e4de; border-radius: 7px; background: #fff; color: #214640; font-size: 12px; }
.field input:hover, .field select:hover, .field textarea:hover, .line-input:hover { border-color: #b8cfc4; }
.field textarea { min-height: 83px; resize: vertical; }
.field input[readonly] { background: #f4f7f4; color: #73877e; }
.form-help { margin: 6px 0 0; color: #829089; font-size: 10px; }
.line-items { margin: 23px 0; overflow-x: auto; }
.line-items table { min-width: 610px; }
.line-items th { padding: 9px 6px; background: #f7faf8; }
.line-items td { padding: 8px 6px; }
.line-items th:first-child, .line-items td:first-child { padding-left: 0; }
.line-items th:last-child, .line-items td:last-child { padding-right: 0; }
.line-input { min-height: 37px; padding: 8px; border-radius: 6px; font-size: 11px; }
.line-input[type="number"] { min-width: 63px; }
.totals-box { width: 310px; max-width: 100%; padding: 17px 19px; margin: 19px 0 0 auto; border: 1px solid #e0ebe4; border-radius: 11px; background: #f7faf7; }
.total-row { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 9px; color: #6b8077; font-size: 12px; font-variant-numeric: tabular-nums; }
.total-row:last-child { margin-bottom: 0; }
tr.total-row { display: table-row; font-weight: 700; }
.grand-total { padding-top: 12px; margin-top: 12px; border-top: 1px solid #dae6dd; color: #255844; font-size: 16px; font-weight: 650; }
.form-error { padding: 10px 13px; margin-top: 15px; border: 1px solid #f1d3d6; border-radius: 7px; background: #fff2f2; color: #ab424e; font-size: 12px; }
.form-error:empty { display: none; }
dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid #d7e4dd; border-radius: 17px; background: #fff; color: var(--ink); box-shadow: 0 24px 90px rgb(9 37 31 / 18%); }
dialog.dialog-wide { width: min(900px, calc(100vw - 40px)); }
dialog::backdrop { background: rgb(12 37 39 / 42%); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 23px 26px 18px; border-bottom: 1px solid #e4ece6; }
.dialog-head h2 { margin: 0 0 6px; font-size: 21px; }
.dialog-head p { margin: 0; color: var(--muted); font-size: 12px; }
.dialog-body { padding: 24px 26px; }
.dialog-foot { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 17px 26px; border-top: 1px solid #e4ece6; background: #fafcfb; }
.toast, #toast { position: fixed; right: 26px; bottom: 24px; z-index: 1000; max-width: min(430px, calc(100vw - 40px)); padding: 14px 19px; border: 1px solid #245e4c; border-radius: 11px; background: #184637; color: #f2fff5; box-shadow: 0 9px 30px rgb(16 43 53 / 17%); font-size: 12px; }
.toast:empty, #toast:empty { display: none; }
.toast.error { border-color: #913b48; background: #863341; }
.vat-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, 1fr); gap: 22px; align-items: start; }
.vat-summary { padding: 23px; border: 1px solid #cde1d4; border-radius: var(--radius); background: #edf7ef; }
.vat-summary h3 { margin-bottom: 23px; color: #315e45; }
.metric-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #d9e7db; color: #5b7765; font-size: 12px; font-variant-numeric: tabular-nums; }
.metric-line strong { color: #284f39; font-weight: 650; }
.metric-line:last-child { border: 0; }
.balance-banner { display: flex; justify-content: space-between; gap: 12px; padding: 16px 20px; border-top: 1px solid #dce9e0; background: #edf7f0; color: #37624e; font-size: 12px; font-weight: 600; }
.roadmap-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 19px; margin: 23px 0; }
.roadmap-card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.step-number { display: inline-grid; place-items: center; width: 33px; height: 33px; margin-bottom: 17px; border: 1px solid #d3e8dc; border-radius: 10px; background: #edf7f0; color: #2c7452; font-size: 12px; font-weight: 700; }
.roadmap-card h3 { margin-bottom: 10px; }
.roadmap-card p { color: #71857b; font-size: 12px; line-height: 1.75; }
.feature-list { padding-left: 17px; margin: 13px 0 0; color: #627e71; font-size: 12px; }
.feature-list li { padding: 4px 0; }
.feature-list li::marker { color: #72aa88; }
.callout { padding: 18px 21px; margin: 18px 0; border: 1px solid #e5e6cc; border-radius: 11px; background: #faf9ee; color: #767446; font-size: 12px; line-height: 1.75; }
.callout p:last-child { margin-bottom: 0; }
.source-links { padding: 0; margin: 17px 0 0; list-style: none; }
.source-links li { margin: 8px 0; }
.source-links a { font-size: 12px; }
.journal-entry { margin-bottom: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.journal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 21px; }
.journal-head h3, .journal-head p { margin: 0; }
.journal-head h3 { margin-bottom: 4px; font-size: 13px; }
.journal-head p { color: #82958c; font-size: 10px; }
.account-code { display: inline-block; min-width: 40px; margin-right: 8px; color: #84988e; font-size: 11px; font-variant-numeric: tabular-nums; }
.export-options { display: grid; gap: 11px; }
.export-options .btn { justify-content: flex-start; padding: 15px; }
.footer-note { margin: 23px 0 0; color: #81948d; font-size: 10px; line-height: 1.7; }
.lock-card { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 17px; padding: 20px 23px; margin-top: 22px; border: 1px solid #dae6dd; border-radius: 13px; background: #edf4ef; }
.lock-card h3 { margin: 0 0 5px; font-size: 14px; }
.lock-card p { margin: 0; color: #6a8476; font-size: 11px; }
.print-only { display: none; }
[hidden] { display: none !important; }
@media (min-width: 1600px) {
  .topbar { padding-right: max(36px, calc((100vw - 1560px - 232px) / 2 + 36px)); padding-left: max(36px, calc((100vw - 1560px - 232px) / 2 + 36px)); }
}
@media (max-width: 1200px) {
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .sidebar { padding-right: 13px; padding-left: 13px; }
  #content { padding-right: 25px; padding-left: 25px; }
  .topbar { padding-right: 25px; padding-left: 25px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.35fr) minmax(250px, 1fr); gap: 17px; }
  .stats-grid { gap: 12px; }
  .stat-card { padding: 18px 16px; }
  .stat-value { font-size: 25px; }
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .vat-grid, .split-grid { grid-template-columns: 1fr; }
  .roadmap-grid { grid-template-columns: 1fr; }
  .roadmap-card { padding: 21px; }
  .topbar-actions { gap: 8px; }
  .topbar-actions .btn { padding-right: 12px; padding-left: 12px; }
  .period-select { max-width: 160px; }
  .page-head { align-items: flex-start; }
  .page-actions { justify-content: flex-end; }
}
@media (max-width: 800px) {
  .app-shell { display: block; }
  .sidebar { position: relative; height: auto; padding: 16px 18px 0; }
  .brand { gap: 10px; padding: 0 3px; margin-bottom: 17px; }
  .brand-mark { width: 33px; height: 35px; border-radius: 9px 9px 9px 2px; }
  .brand-name { font-size: 19px; }
  .brand-caption { font-size: 9px; }
  .nav-list { flex-direction: row; gap: 4px; padding-bottom: 10px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #527570 transparent; }
  .nav-item { gap: 7px; width: auto; min-height: 39px; padding: 9px 12px; flex-shrink: 0; font-size: 11px; white-space: nowrap; }
  .nav-item svg { width: 16px; height: 16px; }
  .nav-item.active::before { display: none; }
  .sidebar-foot { display: none; }
  .topbar { min-height: 80px; padding: 15px 21px; }
  .admin-switch { gap: 9px; }
  .admin-switch .avatar { display: none; }
  .admin-switch select { max-width: 180px; font-size: 12px; }
  .topbar-actions { gap: 7px; }
  .period-select { max-width: 150px; min-height: 37px; font-size: 10px; }
  #content { padding: 25px 21px 33px; }
  .page-head { margin-bottom: 22px; }
  h1 { font-size: 30px; }
  .subtitle { font-size: 12px; }
  .stats-grid { gap: 13px; }
  .stat-card { padding: 18px; }
  .stat-value { font-size: 28px; }
  .table-wrap > table { min-width: 610px; }
  .panel-head { padding: 19px; }
  .list-row { padding: 15px 19px; }
  .page-actions .btn { padding: 9px 12px; }
  .dialog-body { padding: 21px; }
  .dialog-head, .dialog-foot { padding-right: 21px; padding-left: 21px; }
}
@media (max-width: 540px) {
  .sidebar { padding-right: 14px; padding-left: 14px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 10px; padding: 14px 17px; }
  .admin-switch { width: 100%; }
  .admin-switch select { max-width: 270px; }
  .topbar-actions { justify-content: space-between; width: 100%; }
  .topbar-actions .btn { min-height: 37px; font-size: 11px; }
  .period-select { flex: 1; max-width: 190px; }
  #content { padding: 24px 15px 30px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 16px; }
  .page-actions { justify-content: flex-start; }
  h1 { font-size: 28px; letter-spacing: -.8px; }
  .stats-grid { gap: 10px; margin-bottom: 18px; }
  .stat-card { padding: 15px 12px; border-radius: 12px; }
  .stat-label { margin-bottom: 12px; font-size: 10px; }
  .stat-icon { width: 24px; height: 24px; }
  .stat-icon svg { width: 13px; height: 13px; }
  .stat-value { font-size: clamp(20px, 5.5vw, 25px); letter-spacing: -.65px; }
  .stat-detail { font-size: 9px; }
  .demo-notice { padding: 11px 12px; font-size: 10px; }
  .dashboard-grid { gap: 17px; margin-bottom: 18px; }
  .panel { border-radius: 13px; }
  .panel-head { align-items: flex-start; padding: 17px 16px 14px; }
  .panel-title { font-size: 14px; }
  .chart-legend { gap: 9px; font-size: 9px; }
  .chart-wrap { padding-right: 12px; padding-left: 12px; }
  .chart-wrap svg { min-height: 135px; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-card { padding: 19px; }
  .filter-bar { align-items: stretch; }
  .search-input { max-width: none; }
  .filter-select { max-width: 150px; }
  .form-grid { grid-template-columns: 1fr; gap: 15px; }
  .field.full { grid-column: auto; }
  dialog, dialog.dialog-wide { width: calc(100vw - 20px); max-height: calc(100dvh - 24px); border-radius: 13px; }
  .dialog-head { padding: 19px 17px 16px; }
  .dialog-head h2 { font-size: 20px; }
  .dialog-body { padding: 20px 17px; }
  .dialog-foot { padding: 15px 17px; }
  .dialog-foot .btn { flex: 1; }
  .vat-summary { padding: 20px; }
  .journal-head { padding: 15px 16px; }
  .toast, #toast { right: 15px; bottom: 16px; max-width: calc(100vw - 30px); }
  .lock-card { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
@media print {
  :root, body { background: #fff; color: #000; font-size: 10pt; }
  .sidebar, .topbar, .page-actions, .filter-bar, .action-row, .btn, .icon-btn, dialog, .toast, #toast, .demo-notice { display: none !important; }
  .app-shell, .workspace { display: block; }
  #content { max-width: none; padding: 0; }
  .print-only { display: block; }
  .panel, .stat-card, .roadmap-card, .journal-entry { box-shadow: none; break-inside: avoid; }
  .table-wrap { overflow: visible; }
  .table-wrap > table { min-width: 0; font-size: 9pt; }
  td, th { padding: 8px; }
  h1 { font-size: 24pt; }
  .page-head { margin-bottom: 18px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-value { font-size: 18pt; }
  .dashboard-grid, .vat-grid, .split-grid { grid-template-columns: 1fr; }
  a { color: #000; text-decoration: none; }
  .footer-note { color: #555; }
}

/* Multi-company workspace and account entry. */
[hidden] { display: none !important; }
.brand-caption { letter-spacing: .15px; text-transform: none; }
.brand-mark { line-height: 1; }
.admin-switch { flex-direction: column; align-items: flex-start; gap: 3px; }
.admin-switch select { min-width: 180px; max-width: 280px; font-size: 16px; }
.period-controls { display: flex; gap: 7px; }
.year-select { width: 104px; flex-shrink: 0; }
.session-profile { display: flex; gap: 10px; align-items: center; min-width: 0; }
.session-profile > div { min-width: 0; }
#session-name { display: inline-block; max-width: 146px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.sidebar-logout { width: 100%; margin-top: 15px; border-color: #35515a; background: transparent; color: #d0e0e3; }
.sidebar-logout:hover { background: #23424a; }
.company-context { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: -8px 0 24px; color: #6c827c; font-size: 11px; }
.company-context strong { color: #225b4b; font-size: 12px; }
.company-context .pill { margin-left: auto; }
.company-context-dot { width: 7px; height: 7px; border-radius: 50%; background: #128570; }
.context-divider { color: #c0ceca; }
.company-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; align-items: stretch; }
.company-card { min-width: 0; padding: 25px; border: 1px solid #d9e6df; border-radius: 16px; background: #fff; box-shadow: var(--shadow); text-align: left; }
.company-card.is-current { border: 1.5px solid #218d72; background: #fcfffd; }
.company-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.company-avatar { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: #deeee7; color: #24644f; font-weight: 750; font-size: 16px; }
.company-avatar.tone-1 { background: #e7edfb; color: #4b63a6; }
.company-avatar.tone-2 { background: #f7ead7; color: #986a34; }
.company-card h2 { margin: 0 0 5px; font-size: 21px; overflow-wrap: anywhere; }
.company-card > p { margin-bottom: 24px; }
.company-card-detail { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #edf2ee; font-size: 11px; color: #7a8b84; }
.company-card-detail strong { color: #41695a; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.company-card > .btn { width: 100%; margin-top: 19px; }
.add-company-card { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; min-height: 210px; padding: 35px; border-style: dashed; background: #eff6f2; color: #4b7b66; text-align: center; }
.add-company-card:hover { border-color: #68ac8b; background: #e8f3ec; }
.add-company-card strong { font-size: 15px; }
.add-company-card > span:last-child { max-width: 230px; font-size: 12px; color: #7d9487; }
.add-company-icon { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 50%; background: #dceee1; font-size: 25px; font-weight: 400; }
.company-principles { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 26px; padding: 30px 6px; margin-top: 15px; }
.company-principles > div { display: grid; grid-template-columns: 25px 1fr; column-gap: 10px; align-items: start; }
.company-principles svg { color: #5f9681; margin-top: 2px; }
.company-principles strong { color: #3d6655; font-size: 12px; }
.company-principles p { grid-column: 2; margin: 6px 0 0; color: #809287; font-size: 11px; line-height: 1.7; }
.company-data { display: grid; grid-template-columns: 145px 1fr; gap: 11px 15px; margin: 15px 0 23px; font-size: 12px; }
.company-data dt { color: #7b9186; }
.company-data dd { margin: 0; color: #335f4c; overflow-wrap: anywhere; white-space: pre-line; }
.modal-company { margin: 0 0 6px; color: #4c8d72; font-size: 11px; font-weight: 650; }
.dialog-head > div { min-width: 0; }
.dialog-head h2 { overflow-wrap: anywhere; }
.initial-loading, .loading-state { display: flex; align-items: center; justify-content: center; flex-direction: column; min-height: 50vh; padding: 40px; color: #678575; text-align: center; }
.loading-state h2 { margin: 22px 0 8px; }
.loading-state p { max-width: 390px; color: #809589; font-size: 13px; }
.loading-mark { width: 32px; height: 32px; border: 3px solid #ddeee3; border-top-color: #14846c; border-radius: 50%; animation: loading-spin .8s linear infinite; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
.load-error { max-width: 640px; padding: 35px; margin: 35px auto; }
.load-error h1 { font-size: 26px; }
.load-error p { color: #657e6e; }
.auth-layout { min-height: 100dvh; display: grid; grid-template-columns: minmax(360px,42%) 1fr; }
.auth-intro { display: flex; flex-direction: column; justify-content: space-between; gap: 45px; padding: 48px 52px; background: #102b35; color: #d8e7e4; }
.auth-intro .brand { width: fit-content; padding: 0; margin: 0; }
.auth-intro > div { padding: 25px 0 45px; }
.auth-intro .eyebrow { color: #8ac8b1; font-size: 10px; letter-spacing: 1.5px; }
.auth-intro h1 { margin: 24px 0; color: white; font-size: clamp(38px,4.2vw,62px); line-height: 1.12; letter-spacing: -2px; }
.auth-intro p { max-width: 330px; margin-bottom: 37px; color: #b7cfca; font-size: 16px; line-height: 1.85; }
.auth-benefits { display: grid; gap: 19px; color: #bcd8cc; font-size: 12px; }
.auth-benefits > div { display: flex; gap: 12px; align-items: center; }
.auth-benefits svg { color: #78c0a3; }
.auth-intro > .small { color: #769d91; }
.auth-main { display: grid; place-items: center; padding: 65px 35px; background: #f6f9f7; }
.auth-card { width: min(440px,100%); }
.auth-card h2 { margin: 14px 0 14px; font-size: 30px; line-height: 1.23; letter-spacing: -.8px; }
.auth-card > p { font-size: 13px; line-height: 1.85; }
.auth-card form { margin: 28px 0 10px; }
.auth-card .field input { min-height: 48px; font-size: 14px; }
.auth-card form > .btn { min-height: 47px; font-size: 14px; }
.auth-card .auth-switch { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin: 20px 0 25px; font-size: 12px; }
.auth-switch .btn { min-height: 30px; padding: 4px 5px; }
.auth-message { padding: 13px 15px; border: 1px solid #c8e2d2; border-radius: 9px; background: #edf7ef; color: #376a4e; font-size: 12px; }
@media (max-width:1150px) {
  .company-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .auth-intro { padding: 40px 35px; }
  .topbar { padding-right: 25px; padding-left: 25px; gap: 12px; }
  .admin-switch select { min-width: 160px; max-width: 210px; }
}
@media (max-width:800px) {
  .sidebar-foot { display: none; }
  .company-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .company-principles { grid-template-columns: 1fr; gap: 20px; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-intro { min-height: auto; padding: 27px 28px; gap: 20px; }
  .auth-intro > div { padding: 0; }
  .auth-intro h1 { margin: 15px 0; font-size: 36px; letter-spacing: -1px; }
  .auth-intro h1 br { display: none; }
  .auth-intro p { max-width: none; margin-bottom: 0; font-size: 13px; }
  .auth-benefits, .auth-intro > .small, .auth-intro .eyebrow { display: none; }
  .auth-main { padding: 38px 25px 55px; }
  .topbar-actions { justify-content: flex-end; }
  .admin-switch select { max-width: 210px; }
}
@media (max-width:540px) {
  .company-grid { grid-template-columns: 1fr; }
  .company-card { padding: 23px; }
  .topbar { align-items: stretch; flex-direction: column; gap: 14px; }
  .topbar-actions { justify-content: space-between; flex-wrap: nowrap; }
  .admin-switch select { max-width: 100%; width: 100%; }
  .topbar-actions .btn { padding: 9px 11px; font-size: 11px; }
  .period-controls { min-width: 0; flex: 1; }
  .period-controls .period-select { width: 100%; min-width: 0; padding-right: 22px; }
  .period-controls .year-select { flex: 0 0 88px; }
  .company-data { grid-template-columns: 1fr; gap: 3px; }
  .company-data dd { margin-bottom: 12px; }
  .company-context .pill { margin-left: 0; }
  .modal-company { max-width: 250px; }
  .auth-intro { padding: 25px; }
  .auth-intro h1 { font-size: 31px; }
  .auth-card h2 { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) { .loading-mark { animation: none; } }

/* Personal language preference, independent of the selected company. */
.language-picker { display: flex; flex-direction: column; gap: 3px; color: var(--muted); font-size: 10px; font-weight: 600; line-height: 1.2; min-width: 110px; }
.language-picker > span { padding-left: 2px; }
.language-picker select { appearance: auto; min-height: 36px; width: 128px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; font-weight: 500; }
.language-picker select:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.language-picker select:disabled { opacity: .6; cursor: progress; }
.auth-language { width: 100%; max-width: 440px; display: flex; justify-content: flex-end; margin: 0 auto 22px; }
.auth-main { display: flex; flex-direction: column; justify-content: center; align-items: center; }
.dialog-head-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.dialog-head .language-picker select { width: 116px; }
.dialog-head .language-picker { min-width: 100px; }
.topbar { align-items: center; gap: 16px; }
.topbar-actions { justify-content: flex-end; }
.admin-switch { min-width: 170px; }
.company-card-detail strong { overflow-wrap: anywhere; text-align: right; }
.company-card-detail { gap: 10px; }
.stat-label { min-height: 32px; }
.nav-item span { overflow-wrap: break-word; }
@media (max-width: 1180px) {
  .topbar { flex-wrap: wrap; }
  .topbar-actions { margin-left: auto; }
  .language-picker select { width: 120px; }
}
@media (max-width: 720px) {
  .topbar-actions { justify-content: space-between; flex-wrap: wrap; }
  .topbar-actions .period-controls { margin-left: auto; }
  .topbar-actions > .btn { flex: 1 1 100%; justify-content: center; }
  .language-picker { min-width: 100px; }
  .language-picker select { width: 116px; }
  .dialog-head { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .dialog-head-actions { margin-left: auto; }
}

/* Knexx integration: local font, shared colours and a compact back-office shell. */
@font-face{font-family:"Space Grotesk";font-style:normal;font-weight:300 700;font-display:swap;src:url('/assets/fonts/space-grotesk-latin.woff2') format('woff2')}
:root{--navy:#20241f;--navy-deep:#171b16;--teal:#53710f;--teal-dark:#354b0b;--teal-pale:#eef3e2;--page:#f5f6ef;--ink:#20241f;--muted:#697064;--line:#d9ddd1;--radius:8px;font-family:"Space Grotesk",Arial,Helvetica,sans-serif}
body{font-size:14px}.btn,.icon-btn,.field input,.field select,.field textarea{border-radius:4px}.btn{white-space:normal;text-align:center}.nav-item{border-radius:4px}.sidebar{background:#20241f}.nav-item.active{background:#354027;color:#e4f4b7}.nav-item.active::before{background:#a8cf31}.nav-item:hover{background:#2d3427}.knexx-logo{display:block;object-fit:contain;width:76px;height:auto;flex:0 0 76px;background:white;padding:5px}.brand{gap:10px;padding-inline:2px}.brand-name{font-size:21px}.brand-caption{font-size:9px;color:#c5cbbd;letter-spacing:.11em}.brand img+span{min-width:0}.sidebar-foot a,.auth-intro a{color:inherit}.auth-intro{background:var(--navy);color:#e0e6d9}.auth-intro p{color:#d2dbcb}.auth-intro .brand{align-items:center}.auth-intro .brand .knexx-logo{width:100px;flex-basis:100px;padding:7px}.auth-intro .brand-caption{font-size:11px}.auth-intro h1{max-width:10em}.auth-intro .eyebrow{color:#c1d788}.auth-back{margin-top:28px;font-size:12px}.build-note{border-color:#49523f;color:#d0d8c6;border-radius:5px}.sidebar-foot .build-note .activity-dot{background:#a8cf31}.sidebar-foot .user-avatar{background:#3c482d;color:#e4edcf}.topbar{flex-wrap:wrap;padding:18px 28px}.topbar-actions{gap:10px}.admin-switch{max-width:100%;min-width:0}.admin-switch select{max-width:240px;text-overflow:ellipsis}.footer-note{overflow-wrap:anywhere}.auth-card{min-width:0}.auth-card p{overflow-wrap:anywhere}.auth-card .btn{min-height:44px}.auth-language .language-picker{max-width:100%}
@media(max-width:1000px){.topbar{padding:18px 22px}.topbar-actions{justify-content:flex-start}.topbar #backoffice-link{padding-left:0}}
@media(max-width:600px){.topbar{padding:16px;gap:14px}.topbar-actions{width:100%;gap:10px}.admin-switch{width:100%}.admin-switch select{max-width:calc(100vw - 36px)}.topbar .period-controls{width:100%;display:flex;flex-wrap:wrap;gap:8px}.topbar .period-select{max-width:100%}#backoffice-link{font-size:11px}.auth-main{padding:28px 20px}.auth-intro .brand-name{font-size:24px}.auth-intro h1{font-size:32px}}
