/* =====================================================================
   Sunice — Digitaal Pakbon Systeem
   Design system  ·  "van oven naar vriezer naar deur"
   Palette + type pulled from the Sunice bakery logo (sun + ice).
   ===================================================================== */

:root {
  /* --- Brand palette ------------------------------------------------ */
  --sky:      #1FA3E0;   --sky-600: #1487C0;  --sky-700: #0F6F9E;
  --sun:      #F6B23C;   --sun-600: #E2941A;  --sun-700: #C97E12;
  --ice:      #43C6D6;   --ice-600: #2BA9B9;
  --route:    #3F6FD6;
  --fresh:    #25B36B;
  --coral:    #ED5B4F;   --coral-600: #D8412F;
  --steel:    #44638C;   /* the logo's letter blue */
  --ink:      #14233E;
  --ink-soft: #3C4D6B;
  --muted:    #6E83A2;

  /* --- Surfaces ----------------------------------------------------- */
  --snow:    #FFFFFF;
  --frost:   #EAF4FB;
  --frost-2: #DCEDF8;
  --line:    #D8E7F3;
  --line-soft: #ECF3FA;

  /* --- Shape & depth ------------------------------------------------ */
  --r-xl: 26px; --r-lg: 20px; --r-md: 13px; --r-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20,60,110,.06), 0 2px 6px rgba(20,60,110,.05);
  --shadow:    0 14px 34px -16px rgba(16,73,122,.32);
  --shadow-lg: 0 28px 60px -24px rgba(16,73,122,.40);
  --ring: 0 0 0 4px rgba(31,163,224,.28);

  /* --- Type --------------------------------------------------------- */
  --font-display: 'Fredoka', 'Hanken Grotesk', system-ui, sans-serif;
  --font-ui: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Space Mono', ui-monospace, 'SFMono-Regular', monospace;
}

/* --- Status tone helpers (used by .pill--x, .statustrack) ----------- */
.tone-sun   { --tone: var(--sun);   --tone-ink: var(--sun-700); }
.tone-sky   { --tone: var(--sky);   --tone-ink: var(--sky-700); }
.tone-ice   { --tone: var(--ice);   --tone-ink: var(--ice-600); }
.tone-route { --tone: var(--route); --tone-ink: var(--route); }
.tone-fresh { --tone: var(--fresh); --tone-ink: #1B8A52; }
.tone-coral { --tone: var(--coral); --tone-ink: var(--coral-600); }

/* =====================================================================
   Reset / base
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(1100px 520px at 88% -8%, rgba(246,178,60,.16), transparent 60%),
    radial-gradient(900px 600px at -6% 4%, rgba(67,198,214,.16), transparent 55%),
    linear-gradient(180deg, var(--frost) 0%, #F4FAFD 38%, #FFFFFF 100%);
  background-attachment: fixed;
  min-height: 100vh;
}
a { color: var(--sky-700); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; color: var(--ink); line-height: 1.12; letter-spacing: -.01em; }

.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.tnum { font-variant-numeric: tabular-nums; }

/* =====================================================================
   Snow-cap motif — the iced top edge from the logo letters
   Drop .snowcap on any element; it grows a scalloped white bottom rim.
   ===================================================================== */
.snowcap { position: relative; }
.snowcap::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 13px;
  background:
    radial-gradient(11px 13px at 12px 0, var(--snow) 96%, transparent 100%) repeat-x;
  background-size: 26px 13px;
  filter: drop-shadow(0 2px 0 rgba(255,255,255,.5));
}

/* =====================================================================
   Buttons
   ===================================================================== */
