/* Munshian Ledger: the munshian.com look (Plus Jakarta Sans, navy and sky blue, rounded cards, pill buttons) */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/plus-jakarta-sans-latin.woff2) format('woff2');
}
:root {
  --primary: #114688;
  --primary-hover: #0D3A72;
  --accent: #13B5EA;
  --accent-hover: #2FC4F5;
  --accent-soft: #E3F6FD;
  --nav: #192B4F;
  --nav-2: #0F1D38;
  --bg: #F5F8FC;
  --card: #FFFFFF;
  --subtle: #F5F8FC;
  --blue-surface: #EAF2FB;
  --text: #192B4F;
  --text-2: #5B6B85;
  --text-3: #98A2B3;
  --line: #E3E8EF;
  --line-strong: #CDD5E1;
  --ok: #067647;
  --ok-bg: #E7F8EF;
  --err: #B42318;
  --err-bg: #FEF3F2;
  --warn: #93370D;
  --warn-bg: #FEF4E6;
  --r: 10px;
  --r-lg: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px -14px rgba(16, 24, 40, 0.16);
  --shadow-pop: 0 1px 2px rgba(16, 24, 40, 0.05), 0 18px 40px -12px rgba(15, 29, 56, 0.28);
  --hero: radial-gradient(700px 300px at 90% 0%, rgba(19, 181, 234, 0.28), transparent 60%),
          radial-gradient(600px 300px at 0% 100%, rgba(122, 90, 248, 0.18), transparent 60%),
          linear-gradient(160deg, var(--nav) 0%, var(--nav-2) 100%);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font: 400 14px/1.55 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin: 0; }
