/* Hexfold (direction A, 2026-10-15) with Schibsted Grotesk (from direction D).
   Served from public/fonts: the app loads nothing from other hosts. */
@font-face {
  font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(fonts/schibsted-grotesk-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(fonts/schibsted-grotesk-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --brand: #2d4059;          /* Aethereon navy: the hexagon */
  --brand-ink: #ffffff;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --line: #e1e6ed;
  --ink: #1b2638;
  --muted: #5f6c80;
  --accent: #3e7bfa;         /* actions */
  --accent-ink: #ffffff;
  --danger: #c0392b;
  --ok: #2e8b57;
  --warn: #a65f00;           /* money not yet invoiced */
  --bar-todo: #8293ad;
  --bar-in_progress: #3e7bfa;
  --bar-done: #2e8b57;
  --bar-blocked: #c0392b;
  --grid: #e8ecf2;
  --today: #d9480f;
  --focus: #3e7bfa33;
  --logo: #ffffff;
  /* the navy sidebar, the same in both themes apart from depth */
  --side-bg: #1f2d40;
  --side-ink: #e9eef5;
  --side-muted: #93a3ba;
  --side-hover: #273a52;
  --side-active: #2e4260;
  --mk-a: #ffffff; --mk-b: #d7e0ec; --mk-c: #2d4059;
  color-scheme: light;
}
/* Light only: Hexfold is a navy sidebar next to a light working area, in every system theme. */

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 14px/1.45 var(--font);
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .92em; }
.muted { color: var(--muted); }
.right { text-align: right; }
.error { color: var(--danger); min-height: 1.2em; margin: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 7px 14px; border-radius: 7px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.icon-btn {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  width: 26px; height: 26px; border-radius: 5px; line-height: 1;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; background: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Brand: Aethereon wordmark (colour, white in dark mode) with the tool name under it.
   The SVG carries generous vertical padding, so the negative margins trim it visually. */
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding-top: 4px; margin-bottom: 4px; color: var(--ink); text-decoration: none; }
/* Atlas leads; the company wordmark sits under it, smaller. */
.brand-logo img { display: block; width: 92px; height: auto; margin: 0 0 0 2px; opacity: .85; }
/* Atlas: the product mark under the company logo, monoline like the Aethereon icon. */
.atlas-lockup { display: block; width: 132px; height: auto; color: var(--logo); margin: 0 0 2px -2px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: min(360px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 28px; display: flex; flex-direction: column; gap: 10px;
}
.login-card .brand { margin-bottom: 10px; }
.login-card input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }

/* Shell */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px;
  display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; height: 100vh;
}
.toggle-archived { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.project-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; }
.project-link {
  display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none;
}
.project-link:hover { background: var(--surface-2); }
.project-link.active { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--brand); }
.project-link .pl-name { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-link .pl-meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.main { padding: 26px 32px 60px; min-width: 0; }
.empty { color: var(--muted); padding-top: 12vh; text-align: center; }

/* Status chips */
.chip {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase;
  padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted);
}
.chip.s-quoted { color: var(--warn); }
.chip.s-approved, .chip.s-in_progress { color: var(--accent); }
.chip.s-done { color: var(--ok); }

/* Project header */
.project-head { margin-bottom: 18px; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.title-input {
  font-size: 24px; font-weight: 700; border: 1px solid transparent; background: transparent;
  padding: 2px 6px; margin-left: -7px; border-radius: 6px; flex: 1 1 320px; min-width: 0;
}
.title-input:hover, .inline-input:hover { border-color: var(--line); }
.title-input:focus, .inline-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--focus); }
.title-row select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.save-state { font-size: 12.5px; color: var(--muted); min-width: 60px; }
.save-state.err { color: var(--danger); }
.sub-row { display: flex; align-items: center; gap: 6px; margin: 2px 0 16px; color: var(--muted); }
.inline-input {
  border: 1px solid transparent; background: transparent; padding: 1px 5px; margin-left: -6px;
  border-radius: 5px; width: 140px; color: var(--muted);
}
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; }
.tile .t-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.tile .t-value { font-size: 20px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile .t-sub { font-size: 12.5px; color: var(--muted); }
.tile.warn .t-value { color: var(--danger); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button {
  border: 0; background: transparent; padding: 9px 14px; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }

/* Milestones table */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.ms-table { width: 100%; border-collapse: collapse; min-width: 940px; }
.ms-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted);
  padding: 9px 8px; border-bottom: 1px solid var(--line); font-weight: 600;
}
.ms-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ms-table tfoot td { border-bottom: 0; padding: 9px 8px; font-variant-numeric: tabular-nums; }
.ms-table input, .ms-table select {
  width: 100%; padding: 5px 7px; border: 1px solid transparent; border-radius: 6px; background: transparent;
}
.ms-table input:hover, .ms-table select:hover { border-color: var(--line); }
.ms-table input:focus, .ms-table select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--focus); background: var(--surface); }
.ms-table .ms-name { font-weight: 600; }
.c-order { width: 52px; white-space: nowrap; }
.c-kind { width: 122px; } .c-date { width: 128px; } .c-num { width: 72px; text-align: right; }
.c-num input { text-align: right; } .c-bill { width: 56px; text-align: center; }
.c-bill input { width: auto; }
.c-status { width: 116px; } .c-act { width: 56px; white-space: nowrap; text-align: right; }
tr.kind-milestone .ms-name, tr.kind-gate .ms-name { font-weight: 500; font-style: italic; }
tr.overdue td.td-target input { color: var(--danger); font-weight: 600; }
tr.detail > td { background: var(--surface-2); padding: 14px 16px 16px 66px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.detail-grid textarea, .detail-grid input {
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; background: var(--surface); resize: vertical;
}
.deps { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--ink); }
.deps label { flex-direction: row; align-items: center; gap: 5px; color: var(--ink); font-size: 13px; }

