/* TimeSheet Pro web — the "instrument panel" brand (2026-10-12 brand sheet,
   mirror of TimeSheet/Helpers/Brand.swift): dark-first navy grounds, one
   live signal colour (orange), amber reserved for overtime, green for "in
   the ERP", red for alerts. Figures are heavy with tabular digits. */
:root {
  /* Grounds */
  --night: #06111F;   /* page */
  --ink: #0B1F3A;     /* card */
  --panel: #15305A;   /* raised / gradient top */
  --line: #1C3354;    /* hairlines, dial ticks */
  --track: #132A4C;   /* dial track */
  /* Signals */
  --signal: #F97316;
  --overtime: #FFC53D;
  --good: #35C27B;
  --alert: #FF5A4E;
  --alert-soft: #FF8A80;
  /* Text */
  --text: #FFFFFF;
  --muted: #9FB0C6;
  --faint: #5B6B82;
  /* Tinted chip grounds */
  --good-ground: #0F2A1E;
  --overtime-ground: #3A2B10;
  --alert-ground: #3E1A17;
  --radius: 18px;
  /* Legacy names still used by the Pay, Stats, Jobs and settings pages */
  --navy: var(--night); --navy-2: var(--ink); --orange: var(--signal); --orange-2: var(--overtime);
  --card: var(--ink);
}
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
body {
  font: 15px/1.5 -apple-system, "Segoe UI", system-ui, sans-serif;
  background: var(--night);
  min-height: 100vh; color: var(--text);
}
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
h1 { font-size: 20px; font-weight: 700; }
h1 { white-space: nowrap; }
h1 span { color: var(--signal); font-weight: 800; letter-spacing: 2px; }
/* Plain links (payslip months, report rows): brand signal, never browser blue */
a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }
@media (max-width: 520px) { h1 span.muted { display: none; } }
main { max-width: 760px; margin: 20px auto; padding: 0 16px; display: grid; gap: 16px; }
.card { background: var(--ink); border-radius: var(--radius); padding: 16px; border: 1px solid var(--line); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 16px; font-weight: 700; }
.card-head > h2 { font-size: 22px; }
.summary { color: var(--muted); font-variant-numeric: tabular-nums; }
.entry {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.entry-date { font-weight: 600; }
.entry-job { color: var(--muted); font-size: 13px; }
.entry-notes { color: var(--muted); font-size: 12px; margin-top: 2px; }
.entry-times { text-align: right; font-variant-numeric: tabular-nums; }
.entry-hours { color: var(--overtime); font-weight: 600; }
.status {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); padding: 10px 18px; z-index: 50; max-width: 90vw;
  box-shadow: 0 6px 24px rgba(0,0,0,.45);
}
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* Brand pieces (mirror of BrandLabel / BrandChip / figure) */
.blabel { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.blabel.faint { color: var(--faint); }
.blabel.alert { color: var(--alert-soft); }
.figure { font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid transparent; vertical-align: middle;
}
.chip i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; display: inline-block; }
.chip.ot { background: var(--overtime-ground); color: var(--overtime); }
.chip.ot-unclaimed { background: var(--overtime); color: var(--night); }
.chip.ot-changed, .chip.erp-changed { background: var(--overtime-ground); color: var(--overtime); border-color: var(--overtime); }
.chip.erp-in { background: var(--good-ground); color: var(--good); }
.chip.erp-out { background: var(--alert-ground); color: var(--alert-soft); }
.chip.due { background: var(--overtime); color: var(--night); }

button.primary {
  background: var(--signal); color: var(--night); border: 0; border-radius: 10px;
  padding: 8px 14px; font-weight: 700; cursor: pointer;
}
button.primary:hover { filter: brightness(1.08); }
/* The orange primary action — Clock In / Clock Out (BrandPrimaryButtonStyle) */
button.big {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 58px;
  background: var(--signal); color: var(--night); border: 0; border-radius: 18px;
  font-size: 19px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 14px rgba(249,115,22,.3);
  font-variant-numeric: tabular-nums;
}
button.big:hover { filter: brightness(1.06); }
button.big:active { transform: scale(.98); opacity: .85; }
/* Square icon buttons in a page header (BrandIconButtonStyle) */
button.icon {
  width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--text); border: 1px solid var(--line); border-radius: 14px;
  font-size: 20px; font-weight: 600; cursor: pointer; line-height: 1;
}
button.icon.prominent { background: var(--signal); color: var(--night); border-color: transparent; }
button.icon:hover { filter: brightness(1.15); }

