/* Layout: airy app shell. A soft sky "mist" behind the header, white rounded cards that float on it,
   blue pill buttons, icon tiles for job and equipment types, and a floating tab bar on the phone. */
:root {
  --bg: #f3f7fc;
  --mist-1: #dceafe;
  --mist-2: #f3f7fc;
  --card: #ffffff;
  --sunk: #f2f6fb;
  --ink: #13233f;
  --muted: #6b7a93;
  --line: #e3eaf3;
  --brand: #2a74f0;
  --brand-2: #4f9bff;
  --brand-soft: #e6f0fe;
  --brand-ink: #ffffff;
  --red: #d33f35;
  --amber: #c27a06;
  --green: #1d9358;
  --red-soft: #fdeceb;
  --amber-soft: #fdf3dd;
  --green-soft: #e3f6ec;
  --hover: #f5f9ff;
  --shadow: 0 10px 30px rgba(32, 76, 150, .08), 0 1px 3px rgba(32, 76, 150, .06);
  --head: #13233f;
  --paper-ink: #13233f;
  --radius: 20px;
  --f-display: "Urbanist", "Segoe UI", system-ui, sans-serif;
  --f-body: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --lime: var(--green); --nav-head: var(--green); --nav-item: #13233f; /* the app's own green for the date and menu headings, dark blue items */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #071a38; --mist-1: #12356a; --mist-2: #071a38; --card: #0e2748; --sunk: #123056; --ink: #e8eefa; --muted: #a3b6d3; --line: #1f3d66;
    --brand: #4a8cff; --brand-2: #6aa6ff; --brand-soft: #173a70; --hover: #143258;
    --red: #f2665c; --amber: #e6a83b; --green: #4cc488; --red-soft: #3f2230; --amber-soft: #3d3120; --green-soft: #123d35;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35); --head: #04122a;
    --lime: var(--green); --nav-head: var(--green); --nav-item: #e8eefa; /* dark blue text can't be read on the dark blue screen */
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #071a38; --mist-1: #12356a; --mist-2: #071a38; --card: #0e2748; --sunk: #123056; --ink: #e8eefa; --muted: #a3b6d3; --line: #1f3d66;
    --brand: #4a8cff; --brand-2: #6aa6ff; --brand-soft: #173a70; --hover: #143258;
    --red: #f2665c; --amber: #e6a83b; --green: #4cc488; --red-soft: #3f2230; --amber-soft: #3d3120; --green-soft: #123d35;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35); --head: #04122a;
  --lime: var(--green); --nav-head: var(--green); --nav-item: #e8eefa; /* dark blue text can't be read on the dark blue screen */
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0; font: 15px/1.5 var(--f-body); color: var(--ink); font-variant-numeric: tabular-nums;
  background: radial-gradient(1200px 420px at 15% -80px, var(--mist-1), transparent 70%), radial-gradient(900px 380px at 95% -60px, var(--mist-1), transparent 70%), var(--bg);
  background-repeat: no-repeat; background-color: var(--bg);
}
a { color: var(--brand); }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: 30px; margin: 0; font-weight: 700; }
h2 { font-size: 19px; margin: 0 0 12px; font-weight: 700; }
h3 { font-size: 16px; margin: 18px 0 8px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px max(16px, env(safe-area-inset-right, 0px)) 14px max(16px, env(safe-area-inset-left, 0px)); max-width: 1280px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--f-display); font-weight: 800; font-size: 23px; letter-spacing: -.02em; }
.brand img { width: 34px; height: 34px; }
.company { font-size: 13px; color: var(--muted); padding-left: 14px; border-left: 1px solid var(--line); }
.viewas { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; align-items: center; background: var(--card); padding: 5px; border-radius: 999px; box-shadow: var(--shadow); }
.viewas .lbl { font-size: 12px; color: var(--muted); padding: 0 8px; }
.viewas a { color: var(--ink); text-decoration: none; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.viewas a.on { background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: #fff; }
.topbar .ghost { background: var(--card); box-shadow: var(--shadow); border-color: transparent; color: var(--ink); }

main { max-width: 1280px; margin: 0 auto; padding: 8px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px)); }

