/* "Line cook glass" — dark kitchen theme (easier on the eyes/glare in a
   working kitchen than the original warm-daylight version), CSS-only glass
   (no WebGL). Deliberately distinct from dashboard-v2's "cast iron" theme —
   same frosted-glass language, just re-themed dark instead of cream. */

:root {
    --flow-bg: #15110d;
    --flow-bg-2: #201810;
    --flow-surface: rgba(255, 255, 255, 0.06);
    --flow-surface-solid: #241d17;
    --flow-ink: #f3ede4;
    --flow-ink-muted: #a89d8c;
    --flow-accent: #d9480f;
    --flow-accent-ink: #fff8f3;
    --flow-go: #43a565;
    --flow-stop: #ef5350;
    --flow-hold: #e0ab4c;
    --flow-border: rgba(255, 255, 255, 0.10);
    --flow-glass-border: rgba(255, 255, 255, 0.12);
    --flow-glass-btn-bg: rgba(255, 255, 255, 0.05);
    --flow-glass-btn-active: rgba(255, 255, 255, 0.14);
    --flow-radius: 22px;
    --flow-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

body.flow {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--flow-ink);
    background: radial-gradient(120% 140% at 10% 0%, var(--flow-bg-2), var(--flow-bg) 55%);
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

/* Soft colour behind the frosted glass — without this, backdrop-filter blur
   has nothing but flat dark to blur and every "glass" surface just reads as
   plain charcoal. These sit fixed behind all content on every flow page —
   on a dark background the warm ember tones read even richer than on cream. */
body.flow::before,
body.flow::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    filter: blur(70px);
    z-index: 0;
    pointer-events: none;
}
body.flow::before {
    width: 340px;
    height: 340px;
    top: -100px;
    right: -80px;
    background: radial-gradient(circle, rgba(217, 72, 15, 0.35), transparent 70%);
}
body.flow::after {
    width: 300px;
    height: 300px;
    bottom: -80px;
    left: -80px;
    background: radial-gradient(circle, rgba(217, 164, 65, 0.25), transparent 70%);
}

.flow-title, .flow-step-num {
    font-family: 'Fraunces', Georgia, serif;
}

.flow-shell {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0 0 96px;
}

/* Signin screens (pick-kitchen, staff-pin) centre their single card instead
   of pinning it to the top, so there's no dead space on a phone/kiosk.
   .flow-content normally has flex:1 so it always fills the remaining height —
   that has to be turned off here too, or justify-content has nothing to work
   with because the content block is already stretched to fill the viewport. */
body.flow-signin .flow-shell {
    justify-content: center;
    padding-bottom: 40px;
}
body.flow-signin .flow-content {
    flex: none;
}

/* Progress rail — tappable dots pinned at top */
.flow-rail {
    display: flex;
    gap: 6px;
    padding: 18px 20px 10px;
    position: sticky;
    top: 0;
    background: linear-gradient(var(--flow-bg), rgba(21, 17, 13, 0.85) 80%, transparent);
    z-index: 10;
}
.flow-rail a.dot {
    flex: 1;
    height: 6px;
    border-radius: 4px;
    background: var(--flow-border);
    text-decoration: none;
}
.flow-rail a.dot.done { background: var(--flow-go); }
.flow-rail a.dot.current { background: var(--flow-accent); }

.flow-header {
    padding: 8px 24px 4px;
}
.flow-header .kitchen {
    color: var(--flow-ink-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.flow-header .flow-title {
    font-size: 32px;
    font-weight: 600;
    margin: 4px 0 0;
}

.flow-content {
    padding: 12px 20px 20px;
    flex: 1;
}

/* Glass card — the signature surface */
.flow-card {
    background: var(--flow-surface);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid var(--flow-glass-border);
    border-radius: var(--flow-radius);
    box-shadow: var(--flow-shadow);
    padding: 20px;
    margin-bottom: 16px;
}
.flow-card + .flow-card { margin-top: 0; }
.flow-card h2 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--flow-ink-muted);
    margin: 0 0 12px;
}

