/*
 * Plotercafé Recepten — the one stylesheet.
 *
 * Taken from the inventory app (C:\Repos\PlotercafeVoorraad, wwwroot/app.css), whose tokens and
 * components follow its docs/design/STIJLGIDS.md. Only what this app uses is here; add from there
 * rather than inventing. No Bootstrap, no framework, no icon font (CLAUDE.md).
 */

/* ── Fonts (self-hosted IBM Plex, SIL OFL — see fonts/LICENSE.txt) ──────────────────────────── */
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/IBMPlexSans-Regular.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/IBMPlexSans-Medium.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/IBMPlexSans-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/IBMPlexSans-Bold.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/IBMPlexMono-Medium.woff2') format('woff2'); }

/* ── Tokens (STIJLGIDS §2, §4 of the inventory app) ─────────────────────────────────────────── */
:root {
    --navy: #14213D;
    --bg: #EEF1F5;
    --surface: #FFFFFF;
    --border: #D5DBE5;
    --ink: #14213D;
    --ink-2: #3A4966;
    --ink-3: #5B6B85;
    --ink-4: #8A97AD;
    --ink-on-navy: #AEB8CC;
    --amber: #E9A23B;
    --green: #2A7C4E; /* 5.13:1 for white text */
    --slate: #5B6B85;
    --r: 6px;
    --r-card: 8px;
    --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
}

/* ── Base ───────────────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.4; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1:focus { outline: none; }
a { color: var(--ink); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 4px solid var(--amber); outline-offset: 3px; }
.eyebrow { font: 500 14px var(--mono); letter-spacing: .08em; color: var(--ink-3); text-transform: uppercase; }
.help { font-size: 19px; color: var(--ink-2); line-height: 1.45; }
.link { font-size: 16px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 4px; }
.muted { color: var(--ink-3); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Big buttons (sign-in) */
.btn { height: 72px; border-radius: var(--r); font-size: 24px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 0 28px; text-decoration: none; }
.btn-primary { background: var(--navy); color: #fff; }
.btn[disabled] { opacity: .45; cursor: default; }

/* Blazor's own error bar and validation */
#blazor-error-ui { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; background: var(--surface); border-top: 4px solid var(--slate); padding: 12px 20px; font-size: 17px; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 10px; }
.validation-message { color: var(--ink-2); font-size: 15px; }
.invalid { border-color: var(--slate) !important; }

/* ── Sign-in and error pages (MainLayout) ───────────────────────────────────────────────────── */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 32px 40px; width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 18px; }
.auth-card h1 { font-size: 32px; }
.auth-card .field input { height: 56px; font-size: 20px; }
.notice { border: 2px solid var(--slate); border-radius: var(--r); padding: 12px 16px; font-size: 17px; color: var(--ink-2); background: var(--surface); margin: 0; }
.notice.ok { border-color: var(--green); }
@media (max-width: 640px) {
    .auth { padding: 16px; }
    .auth-card { padding: 24px 20px; }
}

/* ── Forms ──────────────────────────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field input[type=search], .field input:not([type]), .field select, .field textarea {
    font: inherit; font-size: 17px; height: 44px; padding: 0 12px; border: 2px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--ink); width: 100%;
}
.field textarea { height: auto; min-height: 80px; padding: 10px 12px; }
.field .hint { font-size: 14px; color: var(--ink-3); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--navy); }

/* ── Shell (AppLayout) ──────────────────────────────────────────────────────────────────────── */
/* Sidebar on the left, as in the inventory and budgetboek apps: 232 px with symbol and name from
   1280 px, 68 px with only the symbols from 641 px (title + aria-label name them), the compact bar
   below. The sidebar sticks to the viewport; the page scrolls beside it. minmax(0, 1fr): a wide
   table cannot push the page under or past the sidebar. */
.shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.shell-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 20px 12px; background: var(--navy); color: #fff; }
.shell-side .brand { font: 500 13px var(--mono); letter-spacing: .08em; color: var(--ink-on-navy); text-transform: uppercase; padding: 0 12px 18px; }
.shell-side a, .shell-side button { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--r); color: #fff; text-decoration: none; font-family: inherit; font-size: 15px; font-weight: 600; background: none; border: none; width: 100%; text-align: left; cursor: pointer; }
.shell-side a:hover, .shell-side button:hover { background: rgba(255,255,255,.1); }
.shell-side a:focus-visible, .shell-side button:focus-visible { outline: 4px solid var(--amber); outline-offset: -4px; }
.shell-side a.active { background: var(--amber); color: var(--navy); }
.shell-side svg { flex: 0 0 auto; }
.shell-side .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-side .spacer { margin: auto 4px 8px; padding-top: 12px; border-bottom: 1px solid rgba(255,255,255,.18); }
.shell-side form { display: block; }
@media (max-width: 1279px) {
    .shell { grid-template-columns: 68px minmax(0, 1fr); }
    .shell-side { padding: 16px 12px; align-items: center; }
    .shell-side .brand, .shell-side .label { display: none; }
    .shell-side a, .shell-side button { justify-content: center; padding: 0; width: 44px; }
    .shell-side .spacer { align-self: stretch; }
}