select, input, textarea {
  background: var(--night); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; font: inherit; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(249,115,22,.5); outline-offset: 0; }
.entry.clickable { cursor: pointer; }
.entry.clickable:hover { background: rgba(255,255,255,.04); }

/* Dialog */
dialog {
  background: var(--ink); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; width: min(440px, 92vw); box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
dialog::backdrop { background: rgba(3, 9, 18, .78); }
dialog h2 { margin-bottom: 14px; }
dialog label { display: block; margin: 10px 0; font-size: 13px; color: var(--muted); }
dialog label input, dialog label select, dialog label textarea { margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.country-hint { display: block; margin-top: 6px; font-size: 12px; line-height: 1.7; }
.country-hint .hint-btn { font-size: 12px; padding: 1px 9px; margin-left: 4px; border-radius: 8px; }
.checks { display: flex; flex-direction: column; gap: 6px; justify-content: end; }
.checks input { width: auto; }
.dialog-buttons { display: flex; gap: 10px; margin-top: 16px; align-items: center; }
.spacer { flex: 1; }
button { font: inherit; cursor: pointer; }
button:not(.primary):not(.danger):not(.big):not(.icon) {
  background: transparent; color: var(--muted); border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 14px;
}
button:not(.primary):not(.danger):not(.big):not(.icon):hover { color: var(--text); border-color: var(--faint); }
button.danger { background: var(--alert-ground); color: var(--alert-soft); border: 1px solid rgba(255,90,78,.4); border-radius: 10px; padding: 7px 14px; }

/* ---- Jobs (instrument panel, 2026-10-13) ----------------------------------- */
#jobs-card { display: grid; gap: 12px; }
#jobs { display: grid; gap: 8px; }
.jcard {
  display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--radius);
  background: var(--ink); border: 1px solid var(--line); color: var(--text); text-decoration: none;
}
.jcard:hover { border-color: var(--faint); }
.jcard.pinned { border-color: rgba(249,115,22,.45); }
.jcard-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.jcard-top { display: flex; gap: 6px; flex-wrap: wrap; }
.jcard-top:empty { display: none; }
.jcard-name { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jcard-proj { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.jcard-meta { font-size: 12px; color: var(--faint); margin-top: 2px; }
.jcard-right { display: flex; align-items: center; gap: 10px; flex: none; }
.jcard-right .figure { font-size: 22px; }
.jcard-right .figure small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.jcard-right .chev { color: var(--faint); font-size: 20px; font-weight: 700; }
.chip.pin { background: var(--track); color: var(--muted); }
/* legacy job rows (kept for any list still using them) */
.job-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.job-row .job-name { font-weight: 600; }
.job-row .job-meta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.job-name.link { cursor: pointer; }
.head-left { display: flex; align-items: center; gap: 12px; }

/* Top nav: the five places */
#topnav {
  display: flex; gap: 4px; padding: 10px 16px 0;
  max-width: 760px; margin: 0 auto;
}
#topnav a {
  color: var(--muted); text-decoration: none; padding: 7px 16px;
  border-radius: 10px; font-weight: 600; font-size: 14px; border: 1px solid transparent;
}
#topnav a.active { background: var(--ink); color: var(--signal); border-color: var(--line); }
#topnav a:hover { color: var(--text); }
#topnav[hidden] { display: none; }

/* Settings / pay forms */
.form-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 8px 0; border-top: 1px solid var(--line);
}
.form-row label { color: var(--muted); font-size: 14px; }
.form-row input { width: 110px; text-align: right; }
.subhead { margin: 18px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stat-line { display: flex; justify-content: space-between; padding: 7px 0;
  border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.stat-line span:first-child { color: var(--muted); }
/* EU (Schengen) page */
.eu-cal-bar { display: flex; justify-content: space-between; align-items: center; margin: 6px 0; }
.eu-cal-bar button { background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 2px 12px; font-size: 18px; cursor: pointer; }
.eu-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.eu-head { text-align: center; font-size: 11px; color: var(--muted); padding: 2px 0; }
.eu-day { text-align: center; padding: 7px 0; border-radius: 6px; background: var(--track); font-size: 12px; font-variant-numeric: tabular-nums; }
.eu-day.out { opacity: .35; }
.eu-day.in { background: rgba(249,115,22,.45); color: var(--text); font-weight: 600; }
.eu-day.today { box-shadow: inset 0 0 0 1.5px var(--signal); }
.eu-tag { font-size: 11px; padding: 1px 6px; border-radius: 10px; margin-right: 6px; }
.eu-tag.d { background: rgba(47,127,224,.3); }
.eu-tag.m { background: rgba(224,100,0,.3); }
.eu-trip { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; margin-top: 8px; border-radius: 14px; background: var(--night); border: 1px solid var(--line); }
.eu-trip-main { min-width: 0; display: grid; gap: 4px; }
.eu-trip-dates { font-weight: 600; font-variant-numeric: tabular-nums; }
.eu-trip-sub { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.eu-trip-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.eu-trip-right .figure { font-size: 22px; }
.eu-trip-right .figure small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 1px; letter-spacing: 0; }
.eu-cal-bar b { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.eu-del { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: 12px; cursor: pointer; margin-top: 4px; }
#eu-card input[type="date"] { width: 160px; }

/* Stats charts */
.chart { margin: 4px 0 6px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font: 11px -apple-system, "Segoe UI", system-ui, sans-serif; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart text.ink { fill: var(--text); font-weight: 600; }
.chart text.label { font-size: 12px; }
.chart g.col:hover .seg { opacity: .78; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin: 2px 0 4px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
#chart-tip {
  position: fixed; z-index: 60; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; font-size: 12px; color: var(--muted); pointer-events: none;
  box-shadow: 0 6px 24px rgba(0,0,0,.45); max-width: 240px;
}
#chart-tip b { display: block; font-size: 14px; color: var(--text); }
/* Segmented controls (year, filter, pay tabs) */
.seg { display: flex; gap: 4px; margin-bottom: 12px; background: var(--night); border: 1px solid var(--line); border-radius: 12px; padding: 3px; width: fit-content; max-width: 100%; flex-wrap: wrap; }
.seg button:not(.primary):not(.danger):not(.big):not(.icon) { border: 0; padding: 6px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
@media (max-width: 520px) { .seg.wide button:not(.primary) { padding: 6px 6px; font-size: 12px; } }
.seg button.on, .seg button:not(.primary).on { background: var(--panel); color: var(--text); }
.seg.wide { width: 100%; }
.seg.wide button { flex: 1; }
.pay-seg { margin-bottom: 14px; }
/* ---- Pay · Stats · Mileage (instrument panel, 2026-10-13) ------------------ */
.pay-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.pay-rate { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pay-rate .figure { font-size: 26px; }
.pay-rate .figure small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.pay-rate a { color: var(--signal); text-decoration: none; }
.pay-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 14px; margin: 4px 0 8px; border-radius: 14px; background: var(--night); border: 1px solid var(--line); }
.pay-total .figure { font-size: 28px; }
.stat-line .amber { color: var(--overtime); }
.rise-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.rise-row .rise-from { flex: 1; min-width: 150px; }
.rise-row .rise-from input { width: 150px; }
.rise-row .rise-rate { display: flex; align-items: center; gap: 4px; color: var(--muted); white-space: nowrap; }
.rise-row .rise-rate input { width: 90px; text-align: right; }
.rise-row .rise-btns { display: flex; gap: 6px; }
.rise-row button { padding: 5px 10px; font-size: 13px; }
.rise-add { flex-wrap: wrap; }
.rise-add label { display: flex; align-items: center; gap: 6px; }
.rise-add input[type="date"] { width: 150px; }
.summary a { color: var(--signal); text-decoration: none; }
.summary a:hover { text-decoration: underline; }

/* Settings menu rows (the sub-pages' "‹ More" link and legacy lists) */
.menu-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 4px; border-top: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-weight: 600;
}
.menu-row:hover { color: var(--signal); }
.menu-row .chev { color: var(--faint); }
.menu-row.danger-row { color: var(--alert-soft); }
#settings-card > .menu-row:first-child, #eu-card > .menu-row:first-child { padding: 0 0 10px; color: var(--signal); font-size: 14px; }
#settings-card > .menu-row:first-child:hover, #eu-card > .menu-row:first-child:hover { color: var(--text); }

/* ---- More (instrument panel, 2026-10-13) ----------------------------------- */
#more-card { background: transparent; border: 0; padding: 0; display: grid; gap: 12px; }
#more-card .page-title { padding: 4px 4px 0; }
#more-card .blabel { padding: 6px 4px 0; }
.brand-strip {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--panel), var(--ink));
}
.brand-strip .bmark { flex: none; }
.brand-text { flex: 1; min-width: 0; display: grid; gap: 4px; }
.wordmark { font-size: 17px; font-weight: 700; }
.wordmark span { font-size: 13px; color: var(--signal); letter-spacing: 2px; }
.sync { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: none; }
.sync i.bad { background: var(--alert); }
.sync i.none { background: var(--faint); }
.brand-strip .ver { font-size: 12px; font-weight: 600; letter-spacing: 1px; color: var(--muted); flex: none; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 2px; min-height: 120px; padding: 16px; border-radius: var(--radius);
  background: var(--ink); border: 1px solid var(--line); color: var(--text); text-decoration: none;
}
.tile:hover { border-color: var(--faint); }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: auto; padding-bottom: 12px; }
.tile-icon { display: inline-flex; color: var(--signal); }
.tile-icon svg { width: 24px; height: 24px; }
.tile.amber .tile-icon { color: var(--overtime); }
.tile b { font-size: 17px; font-weight: 700; }
.tile span:not(.chip):not(.tile-icon) { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.rows { padding: 0; display: grid; }
.srow {
  display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 8px 16px; color: var(--text); text-decoration: none;
  font-size: 16px; font-weight: 500; border-top: 1px solid var(--line);
}
.srow:first-child { border-top: 0; }
.srow > span:first-child { flex: 1; min-width: 0; }
.srow .val { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.srow .chev { color: var(--faint); font-size: 18px; font-weight: 700; line-height: 1; }
a.srow:hover { background: rgba(255,255,255,.03); }
.toggle-row { cursor: pointer; }
.toggle-row span:first-child { display: grid; gap: 2px; }
.toggle-row small { font-size: 12px; color: var(--muted); font-weight: 400; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 15px; background: var(--track); border: 1px solid var(--line); transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + i { background: var(--signal); border-color: transparent; }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid rgba(249,115,22,.5); }
#more-card .hint { font-size: 12px; color: var(--faint); padding: 0 4px; }
.danger-card { display: flex; justify-content: space-between; align-items: center; color: var(--alert-soft); font-weight: 600; font-size: 16px; text-decoration: none; }
.danger-card .tile-icon { color: var(--alert-soft); }
.danger-card:hover { border-color: var(--alert); }

/* ---- Entries (instrument panel, 2026-10-13) -------------------------------- */
#entries-card { display: grid; gap: 12px; }
#entries-card[hidden] { display: none; }
.page-title { font-size: 34px; font-weight: 700; line-height: 1.1; }
.entries-head { display: flex; align-items: flex-end; gap: 12px; padding: 4px 4px 0; }
.entries-head .head-left { flex: 1; min-width: 0; }
.entries-head .head-left h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#back-home { white-space: nowrap; flex: none; }
#back-home:not([hidden]) + h2 { font-size: 24px; }
.entries-total { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.entries-total .figure { font-size: 28px; }
.entries-total .figure small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.entries-controls { display: grid; gap: 8px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; height: 44px; }
.search .glass { color: var(--faint); font-size: 18px; transform: rotate(-45deg); line-height: 1; }
.search input { background: transparent; border: 0; padding: 0; height: 100%; border-radius: 0; }
.search input:focus { outline: none; }
.search input::-webkit-search-cancel-button { filter: invert(.7); }
#entries-nudge:empty { display: none; }
.nudge { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; width: 100%; border-radius: 14px; font-size: 14px; font-weight: 500; text-align: left;
  background: var(--overtime-ground) !important; border: 1px solid rgba(255,197,61,.5) !important; color: var(--text) !important; }
.nudge .warn { color: var(--overtime); }
.nudge .spacer { flex: 1; }
.nudge b { color: var(--overtime); }
#entries-actions:empty, #entries-actions:not(:has(button:not([hidden]))) { display: none; }
#entries { display: grid; gap: 6px; }
/* Month: a collapsible section of entry cards */
#entries details.mo > summary { display: flex; align-items: center; gap: 8px; padding: 10px 4px 6px; cursor: pointer; list-style: none; }
#entries summary::-webkit-details-marker { display: none; }
#entries details.mo > summary .chev { color: var(--faint); font-size: 11px; font-weight: 700; display: inline-block; transition: transform .15s; width: 10px; }
#entries details.mo[open] > summary .chev { transform: rotate(90deg); }
#entries details.mo > summary .mo-sum { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
#entries details.mo > summary .chip { margin-left: auto; }
#entries details.mo > summary .chip + .mo-sum { margin-left: 0; }
#entries details.mo > .ecard { margin-bottom: 8px; }
.empty { display: grid; justify-items: center; gap: 8px; padding: 28px 0; color: var(--muted); font-size: 15px; }
.empty .tray { font-size: 28px; color: var(--faint); }
/* One entry as a card: time rail · job and note · chips · hours */
.ecard { background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 8px; cursor: pointer; }
.ecard:hover { border-color: var(--faint); }
.ecard.today { border-color: var(--signal); }
.ecard-main { display: flex; gap: 14px; align-items: stretch; }
.rail-time { display: flex; flex-direction: column; gap: 1px; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 52px; flex: none; line-height: 1.25; }
.rail-time span:last-child { color: var(--muted); }
.rail-time small { display: block; font-size: 10px; font-weight: 600; color: var(--faint); letter-spacing: .06em; }
.rail { width: 2px; border-radius: 1px; background: #2A4468; flex: none; }
.rail.today { background: var(--signal); }
.rail.ot { background: var(--overtime); }
.ecard-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ecard-date { font-size: 12px; font-weight: 600; color: var(--faint); display: flex; gap: 6px; align-items: baseline; }
.ecard-date.today { color: var(--signal); }
.ecard-date .bh { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--overtime); }
.ecard-date .moon { color: var(--faint); font-size: 11px; }
.ecard-job { font-size: 16px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ecard-job.unassigned { color: var(--alert-soft); }
.ecard-note { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ecard-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.ecard-right .figure { font-size: 26px; }
.ecard-right .miles { font-size: 11px; font-weight: 600; color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:empty { display: none; }
/* The ⋯ menu: the swipe actions the phone has, as a menu here */
.emenu { position: relative; margin-top: auto; }
.emenu > summary { list-style: none; cursor: pointer; color: var(--faint); font-size: 18px; font-weight: 700; line-height: 1; padding: 2px 6px; border-radius: 8px; }
.emenu > summary::-webkit-details-marker { display: none; }
.emenu > summary:hover { color: var(--text); background: var(--track); }
.emenu-list { position: absolute; right: 0; top: 100%; z-index: 20; min-width: 190px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: grid; gap: 2px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.emenu-list button:not(.primary):not(.danger):not(.big):not(.icon) { border: 0; text-align: left; padding: 8px 10px; border-radius: 8px; color: var(--text); font-size: 14px; }
.emenu-list button:not(.primary):not(.danger):not(.big):not(.icon):hover { background: var(--ink); }
.emenu-list button.del { color: var(--alert-soft); }
.emenu-list hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* ---- Today (instrument panel, 2026-10-13) ---------------------------------- */
.today-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 4px 4px 0; }
.today-head .blabel { white-space: nowrap; }
.today-head .big { font-size: 30px; font-weight: 700; line-height: 1.1; margin-top: 4px; white-space: nowrap; }
.today-head .time { font-size: 30px; color: var(--muted); }
.today-head .head-btns { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; row-gap: 6px; }
@media (max-width: 520px) {
  .today-head .big { font-size: 26px; }
  .today-head .time { font-size: 22px; width: 100%; text-align: right; }
}
#today-layout { display: grid; gap: 18px; }
#today-layout[hidden] { display: none; }
.hero-col { display: grid; gap: 12px; }
.cards-col { display: grid; gap: 12px; align-content: start; }
@media (min-width: 760px) {
  #today-layout { grid-template-columns: 360px 1fr; gap: 24px; align-items: start; }
}
#clock-card { display: grid; gap: 12px; justify-items: center; padding: 0; background: transparent; border: 0; }
.dial { width: min(270px, 78vw); height: auto; display: block; }
.dial text { font-weight: 600; font-size: 11px; fill: var(--faint); }
.dial .fig { font-size: 64px; font-weight: 800; fill: var(--text); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dial .lbl { font-size: 12px; font-weight: 600; letter-spacing: 2px; fill: var(--muted); }
.dial .sub { font-size: 13px; font-weight: 400; fill: var(--muted); }
.dial .sub tspan.ot { fill: var(--overtime); font-weight: 600; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 17px;
  font-size: 13px; font-weight: 600; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--ink); border: 1px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums;
}
.pill > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(159,176,198,.25); flex: none; }
.pill.live { background: var(--good-ground); border-color: transparent; color: var(--good); }
.pill.live i { box-shadow: 0 0 0 4px rgba(53,194,123,.25); }
.actions { display: grid; gap: 10px; width: 100%; }
.clock-in-row { display: flex; gap: 10px; align-items: center; }
.clock-in-row select { flex: 1; height: 58px; border-radius: 18px; padding: 0 14px; font-weight: 600; min-width: 0; }
.clock-in-row button.big { width: auto; padding: 0 22px; flex: none; }
button.typical {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px;
  background: transparent; color: var(--text); border: 1.5px solid var(--line); border-radius: 14px;
  font-size: 16px; font-weight: 600; cursor: pointer;
}
button.typical:hover { border-color: var(--faint); }
button.typical > * { white-space: nowrap; }
button.typical .dot { color: var(--faint); }
button.typical .pat { color: var(--muted); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* The week strip: total, seven stacked normal/overtime bars, day labels */
#week-card { display: grid; gap: 10px; cursor: pointer; }
#week-card[hidden] { display: none; }
#week-card:hover { border-color: var(--faint); }
.week-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.week-head .figure { font-size: 24px; }
.week-head .figure small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 64px; align-items: end; }
.week-bars > div { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; }
.week-bars b { display: block; border-radius: 3px; }
.week-bars b.n { background: var(--signal); }
.week-bars b.o { background: var(--overtime); }
.week-bars b.z { background: var(--line); height: 6px; }
.week-names { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; text-align: center; font-size: 11px; font-weight: 600; letter-spacing: 1px; color: var(--faint); }
.week-names span.today { color: var(--signal); }
.week-foot { font-size: 12px; color: var(--muted); }

/* Today cards: tiles */
#today-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
#today-cards[hidden] { display: none; }
.tcard {
  background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none; cursor: pointer; min-height: 116px;
}
.tcard:hover { border-color: var(--faint); }
.tcard .k { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 600; }
.tcard .v { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tcard .v small { display: block; width: 100%; font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; line-height: 1.3; }
.tcard .v .adot { width: 8px; height: 8px; border-radius: 50%; background: var(--alert); flex: none; }
.tcard .s { font-size: 12px; color: var(--muted); line-height: 1.4; }
.tcard .s.warn { color: var(--alert-soft); }
.tcard .s.amber { color: var(--overtime); }
.tcard .bar { height: 4px; border-radius: 2px; background: var(--track); overflow: hidden; margin-top: 4px; }
.tcard .bar i { display: block; height: 100%; background: var(--signal); }
.tcard .bar i.over { background: var(--overtime); }
#cards-dialog .card-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
#cards-dialog .card-row span { flex: 1; }
#cards-dialog .card-row button { padding: 2px 9px; font-size: 13px; }
#cards-dialog .card-row input { width: auto; }

/* Overtime claims page: one card per period */
.ot-card { margin-top: 10px; padding: 14px 16px; border-radius: 14px; background: var(--night); border: 1px solid var(--line); display: grid; gap: 10px; }
.ot-card.due { border-color: rgba(255,197,61,.45); }
.ot-card.overdue { border-color: var(--overtime); }
.ot-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ot-head .figure { font-size: 22px; white-space: nowrap; }
.ot-head .figure small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.ot-due { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ot-due.due, .ot-due.overdue { color: var(--overtime); font-weight: 600; }
.ot-due.done { color: var(--good); }
.ot-steps { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; align-items: center; }
.ot-steps label { display: flex; align-items: center; gap: 6px; color: var(--text); }
.ot-steps input { width: auto; accent-color: var(--signal); }
.ot-steps .warn { color: var(--overtime); }
.ot-steps .ok { color: var(--good); }
input[type="checkbox"] { accent-color: var(--signal); }

/* Overtime claimed badge (legacy, still used by the job list) */
.ot { display: inline-block; border-radius: 6px; font-size: 10px; line-height: 16px; padding: 0 5px; margin-left: 4px; font-weight: 800;
  color: var(--overtime); border: 1px solid rgba(255,197,61,.5); vertical-align: 1px; }

/* Entered in Visual (ERP) badges */
.erp { display: inline-block; min-width: 16px; text-align: center; border-radius: 8px; font-size: 11px; line-height: 16px; margin-left: 4px; font-weight: 700; }
.erp-ok { background: var(--good-ground); color: var(--good); }
.erp-warn { background: var(--overtime-ground); color: var(--overtime); }
.erp-late { color: var(--alert-soft); }
.erp-late-count { color: var(--alert-soft); }

/* Trips */
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 22px 16px; text-align: center; color: var(--muted); font-size: 13px; margin-top: 6px; }
.drop b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.drop.over { border-color: var(--signal); color: var(--text); }
.trip-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; margin-top: 8px; border-radius: 14px; background: var(--night); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.trip-row:hover { border-color: var(--faint); }
.trip-row b { font-size: 16px; }
.trip-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.trip-main .muted, .trip-main small { font-size: 13px; }
.trip-flags { flex: none; font-size: 16px; }
.leg-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 14px; margin-top: 6px; border-radius: 12px; background: var(--night); border: 1px solid var(--line); font-size: 14px; }
.leg-row .trip-x { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 0 8px; font-size: 16px; line-height: 1.4; }
#trip-dialog .checks { margin: 4px 0; }
#trip-dialog .checks input { width: auto; margin-right: 6px; }

/* ---- Entry editor (instrument panel, 2026-10-13) --------------------------- */
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
#job-dialog .btn-row { margin-top: 16px; }
dialog { margin: auto; }
#entry-dialog { width: min(480px, 94vw); }
#entry-dialog h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 22px; margin-bottom: 10px; }
.dlg-hours { font-size: 24px; }
.dlg-hours small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
#entry-dialog label { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 10px 0; }
#entry-dialog label.checks, #entry-dialog label.checks span { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; color: var(--text); }
#entry-dialog label.checks small { font-weight: 400; }
#entry-dialog input, #entry-dialog select, #entry-dialog textarea { font-size: 15px; text-transform: none; letter-spacing: 0; font-weight: 500; }
#entry-dialog input[type="time"] { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
#entry-dialog .country-hint { text-transform: none; letter-spacing: 0; }
#entry-dialog .dialog-buttons { border-top: 1px solid var(--line); padding-top: 14px; }
#entry-dialog button.primary { padding: 9px 18px; }
