/* TidIdag – månadskalender som startvy. Mobil: flikar i botten. Dator (≥ 900px): flikar i toppen,
   kalendern till vänster och summeringar i en sidopanel.
   Färger ligger som variabler på :root. Mörkt läge definieras två gånger
   (systeminställning + data-theme="dark"); ändra båda blocken tillsammans. */

/* Typsnittet Inter ligger i appen (vendor/), så att inga besökares IP-adresser skickas till Google Fonts. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../vendor/inter-latin-wght.woff2') format('woff2'); }

:root {
  --bg: #f9fafc;
  --surface: #ffffff;
  --surface-2: #f2f4f8;
  --text: #0b1220;
  --muted: #4a5466;
  --border: #bcc5d2;
  --brand: #2350d8;
  --brand-ink: #ffffff;
  --brand-soft: #edf2fe;
  --enkel: #0a7d97;
  --enkel-soft: #def2f7;
  --kval: #7045d6;
  --kval-soft: #eee8fb;
  --trip: #a2560c;
  --trip-soft: #fbefe0;
  --warn: #d4700a;
  --warn-soft: #fdebd3;
  --ok: #15803d;
  --ok-soft: #dcf3e4;
  --red: #c0271d;
  --stop: #c2281f;
  --stop-ink: #ffffff;
  --stop-soft: #fbe6e4;
  --focus: #2563eb;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .04);
  --radius: 20px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1116; --surface: #161b22; --surface-2: #1d232c; --text: #e9edf3; --muted: #9aa5b5;
    --border: #424c5a; --brand: #8aaeff; --brand-ink: #0a1630; --brand-soft: #1b2744;
    --enkel: #5cc8e6; --enkel-soft: #12303a; --kval: #b9a0f5; --kval-soft: #2a2242; --trip: #f0b06a; --trip-soft: #3a2a16; --warn: #f5a04a; --warn-soft: #3d2a12; --ok: #4ade80; --ok-soft: #12301d; --red: #f28b82;
    --stop: #f0625a; --stop-ink: #1c0302; --stop-soft: #3a1715;
    --focus: #7aa7ff; --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1116; --surface: #161b22; --surface-2: #1d232c; --text: #e9edf3; --muted: #9aa5b5;
  --border: #424c5a; --brand: #8aaeff; --brand-ink: #0a1630; --brand-soft: #1b2744;
  --enkel: #5cc8e6; --enkel-soft: #12303a; --kval: #b9a0f5; --kval-soft: #2a2242; --trip: #f0b06a; --trip-soft: #3a2a16; --warn: #f5a04a; --warn-soft: #3d2a12; --ok: #4ade80; --ok-soft: #12301d; --red: #f28b82;
  --stop: #f0625a; --stop-ink: #1c0302; --stop-soft: #3a1715;
  --focus: #7aa7ff; --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
/* Element med hidden ska alltid döljas, även om en klass ger dem display (t.ex. grid eller flex). */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100dvh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
h1, h2, h3, p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: calc(60px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { text-decoration: none; border-radius: 10px; }
.brand:hover { opacity: .85; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--brand); letter-spacing: -.01em; font-size: 1.05rem; }
.brand svg { width: 26px; height: 26px; }
.bell {
  position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  color: var(--text); text-decoration: none;
}
.bell:hover, .bell[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.bell svg { width: 24px; height: 24px; }
.bell .dot {
  position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--stop); box-shadow: 0 0 0 2px var(--surface);
}
.bell .dot[hidden] { display: none; }
.bell[hidden] { display: none; }

