/* ==========================================================================
   tid.bullskiten.se – designsystem, riktning C · Retro motorsport
   Utdraget ur design-canvasens artboard Retro.dc.html (2026-09-21).
   Värdena här är källan. Hitta inte på nya färger, radier eller skuggor.

   Typsnitt laddas lokalt via static/css/fonts.css (@font-face, woff2).
   Ingen extern Google Fonts-länk -> ren CSP.
   ========================================================================== */

:root {
  /* Färger */
  --cream: #F2E8D0;        /* sidans grund */
  --surface: #F9F2E0;      /* kort, ljusare yta */
  --ink: #16120D;          /* svart: text, ramar, skuggor */
  --yellow: #F2C200;       /* nummerplåtsgul accent */
  --orange: #E07A1F;
  --red: #C93A17;          /* rödorange */
  --muted: #5A5144;        /* dämpad text på kräm */
  --muted-on-ink: #CFC4AB; /* dämpad text på svart */
  --ghost-on-ink: #3A332A; /* stor spöktext i footern */

  /* Typsnitt */
  --font-display: 'Bowlby One', Impact, sans-serif;
  --font-body: 'Familjen Grotesk', 'Trebuchet MS', sans-serif;

  /* Form */
  --border: 3px solid var(--ink);
  --border-heavy: 4px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);       /* hård, ingen blur */
  --shadow-heavy: 6px 6px 0 var(--ink);
  --radius-btn: 12px;
  --radius-card: 16px;
  --radius-hero-card: 22px;
  --radius-plate: 9px;
  --radius-pill: 999px;

  /* Layout: mobil först, artboarden är 390 px bred */
  --gutter: 20px;
  --section-gap: 52px;
}

/* Kontrastregel: mörk text på gult/orange. Krämvit text ENDAST på --ink eller --red. */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.45;
}

a { color: var(--ink); text-underline-offset: 4px; }
a:hover { color: var(--red); }
button { font: inherit; cursor: pointer; }

/* --- Rubriker ------------------------------------------------------------ */
h1, h2, .display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;            /* Bowlby One har bara en vikt */
  text-transform: uppercase;
}
h1 { font-size: 46px; line-height: 1.02; }
h2 { font-size: 32px; line-height: 1.05; }
.display-time { font-family: var(--font-display); font-size: 68px; line-height: 1; }
.time { font-family: var(--font-display); font-size: 24px; }

/* --- Toppbar + racingränder --------------------------------------------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px var(--gutter);
  background: var(--ink); color: var(--cream);
}
.topbar .brand { font-family: var(--font-display); font-size: 24px; letter-spacing: 0.02em; }
.menu-btn {
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--yellow); color: var(--ink);
}

/* Tre ränder: gul / orange / röd. 8 px som avdelare, 14 px + skew som hero-band. */
.stripes { display: flex; flex-direction: column; }
.stripes > i { display: block; height: 8px; }
.stripes > i:nth-child(1) { background: var(--yellow); }
.stripes > i:nth-child(2) { background: var(--orange); }
.stripes > i:nth-child(3) { background: var(--red); }
.stripes--band { transform: skewY(-5deg); }
.stripes--band > i { height: 14px; }
/* Markup: <div class="stripes" aria-hidden="true"><i></i><i></i><i></i></div> */

/* --- Knappar ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; height: 52px; padding: 0 22px;
  border: var(--border); border-radius: var(--radius-btn);
  background: var(--yellow); color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 16px; font-weight: 700; text-decoration: none;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn--on-ink { border: 0; box-shadow: none; }          /* gul knapp på svart yta */
.btn--danger { background: var(--red); color: var(--cream); }
.link-strong { font-size: 16px; font-weight: 700; }