/* Compact bar on a phone: one line — brand, the current page, Menu. The links fold open under it as
   a list over the page (js/menu.js closes it after a choice). */
.shell-compact { display: none; }
@media (max-width: 640px) {
    .shell { display: flex; flex-direction: column; }
    .shell-side { display: none; }
    .shell-compact { display: flex; align-items: center; gap: 10px; position: relative; min-height: 52px; padding: 0 8px 0 16px; background: var(--navy); color: #fff; }
    .shell-compact .brand { font: 500 12px var(--mono); letter-spacing: .08em; color: var(--ink-on-navy); text-transform: uppercase; white-space: nowrap; }
    .shell-current { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .shell-menu summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: var(--r); font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; }
    .shell-menu summary::-webkit-details-marker { display: none; }
    .shell-menu summary:focus-visible { outline: 4px solid var(--amber); outline-offset: -4px; }
    .shell-menu[open] summary { background: rgba(255,255,255,.14); }
    .shell-menu-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; display: flex; flex-direction: column; gap: 2px; padding: 8px 8px 12px; background: var(--navy); border-top: 1px solid rgba(255,255,255,.18); box-shadow: 0 8px 18px rgba(20,33,61,.25); }
    .shell-menu-list a, .shell-menu-list button { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: var(--r); color: #fff; text-decoration: none; font-size: 16px; font-weight: 600; background: none; border: none; width: 100%; text-align: left; font-family: inherit; }
    .shell-menu-list a.active { background: var(--amber); color: var(--navy); }
    .shell-menu-list .spacer { height: 1px; margin: 6px 4px; background: rgba(255,255,255,.18); }
    .shell-menu-list form { display: block; }
    .shell-menu-list svg { display: none; }
}
.shell-main { flex: 1; min-width: 0; padding: 24px 28px 48px; max-width: 1180px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.shell-main h1 { font-size: 30px; }
.shell-main h2 { font-size: 21px; }
.shell-main p { margin: 0; }
@media (max-width: 640px) {
    .shell-main { padding: 16px 16px 40px; }
}

/* ── Building blocks ────────────────────────────────────────────────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.b { height: 44px; padding: 0 16px; border-radius: var(--r); font-size: 16px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; border: 2px solid var(--navy); background: var(--surface); color: var(--navy); white-space: nowrap; }
.b.primary { background: var(--navy); color: #fff; }
.b.quiet { border-color: var(--border); }
.b[disabled] { opacity: .45; cursor: default; }
.b.small { height: 34px; padding: 0 10px; font-size: 14px; }
.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.toolbar .field { min-width: 180px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
@media (max-width: 640px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; font-size: 16px; }
.table th { text-align: left; font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--border); background: #F7F9FB; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.inactive td { color: var(--ink-3); }
.table a { font-weight: 600; }
.tag { display: inline-block; font: 500 12px var(--mono); letter-spacing: .04em; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--border); color: var(--ink-2); background: var(--bg); white-space: nowrap; vertical-align: middle; }
.tag.ok { border-color: var(--green); color: var(--green); background: var(--surface); }
.tag.off { border-style: dashed; color: var(--ink-3); }
.table td .tag { margin-left: 8px; }

/* ── Recipes (Recepten, Recept, Recept bewerken, Groepen) ───────────────────────────────────── */
/* Nakijken: a neutral slate tag with a "!" and the word — no red, no alarm (STIJLGIDS §1, §6). */
.tag.review { border: 2px solid var(--slate); color: var(--ink); background: var(--surface); font-weight: 500; }
.recipe-group { display: flex; flex-direction: column; gap: 10px; }
.recipe-group h2 { display: flex; align-items: center; gap: 10px; }

/* Recept: the head as label–value pairs; on a phone the label goes above its value. */
.facts { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px 18px; margin: 0; }
.facts dt { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.facts dd { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.facts .notes { white-space: pre-line; display: block; }
.facts-note { flex-basis: 100%; font-size: 15px; color: var(--ink-2); }
@media (max-width: 640px) {
    .facts { grid-template-columns: 1fr; gap: 4px; }
    .facts dd { margin-bottom: 10px; }
}

/* Recept bewerken: a drop-down with its button beside it. */
.field-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.field-row select { flex: 1; min-width: 220px; }
.field input[aria-invalid=true] { border-color: var(--slate); }

/* Groepen: every row is its own small form. */
.table.groups td { vertical-align: middle; }
.table.groups input { font: inherit; font-size: 16px; height: 38px; padding: 0 10px; border: 2px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--ink); width: 100%; max-width: 320px; }
.table.groups input[type=number] { max-width: 96px; }
@media (max-width: 640px) {
    .table.groups thead { display: none; }
    .table.groups tr { display: grid; grid-template-columns: 1fr 96px; gap: 6px 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
    .table.groups td { padding: 0; border: 0; }
    .table.groups td:nth-child(3), .table.groups td:nth-child(4) { grid-column: 1 / -1; }
}

/* Recept bewerken: one form, three parts (decision 29). */
.recipe-form { display: flex; flex-direction: column; gap: 18px; }
.recipe-form > .panel { gap: 14px; }

/* A square button with a symbol: omhoog, omlaag, weghalen. The label is in aria-label and title. */
.icon-b { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--navy); }
.icon-b[disabled] { opacity: .35; cursor: default; }
.row-tools { display: flex; gap: 6px; flex: 0 0 auto; }
.line-no { flex: 0 0 auto; min-width: 26px; font: 500 14px var(--mono); color: var(--ink-3); text-align: right; padding-top: 10px; }

/* Dit heb ik nodig: every line a small block, separated by a rule. */
.lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.line { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.line:first-child { padding-top: 0; }
.line-head { display: flex; gap: 10px; align-items: flex-start; }
.line-head .line-no { padding-top: 12px; }
.line-kind, .line-body, .line-state { margin-left: 36px; }
.line input[type=text], .line input[type=search], .line select, .steps-edit textarea {
    font: inherit; font-size: 16px; height: 44px; padding: 0 12px; border: 2px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--ink); width: 100%;
}
.line input.line-text { flex: 1; min-width: 0; font-size: 18px; }
.line-kind { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.line-kind .check { font-size: 15px; }
.line-body { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.line-link { display: flex; gap: 6px 12px; align-items: baseline; flex-wrap: wrap; }
.line-state { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; font-size: 15px; color: var(--ink-2); }
.line input[aria-invalid=true] { border-color: var(--slate); }

/* The product search: a field with its results as a list of buttons under it. */
.picker { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.picker-list { list-style: none; margin: 0; padding: 0; width: 100%; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); max-height: 320px; overflow-y: auto; }
.picker-list li + li { border-top: 1px solid var(--border); }
.picker-list button { width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; text-align: left; font-size: 16px; }
.picker-list button:hover { background: var(--bg); }
.picker-list button:focus-visible { outline-offset: -4px; }
.picker-empty { font-size: 15px; }

/* An amount with its unit behind it. */
.amount { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.amount input[type=text] { width: 120px; }
.amount-unit { font-weight: 600; color: var(--ink-2); min-width: 3ch; }
.amount .validation-message { flex-basis: 100%; }

.paste { border-top: 1px solid var(--border); padding-top: 14px; }

/* Stappen on Recept bewerken. */
.steps-edit { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps-edit li { display: flex; gap: 10px; align-items: flex-start; }
.steps-edit textarea { flex: 1; min-width: 0; height: auto; min-height: 64px; padding: 10px 12px; resize: vertical; }

/* Recept: Dit heb ik nodig as the guest reads it, and the steps numbered. */
.needs { list-style: none; margin: 0; gap: 0; }
.needs li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.needs li:first-child { padding-top: 0; }
.needs li:last-child { border-bottom: 0; padding-bottom: 0; }
.need-text { font-size: 20px; }
.need-count { font-size: 15px; color: var(--ink-3); }
.need-count a { color: var(--ink-3); }
.need-state { flex-basis: 100%; display: flex; gap: 8px; align-items: center; font-size: 15px; color: var(--ink-2); }
.steps { margin: 0; padding: 18px 20px 18px 48px; gap: 12px; }
.steps li { font-size: 18px; white-space: pre-line; padding-left: 4px; }

@media (max-width: 640px) {
    .line-kind, .line-body, .line-state { margin-left: 0; }
    .line-head { flex-wrap: wrap; }
    .line-head .line-text { flex-basis: calc(100% - 36px); }
    .line-head .row-tools { margin-left: 36px; }
    .steps-edit li { flex-wrap: wrap; }
    .steps-edit textarea { flex-basis: calc(100% - 36px); }
    .steps-edit .row-tools { margin-left: 36px; }
}
