/* ⚠️ Lön K4–K5 — stämplingen och tidbanken (facit lon-klockslag/facit-stampling, s-1 till s-8).
 *
 * Egen fil, som klockslag.css, så att omgång 5:s filer och mobilomgångens inte rörs. Bara Grundens tokens
 * (tokens.css), inga egna färger. Klockslagen kortas aldrig; tabellerna rullar inom sitt kort, aldrig sidan.
 * Se public/js/pages/tidrapport-stampling.js (kalendern), app/anstalld/components/Stampelkort.tsx (portalen) och
 * app/attest/TidVy.tsx (attestanten).
 */

.st-las { width: 11px; height: 11px; vertical-align: -1px; margin-right: 2px; fill: none; stroke: currentColor; stroke-width: 2; color: var(--dampad); }
.st-marke .st-las, .st-lasforklaring .st-las { width: 13px; height: 13px; }

/* ── Kalenderns ruta (s-4a) ───────────────────────────────────────────────────────────────────────── */
.st-kal__utover { display: block; font-size: 11px; color: var(--bla-hover); font-variant-numeric: tabular-nums; }
.st-kal__saknar { display: block; font-size: 11px; color: var(--warning); }
.st-kal__forslag { display: block; font-size: 11px; color: var(--warning); font-weight: 600; }
.o5-kal__dag.st-kal__dag--saknar { border-color: var(--slapande-kant); box-shadow: 0 0 0 1px var(--slapande-kant) inset; }
.st-lasforklaring { font-size: 13px; }

/* ── Huvudet och rutorna ─────────────────────────────────────────────────────────────────────────── */
.st-vantar { align-self: center; white-space: nowrap; }
.st-ruta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 9px 14px; border-radius: var(--radius-md);
  font-size: 13px; line-height: 1.45;
}
.st-ruta--gul { border: 1px solid var(--slapande-kant); background: var(--slapande); color: var(--warning); }
.st-ruta--bla { border: 1px solid var(--bla-ton); background: var(--bla-ton); color: var(--bla-hover); }
.st-ruta--rod { border: 1px solid var(--danger-soft); background: var(--danger-soft); color: var(--danger); }
.o5-trvy > #trContent > .st-ruta { margin: 0 0 14px; }