/* Timeline */
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 26px 0 10px; }
.timeline { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.timeline svg { display: block; }
.timeline .empty-tl { padding: 26px; color: var(--muted); text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 16px; height: 9px; border-radius: 3px; display: inline-block; }
.lg-todo { background: var(--bar-todo); } .lg-in_progress { background: var(--bar-in_progress); }
.lg-done { background: var(--bar-done); } .lg-blocked { background: var(--bar-blocked); }
.lg-nb { border: 1.5px dashed var(--bar-todo); }
.lg-diamond { width: 9px; height: 9px; background: var(--brand); transform: rotate(45deg); display: inline-block; }
.lg-diamond.gate { background: var(--warn); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 12px; }
.form.narrow { max-width: 620px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; }
.form label small { font-weight: 400; color: var(--muted); }
.form input, .form select, .form textarea {
  border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; background: var(--surface); font-weight: 400; resize: vertical;
}
.form input:focus, .form select:focus, .form textarea:focus, .detail-grid :is(input, textarea):focus {
  border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--focus);
}
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.form .section-title { margin: 14px 0 0; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }

/* Quote */
.quote-grid { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 24px; align-items: start; }
.preview { position: sticky; top: 16px; }
.preview-frame {
  background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  box-shadow: 0 6px 24px #0000001a; width: 100%; aspect-ratio: 210 / 297; position: relative;
}
.preview-frame iframe {
  position: absolute; top: 0; left: 0; width: 794px; height: 1123px; border: 0;
  transform-origin: 0 0;
}

