/* RecordsMatter — styled after QuickBooks Online: white surfaces on a cool
   grey page, QuickBooks green for the action that matters, blue for links. */

:root {
  --page: #f4f5f8;
  --panel: #ffffff;
  --ink: #393a3d;
  --ink-2: #6b6c72;
  --ink-3: #8d9096;
  --line: #d4d7dc;
  --line-2: #eceef1;
  --head: #f4f5f8;
  --green: #2ca01c;
  --green-dark: #108000;
  --green-soft: #e8f5e3;
  --blue: #0077c5;
  --blue-soft: #e5f2fa;
  --red: #d52b1e;
  --red-soft: #fdecea;
  --orange: #ff8000;
  --amber: #b25e00;
  --amber-soft: #fff3e0;
  --grey-bar: #babec5;
  --wordmark: #293840;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 6px rgba(0, 0, 0, .04);
  --shadow-pop: 0 6px 24px rgba(0, 0, 0, .14);
  --font: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #18191b; --panel: #232427; --ink: #e8e9eb; --ink-2: #b8bac0; --ink-3: #8d9096;
    --line: #393a3d; --line-2: #2e2f33; --head: #2a2b2f;
    --green: #53b700; --green-dark: #6fd11b; --green-soft: #1d2f16; --blue: #4aa6ff; --blue-soft: #16283a;
    --red: #ff6b5f; --red-soft: #3a1c1a; --amber: #ffb547; --amber-soft: #352710; --grey-bar: #55585e; --wordmark: #e8e9eb;
    --shadow: none; --shadow-pop: 0 6px 24px rgba(0, 0, 0, .5); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--font); background: var(--page); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
.ico { width: 20px; height: 20px; flex: none; }

/* --- Shell -------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  background: var(--panel); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; z-index: 25;
  display: flex; flex-direction: column; padding: 14px 10px 0;
}
.brand { display: flex; align-items: center; gap: 8px; padding: 4px 8px 14px; color: var(--ink); font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.logo { width: 32px; height: 32px; flex: none; }
.wordmark { color: var(--wordmark); font-size: 19px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }

/* The "+ New" button and its menu */
.newmenu { position: relative; margin: 0 6px 12px; }
.newmenu > summary { list-style: none; }
.newmenu > summary::-webkit-details-marker { display: none; }
.btn-new {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow);
}
.btn-new:hover, .newmenu[open] > .btn-new { border-color: var(--green); color: var(--green-dark); }
.btn-new .ico { width: 18px; height: 18px; color: var(--green); }
.newmenu-panel {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 16px 18px; display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 8px 26px; width: max-content;
}
.newmenu-panel h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
.newmenu-panel a { display: block; padding: 5px 0; color: var(--ink); }
.newmenu-panel a:hover { color: var(--blue); text-decoration: none; }

.side nav { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -10px; padding: 0 10px 20px; }
.side .group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 16px 12px 4px; font-weight: 600; }
.side nav a {
  display: flex; align-items: center; gap: 11px; color: var(--ink); padding: 7px 12px; border-radius: 6px;
  font-size: 14px; position: relative;
}
.side nav a .ico { color: var(--ink-2); width: 19px; height: 19px; }
.side nav a span:first-of-type { flex: 1; }
.side nav a:hover { background: var(--line-2); text-decoration: none; }
.side nav a.on { background: var(--green-soft); font-weight: 600; color: var(--ink); }
.side nav a.on::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 4px; border-radius: 0 3px 3px 0; background: var(--green); }
.side nav a.on .ico { color: var(--green-dark); }
.side .pill { background: var(--red); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; font-weight: 700; line-height: 18px; }
.side .pill.info { background: var(--blue); }