/* ── Dagens kort ─────────────────────────────────────────────────────────────────────────────────── */
.st-forslag {
  display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; padding: 10px 12px;
  border: 1px solid var(--slapande-kant); border-radius: var(--radius-md); background: var(--slapande); color: var(--warning);
  font-size: 13px; overflow-wrap: anywhere;
}
.st-forslag__knappar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.st-passnamn { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.st-marke {
  display: inline-flex; align-items: center; gap: 4px; min-height: 20px; padding: 0 7px; border-radius: 6px;
  background: var(--linje-rad); color: var(--grafit); font-size: 12px; font-weight: 500; white-space: nowrap;
}
.st-marke--andrad { background: var(--bla-ton); color: var(--bla-hover); }
.st-dagfot { padding: 8px 0; border-top: 1px solid var(--linje-rad); }
.st-franvaro-nekad { flex: 1 1 200px; text-align: right; }

/* ── Ändringshistoriken (5.8c) ───────────────────────────────────────────────────────────────────── */
.st-historik-plats { grid-column: 1 / -1; min-width: 0; }
.st-historik-plats:empty { display: none; }
.st-historik { overflow: hidden; }
.st-historik__rulla { overflow-x: auto; }
.st-historik__tabell { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 13px; }
.st-historik__tabell th {
  text-align: left; padding: 7px 12px; font-size: 12px; font-weight: 500; color: var(--dampad);
  border-bottom: 1px solid var(--linje); white-space: nowrap;
}
.st-historik__tabell td { padding: 6px 12px; border-bottom: 1px solid var(--linje-rad); vertical-align: top; }
.st-nw { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── Kortet «Arbetstid i dag» (s-1 mobil, s-3c dator) ─────────────────────────────────────────────── */
.st-kort { padding: 0; overflow: hidden; }
.st-kort__huvud {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--linje);
}
.st-kort__huvud > div { display: flex; flex-direction: column; min-width: 0; }
.st-kort__rubrik { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
/* Mobil: rutan, knappen och raden under varandra (facit s-1). */
.st-kort__kropp { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; }
.st-kort__rad { font-variant-numeric: tabular-nums; color: var(--grafit); }
.st-knapp {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; box-sizing: border-box;
  padding: 0 20px; border: 0; border-radius: var(--radius-lg); background: var(--bla); color: var(--kort);
  font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
}
.st-knapp:hover { background: var(--bla-hover); }
.st-knapp--ut, .st-knapp--ut:hover { background: var(--meny-markerad); }
.st-knapp:disabled { background: var(--sparrad); cursor: progress; }
.st-knapp__ikon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.st-snurra {
  width: 16px; height: 16px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--linje-falt);
  border-top-color: var(--kort); animation: spin 0.9s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .st-snurra { animation: none; } }
/* Dator: texterna till vänster, knappen till höger (minst 220 px; facit s-3c). */
@media (min-width: 1024px) {
  .st-kort__kropp {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-auto-flow: dense; align-items: center; gap: 8px 20px;
  }
  .st-kort__kropp > * { grid-column: 1; }
  .st-kort__kropp > .st-knapp { grid-column: 2; grid-row: 1 / span 3; width: auto; min-width: 220px; height: 44px; border-radius: var(--radius-md); font-size: 15px; }
}

/* En länk som knapp: «Föreslå sluttid», «Föreslå ändring». */
.st-lank {
  padding: 0; border: 0; background: transparent; color: var(--bla); font: inherit; font-weight: 600;
  white-space: nowrap; cursor: pointer;
}
.st-lank:hover { color: var(--bla-hover); text-decoration: underline; }

/* ── Förslagsbladet: nerifrån på mobil, dialogen i mitten på dator ─────────────────────────────────── */
.st-blad { display: flex; flex-direction: column; gap: 12px; }
.st-blad__rubrik { margin: 0; }
.st-blad__falt { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.st-blad__kommentar { resize: vertical; min-height: 64px; }
.st-blad__knappar { display: flex; gap: 10px; }
@media (min-width: 1024px) {
  .st-blad-overlay { align-items: center; }
  .st-blad { max-width: 480px; border-radius: var(--radius-lg); }
}

/* ── Portalens Tid (s-2, s-3b) ───────────────────────────────────────────────────────────────────── */
.status-chip.st-chip--bla { background: var(--bla-ton); color: var(--bla-hover); }
.st-tid-huvud { margin: 0 0 12px; }
.st-tid-huvud__dator { display: none; }
@media (min-width: 1024px) {
  .st-tid-huvud__mobil { display: none; }
  .st-tid-huvud__dator { display: inline; }
}
.st-lasd {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; box-sizing: border-box; padding: 0 8px;
  border: 1px solid var(--linje); border-radius: var(--radius-sm); background: var(--yta);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.st-passinfo { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 0; }
.st-passinfo__rad { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.st-phist { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.st-phist li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 4px 0; border-top: 1px solid var(--linje-rad); }
.st-besked { margin: 6px 0 0; }
.st-hinder { margin: 0 0 10px; padding: 9px 14px 9px 30px; border: 1px solid var(--slapande-kant); border-radius: var(--radius-md); background: var(--slapande); color: var(--warning); font-size: 13px; }

/* ── Attestantens flik «Tid» (s-5a dator, s-5b mobil) ─────────────────────────────────────────────── */
.tidattest { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tidattest__kort { padding: 0; overflow: hidden; }
.tidattest__huvud { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-bottom: 1px solid var(--linje); }
.tidattest__huvud--rad { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.tidattest__rubrik { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.tidattest__del { border-top: 1px solid var(--linje); }
.tidattest__huvud + .tidattest__del { border-top: 0; }
.tidattest__delrubrik { margin: 0; padding: 12px 18px 6px; font-size: 15px; font-weight: 600; }
.tidattest__veckohuvud { display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.tidattest__veckohuvud .tidattest__delrubrik { padding-left: 4px; padding-right: 4px; }
.tidattest__rulla { overflow-x: auto; }
.tidattest__tabell { width: 100%; border-collapse: collapse; font-size: 14px; }
.tidattest__tabell th {
  text-align: left; padding: 8px 18px; font-size: 12px; font-weight: 500; color: var(--dampad);
  border-bottom: 1px solid var(--linje); white-space: nowrap;
}
.tidattest__tabell td { padding: 9px 18px; border-bottom: 1px solid var(--linje-rad); vertical-align: middle; }
.tidattest__tabell tr[aria-current="true"] td { background: var(--bla-ton); }
.tidattest__namn { font-weight: 500; }
.tidattest__under { display: none; font-size: 13px; font-weight: 400; color: var(--dampad); }
.tidattest__hoger { text-align: right; white-space: nowrap; }
.tidattest__knappar { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.tidattest__lank {
  padding: 0; border: 0; background: transparent; color: var(--bla); font: inherit; font-weight: 600; cursor: pointer;
  white-space: nowrap; min-height: 32px;
}
.tidattest__lank:hover { color: var(--bla-hover); text-decoration: underline; }
.tidattest__inline { display: inline; margin-left: 4px; }
.tidattest__fot { margin: 0; padding: 10px 18px 14px; }
.tidattest__andrarad td { background: var(--yta); }
.tidattest__falt { display: grid; grid-template-columns: repeat(3, minmax(90px, 140px)); gap: 10px; margin: 4px 0 8px; }
.tidattest__falt .form-group { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 13px; }
.tidattest__andrafot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.tidattest__mobil { display: none; }
.tidattest__skarm { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; }
.tidattest__skarmhuvud { display: flex; align-items: center; justify-content: space-between; }
.tidattest__stort { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tidattest__dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 8px 0; font-size: 14px; }
.tidattest__dl dt { color: var(--dampad); }
.tidattest__dl dd { margin: 0; font-variant-numeric: tabular-nums; }
.tidattest__mobilknappar { display: flex; flex-direction: column; gap: 8px; }
.tidattest__mobilknappar .btn { min-height: 44px; }
.tidattest__fara { color: var(--danger); }
/* Mobil (s-5b): listan som kort, en rad per anställd med raden under namnet. */
@media (max-width: 1023px) {
  .tidattest__dator { display: none; }
  .tidattest__mobil { display: inline; }
  p.tidattest__mobil { display: block; }
  .tidattest__under { display: block; }
  .tidattest__tabell td { padding: 10px 14px; }
  .tidattest__falt { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ── Anställdkortet, del 7 (s-6a): gruppen «Tidbank och arbetstid» ─────────────────────────────────── */
.anst-tidbank { margin: 8px 0 0; padding: 12px 16px; border: 1px solid var(--linje); border-radius: var(--radius); min-width: 0; }
.anst-tidbank > legend { padding: 0 6px; font-weight: 600; }
.anst-tidbank[hidden] { display: none; }

/* ── Lön K5: rutan «Tidbank» i körningen (facit s-7a) ───────────────────── */
.lr-tidbank { display: flex; flex-direction: column; gap: 4px; }
.lr-tidbank h4 { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 650; color: var(--dampad); }
.lr-tidbank__falt { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.lr-tidbank__falt label { font-size: 12.5px; font-weight: 600; }
.lr-tidbank__rad { display: flex; gap: 8px; align-items: center; }
.lr-tidbank__input {
  width: 96px; min-height: 32px; padding: 4px 8px; font: inherit; font-variant-numeric: tabular-nums; text-align: right;
  background: var(--kort); color: var(--grafit); border: 1px solid var(--linje); border-radius: var(--radius-md);
}
.lr-tidbank__input:focus-visible { outline: 2px solid var(--bla); outline-offset: 1px; }