/* Customers */
.nav-link {
  display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; margin: 0 -6px;
  border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600;
}
.nav-link:hover { background: var(--surface-2); }
.nav-link.active { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--brand); }
.count { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 99px; padding: 0 8px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.page-head h1 { font-size: 24px; margin: 0; }
.page-head + .hint { margin: 6px 0 18px; }
.cust-grid { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 24px; align-items: start; }
.cust-list { display: flex; flex-direction: column; gap: 6px; }
.cust-item {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; color: var(--ink); text-decoration: none;
}
.cust-item:hover { border-color: var(--muted); }
.cust-item.active { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.cust-item .ci-name { font-weight: 600; display: block; }
.cust-item .ci-meta { font-size: 12.5px; color: var(--muted); }
.cust-form { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; max-width: 680px; }
.cust-form .title-input { font-size: 20px; }
.cust-projects { display: flex; flex-direction: column; gap: 4px; }
.cust-projects a { color: var(--accent); text-decoration: none; }
.cust-projects a:hover { text-decoration: underline; }
.customer-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px;
  font-size: 13px; color: var(--muted); line-height: 1.55;
}
.customer-card b { color: var(--ink); }
.customer-card a, .readonly a { color: var(--accent); }
.readonly {
  font-weight: 400; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 7px; color: var(--muted);
}
.readonly b { color: var(--ink); font-weight: 600; }

/* Time */
#time-tiles { margin-bottom: 14px; }
.tile-link { color: inherit; text-decoration: none; }
.tile-link:hover { border-color: var(--accent); }
.tile-link .t-sub { color: var(--accent); }
.tile.accent .t-value { color: var(--accent); }
.time-add {
  display: grid; grid-template-columns: 140px minmax(160px, 1.1fr) 96px minmax(130px, .9fr) minmax(200px, 2fr) auto auto;
  gap: 10px; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin: 14px 0 18px;
}
.time-add label, .filter-bar label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.time-add label small { font-weight: 400; }
.time-add input, .time-add select, .filter-bar input, .filter-bar select {
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; background: var(--surface); font-weight: 400; color: var(--ink); min-width: 0;
}
.time-add :is(input, select):focus, .filter-bar :is(input, select):focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--focus); }
.time-add label.check, .filter-bar label.check { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; color: var(--ink); padding-bottom: 8px; }
.time-add :is(input:not([type="checkbox"]), select), .time-add .btn { height: 36px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; margin-bottom: 14px; }
.filter-bar select { max-width: 240px; }
.filter-bar input[type="date"] { width: 140px; }
.time-table { min-width: 860px; }
.time-table .c-tproj { width: 190px; } .time-table .c-task { width: 150px; } .time-table .c-inv { width: 150px; }
.time-table .c-num { width: 70px; }
.time-table .c-date { width: 132px; }
.time-table.one-project .c-tproj { display: none; }
.time-table tr.day-row td {
  background: var(--surface-2); padding: 7px 10px; font-size: 12.5px; border-bottom: 1px solid var(--line);
}
.time-table tr.day-row span { float: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.time-table tr.nonbillable input, .time-table tr.nonbillable select { color: var(--muted); font-style: italic; }
.time-bottom { display: grid; grid-template-columns: 1fr minmax(280px, 380px); gap: 24px; align-items: start; }
.sum-table { min-width: 0; }
.sum-table td { padding: 8px 10px; }
.sum-table .c-share { width: 30%; }
.sum-table .c-share i { display: block; height: 6px; border-radius: 3px; background: var(--accent); opacity: .55; min-width: 2px; }
.ts-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; gap: 10px; }
.ts-card hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.ts-card > .btn { align-self: flex-start; }
.btn:disabled { opacity: .5; cursor: default; }