/* ---------- Layout ---------- */
.view { max-width: 560px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: grid; gap: 16px; align-content: start;
  min-width: 0;
}
.card h2 { font-size: 1.1rem; letter-spacing: -.01em; }
.title { font-size: 1.5rem; letter-spacing: -.02em; }
.eyebrow { color: var(--muted); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stack { display: grid; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* ---------- Veckovy ----------
   Minimalistisk tabell: tunna rader i en gemensam ram, samma stil som lönekontorets chaufförslista. */
.week-layout { display: grid; gap: 14px; min-width: 0; }

.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 0; }
.week-nav .icon-btn { width: 44px; height: 44px; font-size: 1.5rem; }
.week-nav-title { display: grid; text-align: center; min-width: 0; }
.week-nav-title h1 { font-size: 1.3rem; letter-spacing: -.02em; line-height: 1.2; }
.week-nav-title span { color: var(--muted); font-size: .85rem; }
.btn-pill {
  min-height: 36px; padding: 0 14px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: .85rem;
}
.week-today { justify-self: center; margin-top: 4px; min-height: 28px; font-size: .78rem; color: var(--brand); }

/* Rubrik, dagrader, totalrad och månadsrader delar samma kolumner så att siffrorna linjerar. */
.week-layout { --col: 60px; --chev: 14px; }
.days { display: grid; gap: 10px; }
.dtable { display: grid; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.days-head, .day-row, .days-total, .month-row {
  display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, var(--col)) var(--chev);
  align-items: center; column-gap: 6px; padding: 0 10px 0 12px;
}
.days-head {
  min-height: 32px; background: var(--surface-2);
  font-size: .66rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; line-height: 1.2;
}
.day-row {
  position: relative; min-height: 48px; padding-top: 6px; padding-bottom: 6px;
  border-top: 1px solid var(--border); background: var(--surface);
}
.day-row:has(.dr-open:hover) { background: var(--surface-2); }
/* Veckodagens knapp täcker hela raden, så att man kan trycka var som helst på den. */
.dr-open { padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.dr-open::after { content: ""; position: absolute; inset: 0; }
.dr-open:focus-visible { outline: none; }
.dr-open:focus-visible::after { outline: 3px solid var(--focus); outline-offset: -3px; }
.day-row.is-today { background: var(--brand-soft); }
.day-row.is-today::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.day-row.is-future > span { opacity: .5; }

/* Veckodagen är det man letar efter; datumet står mindre bredvid. */
.dr-main { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; }
.dr-day { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; }
.dr-day strong { font-size: .98rem; font-weight: 700; }
.dr-day small { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.dr-day .tag { align-self: center; }
.day-row.is-red .dr-day strong { color: var(--red); }
.day-row.is-today .dr-day strong { color: var(--brand); }
/* Tider och fordon syns på bredare skärmar; på mobilen när man öppnar dagen. */
.dr-sub { display: none; color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Arbetstiderna syns alltid i veckan (även på mobil); fordonen bara på bredare skärmar. */
.dr-times-line { display: block; }
.dr-times { color: var(--text); font-weight: 600; font-size: .86rem; }
.dr-veh { display: none; }
@media (min-width: 640px) { .dr-veh { display: inline; } }
.dr-bottom { display: block; line-height: 1; margin-top: 3px; }
.dr-bottom .tag { margin: 0; font-size: .66rem; }
.dr-bottom .tag + .tag { margin-left: 4px; }
.tag-trip { display: inline-flex; align-items: center; gap: 3px; background: var(--trip-soft); color: var(--trip); }
.tag-trip svg { width: 11px; height: 11px; }
/* Resa och Färdskrivare överst när dagen öppnas */
.day-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.day-actions.is-single { grid-template-columns: 1fr; }
.day-act { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.day-act:hover { border-color: var(--brand); }
.day-act svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.day-act span { display: grid; min-width: 0; }
.day-act strong { font-size: .92rem; }
.day-act small { color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-act.has-trip { border-color: var(--trip); background: var(--trip-soft); }
.day-act.has-trip svg, .day-act.has-trip small { color: var(--trip); }
.day-act.is-warn { border-color: var(--warn); background: var(--warn-soft); }
.day-act.is-warn svg, .day-act.is-warn small { color: var(--warn); }
.dr-cta { color: var(--brand); font-weight: 600; }

/* Resa-knappen ligger ovanpå radens klickyta. */
.trip-btn {
  position: relative; z-index: 1; max-width: 100%;
  display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 99px; background: var(--surface); cursor: pointer;
  color: var(--muted); font-size: .7rem; font-weight: 600;
}
.trip-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-btn svg { width: 13px; height: 13px; flex: none; }
.trip-btn:hover { border-color: var(--trip); color: var(--trip); }
.trip-btn.has-trip { border-color: transparent; background: var(--trip-soft); color: var(--trip); }

/* Streck som skiljer arbetad tid, enkel OB och kval. OB från varandra. */
.dr-val, .days-head span:not(:first-child) { align-self: stretch; display: flex; align-items: center; justify-content: center; text-align: center; }
.dr-val.work, .dr-val.enkel, .dr-val.kval, .days-head span:nth-child(2), .days-head span:nth-child(3), .days-head span:nth-child(4) { border-left: 1px solid var(--border); }
.dr-val { font-weight: 650; font-size: 1rem; font-variant-numeric: tabular-nums; letter-spacing: -.005em; }
.dr-val.enkel { color: var(--enkel); }
.dr-val.kval { color: var(--kval); }
.dr-val.is-zero { color: var(--muted); font-weight: 400; }
.day-row .dr-val.has-leave { color: var(--kval); font-weight: 600; }
.day-row:not(.has-data) .dr-val { color: var(--muted); font-weight: 500; }
.day-row .chev { display: grid; place-items: center; color: var(--muted); font-size: 1.1rem; }
.day-row .chev svg { width: 15px; height: 15px; color: var(--brand); }

.days-total { min-height: 44px; border-top: 1px solid var(--border); background: var(--surface-2); }
.days-total .dr-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
.days-total strong { font-size: .95rem; }
.days-total small { color: var(--muted); font-size: .74rem; }
.days-total .dr-val { font-weight: 700; }
.days-total .dr-val.work { color: var(--brand); }

.tag {
  font-size: .64rem; font-weight: 600; padding: 1px 7px; border-radius: 99px; letter-spacing: 0;
  background: var(--surface-2); color: var(--muted);
}
.tag-today { background: var(--brand); color: var(--brand-ink); }
.tag-red { color: var(--red); }

/* Månadssammanställning under veckan, avskild med rubrik. */
.month-sum { display: grid; gap: 8px; margin-top: 8px; }
.month-sum-head { display: grid; gap: 2px; padding: 0 2px; }
.month-sum-head h2 { font-size: 1rem; letter-spacing: -.01em; }
.month-sum-head p { color: var(--muted); font-size: .8rem; }
.month-row { min-height: 48px; padding-top: 6px; padding-bottom: 6px; border-top: 1px solid var(--border); }
.month-row .dr-main { display: grid; gap: 0; }
.month-row strong { font-size: .95rem; }
.month-row .dr-sub { display: block; font-size: .72rem; }
.month-row .dr-val { font-weight: 700; }

@media (min-width: 640px) {
  .dr-sub { display: block; }
}
@media (max-width: 380px) {
  .week-layout { --col: 54px; --chev: 0px; }
  .days-head, .day-row, .days-total, .month-row { column-gap: 4px; padding-left: 10px; padding-right: 8px; }
  .day-row .chev { display: none; }
  .dr-val { font-size: .92rem; }

  .opts-3 { grid-template-columns: 1fr; }
}

/* ---------- Översikt ---------- */
.weeknav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.weeknav > div { display: grid; text-align: center; }
.weeknav strong { font-size: 1.15rem; }
.weeknav span { color: var(--muted); font-size: .875rem; }
.icon-btn {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-size: 1.35rem; line-height: 1;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

.weeks { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .92rem; }
.weeks th, .weeks td { padding: 10px 4px; text-align: right; border-bottom: 1px solid var(--border); }
.weeks th:first-child { text-align: left; }
.weeks thead th { font-size: .75rem; color: var(--muted); font-weight: 600; }
.weeks tbody th small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.weeks tfoot th, .weeks tfoot td { font-weight: 700; border-bottom: 0; }
.weeks td:nth-child(3) { color: var(--enkel); }
.weeks td:nth-child(4) { color: var(--kval); }

/* ---------- Summering (arket och översikten) ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .stats-4 { grid-template-columns: repeat(4, 1fr); } }
.stats > div small { font-size: .72rem; }

/* Switchar i lönekontorets inställningar. */
.switches { display: grid; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-top: 1px solid var(--border); cursor: pointer;
}
.switch-row:first-child { border-top: 0; padding-top: 0; }
.switch-row > span { display: grid; gap: 2px; min-width: 0; }
.switch-row small { color: var(--muted); font-size: .8rem; }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; margin: 0;
  width: 48px; height: 28px; border-radius: 99px; background: var(--border); cursor: pointer;
  transition: background-color .15s ease;
}
.switch::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 3px rgba(16, 24, 40, .25); transition: transform .15s ease;
}
.switch:checked { background: var(--brand); }
.switch:checked::before { transform: translateX(20px); }
.switch:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.stats > div { display: grid; gap: 2px; padding: 10px 12px; background: var(--surface-2); border-radius: 12px; min-width: 0; }
.stats span { font-size: .75rem; color: var(--muted); font-weight: 600; }
.stats strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.stats .enkel strong { color: var(--enkel); }
.stats .kval strong { color: var(--kval); }
#entry-preview:empty { display: none; }

/* ---------- Rapporter ---------- */
.entries { display: grid; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.entry {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 14px; background: var(--surface); border: 0; border-bottom: 1px solid var(--border);
  text-align: left; cursor: pointer;
}
.entry:last-child { border-bottom: 0; }
.entry:hover { background: var(--surface-2); }
.entry-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.entry-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.entry-time small { color: var(--muted); font-weight: 500; }
.entry-sub { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-dur { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .95rem; }
.chev { color: var(--muted); font-size: 1.2rem; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.pill {
  display: inline-block; font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 99px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pill-enkel { background: var(--enkel-soft); color: var(--enkel); }
.pill-kval { background: var(--kval-soft); color: var(--kval); }
.pill-trip { background: var(--trip-soft); color: var(--trip); }
.card-head { display: grid; gap: 4px; }

/* ---------- Knappar ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 50px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 14px;
  font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform .08s ease, filter .15s ease, background-color .15s ease;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:hover:not(:disabled) { filter: brightness(1.05); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-lg { min-height: 58px; font-size: 1.05rem; }
.btn-sm { min-height: 42px; font-size: .92rem; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-secondary { background: var(--surface-2); border-color: var(--border); }
.btn-ghost { background: transparent; border: 1px dashed var(--border); color: var(--muted); }
.btn-danger { background: transparent; border-color: var(--stop); color: var(--stop); }
.btn.is-armed { background: var(--stop); border-color: var(--stop); color: var(--stop-ink); }
.link {
  justify-self: center; background: none; border: 0; padding: 6px 8px; cursor: pointer;
  color: var(--muted); font-weight: 500; text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- Formulär ---------- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: .85rem; font-weight: 600; color: var(--muted); }
.field input, .field textarea, .inline-add input {
  width: 100%; min-height: 50px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  font-size: 16px; /* undviker inzoomning i iOS */
}
.field textarea { resize: vertical; min-height: 72px; }
.field .time-input { font-size: 1.15rem; font-weight: 600; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.time-input::placeholder { font-weight: 400; color: var(--muted); opacity: .7; }
.field input:focus, .field textarea:focus, .inline-add input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.help { color: var(--muted); font-size: .85rem; margin-top: -6px; }
.form-error { color: var(--stop); background: var(--stop-soft); padding: 10px 12px; border-radius: 10px; font-weight: 500; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; min-width: 0; }
legend { font-size: .85rem; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 6px; }
.break-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.break-row .icon-btn { margin-bottom: 5px; }
.inline-add { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.inline-add .btn { width: auto; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip > span, .chip.is-static {
  display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 99px; background: var(--surface-2);
  font-weight: 600; letter-spacing: .02em;
}
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chip input:checked + span::before { content: "✓"; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip.is-static { cursor: default; padding-right: 4px; }
.chip.is-static button {
  display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer; font-size: 1.2rem; color: var(--muted);
}
.chip.is-static button:hover { background: var(--border); }

/* Sammanfattning av resan överst i resformuläret. */
.trip-sum { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--trip-soft); }
.trip-sum h3 { font-size: 1rem; color: var(--trip); }
.trip-sum .stats > div { background: var(--surface); }

/* Valrutor i resformuläret. */
.opts { display: grid; gap: 8px; }
.opts-2 { grid-template-columns: 1fr 1fr; }
.opts-3 { grid-template-columns: repeat(3, 1fr); }
.opt { position: relative; display: flex; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span {
  flex: 1; display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); font-weight: 500; font-size: .92rem;
}
.opt span::before {
  content: ""; flex: none; width: 18px; height: 18px; border: 2px solid var(--border); border-radius: 50%; background: var(--surface);
}
.opt input[type="checkbox"] + span::before { border-radius: 5px; }
.opt input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--text); font-weight: 600; }
.opt input:checked + span::before { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 3px var(--surface); }
.opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.rules { margin: 0; display: grid; gap: 12px; }
.rules div { display: grid; gap: 4px; }
.rules dd { margin: 0; }

/* ---------- Saldon, övertid och ledighet ---------- */
.balances { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.bal {
  display: flex; align-items: baseline; gap: 8px; padding: 6px 12px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 99px;
}
.bal > span { font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.bal strong { font-size: .95rem; font-variant-numeric: tabular-nums; }
.bal > small { font-size: .72rem; color: var(--muted); }
.bal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bal-block { display: grid; gap: 8px; align-content: start; min-width: 0; }
.bal-block h3 { font-size: .95rem; }
.bal-total { padding-top: 6px; border-top: 1px solid var(--border); }
.bal-total dt, .bal-total dd { color: var(--text); font-weight: 700; }
@media (max-width: 480px) { .bal-grid { grid-template-columns: 1fr; } }

.tag-abs { background: var(--kval-soft); color: var(--kval); }
.tag-rest { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.tag-land { background: var(--trip-soft); color: var(--trip); }
.day-log { font-size: .9rem; color: var(--muted); }
.day-log b { color: var(--text); }
.tag-comp, .pill-comp { background: var(--brand-soft); color: var(--brand); }
/* Enhet efter siffror, t.ex. 8:30 h och 3 st. */
.unit { font-size: .72em; font-weight: 600; opacity: .7; margin-left: 1px; letter-spacing: 0; }
.sheet-tabs { grid-template-columns: 1fr 1fr; }
.sheet-tabs button { min-height: 44px; font-size: .95rem; }
.icon-btn.is-armed { width: auto; padding: 0 12px; border-radius: 99px; font-size: .85rem; font-weight: 600; background: var(--stop); color: var(--stop-ink); border-color: var(--stop); }
.review-leave { grid-column: 1 / -1; }

/* ---------- Konton: inloggning ---------- */
.auth { gap: 18px; }
.auth-head { display: grid; gap: 4px; }
.auth-head h1 { font-size: 1.6rem; letter-spacing: -.02em; text-wrap: balance; }
.demo-note { background: var(--surface-2); box-shadow: none; }
.demo-user { justify-content: flex-start; text-align: left; min-height: 56px; }
.demo-user span { display: grid; }
.demo-user small { color: var(--muted); font-weight: 500; }
body.signed-out { padding-bottom: 32px; }

/* ---------- Konton: lönekontoret ---------- */
.review-bar {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px 14px;
  padding: 12px 14px; border-radius: var(--radius); background: var(--trip-soft); border: 1px solid var(--border);
}
.review-who { display: grid; min-width: 0; }
.review-who strong { font-size: 1.1rem; }
.review-who span { color: var(--muted); font-size: .8rem; }
.review-tabs { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; background: var(--surface); }
.review-tabs a {
  display: grid; place-items: center; min-height: 38px; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: .9rem; text-decoration: none;
}
.review-tabs a[aria-current="page"] { background: var(--brand); color: var(--brand-ink); }
a.btn-pill { display: inline-flex; align-items: center; color: var(--text); text-decoration: none; }

.drivers-card { gap: 12px; }
.drivers-sum { color: var(--muted); font-size: .8rem; text-align: center; font-variant-numeric: tabular-nums; }
#driver-list { display: grid; gap: 8px; }
/* Tunna rader i bokstavsordning; traktamente visas bara på bredare skärmar. */
.dlist { display: grid; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.dl-head, .dl-row {
  display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 62px) 14px; align-items: center; column-gap: 6px;
  padding: 0 10px 0 12px;
}
.dl-head > :nth-child(5), .dl-row > :nth-child(5) { display: none; }
.dl-head { min-height: 32px; background: var(--surface-2); font-size: .66rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dl-head span:not(:first-child) { text-align: right; }
.dl-row {
  width: 100%; min-height: 42px; border: 0; border-top: 1px solid var(--border); background: var(--surface);
  text-align: left; cursor: pointer;
}
.dl-row:hover { background: var(--surface-2); }
.dl-name { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-val { text-align: right; font-size: .88rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dl-val.enkel { color: var(--enkel); }
.dl-val.kval { color: var(--kval); }
.dl-val.trip { color: var(--trip); }
.dl-row .chev { color: var(--muted); font-size: 1.1rem; text-align: right; }
@media (min-width: 640px) {
  .dl-head, .dl-row { grid-template-columns: minmax(0, 1fr) repeat(3, 84px) 110px 16px; column-gap: 10px; padding: 0 14px 0 16px; }
  .dl-head > :nth-child(5), .dl-row > :nth-child(5) { display: block; }
}
/* Fordonslistan: samma tunna rader som chaufförslistan. Favoriter och senast körd visas på bredare skärmar. */
.flist .dl-head, .flist .dl-row { grid-template-columns: 90px minmax(0, 1fr) 34px; }
.flist .dl-head > :nth-child(3), .flist .dl-head > :nth-child(4), .flist .dl-row > :nth-child(3), .flist .dl-row > :nth-child(4) { display: none; }
.flist .dl-head span { text-align: left; }
.fl-row { cursor: default; }
.fl-row:hover { background: var(--surface); }
.fl-cell { font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-del { width: 30px; height: 30px; font-size: 1.1rem; }
@media (min-width: 640px) {
  .flist .dl-head, .flist .dl-row { grid-template-columns: 100px minmax(0, 1fr) minmax(0, 1fr) 150px 34px; }
  .flist .dl-head > :nth-child(3), .flist .dl-head > :nth-child(4), .flist .dl-row > :nth-child(3), .flist .dl-row > :nth-child(4) { display: block; }
}
.export-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.export-row .btn { width: auto; }

.code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: 14px; background: var(--brand-soft);
}
.code-box > div { display: grid; }
.code { font-size: 1.6rem; letter-spacing: .08em; font-variant-numeric: tabular-nums; color: var(--brand); }
.code-box .btn { width: auto; }
.account { margin: 0; display: grid; gap: 6px; }
.account div { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; }
.account dt { color: var(--muted); }
.account dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.entry.staff { cursor: default; }
.fleet-search, .nb-search {
  width: 100%; min-height: 46px; padding: 10px 14px; font-size: 16px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
}
.fleet-search:focus, .nb-search:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.search-results:empty { display: none; }
#fav-results, #fleet-list, .search-results { display: grid; gap: 8px; }
.fav-row { cursor: pointer; }
.star { font-size: 1.4rem; line-height: 1; color: var(--muted); }
.fav-row[aria-pressed="true"] .star { color: var(--trip); }
.vchip { gap: 2px; padding-left: 4px; background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.vchip .chip-fav { font-size: 1.15rem; color: var(--trip); }
/* Fem flikar för lönekontoret: lite mindre text på smala skärmar. */
@media (max-width: 899px) { .tabbar:has(a:nth-child(5)) a { font-size: .68rem; } .tabbar:has(a:nth-child(6)) a { font-size: .6rem; letter-spacing: -.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
/* ---------- Kategorier och filter ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter select {
  min-height: 38px; padding: 6px 30px 6px 12px; font-size: .88rem; font-weight: 600; color: var(--text);
  border: 1px solid var(--border); border-radius: 99px; background: var(--surface);
}
.field select {
  width: 100%; min-height: 50px; padding: 10px 12px; font-size: 16px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cat-block { display: grid; gap: 8px; }
.cat-block h3 { font-size: .95rem; }
.switch-inline { display: flex; align-items: center; gap: 8px; flex: none; }
.review-group { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------- Stämpling ---------- */
.punch {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.punch > div:first-child { display: grid; gap: 2px; min-width: 0; }
.punch strong { font-size: 1.05rem; }
.punch span { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.punch .btn { width: auto; }
.punch-btn { min-width: 160px; }
.punch-actions { display: flex; gap: 8px; }
.punch.is-on { border-color: var(--ok); background: var(--ok-soft); }
.punch.is-on strong { color: var(--ok); }
.punch.is-break { border-color: var(--warn); background: var(--warn-soft); }
.punch.is-break strong { color: var(--warn); }
.punch.is-done { border-color: var(--brand); background: var(--brand-soft); }
@media (max-width: 480px) { .punch, .punch-actions { width: 100%; } .punch .btn { flex: 1; } }
.pill-clock { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.live-dot { display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--ok); vertical-align: middle; }
.opt-desc { display: block; font-size: .78rem; font-weight: 400; color: var(--muted); }
.opt span:has(.opt-desc) { display: flex; flex-wrap: wrap; }

/* ---------- Meddelanden ---------- */
/* Veckoval i chaufförens svar på semesterönskemål. */
.wk-group { display: grid; gap: 6px; }
.wk-month { font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.wk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.wk-pick { position: relative; display: flex; cursor: pointer; }
.wk-pick input { position: absolute; opacity: 0; pointer-events: none; }
.wk-pick span {
  flex: 1; display: grid; gap: 1px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); text-align: center;
}
.wk-pick b { font-size: .95rem; }
.wk-pick small { font-size: .7rem; color: var(--muted); }
.wk-pick input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.wk-pick input:checked + span small { color: var(--brand-ink); opacity: .85; }
.wk-pick input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Semesterplanering: veckor som kolumner, chaufförer som rader. */
.plan { gap: 14px; }
.plan-head { display: flex; align-items: flex-start; gap: 12px; }
.plan-head > div { display: grid; gap: 2px; min-width: 0; }
.plan-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: .82rem; color: var(--muted); }
.lv { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-weight: 600; }
.lv input { width: 46px; min-height: 28px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 16px; text-align: center; }
.lv-ok { background: var(--brand-soft); color: var(--brand); }
.lv-orange { background: var(--warn-soft); color: var(--warn); }
.lv-red { background: var(--stop-soft); color: var(--stop); }
.plan-hot { font-size: .9rem; font-weight: 600; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.plan-hot.is-orange { background: var(--warn-soft); color: var(--warn); }
.plan-hot.is-red { background: var(--stop-soft); color: var(--stop); }
.plan-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.plan-grid { border-collapse: collapse; width: 100%; font-size: .8rem; font-variant-numeric: tabular-nums; }
.plan-grid th, .plan-grid td { padding: 0; border-left: 1px solid var(--border); text-align: center; }
.plan-grid thead th, .plan-grid thead td { background: var(--surface-2); }
.plan-grid tr.pm th { padding: 6px 4px 2px; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-left: 2px solid var(--border); }
.plan-grid th.pw { padding: 2px 4px 6px; min-width: 40px; font-weight: 600; color: var(--muted); }
.plan-grid tr.pc td { padding: 4px 3px; border-top: 1px solid var(--border); }
.plan-grid tbody tr { border-top: 1px solid var(--border); }
.plan-grid tbody td { height: 40px; padding: 4px 3px; }
.plan-grid .pn {
  position: sticky; left: 0; z-index: 1; min-width: 150px; max-width: 220px; padding: 6px 10px;
  background: var(--surface); text-align: left; border-left: 0; font-weight: 400;
}
.plan-grid thead .pn { background: var(--surface-2); font-size: .7rem; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.plan-grid tbody .pn { display: flex; align-items: center; gap: 8px; }
.plan-grid tbody .pn span { display: grid; min-width: 0; }
.plan-grid tbody .pn b { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-grid tbody .pn small { font-size: .7rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-grid tr.no-reply .pn b { color: var(--muted); }
.plan-pick { width: 18px; height: 18px; flex: none; accent-color: var(--brand); }
.cnt { display: grid; place-items: center; min-height: 26px; border-radius: 6px; font-weight: 700; }
.bar { display: grid; place-items: center; height: 26px; border-radius: 6px; font-size: .72rem; font-weight: 700; }
.bar.lv-ok, .cnt.lv-ok { background: var(--brand); color: var(--brand-ink); }
.bar.lv-orange, .cnt.lv-orange { background: var(--warn); color: #fff; }
.bar.lv-red, .cnt.lv-red { background: var(--stop); color: var(--stop-ink); }
.plan-grid tr.is-approved .bar { box-shadow: inset 0 0 0 2px var(--surface); }
.lv-max { background: var(--surface-2); color: var(--text); }
.cnt.over { outline: 2px solid var(--stop); outline-offset: 1px; }
.plan-grid tr.duty td .cnt { color: var(--muted); font-weight: 600; }
.bar.changed { outline: 2px dashed var(--text); outline-offset: -2px; }
.bar.removed { background: transparent; border: 2px dashed var(--muted); }
.cell-btn { display: block; width: 100%; min-height: 32px; padding: 0; border: 1px dashed var(--border); border-radius: 6px; background: transparent; cursor: pointer; }
.cell-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.plan-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.btn-pill.is-on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.plan-moves { display: grid; gap: 10px; padding: 14px; border-radius: 12px; border: 1px solid var(--stop); background: var(--stop-soft); }
.plan-moves h3 { font-size: 1rem; }
.plan-moves .btn { width: auto; }
.plan-moves .entry .btn { flex: none; }
.range-tabs { grid-template-columns: 1fr 1fr; min-width: 200px; margin-left: auto; }
.staff-link { width: auto; justify-self: center; }
.bar.part { opacity: 1; background-image: linear-gradient(135deg, transparent 70%, rgba(255, 255, 255, .75) 70%); }
.pn-btn { display: grid; min-width: 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; }
.pn-btn:hover b { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
/* Detaljvy: välj exakta dagar för en person. */
.day-pick { display: grid; gap: 4px; }
.dp-head, .dp-row { display: grid; grid-template-columns: 52px repeat(5, minmax(0, 1fr)); gap: 4px; align-items: center; }
.dp-head span { font-size: .7rem; font-weight: 600; color: var(--muted); text-align: center; text-transform: uppercase; }
.dp-week { min-height: 40px; border: 0; border-radius: 8px; background: var(--surface-2); font-weight: 700; font-size: .8rem; cursor: pointer; color: var(--text); }
.dp-day { position: relative; display: flex; cursor: pointer; }
.dp-day input { position: absolute; opacity: 0; pointer-events: none; }
.dp-day span {
  flex: 1; display: grid; place-items: center; min-height: 40px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); font-weight: 700; font-size: .9rem; line-height: 1.05;
}
.dp-day small { font-size: .6rem; font-weight: 500; color: var(--muted); }
.dp-day input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.dp-day input:checked + span small { color: var(--brand-ink); }
.dp-day input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.dp-day.has-other span { border-style: dashed; border-color: var(--kval); }
.dp-off { min-height: 40px; }
.bar.draggable { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.bar.dragging { cursor: grabbing; position: relative; z-index: 3; box-shadow: 0 4px 14px rgba(16, 24, 40, .3); transition: none; }
.plan-grid td.drop-target { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }
.plan-grid tr.is-changed .pn b::after { content: " •"; color: var(--warn); }
.plan-actions { display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.plan-reject summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: .9rem; }
.plan-reject .entries { margin-top: 8px; }
.reply-actions:has(> :nth-child(2):last-child) { grid-template-columns: 1fr auto; }

.notice-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--brand); border-radius: 12px; background: var(--brand-soft);
}
.notice-banner > div { display: grid; gap: 2px; min-width: 0; }
.notice-banner span { color: var(--muted); font-size: .82rem; }
.notice-banner .btn { width: auto; flex: none; }
.notice-body { white-space: pre-wrap; line-height: 1.5; }
.entry.is-new .entry-time { color: var(--brand); }
.entry.is-new .entry-time::after { content: " ●"; font-size: .7em; vertical-align: middle; }
.range-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.range-row .icon-btn { margin-bottom: 5px; }
.reply-status { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: .9rem; }
.reply-status span { color: var(--muted); font-size: .85rem; }
.reply-status.is-approved { background: var(--enkel-soft); }
.reply-status.is-rejected { background: var(--stop-soft); }
.reply-row { align-items: flex-start; }
.entry-sub.wrap { white-space: normal; }
.reply-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.reply-actions input {
  grid-column: 1 / -1; min-height: 42px; padding: 8px 12px; font-size: 16px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}

.pill-edit { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* ---------- Temaväljare ---------- */
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 14px; }
.segmented button {
  min-height: 42px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  font-weight: 600; font-size: .9rem; color: var(--muted);
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }

/* ---------- Flikar ---------- */
.tabbar[hidden] { display: none; }
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border);
}
.tabbar a {
  display: grid; justify-items: center; gap: 2px; padding: 6px 0;
  color: var(--muted); text-decoration: none; font-size: .78rem; font-weight: 600; border-radius: 12px;
}
.tabbar svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--brand); }
.tabbar a[aria-current="page"] svg { background: var(--brand-soft); border-radius: 99px; padding: 2px 14px; box-sizing: content-box; }

/* Netlifys etikett ("Powered by Netlify", ca 40 px hög längst ned till höger) täcker annars flikarna på mobil. */
.host-badge .tabbar { padding-bottom: calc(46px + env(safe-area-inset-bottom)); }
.host-badge body { padding-bottom: calc(116px + env(safe-area-inset-bottom)); }

@media (min-width: 640px) and (max-width: 899px) {
  .host-badge .tabbar { bottom: 56px; padding-bottom: 6px; }
  .host-badge body { padding-bottom: 150px; }
  .tabbar { left: 50%; right: auto; bottom: 16px; transform: translateX(-50%); width: 420px; border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); padding-bottom: 6px; }
  body { padding-bottom: 110px; }
}

/* ---------- Dator ---------- */
@media (min-width: 900px) {
  body, .host-badge body { padding-bottom: 32px; }
  .host-badge .tabbar { padding-bottom: 0; bottom: auto; }
  .topbar { padding: 0 28px; }
  .tabbar {
    position: fixed; inset: 0 auto auto 50%; z-index: 11; transform: translateX(-50%);
    display: flex; gap: 4px; align-items: center; height: 60px; padding: 0;
    background: none; border: 0;
  }
  .tabbar a { display: flex; align-items: center; gap: 8px; padding: 8px 16px; font-size: .92rem; border-radius: 99px; }
  .tabbar a:hover { color: var(--text); background: var(--surface-2); }
  .tabbar svg { width: 20px; height: 20px; }
  .tabbar a[aria-current="page"] { background: var(--brand-soft); }
  .tabbar a[aria-current="page"] svg { background: none; padding: 0; }

  .view { max-width: 1180px; padding: 28px; gap: 20px; }
  .view:not(:has(.week-layout)) { max-width: 640px; }
  .view:has(.week-layout), .view:has(.drivers-card) { max-width: 920px; }
  .view:has(.plan) { max-width: 1180px; }
  .review-bar { grid-template-columns: auto minmax(0, 1fr) 260px; }
  .review-tabs { grid-column: auto; }
  .week-layout { --col: 96px; --chev: 18px; }
  .days-head, .day-row, .days-total, .month-row { column-gap: 12px; padding-left: 18px; padding-right: 14px; }
  .days-head { font-size: .7rem; min-height: 36px; }
  .day-row { min-height: 52px; }
  .dr-day strong { font-size: 1.05rem; }
  .dr-day small { font-size: .8rem; }
  .dr-val { font-size: 1.1rem; }
  .month-sum-head h2 { font-size: 1.1rem; }

  .toast { bottom: 28px; }
}

/* ---------- Bottenark (dialog) ---------- */
.sheet {
  width: min(560px, 100%); max-width: 100%; max-height: 92dvh;
  margin: auto auto 0; padding: 0;
  border: 0; border-radius: 24px 24px 0 0;
  background: var(--surface); color: var(--text);
  overflow: auto;
}
.sheet[open] { animation: slide-up .22s ease-out; }
.sheet::backdrop { background: rgba(5, 10, 18, .45); backdrop-filter: blur(2px); }
@keyframes slide-up { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 640px) { .sheet { margin: auto; border-radius: 24px; } }
.sheet-body { display: grid; gap: 16px; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; }
.sheet-title { flex: 1; min-width: 0; }
.sheet-head h2 { font-size: 1.25rem; letter-spacing: -.01em; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-actions .btn-danger { grid-column: 1 / -1; }

/* ---------- Notiscenter (chauffören) ---------- */
.drawer {
  width: min(380px, 92vw); max-width: 92vw; height: 100dvh; max-height: 100dvh;
  margin: 0 0 0 auto; padding: 0; border: 0; border-left: 1px solid var(--border);
  background: var(--surface); color: var(--text); overflow: auto;
}
.drawer[open] { animation: slide-in .2s ease-out; }
.drawer::backdrop { background: rgba(5, 10, 18, .35); }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
.drawer-body { display: grid; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom)); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drawer-head h2 { font-size: 1.15rem; }
.drawer-empty { padding: 20px 4px; }
.notif-list { display: grid; gap: 8px; }
/* Varje notis är ett eget kort med en ikon i färg efter typ. */
.notif {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  text-align: left; cursor: pointer; color: inherit;
}
.notif:hover { border-color: var(--brand); }
.notif.is-new { background: var(--brand-soft); border-color: var(--brand); }
.notif-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; }
.notif-icon svg { width: 20px; height: 20px; }
.v-request .notif-icon { background: var(--brand); color: var(--brand-ink); }
.v-approved .notif-icon { background: var(--ok-soft); color: var(--ok); }
.v-changed .notif-icon { background: var(--warn-soft); color: var(--warn); }
.v-info .notif-icon { background: var(--surface-2); color: var(--muted); }
.v-reminder .notif-icon { background: var(--warn-soft); color: var(--warn); }
.v-reminder .notif-kind { color: var(--warn); }
/* Meddelanden från TidIdag (ägaren) i lönekontorets notiscenter: egen färg */
.notif.v-owner { border-color: var(--enkel); background: var(--enkel-soft); }
.v-owner .notif-icon { background: var(--enkel); color: var(--surface); }
.v-owner .notif-kind { color: var(--enkel); }
.notif-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.notif-kind { display: flex; align-items: center; gap: 6px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.v-approved .notif-kind { color: var(--ok); }
.v-changed .notif-kind { color: var(--warn); }
.v-request .notif-kind { color: var(--brand); }
.notif-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--stop); }
.notif-title { font-weight: 600; font-size: .92rem; }
.notif.is-new .notif-title { font-weight: 700; }
.notif-text { color: var(--text); font-size: .84rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-meta { color: var(--muted); font-size: .75rem; }
.notif-due { color: var(--stop); font-weight: 600; }

.leave-sum { font-size: .9rem; color: var(--muted); }
.leave-sum b { color: var(--text); }
/* Hopfällbar lista (ledighet, personal). Mellanrum sätts med marginaler eftersom gap inte
   gäller innehållet i <details> i alla webbläsare. */
.leave-list { display: block; }
.leave-list > summary {
  list-style: none; display: inline-flex; width: auto; gap: 8px;
  border-color: var(--border); background: var(--surface-2); color: var(--text);
}
.leave-list > summary::-webkit-details-marker { display: none; }
.leave-list > summary::after {
  content: ""; width: 7px; height: 7px; margin-left: 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform .15s ease;
}
.leave-list[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.leave-list > summary:hover { border-color: var(--brand); }
.leave-list > :not(summary) { margin-top: 14px; }
.leave-list .fleet-search + * { margin-top: 12px; }

/* ---------- Färdskrivare ---------- */
/* Rapportformuläret i avsnitt med linje emellan. */
.form-section { display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.fs-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fs-title small { font-weight: 500; text-transform: none; letter-spacing: 0; }
.tacho-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--brand-soft);
}
.tb-icon { display: grid; place-items: center; color: var(--brand); }
.tb-icon svg { width: 20px; height: 20px; }
.tb-text { flex: 1; min-width: 150px; font-size: .88rem; font-variant-numeric: tabular-nums; }
.tb-actions { display: flex; gap: 6px; }
.tb-actions .btn-pill { min-height: 32px; font-size: .8rem; }
.tb-detail { flex-basis: 100%; display: grid; gap: 10px; padding-top: 8px; }
.tb-detail .tacho-axis { margin-top: -6px; }
.entry-open { flex: none; display: inline-flex; align-items: center; gap: 2px; font-size: .8rem; font-weight: 600; color: var(--brand); }
.entry-open b { font-size: 1.1rem; }
.pass-list .entry { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; }
.pass-list .entry:last-child { margin-bottom: 0; }
.pass-list .entry:hover { border-color: var(--brand); background: var(--brand-soft); }
.entries.pass-list { border: 0; overflow: visible; }
.tacho-compare .btn { justify-self: start; width: auto; margin-top: 6px; }
/* Från–till-datum. Kolumnerna får krympa (minmax 0) och datumfälten får ingen inbyggd minsta bredd,
   så att de ryms bredvid varandra även på smala telefoner. */
.date-range { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.date-range .field { min-width: 0; gap: 4px; }
.date-range .field > span { font-size: .78rem; }
.date-range input[type="date"] {
  -webkit-appearance: none; appearance: none; min-width: 0; width: 100%;
  min-height: 42px; padding: 6px 8px; font-size: 16px;
}
.date-range .btn-pill { margin-bottom: 4px; }
@media (max-width: 480px) {
  .date-range { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .date-range .btn-pill { grid-column: 1 / -1; justify-self: start; margin-bottom: 0; }
}
.missing-row { flex-wrap: wrap; }
.missing-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.missing-actions .btn-pill { min-height: 34px; font-size: .8rem; }
.tacho-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tacho-empty { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.tacho-empty > div { display: grid; gap: 4px; }
.tacho-empty span:not(.tb-icon) { color: var(--muted); font-size: .88rem; }
.tacho-empty .tb-icon { color: var(--muted); }
.tacho-bar.is-empty { opacity: .8; }
.tacho-bar.is-empty .tb-text { color: var(--muted); }
.tacho-btn.is-warn { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }

.tacho-chip {
  display: inline-flex; align-items: center; gap: 4px; justify-self: start; min-height: 28px; padding: 0 10px 0 7px;
  border: 1px solid var(--border); border-radius: 99px; background: var(--surface); cursor: pointer;
  font-size: .75rem; font-weight: 600; color: var(--muted);
}
.tacho-chip svg { width: 15px; height: 15px; }
.tacho-chip:hover { border-color: var(--brand); color: var(--brand); }
.tacho-chip.is-warn { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.tacho-chip b { font-variant-numeric: tabular-nums; }
.tacho-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.link-btn { padding: 0; border: 0; background: none; color: var(--brand); font-weight: 600; font-size: .85rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.tacho-line { display: flex; height: 22px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.tacho-line span { height: 100%; }
.tl-drive { background: var(--brand); }
.tl-work { background: var(--warn); }
.tl-avail { background: var(--enkel); }
.tl-rest { background: var(--surface-2); }
.tacho-axis { display: flex; justify-content: space-between; margin-top: -10px; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tacho-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .75rem; color: var(--muted); }
.tacho-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 2px; vertical-align: -1px; border: 1px solid var(--border); }
.tacho-compare { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--ok-soft); font-size: .88rem; }
.tacho-compare span { color: var(--muted); font-size: .82rem; }
.tacho-compare.is-warn { background: var(--warn-soft); }
.tacho-compare.is-warn strong { color: var(--warn); }
.dev-box { padding: 12px; border-radius: 12px; background: var(--warn-soft); }
.dev-box legend { color: var(--warn); }
.tag-dev { background: var(--warn-soft); color: var(--warn); }
.pill-tacho { background: var(--brand-soft); color: var(--brand); }
.pill-dev { background: var(--stop-soft); color: var(--stop); }
.dev-row { align-items: flex-start; }
.dev-row.is-done { opacity: .6; }
.num-input { display: inline-flex; align-items: center; gap: 6px; flex: none; font-weight: 600; }
.num-input input { width: 70px; min-height: 38px; padding: 4px 8px; font-size: 16px; text-align: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); }
.staff-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.staff-links .btn { width: auto; }

/* Avvikelser i chaufförslistan */
.dev-flag { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; padding: 0 6px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); font-style: normal; font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; vertical-align: middle; }
.dev-flag svg { width: 12px; height: 12px; }
.dev-switch { padding: 8px 0; }

/* ---------- Att göra (lönekontoret) ---------- */
.todo { display: grid; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.todo-title { margin: 0; padding: 8px 12px; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.todo-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-top: 1px solid var(--border); background: none; color: var(--text); font: inherit; font-size: .9rem; text-align: left; text-decoration: none; cursor: pointer; }
.todo-row:hover { background: var(--surface-2); }
.todo-dot { width: 9px; height: 9px; border-radius: 50%; }
.t-stop { background: var(--stop); }
.t-warn { background: var(--warn); }
.t-pend { background: var(--brand); }
.todo-empty { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--ok-soft); color: var(--ok); font-size: .88rem; font-weight: 600; }
/* Underflikar i Inställningar och flikar i anställningsarket */
.settings-tabs { grid-template-columns: repeat(4, 1fr); }
.settings-tabs button, .emp-tabs button { min-height: 38px; font-size: .82rem; padding: 0 4px; }
.tab-dot { display: inline-block; width: 7px; height: 7px; margin-left: 4px; border-radius: 50%; background: var(--warn); vertical-align: middle; }

/* ---------- Lön ---------- */
.pay-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.pay-total span { color: var(--muted); font-size: .85rem; }
.pay-total strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.todo-row.is-static { cursor: default; }
.todo-row.is-static:hover { background: none; }
.paylist .dl-head, .paylist .dl-row { grid-template-columns: 52px minmax(0, 1fr) auto 16px; }
.pay-no { color: var(--muted); text-align: left; }
.pay-sub { display: block; color: var(--muted); font-size: .74rem; font-weight: 500; }
.pay-sum { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-warn { display: grid; gap: 4px; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: .85rem; font-weight: 600; }
.pl-list { display: grid; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.pl-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 76px 92px; gap: 8px; align-items: center; padding: 7px 12px; border-top: 1px solid var(--border); font-size: .88rem; font-variant-numeric: tabular-nums; }
.pl-row:first-child { border-top: 0; }
.pl-head { background: var(--surface-2); color: var(--muted); font-size: .74rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.pl-head span:not(:first-child), .pl-qty, .pl-price, .pl-sum { text-align: right; }
.pl-name { display: grid; min-width: 0; }
.pl-name small { color: var(--muted); font-size: .72rem; }
.pl-sum { font-weight: 600; }
.is-neg .pl-sum { color: var(--stop); }
.pl-total { background: var(--surface-2); font-weight: 700; }
.pl-total span:last-child { text-align: right; }
.pl-empty { padding: 10px 12px; margin: 0; }
@media (max-width: 480px) {
  .pl-row { grid-template-columns: minmax(0, 1fr) 64px 84px; }
  .pl-price { display: none; }
  .pl-head span:nth-child(3), .pl-total span:nth-child(3) { display: none; }
}

/* Attest och låsning */
.pay-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border); font-size: .9rem; font-weight: 600; }
.pay-status.is-done { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.pay-status.is-locked { background: var(--surface-2); }
.pay-status .btn { width: auto; }
.pay-mark { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 6px; border-radius: 50%; border: 1.5px solid var(--border); font-style: normal; font-size: .62rem; font-weight: 800; vertical-align: middle; }
.pay-mark.is-ok { border-color: var(--ok); background: var(--ok); color: #fff; }
.pay-mark.is-warn { border-color: var(--warn); background: var(--warn); color: #fff; }
.pay-ok { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); font-size: .88rem; font-weight: 600; }
.pl-name.is-corr { color: var(--brand); }
.pay-log summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.pay-log-row { display: grid; gap: 1px; padding: 6px 0; border-top: 1px dashed var(--border); font-size: .85rem; }
.pay-log-row small { color: var(--muted); }
.num-input.is-off { opacity: .5; }

/* Påminnelser om rapportering */
.month-check { border-color: var(--brand); background: var(--brand-soft); }
.mc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mc-actions .btn { width: auto; }
.payroll-reminder { border-color: var(--warn); background: var(--warn-soft); }
.payroll-reminder > div { display: grid; gap: 2px; }
.import-card { border-color: var(--brand); }
.wt-row.team-row { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
.team-open { display: grid; gap: 2px; min-width: 0; padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.team-open small { color: var(--muted); font-size: .78rem; }
.team-open:hover strong { color: var(--brand); }
.wt-row-link.is-static { cursor: default; }
.wt-row-link.is-static:hover { background: none; }
.self-note { align-self: center; }
.staff-filters { grid-template-columns: minmax(0, 1fr) auto auto auto; }
@media (max-width: 560px) { .staff-filters { grid-template-columns: 1fr 1fr; } .staff-filters .remind-search { grid-column: 1 / -1; } }
.staff-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); margin-bottom: 10px; }
.staff-bar.has-picked { background: var(--brand-soft); }
.staff-picked { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.staff-picked .btn { width: auto; }
/* Kryssrutan direkt intill namnet (högre specificitet än .wt-row, även på mobil). */
.wt-row.staff-row, .wt-row.team-row { gap: 10px; }
/* Två tydliga zoner: kryssrutan i en egen ruta till vänster (välja), namnet till höger (öppna). */
.wt-row.staff-row { grid-template-columns: auto minmax(0, 1fr); align-items: stretch; gap: 0; padding: 0; }
.staff-pick { display: grid; place-items: center; padding: 0 14px; background: var(--surface-2); border-right: 1px solid var(--border); cursor: pointer; }
.staff-pick:hover { background: var(--brand-soft); }
.staff-open { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n c" "s c"; align-items: center; column-gap: 10px; padding: 8px 12px; border-radius: 0; }
.staff-open strong { grid-area: n; }
.staff-open small { grid-area: s; }
.staff-open .chev { grid-area: c; }
.staff-open:hover { background: var(--surface-2); }
.staff-row input[type="checkbox"], .staff-bar input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--brand); }
.staff-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.staff-tools .btn { width: auto; }
.import-steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: .88rem; color: var(--muted); }
.import-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.import-col { display: grid; gap: 3px; font-size: .8rem; }
.import-col span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-col select { min-height: 36px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: .85rem; }
.import-preview { max-height: 46vh; overflow-y: auto; }
.imp-error { background: var(--stop-soft); }
.bulk-filters { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.bulk-list { max-height: 40vh; overflow-y: auto; }
@media (max-width: 560px) { .bulk-filters { grid-template-columns: 1fr 1fr; } .bulk-filters .remind-search { grid-column: 1 / -1; } }
.remind-filters { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.remind-by { display: flex; align-items: center; gap: 8px; }
.remind-group > summary { list-style: none; cursor: pointer; }
.remind-group > summary::-webkit-details-marker { display: none; }
.remind-group > summary strong::before { content: '▾ '; color: var(--muted); }
.remind-group:not([open]) > summary strong::before { content: '▸ '; }
.remind-filters select, .remind-search { min-height: 40px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 16px; min-width: 0; }
.remind-groups { display: grid; gap: 12px; }
.remind-group { display: grid; gap: 6px; }
.remind-group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.remind-group-head .link { margin-left: auto; font-size: .85rem; }
@media (max-width: 480px) { .remind-filters { grid-template-columns: 1fr; } }
.pick-tools { font-size: .85rem; color: var(--muted); }
.remind-row { cursor: pointer; }
.remind-row input { width: 20px; height: 20px; accent-color: var(--brand); }
.pay-remind { border: 1px solid var(--border); border-radius: 12px; }

/* Meddelandemallar och månadsutskick */
.inline-link { display: inline; padding: 0; font-size: inherit; }
.msg-block { display: grid; gap: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.msg-block h3 { margin: 0; font-size: .95rem; }
.msg-block .btn { width: auto; justify-self: start; }
.msg-preview { padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); font-size: .9rem; }
.msg-preview p { margin: 6px 0 0; }
.monthly-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.monthly-card > div { display: grid; gap: 2px; }
.monthly-card .btn { width: auto; }
.payroll-reminder span:not(.eyebrow) { white-space: pre-line; }

/* Lönekontorets jämförelse med färdskrivaren i dagens ark */
.tacho-cmp { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.tacho-cmp.is-warn { border-color: var(--warn); background: var(--warn-soft); }
.tacho-cmp-head { display: flex; align-items: center; gap: 8px; }
.tacho-cmp .btn { width: auto; justify-self: start; }
.tacho-cmp p { margin: 0; }
.cmp-table { display: grid; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); font-size: .86rem; font-variant-numeric: tabular-nums; }
.cmp-row { display: grid; grid-template-columns: 82px minmax(0, 1fr) minmax(0, 1fr) 72px; gap: 8px; padding: 6px 10px; border-top: 1px solid var(--border); }
.cmp-row:first-child { border-top: 0; }
.cmp-row span:not(:first-child) { text-align: right; }
.cmp-row span:first-child { color: var(--muted); }
.cmp-h { background: var(--surface-2); color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.cmp-ok { color: var(--ok); }
.cmp-bad { color: var(--stop); font-weight: 700; }

/* Rimlighetskontroll och attest per grupp */
.pay-flag { margin-left: 6px; padding: 0 6px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); font-style: normal; font-size: .72rem; font-weight: 700; vertical-align: middle; }
.pay-flags { display: grid; gap: 3px; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--text); font-size: .86rem; }
.pay-flags strong { color: var(--warn); }
.pay-cycle { margin-top: -2px; }
.ov-switch { margin-bottom: 0; }
.period-sum { margin-bottom: 4px; }
.bulk-bar { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.bulk-scope { margin: 0; font-size: .88rem; }
.bulk-bar .muted { margin: 0; }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bulk-actions .btn { width: auto; }
.bulk-actions .btn:disabled { opacity: .45; cursor: default; }
.pay-view button { font-size: .8rem; min-height: 36px; padding: 0 4px; }
.check-row-set.is-off .wt-name { opacity: .55; }
.check-row-set .wt-val { gap: 8px; }

/* Export */
.pay-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pay-actions .btn { width: auto; }
.exp-formats { display: grid; gap: 8px; }
.exp-format { display: grid; gap: 2px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.exp-format strong { display: flex; align-items: center; gap: 8px; }
.exp-format small { color: var(--muted); font-size: .8rem; }
.exp-format.is-on { border-color: var(--brand); background: var(--brand-soft); }
.exp-checks { display: grid; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.exp-check { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); font-size: .88rem; }
.exp-check:first-child { border-top: 0; }
.exp-check i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; font-style: normal; font-size: .7rem; font-weight: 800; }
.exp-check.is-ok i { background: var(--ok); }
.exp-check.is-warn i { background: var(--warn); }
.exp-check.is-bad i { background: var(--stop); }
.exp-preview { display: grid; border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; font-size: .8rem; font-variant-numeric: tabular-nums; }
.exp-row { display: grid; grid-template-columns: 56px 60px minmax(140px, 1fr) 72px 84px; gap: 8px; padding: 5px 10px; border-top: 1px solid var(--border); min-width: 460px; }
.exp-row:first-child { border-top: 0; }
.exp-row span:nth-child(4), .exp-row span:nth-child(5) { text-align: right; }
.exp-head { background: var(--surface-2); color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: .7rem; letter-spacing: .03em; }
.exp-more { padding: 6px 10px; border-top: 1px solid var(--border); color: var(--muted); }
.exp-sketch { margin: 0; padding: 8px 12px; border-radius: 10px; border: 1px dashed var(--border); color: var(--muted); font-size: .85rem; }
.wt-wide { width: 110px; text-align: left; }

/* Ägaren */
.owner-sum { margin: 0; color: var(--muted); font-size: .9rem; }
.owner-sum b { color: var(--text); }
.ownerlist .dl-head, .ownerlist .dl-row { grid-template-columns: minmax(0, 1fr) 72px 92px 48px 16px; }
.owner-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.owner-actions .btn { width: auto; }
.owner-kv { display: grid; gap: 0; margin: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.owner-kv > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); font-size: .88rem; }
.owner-kv > div:first-child { border-top: 0; }
.owner-kv dt { color: var(--muted); }
.owner-kv dd { margin: 0; min-width: 0; }
.support-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); border: 1px solid var(--warn); font-size: .9rem; }
.support-bar .btn { width: auto; }
.owner-msg { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--brand-soft); border: 1px solid var(--brand); }
.owner-msg > div { display: grid; gap: 2px; }
.owner-msg span:not(.eyebrow) { font-size: .88rem; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.stat-tiles > div { display: grid; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.stat-tiles b { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.stat-tiles span { color: var(--muted); font-size: .8rem; }
.stat-row { display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 1fr) 44px; align-items: center; gap: 10px; padding: 4px 0; font-size: .86rem; }
.stat-row b { text-align: right; font-variant-numeric: tabular-nums; }
.stat-bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.stat-bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.stat-split { height: 14px; border-radius: 99px; background: var(--ok); overflow: hidden; }
.stat-split i { display: block; height: 100%; background: var(--brand); }
@media (max-width: 480px) {
  .ownerlist .dl-head, .ownerlist .dl-row { grid-template-columns: minmax(0, 1fr) 48px 72px 28px 12px; }
  .owner-kv > div { grid-template-columns: 1fr; gap: 2px; }
  .stat-row { grid-template-columns: minmax(0, 120px) minmax(0, 1fr) 36px; }
}

/* Kom igång */
.setup-box { border-color: var(--brand); }
.setup-row { cursor: default; }
.setup-row:hover { background: none; }
.setup-row .btn { width: auto; }
.setup-num { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-style: normal; font-size: .75rem; font-weight: 800; }
.setup-row.is-done { color: var(--muted); }
.setup-row.is-done span { text-decoration: line-through; }
.setup-row.is-done .setup-num { background: var(--ok); color: #fff; }

/* Avtalsval */
.agr-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.agr-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); color: var(--text); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.agr-chip small { color: var(--muted); font-weight: 500; }
.agr-chip.is-on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.agr-chip.is-on small { color: inherit; opacity: .8; }
.agr-chip.agr-add { border-style: dashed; color: var(--brand); }
.agr-chip svg { width: 16px; height: 16px; }
#new-type-form { flex-wrap: wrap; }
.agr-chip.agr-read { border-color: var(--border); color: var(--text); }
.agr-chip.agr-read.has-new { border-color: var(--warn); background: var(--warn-soft); }
.agr-chip.agr-read b { color: var(--warn); }
.agr-lib { display: grid; gap: 6px; }
.agr-lib h3 { margin: 0; font-size: .95rem; display: flex; align-items: center; gap: 8px; }
.agr-lib .wt-row.agr-new { background: var(--warn-soft); }
.agr-lib-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.agr-lib-actions .btn { width: auto; }
.agr-remove { color: var(--stop); font-size: .85rem; justify-self: start; }
.agr-remove-note { margin: 0; }

/* Röda dagar */
.red-sum { margin: 0; font-size: .9rem; }
.red-list > summary { list-style: none; width: auto; display: inline-flex; }
.red-list > summary::-webkit-details-marker { display: none; }
.red-list .wt-list { margin-top: 8px; max-height: 40vh; overflow-y: auto; }
.is-struck .wt-name strong { text-decoration: line-through; color: var(--muted); }
.rc-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.rc-month strong { display: block; margin-bottom: 4px; font-size: .88rem; }
.rc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.rc-dow { text-align: center; font-size: .66rem; font-weight: 700; color: var(--muted); }
.rc-day { display: grid; place-items: center; aspect-ratio: 1; min-height: 24px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: .78rem; font-variant-numeric: tabular-nums; cursor: pointer; padding: 0; }
button.rc-day:hover { background: var(--surface-2); }
.rc-day.is-weekend { color: var(--red); opacity: .65; cursor: default; }
.rc-day.is-red { background: var(--stop); color: var(--stop-ink); font-weight: 700; }
.rc-day.is-eve { box-shadow: inset 0 0 0 2px var(--red); color: var(--red); font-weight: 700; }
.rc-day.is-own { background: var(--kval); color: var(--surface); font-weight: 700; }
.rc-day.is-removed { color: var(--muted); text-decoration: line-through; box-shadow: inset 0 0 0 1px var(--border); }
.rc-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--muted); }
.rc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.rc-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.rc-legend i.is-red { background: var(--stop); }
.rc-legend i.is-eve { box-shadow: inset 0 0 0 2px var(--red); }
.rc-legend i.is-own { background: var(--kval); }
.rc-legend i.is-removed { box-shadow: inset 0 0 0 1px var(--border); background: linear-gradient(to top right, transparent 45%, var(--muted) 47%, var(--muted) 53%, transparent 55%); }
.rc-legend i.is-weekend { background: var(--stop-soft); }

/* Avtalsversioner */
.agr-update { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--warn); background: var(--warn-soft); }
.agr-update > div { display: grid; gap: 2px; }
.agr-update span { color: var(--muted); font-size: .82rem; }
.agr-update .btn { width: auto; }
.agr-note { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: .88rem; }
.agr-list { display: grid; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.agr-row { display: grid; grid-template-columns: minmax(0, 1fr) 92px 16px 92px 96px; gap: 6px; align-items: center; padding: 7px 12px; border-top: 1px solid var(--border); font-size: .86rem; font-variant-numeric: tabular-nums; }
.agr-row:first-child { border-top: 0; }
.agr-head { background: var(--surface-2); color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.agr-name { display: grid; min-width: 0; }
.agr-name small { color: var(--brand); font-size: .72rem; }
.agr-old, .agr-new { text-align: right; }
.agr-row.is-changed .agr-new { font-weight: 700; color: var(--ok); }
.agr-row:not(.is-changed) { color: var(--muted); }
.agr-arrow { text-align: center; color: var(--muted); }
.agr-keep { display: flex; align-items: center; gap: 4px; font-size: .74rem; color: var(--brand); }
.wt-text { width: 220px; max-width: 100%; text-align: left; }
@media (max-width: 560px) {
  .agr-row { grid-template-columns: minmax(0, 1fr) 70px 12px 70px; }
  .agr-row > :nth-child(5) { grid-column: 1 / -1; }
  .agr-row > span:nth-child(5):empty { display: none; }
}

/* ---------- Lönearter ---------- */
.wt-group { margin: 6px 0 0; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.wt-list { display: grid; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.wt-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 6px 12px; padding: 8px 12px; border-top: 1px solid var(--border); }
.wt-row:first-child { border-top: 0; }
.wt-name { display: grid; min-width: 0; }
.wt-name small { color: var(--muted); font-size: .74rem; }
.wt-name a { color: inherit; }
.wt-val { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.wt-formula { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; }
.wt-input { width: 72px; min-height: 34px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; text-align: right; font-variant-numeric: tabular-nums; }
.wt-formula .wt-input { width: 56px; }
.wt-code { display: flex; align-items: center; gap: 4px; font-size: .74rem; color: var(--muted); }
.wt-code input { width: 56px; min-height: 34px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; }
.wt-status .q-pill { border: 0; cursor: pointer; font: inherit; font-size: .72rem; font-weight: 700; }
.warn-text { color: var(--warn); }
.wt-row-link { grid-template-columns: minmax(0, 1fr) auto auto; width: 100%; border: 0; border-top: 1px solid var(--border); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.wt-list > .wt-row-link:first-child { border-top: 0; }
.wt-row-link:hover { background: var(--surface-2); }
.supp-pick { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
.supp-pick legend { margin-bottom: 4px; font-weight: 600; font-size: .9rem; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--brand); }
.emp-supp { display: grid; gap: 10px; }
.wt-row-rule { grid-template-columns: minmax(0, 1fr) auto; }
.wt-date { width: 150px; text-align: left; }
.mini-seg { display: inline-grid; grid-auto-flow: column; gap: 2px; padding: 2px; border-radius: 9px; background: var(--surface-2); }
.mini-seg button { min-height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--muted); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.mini-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
@media (max-width: 640px) {
  .wt-row { grid-template-columns: minmax(0, 1fr) auto; }
  .wt-row-rule .wt-val { grid-column: 1 / -1; grid-row: 2; }
  .wt-row-link { grid-template-columns: minmax(0, 1fr) auto auto; }
  .wt-row-link .wt-name { grid-column: auto; }
  .wt-name { grid-column: 1 / -1; }
  .wt-val { grid-column: 1; grid-row: 2; }
  .wt-status { grid-column: 2; grid-row: 2; justify-self: end; }
  .wt-code { grid-column: 1 / -1; grid-row: 3; }
}
.settings-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tabs button { flex: 1 0 auto; white-space: nowrap; padding: 0 6px; font-size: .78rem; letter-spacing: -.01em; }

/* ---------- Behörigheter ---------- */
.review-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.q-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.q-tag { border: 0; cursor: pointer; padding: 2px 8px; border-radius: 99px; font: inherit; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.q-tag:hover { filter: brightness(.95); }
.q-pill, .q-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: .72rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.q-ok { background: var(--ok-soft); color: var(--ok); }
.q-soon { background: var(--warn-soft); color: var(--warn); }
.q-expired, .q-missing { background: var(--stop-soft); color: var(--stop); }
.q-unused { background: var(--surface-2); color: var(--muted); }
.q-pend { background: var(--brand-soft); color: var(--brand); }
.q-none { background: transparent; color: var(--muted); }
.q-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.q-summary .q-pill { font-size: .8rem; padding: 4px 10px; }
.q-flag { margin-left: 6px; font-style: normal; font-size: .85rem; }
.q-flag.q-soon { color: var(--warn); background: none; }
.q-flag.q-expired, .q-flag.q-missing { color: var(--stop); background: none; }
.q-flag.q-pend { color: var(--brand); background: none; font-weight: 700; }
.count-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 5px; border-radius: 99px; background: var(--stop); color: var(--stop-ink); font-size: .7rem; }
.qlist .dl-head, .qlist .dl-row { grid-template-columns: minmax(0, 1fr) repeat(3, 84px); }
.qlist .dl-head span { text-align: center; }
.qlist .dl-head span:first-child { text-align: left; }
.qlist .dl-row > .q-chip { justify-self: center; }
@media (min-width: 640px) { .qlist .dl-head, .qlist .dl-row { grid-template-columns: minmax(0, 1fr) repeat(3, 120px); } }
.q-edit { display: grid; gap: 8px; padding: 10px 0; border-top: 1px dashed var(--border); }
.q-edit:first-of-type { border-top: 0; }
.q-edit-head { display: flex; align-items: center; gap: 8px; }
.q-pending { display: grid; gap: 8px; padding: 10px; border-radius: 10px; background: var(--brand-soft); }
.q-pending > div:first-child { display: grid; gap: 2px; }
.q-pending span { color: var(--muted); font-size: .85rem; }
.q-pending img, .renew-img { max-width: 100%; max-height: 240px; border-radius: 8px; border: 1px solid var(--border); object-fit: contain; }
.q-pending-actions { display: flex; gap: 8px; }
.q-pending-actions .btn { width: auto; }
.q-row .entry-time { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-banner.q-soon { border-color: var(--warn); background: var(--warn-soft); }
.q-banner.q-expired, .q-banner.q-missing { border-color: var(--stop); background: var(--stop-soft); }
.cat-flags { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.entry.staff:has(.cat-flags) { flex-wrap: wrap; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 100;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 99px;
  background: var(--text); color: var(--bg); font-weight: 500; font-size: .95rem; text-align: center;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 640px) and (max-width: 899px) { .toast { bottom: 112px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Lönetabell och lönenivåer */
.scale-vals { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 6px; }
.scale-vals .wt-input { width: 84px; }
.scale-row .wt-name small .wt-input { width: 52px; min-height: 28px; }
.scale-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.scale-status .q-pill { border: 0; cursor: pointer; font: inherit; font-size: .72rem; font-weight: 700; }
.scale-status .q-pill:disabled { cursor: default; }
.level-box { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.level-box .wt-group { margin-bottom: 8px; }
.salary-log summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--brand); padding: 4px 0; }
.salary-list { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.salary-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--border); }
.salary-row:first-child { border-top: 0; }
.salary-pick { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.salary-pick input { width: 18px; height: 18px; flex: none; }
.salary-name { display: grid; gap: 2px; min-width: 0; }
.salary-name small, .salary-amt small { color: var(--muted); font-size: .76rem; }
.salary-amt { display: grid; justify-items: end; gap: 2px; font-variant-numeric: tabular-nums; text-align: right; }
.salary-amt s { color: var(--muted); }
.salary-row.is-info { background: var(--surface-2, transparent); }
.away-mode { margin-left: 8px; vertical-align: middle; }
.form-note { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: .84rem; }
.form-note.is-warn { background: var(--warn-soft, var(--surface-2)); color: var(--warn); }

/* Lönekörningen i fyra steg på Lön-fliken */
.pay-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 10px 0 0; padding: 0; list-style: none; }
.pay-steps li { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.pay-steps i { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid currentColor; font-style: normal; font-size: .74rem; font-weight: 700; }
.pay-steps span { display: grid; min-width: 0; }
.pay-steps strong { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-steps small { font-size: .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-steps li.is-done { background: var(--ok-soft); color: var(--ok); }
.pay-steps li.is-done i { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.pay-steps li.is-current { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
@media (max-width: 520px) { .pay-steps { grid-template-columns: repeat(2, 1fr); } }
.wt-all { margin-left: 6px; text-transform: none; letter-spacing: 0; font-size: .78rem; }
.lon-parts { margin-bottom: 12px; }
.lon-intro { margin: 0 4px 12px; }
.switch-row.is-flash { border-radius: 10px; background: var(--brand-soft); box-shadow: 0 0 0 2px var(--brand); transition: background .3s, box-shadow .3s; }
.nb-years { margin-bottom: 4px; }
.nb-list { max-height: 50vh; overflow-y: auto; }
/* Namnknappen i ett lönegruppschip (den runda stilen nedan gäller bara ×-knappen). */
.chip.is-static button.chip-open { display: inline-flex; align-items: center; gap: 4px; width: auto; height: auto; padding: 0; border-radius: 0; background: none; color: inherit; font: inherit; white-space: nowrap; cursor: pointer; }
.chip.is-static button.chip-open:hover { background: none; color: var(--brand); }
.chip-open small { font-size: .72rem; color: var(--muted); }
.chip-open:hover { color: var(--brand); }
/* Landsökning: välj landet i listan */
.country-pick { display: grid; gap: 6px; }
.country-pick > label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.country-input { width: 100%; min-height: 46px; padding: 10px 14px; font: inherit; font-size: 16px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.country-input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.country-results { display: flex; flex-wrap: wrap; gap: 6px; }
.country-results:empty { display: none; }
.country-opt { min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); color: var(--text); font: inherit; font-size: .88rem; cursor: pointer; }
.country-opt:hover { border-color: var(--brand); color: var(--brand); }
.size-band { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.size-pick { border: 0; padding: 0; margin: 0; }
.size-pick legend { font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }

.ver-pick { display: grid; gap: 6px; margin: 0 4px 12px; }
.ver-pick .mini-seg { justify-self: start; }

#visma-codes, #size-card, #abroad-setting { scroll-margin-top: 80px; }
/* Tre siffror före kolon (t.ex. 118:14 h i månadsraden) får plats i kolumnen på smala telefoner. */
@media (max-width: 600px) { .month-row .dr-val, .days-total .dr-val { font-size: .84rem; letter-spacing: -.02em; } .month-row .dr-val .unit, .days-total .dr-val small { font-size: .7em; } }
/* Ledighetsansökningar */
.tag-pend { background: transparent; color: var(--leave, #7c3aed); border: 1px dashed currentColor; }
.lr-row { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; }
.lr-row p { margin: 0; font-size: .9rem; }
.lr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lr-note { font-style: italic; color: var(--text); }
.lr-comment { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px; }
.lr-actions { display: flex; justify-content: flex-end; gap: 8px; }
.lr-actions .btn { width: auto; }
.lr-mine { display: grid; gap: 4px; margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--border); font-size: .88rem; }
.lr-mine-row { display: flex; justify-content: space-between; gap: 8px; }
.chev.is-apply { color: var(--muted); opacity: .7; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tacho-reviewed { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); font-size: .88rem; font-weight: 600; }
.nb-years button { display: inline-flex; align-items: center; gap: 4px; }
.nb-years svg { width: 14px; height: 14px; flex: none; }
/* Hjälp */
.help-list { display: grid; gap: 8px; }
.help-item { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.help-item summary { cursor: pointer; padding: 12px 14px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 8px; }
.help-item summary::-webkit-details-marker { display: none; }
.help-item summary::after { content: "›"; color: var(--muted); transition: transform .15s; }
.help-item[open] summary::after { transform: rotate(90deg); }
.help-body { padding: 0 14px 12px; font-size: .92rem; }
.help-body p { margin: 0; }
.help-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.help-contacts { display: grid; gap: 8px; }
.help-contact { display: grid; gap: 2px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; }
.help-contact span { color: var(--brand); font-size: .88rem; }
.help-contact:hover { border-color: var(--brand); }
.review-contact a, .sheet-title p a, .ice-line a { color: var(--brand); text-decoration: none; }
.review-contact { font-size: .86rem; }
.ice { border: 0; padding: 0; margin: 4px 0 0; display: grid; gap: 6px; }
.ice legend { font-weight: 600; font-size: .9rem; }
/* Färdskrivare: nedladdningar */
.drop-zone { position: relative; display: grid; place-items: center; gap: 4px; padding: 22px 16px; margin-bottom: 12px; border: 2px dashed var(--border); border-radius: 14px; background: var(--surface-2); text-align: center; cursor: pointer; }
.drop-zone:hover, .drop-zone.is-over { border-color: var(--brand); background: var(--brand-soft); }
.drop-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.tacho-unmatched { margin-bottom: 12px; }
.tm-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px 10px; padding: 10px 12px; border-top: 1px solid var(--border); }
.tm-row > div { display: grid; gap: 2px; min-width: 0; }
.tm-row strong { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-row small { color: var(--muted); font-size: .78rem; }
.tm-row select { min-height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: .88rem; max-width: 190px; }
@media (max-width: 560px) { .tm-row { grid-template-columns: 1fr auto; } .tm-row > div { grid-column: 1 / -1; } }
/* Fordonets färdskrivare */
.veh-stats { grid-template-columns: repeat(4, 1fr); margin: 10px 0; }
@media (max-width: 560px) { .veh-stats { grid-template-columns: repeat(2, 1fr); } }
.veh-stats .stat span { font-size: .74rem; color: var(--muted); }
.veh-stats .stat strong { font-size: 1.05rem; }
.veh-stats .stat.is-warn { background: var(--warn-soft); color: var(--warn); }
.veh-day.is-pending { opacity: .6; }
.veh-day .pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.fl-open { padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
/* Jämförelse med tre källor: rapporterat, förarkortet, fordonet */
.cmp-row.cmp-4 { grid-template-columns: 70px repeat(3, minmax(0, 1fr)) 58px; gap: 6px; }
.cmp-h small { font-weight: 600; text-transform: none; letter-spacing: 0; }
@media (max-width: 480px) { .cmp-row.cmp-4 { grid-template-columns: 58px repeat(3, minmax(0, 1fr)) 48px; font-size: .78rem; padding: 6px 8px; } }
.veh-findings { display: grid; gap: 6px; margin-top: 8px; }
.veh-findings .form-note { margin: 0; }
/* Övertidsperioden är inte avslutad */
.ot-open { display: grid; gap: 4px; margin: 10px 0; padding: 12px 14px; border: 2px solid var(--stop); border-radius: 12px; background: var(--stop-soft); color: var(--text); font-size: .9rem; }
.ot-open strong { color: var(--stop); font-size: 1rem; }
.ot-open .ot-when { margin-top: 2px; font-weight: 600; }
/* Övertidsperioden är inte avslutad */
.ot-open { display: grid; gap: 4px; margin: 10px 0; padding: 12px 14px; border: 2px solid var(--stop); border-radius: 12px; background: var(--stop-soft); color: var(--text); font-size: .9rem; }
.ot-open strong { color: var(--stop); font-size: 1rem; }
.ot-open .ot-when { margin-top: 2px; font-weight: 600; }

/* Integritetspolicy och villkor: små länkar under inloggningen och i Profil, och kryssrutan vid registrering. */
.legal-links { margin: 14px 0 0; text-align: center; font-size: .82rem; color: var(--muted); }
.legal-links a { color: var(--muted); }
.terms-check { align-items: flex-start; font-size: .9rem; line-height: 1.4; }
.terms-check input { margin-top: 3px; flex: none; }
.terms-check a { color: var(--brand); }

/* Lön: genvägar till inställningarna som påverkar lönen. */
.pay-settings { margin: 14px 0 6px; display: grid; gap: 6px; }
.pay-settings-btns { display: flex; flex-wrap: wrap; gap: 6px; }