/* Office shell */
.office { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.office-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 4px; background: var(--card); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.office-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; text-decoration: none; color: var(--nav-item); font-weight: 600; }
.office-nav a:hover { background: var(--hover); color: var(--nav-item); }
.office-nav a.on { background: var(--brand-soft); color: var(--brand); }
.office-nav svg { width: 20px; height: 20px; flex: none; }
.office-nav .nav-group { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--nav-head); padding: 12px 12px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.office-nav .nav-group:empty { padding: 4px 0 0; }
.office-nav .nav-group:first-child { border-top: 0; margin-top: 0; padding-top: 4px; }
.office-nav .count { margin-left: auto; font-size: 12px; background: var(--red); color: #fff; border-radius: 999px; padding: 0 7px; }
.content { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.eyebrow { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 2px; }

.card { background: var(--card); border: 0; border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.scroll { overflow-x: auto; }

/* Icon tiles */
.ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.ico svg { width: 22px; height: 22px; }
.ico.red { background: var(--red-soft); color: var(--red); }
.ico.amber { background: var(--amber-soft); color: var(--amber); }
.ico.green { background: var(--green-soft); color: var(--green); }

/* Dashboard tiles */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tile { background: var(--card); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); transition: transform .14s ease, box-shadow .14s ease; }
.tile:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(32, 76, 150, .14); }
.tile .top { display: flex; justify-content: space-between; align-items: flex-start; }
.tile .n { font-family: var(--f-display); font-size: 36px; font-weight: 800; line-height: 1; }
.tile.red .n { color: var(--red); }
.tile .lab { font-weight: 600; font-size: 14px; }
.tile .sub { font-size: 12.5px; color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--hover); }
tr.click td:first-child { border-radius: 12px 0 0 12px; }
tr.click td:last-child { border-radius: 0 12px 12px 0; }
.idcell { font-family: var(--f-mono); font-size: 13px; white-space: nowrap; color: var(--muted); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.badge.New, .badge.Fail, .badge.Overdue, .badge.Void, .badge.Urgent, .badge.Low { background: var(--red-soft); color: var(--red); }
.badge.In-progress, .badge.Done, .badge.Repair, .badge.On-hold { background: var(--amber-soft); color: var(--amber); }
.badge.Paid, .badge.Pass { background: var(--green-soft); color: var(--green); }
.badge.Draft, .badge.Cancelled { background: var(--sunk); color: var(--muted); }

button, .btn { font: inherit; font-weight: 700; padding: 10px 20px; border-radius: 999px; border: 0; background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: #fff; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 6px 16px rgba(42, 116, 240, .28); }
button:hover, .btn:hover { filter: brightness(1.05); }
button.ghost, .btn.ghost { background: var(--card); color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand-soft), var(--shadow); }
button.small, .btn.small { padding: 6px 13px; font-size: 13px; }
button:disabled { opacity: .45; cursor: default; filter: none; }
input, select, textarea { font: inherit; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); max-width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px var(--brand-soft); }
textarea { width: 100%; min-height: 84px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.form-grid input, .form-grid select { width: 100%; }

.history { list-style: none; padding: 0; margin: 0; font-size: 13.5px; }
.history li { padding: 8px 0 8px 18px; border-left: 2px solid var(--line); position: relative; }
.history li::before { content: ""; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photos img { width: 92px; height: 92px; object-fit: cover; border-radius: 14px; }

/* Worker phone */
.phone { max-width: 390px; margin: 0 auto; background: var(--bg); border: 10px solid #0d1526; border-radius: 46px; min-height: 760px; overflow: hidden; box-shadow: 0 30px 70px rgba(19, 35, 63, .25); position: relative; display: flex; flex-direction: column; }
.phone-top { background: radial-gradient(420px 220px at 30% 0, var(--mist-1), transparent 75%), radial-gradient(300px 200px at 100% 30px, var(--mist-1), transparent 70%), var(--bg); padding: 0 20px 18px; }
.phone-status { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; padding: 12px 6px 6px; color: var(--ink); }
.phone-hello { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.phone-hello b { font-family: var(--f-display); font-size: 26px; font-weight: 700; display: block; line-height: 1.15; }
.phone-hello .small { color: var(--muted); }
.avatar { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 18px; color: #fff; background: linear-gradient(135deg, var(--brand-2), var(--brand)); box-shadow: 0 0 0 3px var(--card), var(--shadow); flex: none; }
.backrow { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.backbtn { width: 42px; height: 42px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--ink); text-decoration: none; font-size: 20px; flex: none; }
.backrow b { font-family: var(--f-display); font-size: 22px; line-height: 1.2; }
.search { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 999px; padding: 6px 6px 6px 16px; margin-top: 16px; box-shadow: var(--shadow); }
.search input { border: 0; padding: 8px 0; flex: 1; min-width: 0; background: transparent; box-shadow: none; }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--card); color: var(--ink); font-weight: 600; font-size: 13px; box-shadow: var(--shadow); border: 0; }
.chip.on { background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: #fff; }
.phone-body { padding: 14px 16px 110px; flex: 1; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 2px 10px; }
.section-title h3 { margin: 0; font-size: 18px; }
.jobcard { display: flex; gap: 12px; align-items: flex-start; border-radius: 20px; padding: 14px; margin-bottom: 12px; text-decoration: none; color: var(--ink); background: var(--card); box-shadow: var(--shadow); }
.jobcard .body { min-width: 0; flex: 1; }
.jobcard b { font-family: var(--f-display); font-size: 17px; font-weight: 700; }
.jobcard .desc { font-size: 13px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.jobcard.urgent { box-shadow: inset 0 0 0 2px var(--red-soft), var(--shadow); }
.check-item { background: var(--card); border-radius: 18px; padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.check-item b { font-family: var(--f-mono); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.seg button { background: var(--sunk); color: var(--ink); padding: 11px 4px; font-size: 14px; justify-content: center; box-shadow: none; border-radius: 14px; }
.seg button.on.Pass { background: var(--green); color: #fff; }
.seg button.on.Fail { background: var(--red); color: #fff; }
.seg button.on.Repair { background: var(--amber); color: #fff; }
.big { width: 100%; padding: 16px; font-size: 16px; margin-top: 12px; justify-content: center; }
.sync { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }
.note { background: var(--brand-soft); border-radius: 16px; padding: 12px 14px; margin: 12px 0; font-size: 14px; }
.panel { background: var(--card); border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow); margin-top: 12px; }
.panel h3 { margin-top: 0; }
.tabbar { position: absolute; left: 14px; right: 14px; bottom: 16px; display: flex; justify-content: space-around; background: var(--card); border-radius: 26px; padding: 8px 6px; box-shadow: 0 12px 30px rgba(19, 35, 63, .16); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 4px 10px; }
.tabbar svg { width: 22px; height: 22px; }
.tabbar a.on { color: var(--brand); }
.tabbar a.on::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }

.toast { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--head); color: #fff; padding: 13px 20px; border-radius: 18px; max-width: min(520px, 90vw); z-index: 10; box-shadow: 0 14px 34px rgba(0,0,0,.25); }

/* Printable invoice / certificate (always on white paper) */
.paper { background: #fff; color: var(--paper-ink); max-width: 820px; margin: 0 auto; padding: 44px; border-radius: 20px; box-shadow: var(--shadow); }
.paper th { color: #6b7a93; }
.paper td, .paper th { border-color: #e3eaf3; }
.paper .head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 3px solid #2a74f0; }
.paper .title { font-family: var(--f-display); font-size: 26px; font-weight: 800; color: #2a74f0; }
.paper .badge { background: #e6f0fe; color: #2a74f0; }
.paper .badge.Pass { background: #e3f6ec; color: #1d9358; }
.paper .badge.Fail { background: #fdeceb; color: #d33f35; }
.paper .badge.Repair { background: #fdf3dd; color: #c27a06; }
.totals { margin-left: auto; width: 290px; max-width: 100%; }
.totals td { border: 0; padding: 4px 8px; font-size: 15px; }
.sign { margin-top: 48px; display: flex; gap: 40px; }
.sign div { flex: 1; border-top: 1px solid var(--paper-ink); padding-top: 6px; font-size: 13px; }

@media (max-width: 860px) {
  .office { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .office-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .office-nav::-webkit-scrollbar { display: none; }
  .office-nav a { white-space: nowrap; }
  .office-nav .nav-group { display: none; }
  .company { display: none; }
}
@media (max-width: 560px) {
  .phone { border: 0; border-radius: 0; box-shadow: none; min-height: 100vh; }
  .phone-status { display: none; }
  .tabbar { position: fixed; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .hide-sm { display: none; }
  .paper { padding: 22px; }
  h1 { font-size: 24px; }
  .viewas { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } .tile:hover { transform: none; } }
@media print {
  .no-print, .topbar, .office-nav { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .paper { box-shadow: none; padding: 0; }
}

/* Sign-in */
.authbox { max-width: 460px; margin: 32px auto; }
.authbox h1 { margin-bottom: 6px; }
/* The logo has dark lettering, so it keeps a white plate in dark mode too. */
.authlogo { background: #fff; border-radius: 14px; padding: 10px; margin-bottom: 16px; }
.authlogo img { display: block; width: 100%; height: auto; }
body.signed-out .topbar { display: none; }
.authform input { width: 100%; }
.authmsg { color: var(--red); min-height: 1.2em; margin: 10px 0 0; }
body.signed-out .viewas, body.signed-out #signout-btn, body.signed-out #sync-status { display: none; }
#sync-status { margin-left: 8px; }

/* Strokes so tabs stand out from the background: chrome on the header, white (silver on light screens) on the side menu. */
:root {
  --chrome: linear-gradient(135deg, #ffffff 0%, #a7b2c2 35%, #f2f5f8 55%, #8a96a9 100%);
  --side-stroke: #a7b2c2;
  --tab-stroke: #cbd5e2;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --side-stroke: #ffffff; --tab-stroke: #3a5c8c; }
}
:root[data-theme="dark"] { --side-stroke: #ffffff; --tab-stroke: #3a5c8c; }
.viewas, .topbar .ghost {
  border: 1.5px solid transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box, var(--chrome) border-box;
}
.office-nav { box-shadow: 0 0 0 1.5px var(--side-stroke), var(--shadow); }
.office-nav a.on { box-shadow: inset 0 0 0 1.5px var(--side-stroke); }
.tile, .card, .jobcard, .check-item, .panel, .chip { box-shadow: 0 0 0 1px var(--tab-stroke), var(--shadow); }
.tabbar { box-shadow: 0 0 0 1.5px var(--side-stroke), 0 12px 30px rgba(19, 35, 63, .16); }

/* Larger text on tabs and labels. */
.office-nav a { font-size: 16.5px; }
.viewas a, .viewas .lbl { font-size: 14.5px; }
.topbar .ghost, button.small, .btn.small { font-size: 14.5px; }
.company, #sync-status { font-size: 14.5px; }
.tile .lab { font-size: 16px; }
.tile .sub { font-size: 14px; }
th { font-size: 13.5px; }
label { font-size: 14.5px; }
.badge { font-size: 13px; }
.small { font-size: 14px; }
.eyebrow { font-size: 14.5px; }
.chip { font-size: 14.5px; }
.tabbar a { font-size: 13px; }

/* Client signature */
.sigpad { display: block; width: 100%; height: auto; background: #fff; border: 1.5px solid var(--tab-stroke); border-radius: 12px; touch-action: none; cursor: crosshair; }
.sigimg { display: block; max-width: 260px; width: 100%; background: #fff; border-radius: 10px; border: 1px solid var(--tab-stroke); }
.badge.Approved, .badge.Converted { background: var(--green-soft); color: var(--green); }
.badge.Declined { background: var(--red-soft); color: var(--red); }

/* Due notices and report history */
.due-msg { white-space: pre-wrap; font-size: 14px; margin-top: 8px; padding: 12px; background: var(--sunk); border: 1px solid var(--line); border-radius: 10px; }
.pack .paper + .paper { margin-top: 20px; }
.pack .paper + .paper > .no-print { display: none; }
@media print { .pack .paper { break-after: page; } .pack .paper + .paper { margin-top: 0; } }

/* First login: choose the trade */
.setup-trades { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 16px 0; }
.setup-trades button { width: 100%; }

/* Reports and projects */
.good { color: var(--green); }
.slow { color: #c27a06; }
.suggest { margin: 0 0 12px; padding: 10px 12px; background: var(--sunk); border: 1px solid var(--line); border-radius: 10px; }
.suggest b.small { display: block; margin-bottom: 4px; }
.logrow { padding: 10px 0; border-bottom: 1px solid var(--line); }

/* Help, Admin, trial */
.startlist { list-style: none; padding: 0; margin: 12px 0; }
.startlist li { padding: 5px 0; }
.startlist li.isdone { color: var(--muted); text-decoration: line-through; }
.guide > summary { cursor: pointer; }
.guide ul { margin: 12px 0 2px; padding-left: 20px; }
.guide li { margin-bottom: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; }
.stat .n { font-family: var(--f-display); font-size: 24px; font-weight: 800; }
.feed { padding-left: 18px; margin: 8px 0; }
.feed li { margin-bottom: 7px; }
.authmore { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.hp { position: absolute; left: -9999px; height: 1px; overflow: hidden; }

/* Business logo */
.co-logo { height: 26px; max-width: 90px; object-fit: contain; vertical-align: middle; margin-right: 8px; border-radius: 4px; }
.logo-preview img { height: 56px; max-width: 160px; object-fit: contain; border-radius: 8px; background: #fff; padding: 4px; border: 1px solid var(--line); }
.logo-preview { display: inline-flex; align-items: center; min-height: 56px; margin-right: 10px; }
.head-co { display: flex; gap: 14px; align-items: flex-start; }
.paperlogo { max-height: 64px; max-width: 140px; object-fit: contain; }
.setupform label { margin-top: 12px; }
.tradeopt { display: flex; align-items: center; gap: 8px; margin: 0 !important; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; color: var(--ink); }
.tradeopt:has(input:checked) { border-color: #2a74f0; background: var(--sunk); }

/* Guided tour */
.tour-box { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); width: min(380px, calc(100vw - 32px)); background: var(--card); color: var(--ink); border: 2px solid var(--brand); border-radius: var(--radius); padding: 16px 18px; box-shadow: 0 18px 44px rgba(0, 0, 0, .3); z-index: 20; }
.tour-box h3 { margin: 4px 0 6px; }
.tour-box p { margin: 0 0 12px; line-height: 1.5; }
.tour-spot { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 12px; box-shadow: 0 0 0 6px var(--brand-soft); position: relative; z-index: 1; }
@media (max-width: 700px) { .tour-box { left: 16px; right: 16px; width: auto; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }

/* Worker hours */
.hours-day { margin: 0 0 10px; }
.hours-day label input { margin-left: 8px; }

/* Dashboard date */
.eyebrow.dash-date { font-size: 17px; font-weight: 700; color: var(--lime); margin-bottom: 4px; }

/* ---------- Left menu as a slim icon rail (computers and tablets) ----------
   Each icon with its name underneath, grouped Work / Money / Company, always on a dark strip.
   Sized from the window height so every item fits without scrolling; on short screens the names
   shrink, then hide (the name still shows when you point at an icon). Phones keep the row of tabs. */
@media (min-width: 861px) {
  .office { grid-template-columns: 108px minmax(0, 1fr); gap: 24px; }
  .office-nav {
    background: #0b1f3f; border: 1px solid rgba(255, 255, 255, .14); border-radius: 22px;
    padding: 8px 6px; gap: 1px;
    box-shadow: 0 12px 30px rgba(4, 18, 42, .3); max-height: calc(100vh - 32px);
  }
  .office-nav a {
    position: relative; flex-direction: column; align-items: center; gap: 3px; text-align: center;
    padding: 6px 4px; border-radius: 14px;
    font-size: 13px; line-height: 1.15; font-weight: 600; color: #c9d6ee;
  }
  .office-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
  .office-nav a.on { background: var(--green); color: #04122a; box-shadow: none; }
  .office-nav svg { width: 23px; height: 23px; }
  .office-nav .count { position: absolute; top: 3px; right: 9px; margin: 0; font-size: 10.5px; padding: 0 5px; line-height: 16px; }
  .office-nav .nav-group {
    font-size: 10.5px; letter-spacing: .14em; text-align: center; color: #8fa6cc; font-weight: 800;
    padding: 8px 0 2px; border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 2px;
  }
  .office-nav .nav-group:first-child { border-top: 0; margin-top: 0; padding-top: 2px; }
}
@media (min-width: 861px) and (max-height: 1000px) {
  .office-nav { padding: 6px 6px; gap: 0; }
  .office-nav a { font-size: 12px; gap: 1px; padding: 4px 4px; }
  .office-nav svg { width: 20px; height: 20px; }
  .office-nav .nav-group { font-size: 0; padding: 3px 0 0; }
}
@media (min-width: 861px) and (max-height: 740px) {
  .office-nav a { font-size: 0; gap: 0; padding: 7px 4px; }
}

/* ---------- Dashboard designs (see dashboards.js) ---------- */
.dash-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dash-actions .btn { display: inline-flex; align-items: center; gap: 8px; }
.dash-actions svg { width: 18px; height: 18px; }
.pill { display: inline-block; min-width: 26px; padding: 1px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 700; text-align: center; vertical-align: middle; }

/* Design 1: Today */
.dash-today { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; text-decoration: none; color: var(--ink); background: var(--sunk); border-left: 4px solid var(--amber); transition: background .12s ease; }
.todo.red { border-left-color: var(--red); }
.todo:hover { background: var(--hover); }
.todo .ico { width: 40px; height: 40px; border-radius: 12px; }
.todo-text { flex: 1; font-size: 16px; line-height: 1.35; }
.todo-go { font-weight: 700; color: var(--brand); white-space: nowrap; }
.all-clear { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 16px; background: var(--green-soft); font-size: 16px; }
.dash-side { display: flex; flex-direction: column; gap: 18px; }
.money-big { font-family: var(--f-display); font-size: 40px; font-weight: 800; line-height: 1.1; color: var(--ink); }
.money-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.money-row b { display: block; font-size: 20px; font-family: var(--f-display); }
.money-row span { display: block; }
.today-who { padding: 8px 0; border-top: 1px solid var(--line); }
.today-who:first-of-type { border-top: 0; padding-top: 0; }
.today-who a { display: block; padding: 4px 0; text-decoration: none; color: var(--ink); }
.today-who a:hover { color: var(--brand); }

/* Design 2: Board */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius); background: var(--card); box-shadow: 0 0 0 1px var(--tab-stroke, var(--line)), var(--shadow); text-decoration: none; color: var(--ink); }
.kpi-n { font-family: var(--f-display); font-size: 28px; font-weight: 800; line-height: 1.1; }
.kpi.red .kpi-n { color: var(--red); }
.kpi-l { color: var(--muted); font-size: 14px; }
.ico.blue { background: var(--brand-soft); color: var(--brand); }
.reminders { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--amber-soft); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.chip-link svg { width: 15px; height: 15px; color: var(--amber); }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.col { background: var(--sunk); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; border-top: 4px solid var(--brand); min-width: 0; }
.col.c-new { border-top-color: var(--red); }
.col.c-booked { border-top-color: var(--brand); }
.col.c-working { border-top-color: var(--amber); }
.col.c-done { border-top-color: var(--green); }
.col-head { display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.col-hint { margin-top: -6px; }
.col-empty { color: var(--muted); font-size: 14px; padding: 10px 0; text-align: center; }
.mini { display: block; background: var(--card); border-radius: 12px; padding: 10px 12px; text-decoration: none; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.mini:hover { outline: 2px solid var(--brand-soft); }
.mini-what { font-weight: 600; margin: 4px 0 2px; overflow-wrap: anywhere; }
.day { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.day:first-of-type { border-top: 0; }
.day-name { font-weight: 700; color: var(--muted); }
.day-job { display: block; padding: 2px 0; text-decoration: none; color: var(--ink); }
.day-job:hover { color: var(--brand); }

@media (max-width: 860px) {
  .dash-today { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { grid-template-columns: minmax(0, 1fr); }
  .todo-go { display: none; }
  .day { grid-template-columns: 90px minmax(0, 1fr); }
}

/* Sign-in logo: the light version on the light screen, the dark version on the dark blue screen. */
.authlogo .logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .authlogo { background: transparent; padding: 0; }
  :root:not([data-theme="light"]) .authlogo .logo-light { display: none; }
  :root:not([data-theme="light"]) .authlogo .logo-dark { display: block; border-radius: 16px; }
}
:root[data-theme="dark"] .authlogo { background: transparent; padding: 0; }
:root[data-theme="dark"] .authlogo .logo-light { display: none; }
:root[data-theme="dark"] .authlogo .logo-dark { display: block; border-radius: 16px; }

/* Price cards (plans.js): sign-in page and Admin */
.plan-toggle { display: inline-flex; gap: 6px; margin: 4px 0 14px; }
.plan-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plan-card { border: 1px solid var(--line); border-radius: 18px; padding: 18px; background: var(--card); }
.plan-card.best { border: 2px solid var(--brand); }
.plan-card.current { box-shadow: 0 0 0 3px var(--green-soft); }
.plan-name { font-family: var(--f-display); font-size: 20px; font-weight: 800; }
.plan-price { font-family: var(--f-display); font-size: 40px; font-weight: 800; line-height: 1.1; margin-top: 10px; }
.plan-price span { font-size: 16px; font-weight: 600; color: var(--muted); }
.plan-users { font-weight: 700; margin: 12px 0 6px; }
.plan-card ul { list-style: none; padding: 0; margin: 0; }
.plan-card li { padding: 4px 0 4px 22px; position: relative; }
.plan-card li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.authbox.wide { max-width: 1040px; }
.plan-card { display: flex; flex-direction: column; }
.plan-card ul { flex: 1; }
.plan-pick { width: 100%; margin-top: 14px; }
@media (max-width: 860px) { .plan-cards { grid-template-columns: minmax(0, 1fr); } }