/* Sidebar navigation */
.main-nav { display: flex; flex-direction: column; gap: 2px; }
.side-head { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); padding-left: 4px; }
.pl-group { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 10px 10px 2px; }
.project-link { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 10px; }
.project-link .pl-name { font-weight: 500; }
.project-link.active .pl-name { font-weight: 650; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon-btn.big { width: 34px; height: 34px; font-size: 20px; }
.warn-text { color: var(--warn); }
.danger-text { color: var(--danger) !important; }
.check.small { font-size: 12.5px; }
label.check { display: inline-flex; align-items: center; gap: 6px; }

/* Week */
.week-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.week-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.week-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.week-head h1 { margin: 0; font-size: 26px; }
.week-head p { margin: 2px 0 0; }
.wk-nav { display: flex; align-items: center; gap: 6px; }
.wk-nav .btn:disabled { opacity: .45; }
.wk-grid-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.wk-grid { width: 100%; border-collapse: collapse; min-width: 720px; font-variant-numeric: tabular-nums; }
.wk-grid th, .wk-grid td { border-bottom: 1px solid var(--line); padding: 0; text-align: right; }
.wk-grid thead th { font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px 6px; }
.wk-grid thead th b { display: block; font-size: 15px; color: var(--ink); }
.wk-grid .c-proj, .wk-grid tbody th, .wk-grid tfoot th { text-align: left; padding: 6px 12px; width: 30%; }
.wk-grid tbody th a { color: var(--ink); text-decoration: none; font-weight: 500; }
.wk-grid tbody th a:hover { text-decoration: underline; }
.wk-grid tr.grp th { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 10px 12px 3px; border-bottom: 0; text-align: left; }
.wk-grid .today { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.wk-grid .tot { padding: 6px 12px; font-weight: 650; width: 70px; }
.wk-grid tfoot th, .wk-grid tfoot td { border-bottom: 0; border-top: 2px solid var(--line); font-weight: 650; padding: 9px 10px; }
.wk-grid tfoot th { padding-left: 12px; }
.cell {
  display: block; width: 100%; min-height: 38px; border: 0; background: transparent; cursor: pointer;
  text-align: right; padding: 8px 10px; font: inherit; color: var(--ink); border-radius: 0;
}
.cell:hover { background: var(--surface-2); }
.cell.empty::after { content: "+"; color: transparent; }
.cell.empty:hover::after, .cell.empty:focus-visible::after { color: var(--muted); }
.cell.nb { color: var(--muted); font-style: italic; }
.cell.sel { box-shadow: inset 0 0 0 2px var(--accent); background: var(--surface); font-weight: 700; border-radius: 4px; }
.cell:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.wk-empty { padding: 20px 12px; text-align: left; }
.wk-addrow select { border: 1px dashed var(--line); background: transparent; border-radius: 7px; padding: 6px 10px; color: var(--muted); }

/* The selected day */
.wk-cell { background: var(--surface); border: 1px solid var(--accent); border-radius: 10px; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.wc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.wc-head p { margin: 0; font-size: 12.5px; }
.wc-head h2 { margin: 0; font-size: 18px; }
.wc-total { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wc-list { list-style: none; margin: 0; padding: 0; }
.wc-entry { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.wc-entry.nb .wc-h, .wc-entry.nb .wc-d { color: var(--muted); font-style: italic; }
.wc-entry.editing { display: block; }
.wc-h { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.wc-d { min-width: 0; }
.wc-act { display: flex; gap: 2px; align-items: center; }
.small { font-size: 12px; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 0 7px; border-radius: 5px; background: var(--surface-2); }
.wc-add, .wc-edit { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.wc-add label, .wc-edit label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.wc-add label.check, .wc-edit label.check { flex-direction: row; color: var(--ink); font-weight: 400; padding-bottom: 8px; }
.wc-add input:not([type="checkbox"]), .wc-edit input:not([type="checkbox"]) {
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; background: var(--surface); color: var(--ink); font-weight: 400; height: 36px;
}
.wc-add :is(input):focus, .wc-edit :is(input):focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--focus); }
.wc-f-hours input, .wc-edit label:first-child input { width: 84px; }
.wc-f-desc, .wc-edit .grow { flex: 1 1 260px; }
.wc-f-task input, .wc-edit label:nth-child(3) input { width: 150px; }
.wc-add .btn { height: 36px; }

/* Month panel */
.month-panel { position: sticky; top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.mp-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.mp-head h2 { margin: 0; font-size: 16px; text-align: center; flex: 1; }
.mp-total b { display: block; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mp-total span { color: var(--muted); font-size: 12.5px; }
.mp-open { background: color-mix(in srgb, var(--warn) 12%, transparent); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; font-size: 13px; }
.mp-open b { color: var(--warn); }
.mp-open.done { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.mp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mp-cust { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.mp-c-head { display: flex; justify-content: space-between; width: 100%; gap: 8px; font-variant-numeric: tabular-nums; }
.mp-c-head a { color: var(--ink); font-weight: 650; text-decoration: none; }
.mp-c-head a:hover { text-decoration: underline; }
.mp-c-open { color: var(--warn); font-size: 12.5px; font-weight: 600; }
.mp-invs { display: flex; flex-wrap: wrap; gap: 4px; }
.mp-billing { font-size: 11.5px; color: var(--muted); }
.inv-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 1px 9px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--ink); }
.inv-chip span { font-weight: 500; color: var(--muted); margin-left: 3px; }
.inv-chip.ok span { color: var(--ok); } .inv-chip.bad span { color: var(--danger); } .inv-chip.warn span { color: var(--warn); }
.inv-chip.info span { color: var(--accent); } .inv-chip.mute { opacity: .6; }
span.inv-chip { cursor: default; }

/* Closing dialog */
.close-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--bg); color: var(--ink); box-shadow: 0 24px 60px #0004; }
.close-dialog::backdrop { background: #0f162280; }
.cd-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 20px 12px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
.cd-head h2 { margin: 0; font-size: 20px; }
.cd-head p { margin: 2px 0 0; font-size: 13px; }
.cd-body { padding: 16px 20px 22px; display: flex; flex-direction: column; gap: 18px; }
.cd-section { display: flex; flex-direction: column; gap: 10px; }
.cd-section h3 { margin: 0; font-size: 14px; }
.cd-inv { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.cd-inv p { margin: 0; font-size: 12.5px; }
.cd-inv-head { display: flex; align-items: center; gap: 8px; }
.cd-amt { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.cd-lines { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.cd-lines th, .cd-lines td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.cd-lines th { font-size: 12px; color: var(--muted); font-weight: 600; }
.cd-lines .num { text-align: right; }
.cd-lines tfoot td { font-weight: 700; border-bottom: 0; }
.cd-ts { align-items: center; }
.cd-fixed { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.cd-fixed label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cd-fixed label.grow { flex: 1 1 260px; }
.cd-fixed input { border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; background: var(--surface); color: var(--ink); font-weight: 400; height: 36px; }
.cd-fixed input[type="number"] { width: 140px; }
.cd-problems { margin: 0; padding: 10px 14px 10px 30px; background: color-mix(in srgb, var(--warn) 12%, transparent); border-radius: 8px; font-size: 13px; }
.cd-create { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.cd-create label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cd-create input { border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; background: var(--surface); color: var(--ink); font-weight: 400; height: 36px; }
.cd-create .hint { flex-basis: 100%; order: 3; }
.cd-create .btn { height: 36px; }

/* Customer billing */
.billing-choice { border: 0; padding: 0; margin: 0 0 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.billing-choice .radio { flex-direction: row !important; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; cursor: pointer; font-weight: 400 !important; }
.billing-choice .radio:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--focus); }
.billing-choice .radio span { display: flex; flex-direction: column; gap: 2px; }
.billing-choice .radio small { color: var(--muted); }
.cust-stripe { margin-bottom: 10px; }
.row-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.row-inline input { flex: 1 1 220px; }
.stripe-results { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
.stripe-results li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }

@media (max-width: 1100px) {
  .week-layout { grid-template-columns: 1fr; }
  .month-panel { position: static; }
}
@media (max-width: 700px) {
  .billing-choice { grid-template-columns: 1fr; }
}

/* Toast */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 8px; font-size: 13.5px;
  box-shadow: 0 6px 20px #0003; z-index: 10;
}

/* Narrow screens */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .project-list { max-height: 220px; }
  .main { padding: 18px 16px 48px; }
  .quote-grid { grid-template-columns: 1fr; }
  .preview { position: static; }
  .detail-grid, .row2, .cust-grid, .time-bottom { grid-template-columns: 1fr; }
  .time-add { grid-template-columns: 1fr 1fr; }
  .time-add .ta-project, .time-add .ta-desc, .time-add .ta-task { grid-column: 1 / -1; }
  tr.detail > td { padding-left: 16px; }
}

/* ---------- Hexfold: navy sidebar and the Atlas logo ---------- */
.btn { border-radius: 8px; }
h1, h2, .title-input, .page-head h1, .week-head h1 { letter-spacing: -0.015em; }
.week-head h1, .page-head h1 { font-weight: 800; }
.sidebar { background: var(--side-bg); color: var(--side-ink); border-right: 0; }
.sidebar .brand { color: var(--side-ink); gap: 8px; margin: 2px 0 10px 2px; }
.atlas-lockup { display: inline-flex; align-items: center; gap: 9px; width: auto; margin: 0; color: var(--side-ink); }
.atlas-mark { width: 34px; height: 34px; flex: none; }
.atlas-word { font: 800 27px/1 var(--font); letter-spacing: -0.035em; }
.brand-logo img { width: 86px; margin: 0 0 0 1px; opacity: .75; }
.sidebar .nav-link { color: var(--side-ink); font-weight: 600; }
.sidebar .nav-link:hover { background: var(--side-hover); }
.sidebar .nav-link.active { background: var(--side-active); box-shadow: inset 3px 0 0 var(--accent); }
.sidebar .count { background: rgba(255, 255, 255, .08); color: var(--side-muted); }
.sidebar .side-head, .sidebar .pl-group, .sidebar .toggle-archived { color: var(--side-muted); }
.sidebar .project-link { color: var(--side-ink); }
.sidebar .project-link:hover { background: var(--side-hover); }
.sidebar .project-link.active { background: var(--side-active); box-shadow: inset 3px 0 0 var(--accent); }
.sidebar .chip { background: rgba(255, 255, 255, .08); color: var(--side-muted); }
.sidebar .chip.s-quoted { color: #ffc36b; } .sidebar .chip.s-done { color: #7fd6a4; }
.sidebar .btn.ghost { color: var(--side-muted); }
.sidebar .btn.ghost:hover { color: var(--side-ink); background: var(--side-hover); }
.sidebar input[type="checkbox"] { accent-color: var(--accent); }
/* Login: the logo on the page's own ground */
.login-card .atlas-lockup { color: var(--ink); --mk-a: #2d4059; --mk-b: #24364c; --mk-c: #ffffff; }
/* Schibsted Grotesk's tabular figures make the decimal point as wide as a digit ("31 . 92"):
   its proportional figures read better, and right-aligned columns still line up. */
* { font-variant-numeric: normal !important; }
.mp-c-head span { white-space: nowrap; }

/* The two halves of a month for customers invoiced twice a month */
.cd-parts { display: flex; gap: 8px; flex-wrap: wrap; }
.cd-part { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 9px; padding: 8px 14px; cursor: pointer; font: inherit; color: var(--ink); min-width: 150px; }
.cd-part span { font-size: 12px; color: var(--muted); }
.cd-part.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--focus); }