h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 700; margin: 0 0 8px; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* Top navigation */
.topnav { background: var(--nav-2); color: #fff; border-bottom: 1px solid rgba(255, 255, 255, 0.08); position: relative; z-index: 30; }
.topnav-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 20px; }
.org-name { font-weight: 700; font-size: 15px; color: #fff; white-space: nowrap; display: flex; align-items: center; gap: 10px; }
.org-name:hover { text-decoration: none; }
.org-badge { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--nav-2); display: grid; place-items: center; font-weight: 800; font-size: 13px; box-shadow: 0 6px 16px -6px rgba(19, 181, 234, 0.7); }
.menu { display: flex; height: 100%; gap: 2px; margin: 0; padding: 0; }
.menu > li { list-style: none; position: relative; display: flex; align-items: center; }
.menu > li > a, .menu > li > button { white-space: nowrap; display: flex; align-items: center; height: 38px; padding: 0 14px; border-radius: 999px; color: #C9D6EA; font: inherit; font-weight: 600; background: none; border: 0; cursor: pointer; }
.menu > li > a:hover, .menu > li > button:hover, .menu > li:focus-within > button { color: #fff; text-decoration: none; background: rgba(255, 255, 255, 0.08); }
.menu > li.active > a, .menu > li.active > button { color: #fff; background: rgba(19, 181, 234, 0.18); box-shadow: inset 0 0 0 1px rgba(19, 181, 234, 0.35); }
.dropdown { display: none; position: absolute; top: calc(100% - 8px); left: 0; min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 8px; z-index: 20; }
.menu > li:hover .dropdown, .menu > li:focus-within .dropdown { display: block; }
.dropdown a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text); font-weight: 500; }
.dropdown a:hover { background: var(--subtle); color: var(--primary); text-decoration: none; }
.dropdown .dropdown-item { display: block; width: 100%; text-align: left; padding: 8px 12px; border-radius: 8px; background: none; border: 0; font: inherit; font-weight: 500; color: var(--text); cursor: pointer; }
.dropdown .dropdown-item:hover { background: var(--subtle); color: var(--primary); }
.caret { margin-left: 6px; font-size: 11px; opacity: 0.7; }
.org-name .caret { margin-left: -4px; }
.menu.switcher { margin-right: 8px; }
.menu.switcher > li > .org-name { color: #fff; padding-left: 0; height: auto; }
.menu.switcher > li > .org-name:hover { background: none; }
.dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.topnav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; color: #A9B8D0; font-size: 13px; }
.topnav-right .settings-link { color: #C9D6EA; font-weight: 600; }
.topnav-right .settings-link:hover { color: #fff; text-decoration: none; }
.topnav-right button { background: none; border: 1px solid rgba(255, 255, 255, 0.3); color: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.topnav-right button:hover { background: rgba(255, 255, 255, 0.1); }

/* Page header: the title and its buttons, on the page background */
.page-head-inner { max-width: 1280px; margin: 0 auto; padding: 28px 24px 0; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
main { max-width: 1280px; margin: 0 auto; padding: 22px 24px 64px; }
.site-foot { max-width: 1280px; margin: 0 auto; padding: 18px 24px 32px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; }
.site-foot a { color: var(--text-2); text-decoration: none; }
.site-foot a:hover { color: var(--primary); text-decoration: underline; }

/* Buttons: pills, as on the website */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background 0.15s, box-shadow 0.15s, transform 0.15s; }
.btn:hover { background: var(--subtle); text-decoration: none; transform: translateY(-1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 8px 18px -10px rgba(17, 70, 136, 0.8); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.green { background: #079455; border-color: #079455; color: #fff; }
.btn.green:hover { background: #067647; }
.btn.danger { color: var(--err); }
.btn.small { height: 30px; padding: 0 12px; font-size: 13px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
.linkbtn.danger { color: var(--err); }
form.inline { display: inline; }

/* Cards and panels */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.stat { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.stat-row { display: flex; gap: 32px; flex-wrap: wrap; margin: 6px 0 14px; }
.stat-label { font-size: 12.5px; color: var(--text-2); }
.stat.overdue { color: var(--err); }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 0 16px; overflow-x: auto; }
.tabs a { padding: 14px 14px; color: var(--text-2); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--primary); font-weight: 700; border-bottom-color: var(--accent); }
.tabs .count { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: #0B6E91; font-size: 12px; text-align: center; }
.toolbar { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fff; flex-wrap: wrap; }
.toolbar input[type=search] { width: 280px; max-width: 100%; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th { text-align: left; font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: none; padding: 11px 12px; border-bottom: 1px solid var(--line); background: var(--subtle); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--blue-surface); }
tfoot td { font-weight: 600; background: var(--subtle); }
.empty { padding: 40px 16px; text-align: center; color: var(--text-2); }

/* Status badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--subtle); color: var(--text-2); }
.badge.DRAFT { background: #F2F4F7; color: #475467; }
.badge.AUTHORISED { background: var(--accent-soft); color: #0B6E91; }
.badge.PAID { background: var(--ok-bg); color: var(--ok); }
.badge.VOIDED { background: #F2F4F7; color: var(--text-3); text-decoration: line-through; }
.badge.overdue { background: var(--err-bg); color: var(--err); }
.badge.paused { background: var(--warn-bg); color: var(--warn); }

/* Forms */
label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.hint { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r); font: inherit; color: var(--text); background: #fff;
}
input[type=file] { font: inherit; color: var(--text-2); }
input[type=file]::file-selector-button { margin-right: 10px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
textarea { height: auto; min-height: 70px; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(19, 181, 234, 0.2); }
input[readonly] { background: var(--subtle); }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; height: auto; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }

/* Line items editor */
.lines td { padding: 6px; }
.lines input, .lines select { height: 34px; }
.lines .c-item { width: 150px; }
.lines .c-desc { min-width: 220px; }
.lines .c-qty { width: 80px; }
.lines .c-price { width: 110px; }
.lines .c-acc { width: 200px; }
.lines .c-tax { width: 190px; }
.lines .c-amt { width: 110px; }
.lines .c-del { width: 34px; }
.lines textarea { min-height: 34px; height: 34px; }
.remove-line { background: none; border: 0; color: var(--text-3); font-size: 18px; cursor: pointer; line-height: 1; }
.remove-line:hover { color: var(--err); }
.totals { margin-left: auto; width: 340px; max-width: 100%; }
.totals div { display: flex; justify-content: space-between; padding: 5px 0; }
.totals .grand { border-top: 2px solid var(--text); margin-top: 6px; padding-top: 8px; font-size: 18px; font-weight: 800; }
.rates-box { background: var(--subtle); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 14px; }

/* Messages */
.alert { padding: 13px 16px; border-radius: 12px; margin-bottom: 16px; border: 1px solid; }
.alert.error { background: var(--err-bg); color: var(--err); border-color: #FECDCA; }
.alert.ok { background: var(--ok-bg); color: var(--ok); border-color: #ABEFC6; }
.alert.info { background: var(--accent-soft); color: #0B4F68; border-color: #BFE9F8; }
.alert.warn { background: var(--warn-bg); color: var(--warn); border-color: #FDDCAB; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

/* Document view */
.doc-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 18px; }
.doc-meta .k { font-size: 12px; color: var(--text-2); }
.doc-meta .v { font-weight: 700; }
details.panel summary { cursor: pointer; font-weight: 600; }
details.panel[open] summary { margin-bottom: 12px; }

/* Bank accounts */
.bank-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.bank-card-head h2 { margin: 0; }
.bank-links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; }

/* Reconcile: statement line on the left, what it matches on the right */
.rec-list { padding: 16px; display: grid; gap: 14px; background: var(--bg); }
.rec { display: grid; grid-template-columns: minmax(220px, 1fr) 32px minmax(320px, 1.4fr); background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.rec-line { display: grid; grid-template-columns: 90px 1fr auto; gap: 12px; padding: 14px; background: var(--subtle); border-radius: var(--r-lg) 0 0 var(--r-lg); }
.rec-date { font-size: 13px; color: var(--text-2); }
.rec-desc { word-break: break-word; }
.rec-amt { font-size: 12px; color: var(--text-2); }
.rec-amt strong { font-size: 15px; }
.rec-amt.in strong { color: var(--ok); }
.rec-amt.out strong { color: var(--text); }
.rec-arrow { display: grid; place-items: center; color: var(--text-3); font-size: 18px; }
.rec-actions { padding: 10px 14px 14px; }
.rec-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.rec-tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 6px 10px; font: inherit; font-weight: 500; color: var(--text-2); cursor: pointer; }
.rec-tabs button.on { color: var(--primary); font-weight: 700; border-bottom-color: var(--accent); }
.rec-ok { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; background: var(--ok-bg); border-radius: var(--r); margin-bottom: 10px; }
.rec-row { display: flex; gap: 8px; margin-bottom: 8px; }
.rec-row select { flex: 1; min-width: 0; }
.rec-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 4px; }
.rec .field { margin-bottom: 10px; }
@media (max-width: 860px) {
  .rec { grid-template-columns: 1fr; }
  .rec-line { border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .rec-arrow { display: none; }
}

/* Sign-in pages: the website's hero, with a white card on top */
body.auth { display: grid; place-items: center; align-content: center; gap: 18px; min-height: 100vh; padding: 32px 0; background: var(--hero); background-attachment: fixed; position: relative; }
body.auth::before { content: ''; position: fixed; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px); background-size: 48px 48px; -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent); mask-image: linear-gradient(to bottom, #000 30%, transparent); }
.auth-card { position: relative; width: 440px; max-width: calc(100vw - 32px); background: #fff; border-radius: 20px; box-shadow: 0 30px 60px -20px rgba(15, 29, 56, 0.55); padding: 36px; }
.auth-card img.logo { height: 40px; margin-bottom: 22px; }
.auth-site { position: relative; color: rgba(255, 255, 255, 0.8); font-size: 14px; font-weight: 600; text-decoration: none; }
.auth-site:hover { color: #fff; text-decoration: underline; }
.auth-card h1 { margin-bottom: 8px; font-size: 26px; }
.auth-card .btn { width: 100%; height: 46px; font-size: 15px; }
.auth-card .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--nav-2); box-shadow: 0 8px 20px -6px rgba(19, 181, 234, 0.6); }
.auth-card .btn.primary:hover { background: var(--accent-hover); }
.qr { display: block; margin: 12px auto; }
code { background: var(--subtle); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; word-break: break-all; }

@media (max-width: 860px) {
  .topnav-inner { height: auto; flex-wrap: wrap; padding: 8px 16px; gap: 6px 12px; }
  .menu { order: 3; width: 100%; overflow-x: auto; height: 44px; }
  .menu.switcher { order: 0; width: auto; overflow: visible; }
  .dropdown { position: fixed; top: auto; left: 16px; right: 16px; }
  .page-head-inner, main { padding-left: 16px; padding-right: 16px; }
  .page-head-inner { padding-top: 20px; }
  h1 { font-size: 23px; }
  .page-actions { margin-left: 0; }
  .topnav-right .who { display: none; }
}

@media print {
  .topnav, .page-actions, .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* VAT return */
.vat-boxes td { vertical-align: middle; }
.vat-boxes tr.total td { background: var(--blue-surface); }
.vat-boxes input.adj { width: 120px; }
.overdue-text { color: var(--err); font-weight: 600; }

/* Dashboard */
.dash { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.dash-col { min-width: 0; }
@media (max-width: 860px) { .dash { grid-template-columns: 1fr; } }
.dash-card h2 { margin: 0; font-size: 16px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.dash-split { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.dash-figures { width: auto; margin-left: auto; }
.dash-figures td { padding: 3px 0 3px 18px; border: 0; font-size: 13px; color: var(--text-2); }
.dash-figures td.num { color: var(--text); font-weight: 600; }
.overdue-text, .dash-figures td.overdue-text { color: var(--err); }
.chart { display: block; overflow: visible; }
.chart-axis { font: 400 10.5px var(--font); fill: var(--text-2); }
@media (max-width: 600px) { .chart-axis { font-size: 14px; } }
.chart a .chart-hit, .chart-hit { cursor: default; outline: none; }
.chart a .chart-hit { cursor: pointer; }
.chart-hit:hover, .chart-hit:focus { fill: rgba(17, 70, 136, 0.06); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); margin-top: 6px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.chart-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--nav-2); color: #fff; font-size: 12px; line-height: 1.4; padding: 7px 10px; border-radius: 8px; white-space: pre-line; box-shadow: 0 4px 12px rgba(16, 24, 40, 0.18); max-width: 260px; }

/* Reports */
.report-links { list-style: none; margin: 0; padding: 0; }
.report-links li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.report-links li:last-child { border-bottom: 0; }
.report-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
table.report td { padding: 7px 12px; }
table.report td.indent { padding-left: 28px; }
table.report tr.section td { font-weight: 650; border-bottom: 0; padding-top: 14px; }
table.report tr.total td { font-weight: 600; border-top: 1px solid var(--line-strong); }
table.report tr.grand td { font-weight: 700; border-top: 1px solid var(--text); border-bottom: 2px solid var(--line-strong); }
table.report tr.gap td { border: 0; padding: 4px; }
@media print { table.report tr.clickable td a { color: inherit; } }
.badge.SENT, .badge.APPROVED { background: var(--accent-soft); color: #0B6E91; }
.badge.ACCEPTED, .badge.INVOICED, .badge.BILLED { background: var(--ok-bg); color: var(--ok); }
.badge.DECLINED { background: #F2F4F7; color: var(--text-3); }
.receipts { display: flex; flex-wrap: wrap; gap: 12px; }
.receipt { width: 140px; }
.receipt img, .receipt-file { display: grid; place-items: center; width: 140px; height: 140px; object-fit: cover; border: 1px solid var(--line); border-radius: 12px; background: var(--subtle); font-weight: 700; color: var(--text-2); }

/* Budgets: a grid of months, the account column kept in view while scrolling sideways. */
.budget-grid input { width: 92px; text-align: right; padding: 5px 6px; }
.budget-grid td, .budget-grid th { padding: 4px 6px; }
.budget-grid td:first-child, .budget-grid th:first-child { position: sticky; left: 0; background: var(--card); z-index: 1; }
.budget-grid tr.section td { padding-top: 12px; }
td.neg { color: var(--err); }
.badge.refused { background: var(--err-bg); color: var(--err); }