.flow-badge {
    display: inline-block;
    font-size: 12px;
    padding: 3px 9px;
    border-radius: 100px;
    background: rgba(217, 72, 15, 0.18);
    color: var(--flow-accent);
    margin-left: 8px;
}
.flow-badge.warn { background: rgba(224, 171, 76, 0.20); color: var(--flow-hold); }
.flow-badge.stop { background: rgba(239, 83, 80, 0.20); color: var(--flow-stop); }
.flow-badge.go { background: rgba(67, 165, 101, 0.20); color: var(--flow-go); }

/* Item rows (prep list, checklist items) */
.flow-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--flow-border);
}
.flow-item:last-child { border-bottom: none; }
.flow-item input[type="checkbox"] {
    width: 26px;
    height: 26px;
    accent-color: var(--flow-go);
}
.flow-item .name { flex: 1; font-size: 16px; }
.flow-item input[type="number"], .flow-item input[type="text"] {
    width: 90px;
    font-size: 16px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--flow-border);
    background: var(--flow-surface-solid);
    color: var(--flow-ink);
}
.flow-hint {
    font-size: 12px;
    color: var(--flow-ink-muted);
    display: block;
    margin-top: 2px;
}

/* Native form controls default to light-mode UA styling regardless of page
   theme, and several views set inline border-color via var(--flow-border)
   but never set background/text colour — without this they'd render as
   glaring white boxes on every dark card. */
body.flow input[type="text"],
body.flow input[type="number"],
body.flow input[type="date"],
body.flow input[type="time"],
body.flow select,
body.flow textarea {
    background: var(--flow-surface-solid);
    color: var(--flow-ink);
}
body.flow select option {
    background: var(--flow-surface-solid);
    color: var(--flow-ink);
}
body.flow ::placeholder {
    color: var(--flow-ink-muted);
    opacity: 0.8;
}

textarea.flow-textarea {
    width: 100%;
    min-height: 120px;
    font-family: inherit;
    font-size: 16px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--flow-border);
    resize: vertical;
}

/* Bottom action bar — persistent, one primary action */
.flow-actionbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
    background: var(--flow-surface);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
    border-top: 1px solid var(--flow-glass-border);
    max-width: 640px;
    margin: 0 auto;
}
.flow-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 0 24px;
    border-radius: 16px;
    border: none;
    font-size: 17px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
}
.flow-btn.primary {
    flex: 1;
    background: var(--flow-accent);
    color: var(--flow-accent-ink);
}
.flow-btn.secondary {
    background: transparent;
    color: var(--flow-ink-muted);
}

/* Tile row — only used on the "get on with day" hub.
   Each category is one fixed-height horizontally-scrolling row (swipe for
   more tiles) instead of a vertical grid, so adding tiles/categories grows
   the page far less — the whole hub stays close to one screen. */
.flow-section-title {
    font-family: 'Fraunces', serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--flow-ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 14px 4px 8px;
}
.flow-section-title:first-child { margin-top: 4px; }
.flow-tiles {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scroll-padding-left: 4px;
    padding: 2px 4px 10px;
    margin: 0 -4px 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.flow-tiles::-webkit-scrollbar { display: none; }
.flow-tile-wrap {
    position: relative;
    flex: 0 0 78px;
    scroll-snap-align: start;
}
.flow-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 10px 6px 8px;
    min-height: 78px;
    width: 78px;
    border-radius: 16px;
    background: var(--flow-surface);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid var(--flow-glass-border);
    text-decoration: none;
    color: var(--flow-ink);
    box-shadow: var(--flow-shadow);
}
.flow-tile .label {
    font-weight: 600;
    font-size: 11px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.flow-tile .sub { display: none; }
.flow-tile-icon {
    font-size: 18px;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(217, 72, 15, 0.18);
    margin-bottom: 1px;
    flex-shrink: 0;
}

/* Android-style app drawer bits: collapsible category + favorite/pin star */
.flow-fav-btn {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: var(--flow-glass-btn-active);
    color: var(--flow-ink-muted);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--flow-shadow);
}
.flow-fav-btn.active { color: var(--flow-hold); background: rgba(224, 171, 76, 0.22); }

.flow-collapse summary::-webkit-details-marker { display: none; }
.flow-collapse-chevron {
    display: inline-block;
    transition: transform 0.15s;
    font-size: 18px;
}
.flow-collapse[open] > summary .flow-collapse-chevron { transform: rotate(90deg); }
.flow-collapse:not([open]) .flow-tiles { display: none; }