.btn {
  --b: var(--sky);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--font-ui); font-weight: 700; font-size: .96rem;
  line-height: 1; letter-spacing: .005em;
  padding: .72rem 1.15rem; border: 0; border-radius: 999px;
  background: var(--b); color: #fff;
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--b) 70%, #001a33);
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn--sun   { --b: var(--sun); color: #3a2606; }
.btn--sun:hover { background: var(--sun-600); }
.btn--sky:hover { background: var(--sky-600); }
.btn--fresh { --b: var(--fresh); }
.btn--danger { --b: var(--coral); }
.btn--ghost {
  background: #fff; color: var(--ink); box-shadow: none;
  border: 1.5px solid var(--line);
}
.btn--ghost:hover { border-color: var(--sky); background: var(--frost); }
.btn--lg { font-size: 1.12rem; padding: 1rem 1.5rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* =====================================================================
   Pills (status)
   ===================================================================== */
.pill {
  display: inline-flex; align-items: center; gap: .45em;
  font-size: .76rem; font-weight: 700; letter-spacing: .01em;
  padding: .3em .7em .3em .55em; border-radius: 999px;
  background: color-mix(in srgb, var(--tone, var(--steel)) 14%, #fff);
  color: var(--tone-ink, var(--steel));
  border: 1px solid color-mix(in srgb, var(--tone, var(--steel)) 26%, #fff);
  white-space: nowrap;
}
.pill__dot { width: .5em; height: .5em; border-radius: 50%; background: var(--tone, var(--steel)); }
.pill--sun   { --tone: var(--sun);   --tone-ink: var(--sun-700); }
.pill--sky   { --tone: var(--sky);   --tone-ink: var(--sky-700); }
.pill--ice   { --tone: var(--ice);   --tone-ink: var(--ice-600); }
.pill--route { --tone: var(--route); --tone-ink: var(--route); }
.pill--fresh { --tone: var(--fresh); --tone-ink: #1B8A52; }
.pill--coral { --tone: var(--coral); --tone-ink: var(--coral-600); }

/* =====================================================================
   Cards
   ===================================================================== */
.card {
  background: var(--snow);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.05rem 1.25rem; border-bottom: 1px solid var(--line-soft);
}
.card__head h2, .card__head h3 { font-size: 1.06rem; }
.card__body { padding: 1.25rem; }

/* =====================================================================
   Forms
   ===================================================================== */
.field { margin-bottom: 1rem; }
.label {
  display: block; font-size: .8rem; font-weight: 700; color: var(--ink-soft);
  margin-bottom: .35rem; letter-spacing: .01em;
}
.input, .select, textarea.input {
  width: 100%; font: inherit; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: .7rem .85rem; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--sky); box-shadow: var(--ring);
}
.input::placeholder { color: #9DB1C9; }
.hint { font-size: .78rem; color: var(--muted); margin-top: .3rem; }
.field--row { display: flex; gap: .9rem; flex-wrap: wrap; margin-bottom: 1rem; }
.field--row > * { flex: 1 1 160px; }

/* =====================================================================
   Tables (back-office order/customer lists)
   ===================================================================== */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
  text-align: left; font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
  padding: .6rem .9rem; border-bottom: 2px solid var(--line-soft);
}
.table td { padding: .8rem .9rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--frost); }
.table a.rowlink { color: var(--ink); font-weight: 600; }

/* =====================================================================
   Status track — the oven→vriezer→deur temperature line
   ===================================================================== */
.statustrack { display: flex; align-items: flex-start; gap: 0; width: 100%; }
.statustrack .step {
  flex: 1; position: relative; text-align: center; min-width: 0;
}
.statustrack .step::before {
  content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 3px;
  background: var(--line); z-index: 0;
}
.statustrack .step:first-child::before { display: none; }
.statustrack .step .dot {
  position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; border: 3px solid var(--line); margin: 0 auto 6px;
  display: grid; place-items: center;
}
.statustrack .step .lbl { font-size: .72rem; color: var(--muted); font-weight: 600; }
.statustrack .step.done .dot { background: var(--tone, var(--sky)); border-color: var(--tone, var(--sky)); }
.statustrack .step.done::before { background: var(--tone, var(--sky)); }
.statustrack .step.done .lbl { color: var(--ink); }
.statustrack .step.current .dot {
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--tone, var(--sky)) 22%, transparent);
}

/* =====================================================================
   Flash toasts
   ===================================================================== */
.flashes { position: fixed; top: 14px; right: 14px; z-index: 90; display: flex; flex-direction: column; gap: .5rem; max-width: min(92vw, 380px); }
.flash {
  background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--sky);
  border-radius: var(--r-md); padding: .8rem 1rem; box-shadow: var(--shadow);
  font-size: .9rem; animation: flashIn .35s ease both;
}
.flash--ok    { border-left-color: var(--fresh); }
.flash--error { border-left-color: var(--coral); }
.flash--info  { border-left-color: var(--sky); }
@keyframes flashIn { from { opacity: 0; transform: translateY(-8px); } }

/* =====================================================================
   Utilities
   ===================================================================== */
.stack > * + * { margin-top: var(--gap, 1rem); }
.row { display: flex; gap: 1rem; align-items: center; }
.row--between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.center { text-align: center; }
.eyebrow {
  font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--sky-700);
}
.hr { height: 1px; background: var(--line-soft); border: 0; margin: 1.1rem 0; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.empty .big { font-size: 2.4rem; margin-bottom: .4rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition: none !important; }
}