.frame { min-width: 0; display: flex; flex-direction: column; }
.appbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 60px; padding: 0 28px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.appbar .company { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32ch; }
.appbar .company:hover { text-decoration: none; }
.menu-btn { display: none; background: none; border: 0; color: var(--ink); padding: 6px; border-radius: 6px; cursor: pointer; }
.search { flex: 1; max-width: 460px; margin-left: auto; position: relative; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 18px; height: 18px; }
.search input[type=search] { width: 100%; padding: 8px 14px 8px 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--page); font: inherit; color: var(--ink); min-height: 38px; }
.search input[type=search]:focus { background: var(--panel); outline: 2px solid var(--blue-soft); border-color: var(--blue); }

.usermenu { position: relative; }
.usermenu > summary { list-style: none; display: flex; align-items: center; gap: 4px; cursor: pointer; color: var(--ink-2); }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu .ico { width: 16px; height: 16px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.usermenu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-pop); padding: 8px 0; min-width: 230px; z-index: 30;
}
.usermenu-panel .who { padding: 8px 16px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; display: grid; }
.usermenu-panel .who span { font-size: 12.5px; color: var(--ink-3); }
.usermenu-panel a, .usermenu-panel button { display: block; width: 100%; text-align: left; padding: 8px 16px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; }
.usermenu-panel a:hover, .usermenu-panel button:hover { background: var(--line-2); text-decoration: none; }