/* Sign-in */
.flow-staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 150px));
    justify-content: center;
    gap: 14px;
    max-width: 480px;
    margin: 0 auto;
}
.flow-staff-card {
    background: var(--flow-surface);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid var(--flow-glass-border);
    border-radius: 18px;
    padding: 16px 10px;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--flow-shadow);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.flow-staff-card:active {
    transform: scale(0.95);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.flow-staff-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    margin: 0 auto 8px;
    background: linear-gradient(135deg, var(--flow-accent), var(--flow-hold));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 20px;
    box-shadow: 0 4px 14px rgba(217, 72, 15, 0.45);
}
.flow-staff-rank {
    font-size: 11px;
    color: var(--flow-ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}
.flow-pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 280px;
    margin: 20px auto 0;
}
.flow-pin-pad button {
    min-height: 64px;
    border-radius: 16px;
    border: 1px solid var(--flow-glass-border);
    background: var(--flow-surface);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    font-size: 22px;
    font-family: 'Fraunces', serif;
    color: var(--flow-ink);
    transition: transform 0.1s ease, background 0.1s ease;
}
.flow-pin-pad button:active {
    transform: scale(0.93);
    background: var(--flow-glass-btn-active);
}
.flow-pin-pad button.flow-pin-key-secondary {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--flow-ink-muted);
}
.flow-pin-dots {
    display: flex; gap: 12px; justify-content: center; margin: 16px 0;
}
.flow-pin-dots span {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid var(--flow-accent);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
.flow-pin-dots span.filled {
    background: var(--flow-accent);
    box-shadow: 0 0 0 5px rgba(217, 72, 15, 0.22);
}

/* Custom toggle switch — replaces the bare native checkbox on signin */
.flow-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.flow-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.flow-toggle-track {
    width: 44px;
    height: 26px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.16);
    position: relative;
    flex-shrink: 0;
    transition: background 0.15s ease;
}
.flow-toggle-track::after {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    transition: transform 0.18s ease;
}
.flow-toggle input:checked + .flow-toggle-track {
    background: var(--flow-accent);
}
.flow-toggle input:checked + .flow-toggle-track::after {
    transform: translateX(18px);
}

/* Header icon — a per-page visual identity marker, echoing the icon
   language already used on the day-hub tiles and PIN pad, instead of
   every step just being a bare text title. */
.flow-header-with-icon {
    display: flex;
    align-items: center;
    gap: 14px;
}
.flow-header-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(217, 72, 15, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

/* Form fields — shared glass input with a real label above it instead of
   relying on placeholder text as the only label. */
.flow-field { margin-bottom: 14px; }
.flow-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--flow-ink-muted);
    margin-bottom: 6px;
}
.flow-field-row { display: flex; gap: 8px; }
.flow-field-row .flow-field { flex: 1; margin-bottom: 14px; }
.flow-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--flow-glass-border);
    background: var(--flow-surface-solid);
    color: var(--flow-ink);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.flow-input:focus {
    outline: none;
    border-color: var(--flow-accent);
    box-shadow: 0 0 0 3px rgba(217, 72, 15, 0.20);
}
.flow-input.flow-input-compact {
    width: auto;
    padding: 8px 10px;
    font-size: 14px;
}

/* Checklist / prep-list progress bar */
.flow-progress-label {
    font-size: 12px;
    color: var(--flow-ink-muted);
    margin-bottom: 6px;
}
.flow-progress {
    height: 8px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-bottom: 14px;
}
.flow-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--flow-hold), var(--flow-go));
    border-radius: 100px;
    transition: width 0.25s ease;
}

/* Tappable checklist/prep row — the whole row is the touch target, not just
   the small native checkbox, which matters a lot with kitchen-glove taps. */
.flow-check-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--flow-border);
    cursor: pointer;
}
.flow-check-row:last-child { border-bottom: none; }
.flow-check-row input[type="checkbox"] {
    width: 24px;
    height: 24px;
    accent-color: var(--flow-go);
    flex-shrink: 0;
}
.flow-check-row .name { flex: 1; font-size: 16px; transition: color 0.15s ease; }
.flow-check-row.checked .name { color: var(--flow-ink-muted); text-decoration: line-through; }

/* Small icon chip for waste/probe list rows */
.flow-row-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(217, 72, 15, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