/* --- Piller: etiketter och flikar ---------------------------------------- */
.eyebrow {
  display: inline-block; padding: 4px 10px;
  border: 2px solid var(--ink); border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
.tab {
  height: 46px; padding: 0 14px;
  border: var(--border); border-radius: var(--radius-pill);
  background: transparent; color: var(--ink);
  font-size: 15px; font-weight: 700;
}
.tab[aria-selected="true"], .tab.is-active { background: var(--ink); color: var(--cream); }
.chip {
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: var(--ink); color: var(--cream);
  font-size: 13px; font-weight: 600;
}

/* --- Kort ---------------------------------------------------------------- */
.card {
  padding: 16px;
  border: var(--border); border-radius: var(--radius-card);
  background: var(--surface); box-shadow: var(--shadow);
}
.card--plate {                 /* stort nummerplåtskort, t.ex. "Senaste varv" */
  padding: 20px 22px;
  border: var(--border-heavy); border-radius: var(--radius-hero-card);
  background: var(--yellow); box-shadow: var(--shadow-heavy);
}
.step-nr {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--cream);
  font-family: var(--font-display); font-size: 18px;
}

/* --- Nummerplåt (placering, plopp-nummer) -------------------------------- */
.plate {
  min-width: 46px; height: 38px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border: var(--border); border-radius: var(--radius-plate);
  background: var(--surface);
  font-family: var(--font-display); font-size: 18px;
}
.plate--first { background: var(--yellow); }

/* --- Listrad med streckad avdelare ---------------------------------------- */
.row {
  display: grid; grid-template-columns: 60px 1fr auto; align-items: center;
  min-height: 64px; border-bottom: 2px dashed var(--ink);
}
.row .name { font-size: 18px; font-weight: 700; }
.row .sub { font-size: 13px; font-weight: 500; color: var(--muted); }

/* --- Stapel (flest varv) -------------------------------------------------- */
.bar {
  height: 14px; border: var(--border); border-radius: var(--radius-pill);
  background: var(--surface);
}
.bar > span { display: block; height: 8px; border-radius: var(--radius-pill); background: var(--red); }

/* --- Footer --------------------------------------------------------------- */
.footer { padding: 32px var(--gutter) 28px; background: var(--ink); color: var(--cream); }
.footer .ghost { font-family: var(--font-display); font-size: 40px; line-height: 1; color: var(--ghost-on-ink); }
.footer .small { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--muted-on-ink); }

/* ==========================================================================
   LUGNA VYER: admin, tabeller, statistik
   Princip: retro-uttrycket bärs av toppbar, rubriker, plåtar och ränder.
   Täta vyer hålls i kräm + svart med Familjen Grotesk. Inga offset-skuggor
   på tabeller, ingen Bowlby One i celler (undantag: plopp-nummer som .plate).
   ========================================================================== */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th {
  text-align: left; padding: 10px 8px;
  border-bottom: var(--border);
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.table td { padding: 12px 8px; border-bottom: 1px solid rgba(22, 18, 13, 0.25); }
.table-wrap { overflow-x: auto; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 700; }
.input {
  height: 52px; padding: 0 14px;
  border: var(--border); border-radius: var(--radius-btn);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 17px;
}
.input:focus-visible, .btn:focus-visible, .tab:focus-visible {
  outline: 3px solid var(--red); outline-offset: 2px;
}
.input--mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.04em; } /* MAC, reservkod */

.status { padding: 3px 9px; border: 2px solid var(--ink); border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; }
.status--i_lager   { background: var(--surface); }
.status--utskriven { background: var(--yellow); }
.status--aktiverad { background: var(--ink); color: var(--cream); }
.status--sparrad   { background: var(--red); color: var(--cream); }

/* ==========================================================================
   UTSKRIFTSBLAD (A5 stående)
   ========================================================================== */
@page { size: A5 portrait; margin: 12mm; }
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .sheet { border: var(--border-heavy); border-radius: 0; box-shadow: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* Bladet ska tåla svartvit skrivare: ränderna blir tre gråtoner, all text är
   svart på vitt/kräm, QR-koden är alltid svart på vit med tyst zon runt om. */
.sheet .plopp-nr { font-family: var(--font-display); font-size: 56px; line-height: 1; }
.sheet .qr { background: #fff; padding: 4mm; border: var(--border); display: inline-block; }
.sheet .reserve-code { font-family: ui-monospace, Menlo, monospace; font-size: 22px; font-weight: 700; letter-spacing: 0.12em; }