.main { padding: 24px 28px 64px; width: 100%; max-width: 1320px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.head .sub { color: var(--ink-2); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* --- Cards ---------------------------------------------------------------------- */
.panel { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel > .bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.panel > .bar h2 { margin: 0; }
.panel.flush > .bar { padding: 16px 20px 10px; margin: 0; }
.panel.flush > h2 { padding: 16px 20px 0; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--line-2); }
.gap-top { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.tile { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.tile .k { font-size: 12px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 6px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.tile .k a { text-transform: none; letter-spacing: 0; font-weight: 500; }
.tile .v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; color: var(--ink); }
.tile .v.small { font-size: 21px; }
.tile .s { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.tile.hero { border-top: 3px solid var(--green); }
.tile.alert { border-top: 3px solid var(--red); }
.tile.chosen { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.tile .v.neg { color: var(--red); }
.bar-title { display: flex; align-items: baseline; gap: 12px; margin: 22px 0 10px; }
.bar-title h2 { margin: 0; }
.grid.tight { gap: 28px; }
.grid.tight h3 { margin-top: 0; }
a.tile { display: block; color: inherit; }
a.tile:hover { text-decoration: none; border-color: var(--green); }
.tile a.v { display: block; color: inherit; }
.up { color: var(--green-dark); }
.down { color: var(--red); }

/* --- Tables ----------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); font-weight: 700; background: var(--head); border-bottom: 1px solid var(--line); }
tbody tr:hover td { background: #f8f9fa; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) tbody tr:hover td { background: var(--line-2); } }
tr.total td { font-weight: 700; border-top: 1px solid var(--ink-3); border-bottom: 3px double var(--ink-3); background: transparent; }
tr.subtotal td { font-weight: 600; border-top: 1px solid var(--line); }
tr.section td { font-weight: 700; padding-top: 18px; background: transparent; border-bottom: 1px solid var(--line); }
tr.indent td:first-child, td.indent { padding-left: 28px; }
tr.muted td { color: var(--ink-3); }
tr.future td { color: var(--ink-3); font-style: italic; }
.panel.flush table th:first-child, .panel.flush table td:first-child { padding-left: 20px; }
.panel.flush table th:last-child, .panel.flush table td:last-child { padding-right: 20px; }
.empty { padding: 32px; text-align: center; color: var(--ink-3); }

/* --- Status ------------------------------------------------------------------------ */
.badge { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.badge.overdue, .badge.bad, .badge.written_off { background: var(--red-soft); color: var(--red); }
.badge.paid, .badge.good, .badge.settled { background: var(--green-soft); color: var(--green-dark); }
.badge.due_soon, .badge.part_paid, .badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.active, .badge.upcoming { background: var(--blue-soft); color: var(--blue); }
.badge.cancelled, .badge.void { background: var(--line-2); color: var(--ink-3); text-decoration: line-through; }

/* --- Forms ------------------------------------------------------------------------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
label .hint, .hint { font-weight: 400; color: var(--ink-3); font-size: 12px; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--grey-bar); border-radius: 4px; background: var(--panel); color: var(--ink);
  font: inherit; min-height: 38px;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-soft); border-color: var(--blue); }
textarea { min-height: 72px; resize: vertical; }
.field { margin-bottom: 16px; }
.fields { display: grid; gap: 0 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fields.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fields .wide { grid-column: 1 / -1; }
.fields .wide-2 { grid-column: span 2; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.check input { width: auto; min-height: 0; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin: 0; }
.inline-form input, .inline-form select { width: auto; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters input, .filters select { width: auto; }
.filters input[type=search] { width: 260px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 18px; border-radius: 4px; border: 1px solid var(--grey-bar);
  background: var(--panel); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; min-height: 38px; white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: var(--ink-2); background: var(--line-2); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn.danger { color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.small { padding: 4px 12px; min-height: 30px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.link { border: 0; background: none; color: var(--blue); padding: 0; min-height: 0; font-weight: 500; }
button:disabled { opacity: .5; cursor: not-allowed; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 10px 16px; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tabs a.on { color: var(--ink); border-color: var(--green); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs .count { color: var(--ink-3); font-weight: 500; margin-left: 6px; }

.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; border-left: 4px solid; background: var(--panel); box-shadow: var(--shadow); }
.flash.ok { border-color: var(--green); color: var(--ink); }
.flash.error { border-color: var(--red); color: var(--red); }
.error-box { background: var(--red-soft); color: var(--red); padding: 11px 14px; border-radius: 4px; margin-bottom: 14px; }
.note ul.changes { margin: 6px 0 8px; padding-left: 20px; }
.radios { display: grid; gap: 6px; margin-top: 2px; }
.amount-input { width: 110px; text-align: right; }
.cell-name { min-width: 9.5rem; }
.change-choices { display: grid; gap: 14px; margin-top: 12px; }
.change-choices p { margin: 6px 0 0; }
.btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.note { background: var(--blue-soft); color: var(--ink); padding: 12px 16px; border-radius: 4px; margin-bottom: 14px; border-left: 4px solid var(--blue); }
.warnbox { background: var(--amber-soft); color: var(--amber); padding: 11px 14px; border-radius: 4px; margin-bottom: 14px; }
div.warn { color: var(--amber); }
.ok-line { color: var(--green-dark); font-weight: 600; }
.bad-line { color: var(--red); font-weight: 600; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
dl.facts dt { color: var(--ink-3); }
dl.facts dd { margin: 0; font-weight: 500; }
details.more { margin-top: 10px; }
details.more summary { cursor: pointer; color: var(--blue); font-weight: 600; }
details.more[open] summary { margin-bottom: 10px; }

/* --- Expenses ------------------------------------------------------------------------------ */
td.share { width: 38%; vertical-align: middle; }
td.share svg { width: 100%; height: 8px; display: block; }
.share-bg { fill: var(--line-2); }
.share-fill { fill: var(--green); }
table.lines th.hash, table.lines td.hash { width: 36px; }
table.lines td { vertical-align: middle; }
td.line-acts { width: 1%; white-space: nowrap; text-align: right; }
td.line-acts .small { margin-top: 4px; }
td.line-acts .btn.link { font-size: 12.5px; }

/* --- The money bar (Invoices due) ------------------------------------------------------ */
.moneybar { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.moneybar .side-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.moneybar .side-head strong { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.moneybar .figs { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.moneybar .fig .amt { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.moneybar .fig .lbl { font-size: 12px; color: var(--ink-2); }
.moneybar svg { width: 100%; height: 14px; display: block; }
.moneybar .seg-overdue { fill: var(--orange); }
.moneybar .seg-notdue { fill: var(--grey-bar); }
.moneybar .seg-paid { fill: var(--green); }

/* --- Chart ------------------------------------------------------------------------------ */
.chart svg { width: 100%; height: auto; display: block; }
.chart .bar-in { fill: var(--green); }
.chart .bar-out { fill: var(--grey-bar); }
.chart .dot { fill: var(--blue); }
.chart .dot-line { fill: none; stroke: var(--blue); stroke-width: 2; }
.chart .axis { stroke: var(--line-2); }
.chart text { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend .in { background: var(--green); }
.legend .out { background: var(--grey-bar); }
.legend .net { background: var(--blue); border-radius: 50%; }

/* --- Import ------------------------------------------------------------------------------ */
.steps { counter-reset: step; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 8px 12px; padding: 16px 0; border-top: 1px solid var(--line-2); align-items: start; }
.step:first-child { border-top: 0; }
.step::before { counter-increment: step; content: counter(step); width: 26px; height: 26px; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.step .what h3 { margin: 2px 0 2px; }
.step .acts { grid-column: 2; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.uploader { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.uploader input[type=file] { max-width: 260px; font-size: 12.5px; }

/* --- Reports ------------------------------------------------------------------------------ */
.report-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.report-list a { display: block; padding: 16px 18px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel); color: inherit; box-shadow: var(--shadow); }
.report-list a:hover { border-color: var(--green); text-decoration: none; }
.report-list strong { display: block; color: var(--blue); margin-bottom: 3px; font-size: 15px; }
.report-head { text-align: center; margin-bottom: 16px; }
.report-head h2 { margin: 0; font-size: 18px; }
.report-head div { color: var(--ink-2); }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets a { padding: 5px 13px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--ink); background: var(--panel); }
.presets a.on { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.presets a:hover { text-decoration: none; border-color: var(--ink-2); }
.checkline { margin-top: 10px; font-size: 13px; }

/* --- Sign in -------------------------------------------------------------------------------- */
.login-page { background: var(--page); }
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.login .card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 30px 32px; box-shadow: var(--shadow-pop); }
.login .card h1 { font-size: 22px; }
.login .card > .muted { margin-bottom: 20px; }

/* The sign-in page. The picture panel stays light in dark mode too, so its
   colours are fixed rather than themed. */
.signin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.signin-hero {
  position: relative; overflow: hidden; color: #293840;
  padding: clamp(40px, 7vh, 88px) clamp(28px, 5vw, 96px) 140px clamp(32px, 9.5vw, 160px);
  background: #f3f8f4 url(login-hero.webp) left bottom / cover no-repeat;
}
.signin-brand { display: flex; align-items: center; gap: 16px; margin-bottom: clamp(32px, 8vh, 76px); }
.signin-brand .logo { width: 64px; height: 64px; }
.signin-brand .wordmark { font-size: 34px; color: #293840; }
.signin-tagline { font-size: clamp(34px, 3.7vw, 62px); line-height: 1.1; font-weight: 700; letter-spacing: -.025em; margin: 0 0 20px; }
.signin-tagline span { color: #2ca01c; }
.signin-lede { font-size: clamp(16px, 1.45vw, 22px); line-height: 1.45; color: #6f7b84; max-width: 29em; margin: 0 0 clamp(28px, 5.5vh, 48px); }
.signin-points { list-style: none; margin: 0; padding: 0; display: flex; }
.signin-points li {
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  padding: 0 clamp(16px, 2.6vw, 50px); font-weight: 600; font-size: clamp(13px, 1.05vw, 15.5px); line-height: 1.35;
}
.signin-points li:first-child { padding-left: 0; }
.signin-points li + li { border-left: 1px solid rgba(41, 56, 64, .14); }
.signin-points li > span { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(44, 160, 28, .1); color: #2ca01c; }
.signin-points .ico { width: 30px; height: 30px; stroke-width: 1.6; }
.signin-motto { position: absolute; left: clamp(32px, 5.5vw, 112px); bottom: clamp(28px, 6vh, 60px); margin: 0; font-size: 13px; line-height: 1.9; letter-spacing: .22em; text-transform: uppercase; color: #5b6870; }
.signin-motto::before { content: ""; display: block; width: 48px; height: 1px; margin-bottom: 18px; background: currentColor; opacity: .6; }

.signin-side { position: relative; display: grid; place-items: center; padding: 72px 24px 48px; background: var(--page); }
.lang-switch { position: absolute; top: 20px; right: 28px; }
.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 16px; color: var(--ink); }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary:hover { background: var(--line-2); }
.lang-menu > summary .ico { width: 18px; height: 18px; color: var(--ink-2); }
.lang-menu-panel { position: absolute; right: 0; top: calc(100% + 4px); min-width: 150px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-pop); padding: 6px; z-index: 30; }
.lang-menu-panel a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--ink); }
.lang-menu-panel a:hover { background: var(--line-2); text-decoration: none; }
.lang-menu-panel a.on { font-weight: 700; color: var(--green-dark); }
/* In the top bar it sits just before the search box, the same height. */
.appbar .lang-menu { margin-left: auto; }
.appbar .lang-menu + .search { margin-left: 0; }
.appbar .lang-menu > summary { min-height: 38px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; background: var(--panel); white-space: nowrap; }
.appbar .lang-menu > summary .ico { width: 16px; height: 16px; }
/* The card grows with the screen: everything in it is sized in em, from a
   base that rises from 16px on a laptop to 22px on a large monitor. */
.signin-card {
  width: 100%; max-width: 30em; font-size: clamp(16px, 1.2vw, 22px); background: var(--panel); border-radius: 1em;
  padding: 2.75em 3em 3em; box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 18px 48px rgba(16, 24, 40, .09);
}
.signin-card-brand { display: flex; align-items: center; justify-content: center; gap: .75em; margin-bottom: 2em; }
.signin-card-brand .logo { width: 3.25em; height: 3.25em; }
.signin-card-brand .wordmark { font-size: 1.7em; }
.signin-card h1 { font-size: 1.875em; font-weight: 700; letter-spacing: -.02em; margin-bottom: .15em; }
.signin-sub { color: var(--ink-3); font-size: 1em; margin-bottom: 1.6em; }
.signin-card .field { margin-bottom: 1.25em; }
.signin-card label { font-size: .875em; margin-bottom: .5em; }
.signin-card .error-box { font-size: .9em; }
.input-ico { position: relative; }
.input-ico > .ico { position: absolute; left: 1em; top: 50%; width: 1.25em; height: 1.25em; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.input-ico input { min-height: 3.25em; padding: .5em 1em .5em 3em; border-radius: .5em; font-size: 1em; }
.input-ico:has(.reveal) input { padding-right: 3.25em; }
.reveal { position: absolute; right: .4em; top: 50%; transform: translateY(-50%); width: 2.5em; height: 2.5em; display: grid; place-items: center; border: 0; border-radius: .4em; background: none; color: var(--ink-2); cursor: pointer; font: inherit; }
.reveal .ico { width: 1.25em; height: 1.25em; }
.reveal:hover { color: var(--ink); background: var(--line-2); }
.reveal .ico + .ico, .reveal[aria-pressed="true"] .ico:first-child { display: none; }
.reveal[aria-pressed="true"] .ico + .ico { display: block; }
.signin-row { display: flex; align-items: center; justify-content: space-between; gap: .6em 1em; flex-wrap: wrap; margin: .15em 0 1.6em; font-size: .9em; }
.signin-remember { display: flex; align-items: center; gap: .65em; margin: 0; font-size: 1em; font-weight: 500; cursor: pointer; }
.signin-remember input { font-size: inherit; width: 1.2em; height: 1.2em; margin: 0; accent-color: var(--green); }
.signin-row a { color: var(--green-dark); font-weight: 600; }
.signin-go { min-height: 3.2em; border-radius: .47em; font-size: 1.0625em; gap: .6em; }
.signin-go .ico { width: 1.2em; height: 1.2em; }
.signin-help { margin: 0 0 1.75em; padding-left: 1.15em; display: grid; gap: .75em; line-height: 1.6; }
@media (max-width: 960px) {
  .signin { grid-template-columns: 1fr; }
  .signin-hero { display: none; }
}
/* The way back to the phone view, offered only on a phone-sized screen. */
.show-phone { display: none !important; }
@media (max-width: 600px) { .show-phone { display: block !important; } }

/* On a phone the card becomes the page, as the sign-in of the iPhone app is. */
@media (max-width: 480px) {
  .login-page, .signin-side { background: var(--panel); }
  .signin-side { place-items: start center; padding: 56px 8px 24px; }
  .lang-switch { top: 12px; right: 10px; }
  .signin-card { font-size: 16px; padding: 1.2em 1em 2em; background: transparent; box-shadow: none; border-radius: 0; }
  .signin-card-brand { margin-bottom: 1.75em; }
  .signin-card-brand .wordmark { font-size: 1.5em; }
  .signin-card h1 { font-size: 2.125em; }
  .signin-go { border-radius: .75em; }
}

/* --- Print ---------------------------------------------------------------------------------- */
@media print {
  .side, .appbar, .actions, .no-print, .flash { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  .panel { border: 0; box-shadow: none; padding: 0; }
  body { background: #fff; color: #000; font-size: 12px; }
  th { background: #fff; }
  .payslip { break-after: page; border: 1px solid #999 !important; padding: 18px !important; margin: 0; }
  .payslip:last-of-type { break-after: auto; }
}

/* Payslips */
.payslip { max-width: 780px; }
.payslip-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 12px; }
.payslip-title { text-align: right; font-size: 16px; }
.payslip-who { margin-bottom: 14px; }
.payslip table { width: 100%; }
.payslip-net { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 8px; padding: 10px 14px; background: var(--green-soft); border-radius: 6px; font-size: 16px; }
.payslip-net strong { font-size: 20px; }

/* --- Narrower screens ---------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .g2 { grid-template-columns: 1fr; }
  .newmenu-panel { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .18s; }
  body.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); }
  .menu-btn { display: inline-flex; }
  .appbar { padding: 0 12px; gap: 10px; }
  .search { display: none; }
  .appbar .company { flex: 1; }
  .newmenu-panel { position: static; box-shadow: none; grid-template-columns: 1fr; width: auto; margin-top: 8px; }
  .main { padding: 16px 16px 56px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3, .g2 { grid-template-columns: 1fr; }
  .fields, .fields.three, .fields.four { grid-template-columns: 1fr; }
  .fields .wide-2 { grid-column: auto; }
  .moneybar { grid-template-columns: 1fr; gap: 18px; }
  .filters input[type=search] { width: 100%; }
  .tile .v { font-size: 21px; }
  .hide-sm { display: none; }
}
@media (max-width: 480px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 12px 14px; }
  .tile .v, .tile .v.small { font-size: 17px; }
  h1 { font-size: 20px; }
}

/* Collateral */
.checks { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-bottom: 8px; }
.checks .check { font-weight: 400; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 6px; }
.panel-foot.inline-form .field { margin: 0; }

/* Documents */
.thumb-col { width: 64px; }
.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line-2); display: block; background: var(--line-2); }
.filetag { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 4px; background: var(--red-soft); color: var(--red); font-weight: 700; font-size: 11px; letter-spacing: .04em; }
form.inline { display: inline; }
.doc-picker { margin-bottom: 12px; }
.doc-drop { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px; border: 1.5px dashed var(--grey-bar); border-radius: var(--radius); cursor: pointer; font-weight: 400; }
.doc-drop:hover { border-color: var(--green); }
.doc-drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.doc-drop:focus-within { outline: 2px solid var(--blue-soft); border-color: var(--blue); }
.doc-rows { display: grid; gap: 8px; margin-top: 10px; }
.doc-rows:empty { display: none; }
.doc-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.3fr) minmax(0, 1.3fr) auto; gap: 8px; align-items: center; padding: 8px 10px; background: var(--page); border-radius: 6px; }
.doc-row .doc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
@media (max-width: 900px) { .doc-row { grid-template-columns: 1fr; } }
