/*
 * Winkla Servis: workshop interface.
 *
 * Loaded after admin-css.css. Unlayered, so the token overrides below win over
 * the layered base tokens, and every older admin page picks up the same look.
 *
 * Idea: the paper repair tag that hangs on a customer's keys. Graphite ink,
 * cool workshop-grey paper, tag yellow for "this needs you", Archivo with its
 * width axis: wide and heavy for numbers and headings, normal for reading.
 */

/* Archivo @font-face lives in templates/partials/admin-head.php. */

:root {
    --ink: #1C2430;
    --ink-soft: #2A3442;
    --paper: #E9EBE7;
    --card: #FFFFFF;
    --well: #F4F5F2;
    --steel: #5D6673;
    --line: #D6DAD3;
    --tag: #E8B820;
    --tag-soft: #FBF1CF;
    --work: #2F5DB8;
    --work-soft: #E3EAF8;
    --ready: #1E7A4F;
    --ready-soft: #DDF0E5;
    --pause: #8A6A12;
    --alarm: #B42F25;
    --alarm-soft: #F7E1DE;
    --wide: 118%;

    --vb-bg-base: var(--paper);
    --vb-bg-surface: var(--card);
    --vb-bg-surface-rgb: 255, 255, 255;
    --vb-bg-raised: var(--card);
    --vb-bg-input: #FFFFFF;
    --vb-bg-well: var(--well);
    --vb-border-subtle: #E1E4DF;
    --vb-border-default: var(--line);
    --vb-border-card: var(--line);
    --vb-text-primary: var(--ink);
    --vb-text-secondary: #3C4552;
    --vb-text-tertiary: var(--steel);
    --vb-text-ghost: #858C95;
    --vb-accent: var(--ink);
    --vb-accent-hover: var(--ink-soft);
    --vb-accent-active: #11161E;
    --vb-accent-subtle: rgba(28, 36, 48, 0.07);
    --vb-accent-glow: transparent;
    --vb-accent-gradient: var(--ink);
    --vb-shadow-card: none;
    --vb-shadow-card-hover: none;
    --vb-shadow-glow: 0 0 0 3px rgba(232, 184, 32, 0.45);
    --vb-success: var(--ready);
    --vb-warning: var(--pause);
    --vb-error: var(--alarm);
    --vb-info: var(--work);
    --vb-font-sans: 'Archivo', -apple-system, 'Segoe UI', system-ui, sans-serif;
    --vb-radius-lg: 5px;
    --vb-radius: 6px;
    --vb-radius-xl: 8px;
    --vb-sidebar-width: 232px;
}

[data-theme="dark"] {
    --ink: #E8EBE6;
    --ink-soft: #CBD0C9;
    --paper: #13171C;
    --card: #1B2027;
    --well: #222831;
    --steel: #9BA3AD;
    --line: #2F3741;
    --tag-soft: #3A3218;
    --work: #7EA2EC;
    --work-soft: #1E2B44;
    --ready: #5CC48F;
    --ready-soft: #173426;
    --pause: #E0BE5A;
    --alarm: #F08377;
    --alarm-soft: #3C1F1C;

    --vb-bg-base: var(--paper);
    --vb-bg-surface: var(--card);
    --vb-bg-surface-rgb: 27, 32, 39;
    --vb-bg-raised: var(--card);
    --vb-bg-input: #161B21;
    --vb-bg-well: var(--well);
    --vb-border-subtle: #262D36;
    --vb-border-default: var(--line);
    --vb-border-card: var(--line);
    --vb-text-primary: var(--ink);
    --vb-text-secondary: #C3C9C2;
    --vb-text-tertiary: var(--steel);
    --vb-accent: var(--tag);
    --vb-accent-hover: #F0C63E;
    --vb-accent-subtle: rgba(232, 184, 32, 0.1);
    --vb-shadow-card: none;
}

body { font-family: var(--vb-font-sans); font-feature-settings: 'tnum' 0; }

/* ── Shell ─────────────────────────────────────────────────────── */

.vb-sidebar,
[data-theme="dark"] .vb-sidebar {
    background: var(--paper);
    border-inline-end: 1px solid var(--line);
    color: var(--ink);
}
.vb-sidebar-brand { height: auto; padding: 1.1rem 1.1rem 0.9rem; overflow: hidden; align-items: flex-start; }
.vb-sidebar-logo { filter: none; }
.ws-brand { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ws-brand-shop { font-weight: 700; font-size: 0.95rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-brand-app { font-size: 0.78rem; color: var(--steel); }
.vb-sidebar-name { color: var(--ink); font-weight: 700; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.vb-sidebar-section { border-top-color: var(--line); }
.vb-sidebar-section-label { color: var(--steel); text-transform: none; letter-spacing: 0; font-size: 0.75rem; font-weight: 500; }
.vb-sidebar-link {
    color: #3C4552;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    min-height: 36px;
}
[data-theme="dark"] .vb-sidebar-link { color: #C3C9C2; }
.vb-sidebar-link svg, .vb-sidebar-link [data-lucide] { color: var(--steel); width: 16px; height: 16px; }
.vb-sidebar-link:hover { background: rgba(28, 36, 48, 0.05); color: var(--ink); }
.vb-sidebar-link:hover svg { color: var(--ink); }
[data-theme="dark"] .vb-sidebar-link:hover { background: rgba(255, 255, 255, 0.05); }
.vb-sidebar-link.active,
[data-theme="dark"] .vb-sidebar-link.active {
    background: rgba(28, 36, 48, 0.08);
    color: var(--ink);
    font-weight: 600;
    border: 0;
}
[data-theme="dark"] .vb-sidebar-link.active { background: rgba(255, 255, 255, 0.08); }
.vb-sidebar-link.active svg, .vb-sidebar-link.active [data-lucide] { color: var(--ink); }
.vb-sidebar-footer { border-top-color: var(--line); color: var(--steel); }

.ws-sidebar-new {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0.1rem 0.9rem;
    min-height: 40px;
    padding: 0 0.75rem;
    background: var(--ink);
    color: var(--card);
    font-weight: 650;
    font-size: 0.92rem;
    border-radius: 6px;
    text-decoration: none;
}
.ws-sidebar-new:hover { background: var(--ink-soft); }
.ws-sidebar-new svg { width: 16px; height: 16px; }
[data-theme="dark"] .ws-sidebar-new { color: #13171C; }

.vb-topbar {
    background: var(--paper);
    backdrop-filter: none;
    box-shadow: none;
    border-bottom: 1px solid var(--line);
    height: 60px;
}
.vb-topbar-title { font-size: 1rem; font-weight: 650; letter-spacing: 0; }

.vb-btn-primary { background: var(--ink); color: var(--card); box-shadow: none; }
[data-theme="dark"] .vb-btn-primary { background: var(--tag); color: #1C2430; }
.vb-card { box-shadow: none; }

:focus-visible { outline: 3px solid var(--tag); outline-offset: 2px; }

/* ── Page frame ───────────────────────────────────────────────── */

.ws-page { max-width: 1240px; margin: 0 auto; padding: 1.75rem 1.75rem 4rem; color: var(--ink); }
.ws-page--narrow { max-width: 820px; }
.ws-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.ws-title { font-size: 1.5rem; line-height: 1.2; font-weight: 700; margin: 0; }
.ws-sub { color: var(--steel); font-size: 0.95rem; margin-top: 0.35rem; }
.ws-h2 { font-size: 1rem; font-weight: 650; margin: 0 0 0.75rem; }
.ws-muted { color: var(--steel); }
.ws-small { font-size: 0.85rem; }

/* ── Buttons ──────────────────────────────────────────────────── */

.ws-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 38px;
    padding: 0 1rem;
    border-radius: 6px;
    border: 1px solid #CDD2CC;
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-weight: 650;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.ws-btn:hover { border-color: var(--steel); }
.ws-btn svg { width: 18px; height: 18px; }
.ws-btn--ink { background: var(--ink); border-color: var(--ink); color: var(--card); }
.ws-btn--ink:hover { background: var(--ink-soft); }
.ws-btn--tag { background: var(--tag); border-color: var(--tag); color: #1C2430; }
.ws-btn--tag:hover { background: #F0C63E; border-color: #F0C63E; }
.ws-btn--big { min-height: 44px; font-size: 1rem; padding: 0 1.2rem; }
.ws-btn--block { width: 100%; }
.ws-btn--quiet { border-color: transparent; background: transparent; color: var(--steel); }
.ws-btn--quiet:hover { color: var(--ink); border-color: var(--line); }
.ws-btn--danger { color: var(--alarm); }

/* ── Status chip ──────────────────────────────────────────────── */

.ws-chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 550;
    white-space: nowrap;
    background: var(--well);
    color: var(--steel);
}
.ws-chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ws-chip--active { background: var(--work-soft); color: var(--work); }
.ws-chip--attention { background: var(--tag-soft); color: var(--pause); }
.ws-chip--paused { background: var(--tag-soft); color: var(--pause); }
.ws-chip--paused::before { border-radius: 1px; }
.ws-chip--ready { background: var(--ready-soft); color: var(--ready); }
.ws-chip--closed { background: transparent; color: var(--steel); padding-left: 0; }
.ws-chip--alarm { background: var(--alarm-soft); color: var(--alarm); }

/* ── The tag: order number with a punched hole ────────────────── */

.ws-tag {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0.75rem 0.3rem 1.65rem;
    background: var(--tag);
    color: #1C2430;
    font-weight: 800;
    font-stretch: var(--wide);
    font-variant-numeric: tabular-nums;
    clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%);
    text-decoration: none;
    white-space: nowrap;
}
.ws-tag::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -3.5px;
    border-radius: 50%;
    background: var(--paper);
}
.ws-tag--big { font-size: 1.5rem; padding: 0.45rem 1rem 0.45rem 2.1rem; clip-path: polygon(16px 0, 100% 0, 100% 100%, 16px 100%, 0 50%); }
.ws-tag--big::before { left: 13px; width: 10px; height: 10px; margin-top: -5px; }

/* ── Panels ───────────────────────────────────────────────────── */

.ws-panel { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1.25rem 1.35rem; }
.ws-panel + .ws-panel { margin-top: 1rem; }
.ws-panel--flat { background: transparent; border: 0; padding: 0; }
.ws-panel--tag { background: var(--tag-soft); border-color: #E9D27A; }
[data-theme="dark"] .ws-panel--tag { border-color: #5A4C1E; }

/* ── Today: attention list ────────────────────────────────────── */

.ws-attention { list-style: none; margin: 0 0 2rem; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.ws-attention li + li { border-top: 1px solid #EEF0EC; }
[data-theme="dark"] .ws-attention li + li { border-top-color: var(--line); }
.ws-alert {
    display: grid;
    grid-template-columns: 10rem 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    color: inherit;
    text-decoration: none;
}
.ws-alert:hover { background: var(--well); }
.ws-alert strong { font-weight: 650; }
.ws-alert .ws-why { color: var(--steel); font-size: 0.88rem; }
.ws-alert-what { display: flex; align-items: center; gap: 0.5rem; font-weight: 650; }
.ws-alert-what::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--pause); flex: none; }
.ws-alert--good .ws-alert-what::before { background: var(--ready); }
.ws-alert--bad .ws-alert-what::before { background: var(--alarm); }
.ws-alert-num { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--steel); font-size: 0.85rem; }
.ws-calm { padding: 0.25rem 0 2rem; color: var(--steel); }

/* ── Board ────────────────────────────────────────────────────── */

.ws-board { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 0.75rem; overflow-x: auto; padding-bottom: 0.5rem; }
.ws-col { min-width: 0; }
.ws-col-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 0.15rem 0.5rem; border-bottom: 1px solid var(--line); margin-bottom: 0.6rem; }
.ws-col-head h3 { font-size: 0.88rem; font-weight: 600; margin: 0; }
.ws-col-head span { font-weight: 600; color: var(--steel); font-variant-numeric: tabular-nums; }
.ws-col-empty { color: var(--steel); font-size: 0.85rem; padding: 0.4rem 0.15rem; }

.ws-card {
    display: block;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.7rem 0.75rem;
    margin-bottom: 0.5rem;
    color: inherit;
    text-decoration: none;
}
.ws-card:hover { border-color: var(--ink); }
.ws-card-num { font-size: 0.78rem; font-weight: 600; color: var(--steel); font-variant-numeric: tabular-nums; }
.ws-card-item { font-weight: 650; margin: 0.15rem 0 0.1rem; line-height: 1.25; overflow-wrap: anywhere; }
.ws-card-meta { font-size: 0.82rem; color: var(--steel); overflow-wrap: anywhere; }
.ws-card-due { font-size: 0.78rem; margin-top: 0.4rem; color: var(--steel); }
.ws-card-due--late { color: var(--alarm); font-weight: 650; }

/* ── Search + filters ─────────────────────────────────────────── */

.ws-search { display: flex; gap: 0.5rem; flex: 1; max-width: 520px; }
.ws-input,
.ws-form input[type="text"], .ws-form input[type="tel"], .ws-form input[type="email"],
.ws-form input[type="date"], .ws-form input[type="search"], .ws-form textarea, .ws-form select {
    width: 100%;
    min-height: 40px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #CDD2CC;
    border-radius: 6px;
    background: var(--vb-bg-input);
    color: var(--ink);
    font: inherit;
    font-size: 1rem;
}
.ws-form textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.ws-input:focus, .ws-form input:focus, .ws-form textarea:focus, .ws-form select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(232, 184, 32, 0.45); }

.ws-filters { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 1rem; }
.ws-filter {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.4rem 0.75rem; border-radius: 6px; border: 1px solid transparent;
    color: var(--steel); text-decoration: none; font-weight: 600; font-size: 0.9rem;
}
.ws-filter:hover { color: var(--ink); border-color: var(--line); }
.ws-filter.is-on { background: rgba(28, 36, 48, 0.08); color: var(--ink); }
[data-theme="dark"] .ws-filter.is-on { background: rgba(255,255,255,0.08); }
.ws-filter b { font-weight: 500; color: var(--steel); font-variant-numeric: tabular-nums; }

/* ── Order table ──────────────────────────────────────────────── */

.ws-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.ws-table th { text-align: left; font-size: 0.78rem; font-weight: 500; color: var(--steel); padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); background: transparent; }
.ws-table td { padding: 0.75rem 0.9rem; border-bottom: 1px solid #EEF0EC; vertical-align: middle; }
[data-theme="dark"] .ws-table td { border-bottom-color: var(--line); }
.ws-table tr:last-child td { border-bottom: 0; }
.ws-table tbody tr { cursor: pointer; }
.ws-table tbody tr:hover td { background: var(--well); }
.ws-table a { color: inherit; text-decoration: none; }
.ws-table .ws-num { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ws-empty { padding: 3rem 1rem; text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: 6px; }
.ws-empty p { color: var(--steel); margin: 0.4rem 0 1.2rem; }

/* ── Intake form ──────────────────────────────────────────────── */

.ws-form { display: grid; gap: 1.25rem; }
.ws-step { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1.4rem 1.5rem 1.5rem; }
.ws-step-head { margin-bottom: 1rem; }
.ws-step-head h2 { font-size: 1.05rem; font-weight: 650; margin: 0; }
.ws-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 1rem; }
.ws-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ws-span { grid-column: 1 / -1; }
.ws-field label, .ws-label { display: block; font-weight: 650; font-size: 0.92rem; margin-bottom: 0.35rem; }
.ws-field .ws-hint { display: block; font-weight: 400; color: var(--steel); font-size: 0.82rem; margin-top: 0.3rem; }
.ws-field .ws-err { display: block; color: var(--alarm); font-size: 0.85rem; font-weight: 600; margin-top: 0.3rem; }
.ws-field.has-error input, .ws-field.has-error textarea { border-color: var(--alarm); }
.ws-opt { font-weight: 400; color: var(--steel); }

.ws-return {
    display: none;
    margin-top: 0.9rem;
    padding: 0.8rem 1rem;
    background: var(--tag-soft);
    border-radius: 4px;
    font-size: 0.92rem;
}
.ws-return.is-on { display: block; }
.ws-return-items { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.55rem; }

.ws-choices { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ws-choice { position: relative; }
.ws-choice input { position: absolute; opacity: 0; pointer-events: none; }
.ws-choice span {
    display: inline-flex; align-items: center; gap: 0.4rem;
    min-height: 36px; padding: 0 0.8rem;
    border: 1px solid #CDD2CC; border-radius: 6px; background: var(--card);
    font-weight: 600; font-size: 0.9rem; cursor: pointer; user-select: none;
}
.ws-choice span svg { width: 16px; height: 16px; }
.ws-choice input:checked + span { background: var(--ink); color: var(--card); border-color: var(--ink); }
[data-theme="dark"] .ws-choice span, [data-theme="dark"] .ws-btn, [data-theme="dark"] .ws-input, [data-theme="dark"] .ws-form input, [data-theme="dark"] .ws-form textarea, [data-theme="dark"] .ws-form select { border-color: #3A434E; }
.ws-choice input:focus-visible + span { outline: 3px solid var(--tag); outline-offset: 2px; }

.ws-more { border-top: 1px solid var(--line); margin-top: 1.1rem; padding-top: 0.9rem; }
.ws-more summary { cursor: pointer; font-weight: 650; color: var(--steel); list-style: none; }
.ws-more summary::-webkit-details-marker { display: none; }
.ws-more summary::before { content: '+ '; font-weight: 800; }
.ws-more[open] summary::before { content: '− '; }
.ws-more[open] summary { margin-bottom: 1rem; color: var(--ink); }

.ws-toggle { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.9rem 1rem; background: var(--well); border-radius: 4px; cursor: pointer; }
.ws-toggle input { width: 20px; height: 20px; margin-top: 2px; accent-color: #1C2430; flex-shrink: 0; }
.ws-toggle strong { display: block; }
.ws-toggle span { color: var(--steel); font-size: 0.88rem; }

.ws-submit { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; position: sticky; bottom: 0; padding: 0.9rem 0; background: var(--paper); border-top: 1px solid var(--line); }

/* ── Order page ───────────────────────────────────────────────── */

.ws-order-head { display: grid; grid-template-columns: 1fr auto; gap: 1rem 1.5rem; align-items: start; margin-bottom: 1.5rem; }
.ws-order-item { font-size: 1.75rem; line-height: 1.15; font-weight: 700; margin: 0.75rem 0 0.35rem; overflow-wrap: anywhere; }
.ws-order-ids { display: flex; flex-wrap: wrap; gap: 0.3rem 1.25rem; color: var(--steel); }
.ws-order-ids b { color: var(--ink); font-weight: 650; }
.ws-order-tools { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; }

.ws-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }

.ws-rail { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 0.25rem 0 0.6rem; }
.ws-rail-step { height: 8px; background: var(--line); border-radius: 1px; }
.ws-rail-step.is-done { background: var(--ink); }
.ws-rail-step.is-now { background: var(--tag); }
.ws-rail-labels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; font-size: 0.78rem; color: var(--steel); }
.ws-rail-labels .is-now { color: var(--ink); font-weight: 700; }

.ws-now { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.2rem; }
.ws-now-label { font-size: 1.25rem; font-weight: 700; }
.ws-now-meta { color: var(--steel); font-size: 0.9rem; }
.ws-other { margin-top: 1rem; }
.ws-other summary { cursor: pointer; color: var(--steel); font-size: 0.9rem; font-weight: 600; }
.ws-other-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.ws-other-grid form { margin: 0; }

.ws-quote-amount { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.ws-quote-state { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-bottom: 0.6rem; }
.ws-quote-text { white-space: pre-line; margin: 0.6rem 0 0; }
.ws-answer { margin-top: 0.9rem; padding: 0.75rem 0.9rem; border-radius: 4px; background: var(--well); }

.ws-compose { display: grid; gap: 0.6rem; }
.ws-compose-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem; align-items: center; }
.ws-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.ws-seg label { position: relative; }
.ws-seg input { position: absolute; opacity: 0; }
.ws-seg span { display: block; padding: 0.5rem 0.8rem; font-size: 0.88rem; font-weight: 600; cursor: pointer; color: var(--steel); }
.ws-seg input:checked + span { background: var(--ink); color: var(--card); }
.ws-seg input:focus-visible + span { outline: 3px solid var(--tag); outline-offset: -3px; }

.ws-timeline { list-style: none; margin: 0; padding: 0; }
.ws-event { position: relative; padding: 0 0 1.1rem 1.4rem; border-left: 2px solid var(--line); margin-left: 5px; }
.ws-event:last-child { border-left-color: transparent; padding-bottom: 0; }
.ws-event::before { content: ''; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink); }
.ws-event--internal::before { border-style: dashed; border-color: var(--steel); }
.ws-event-title { font-weight: 700; }
.ws-event-meta { font-size: 0.8rem; color: var(--steel); margin-top: 0.1rem; }
.ws-event-note { margin-top: 0.35rem; white-space: pre-line; }
.ws-event--internal .ws-event-note { color: var(--steel); }

.ws-facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.45rem 1rem; margin: 0; font-size: 0.93rem; }
.ws-facts dt { color: var(--steel); }
.ws-facts dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.ws-phone { font-size: 1.15rem; font-weight: 750; color: var(--ink); text-decoration: none; }
.ws-qr { display: flex; gap: 0.9rem; align-items: center; }
.ws-qr svg { width: 96px; height: 96px; flex-shrink: 0; background: #fff; padding: 4px; border-radius: 3px; }
.ws-link-row { display: flex; gap: 0.4rem; margin-top: 0.6rem; }
.ws-link-row input { flex: 1; min-width: 0; font-size: 0.82rem; min-height: 38px; padding: 0 0.6rem; border: 1px solid var(--line); border-radius: 3px; background: var(--well); color: var(--ink); }

.ws-docs { list-style: none; margin: 0; padding: 0; }
.ws-docs li { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.ws-docs li:last-child { border-bottom: 0; }
.ws-docs a { color: var(--ink); font-weight: 650; }

.ws-toast { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 90; max-width: 420px; padding: 0.9rem 1.1rem; border-radius: 4px; background: var(--ink); color: var(--card); font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.ws-toast--error { background: var(--alarm); color: #fff; }
[data-theme="dark"] .ws-toast { background: #E9EBE7; color: #1C2430; }

@media (max-width: 1100px) {
    .ws-board { grid-template-columns: repeat(3, minmax(200px, 1fr)); }
    .ws-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .ws-page { padding: 1.1rem 1rem 5rem; }
    .ws-title { font-size: 1.5rem; }
    .ws-board { grid-template-columns: 1fr; }
    .ws-grid, .ws-grid--3 { grid-template-columns: 1fr; }
    .ws-order-head { grid-template-columns: 1fr; }
    .ws-order-tools { justify-content: flex-start; }
    .ws-order-item { font-size: 1.55rem; }
    .ws-step { padding: 1.1rem; }
    .ws-table thead { display: none; }
    .ws-table, .ws-table tbody, .ws-table tr, .ws-table td { display: block; }
    .ws-table tr { border-bottom: 1px solid var(--line); padding: 0.6rem 0.2rem; }
    .ws-table td { border: 0; padding: 0.15rem 0.7rem; }
    .ws-alert { grid-template-columns: 1fr; gap: 0.35rem; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* No entrance animation on every page load: the content is simply there. */
.vb-content { animation: none; }
.vb-content:has(> .ws-page) { padding: 0; }
.vb-sidebar-link, .vb-sidebar-link.active { box-shadow: none; }
.vb-animate-in, .vb-fade-in-up, .vb-fade-in, [class*="stagger-"] { animation: none !important; opacity: 1 !important; transform: none !important; }

/* On workshop screens the page carries its own h1; the bar only names where you are. */
.ws-topbar-crumb { font-size: 0.9rem; font-weight: 500; color: var(--steel); font-stretch: 100%; }
.vb-main:has(.ws-page) .vb-topbar { height: 52px; }

/* ── Order page: every status one tap away ─────────────────────── */
.ws-statusbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: -0.5rem 0 1.25rem; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.ws-statusbar-label { font-size: 0.8rem; color: var(--steel); padding: 0 0.5rem 0 0.4rem; }
.ws-statusbar-item {
    display: inline-flex; align-items: center; min-height: 34px; padding: 0 0.8rem;
    border: 0; border-radius: 6px; background: transparent; color: #3C4552;
    font: inherit; font-size: 0.88rem; font-weight: 550; cursor: pointer; text-decoration: none;
}
[data-theme="dark"] .ws-statusbar-item { color: #C3C9C2; }
.ws-statusbar-item:hover { background: var(--well); color: var(--ink); }
.ws-statusbar-item.is-on { background: var(--ink); color: var(--card); cursor: default; }

/* ── Photos of the job ─────────────────────────────────────────── */
.ws-photos { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
.ws-photos li { display: grid; gap: 0.25rem; }
.ws-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; background: var(--well); }
.ws-photos form { margin: 0; }
.ws-photos .ws-btn { min-height: 30px; padding: 0 0.5rem; justify-self: start; }
.ws-photo-form { display: grid; grid-template-columns: 1fr; gap: 0.5rem; }
@media (min-width: 720px) { .ws-photo-form { grid-template-columns: auto 1fr auto; align-items: center; } }

/* ── Settings ──────────────────────────────────────────────────── */
.ws-tabs { display: flex; flex-wrap: wrap; gap: 1.25rem; border-bottom: 1px solid var(--line); margin: 0 0 1.5rem; }
.ws-tab { padding: 0.6rem 0 0.55rem; color: var(--steel); text-decoration: none; font-weight: 550; font-size: 0.92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ws-tab:hover { color: var(--ink); }
.ws-tab.is-on { color: var(--ink); border-bottom-color: var(--ink); }
.ws-setting { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 1rem 2rem; padding: 1.5rem 0; border-top: 1px solid var(--line); }
.ws-setting:first-of-type { border-top: 0; padding-top: 0.25rem; }
.ws-setting-head h2 { font-size: 1rem; font-weight: 650; margin: 0 0 0.3rem; }
.ws-setting-head p { color: var(--steel); font-size: 0.88rem; margin: 0; }
.ws-image-field { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.ws-image-field img { width: 96px; height: 96px; object-fit: contain; background: var(--well); border-radius: 6px; border: 1px solid var(--line); }
.ws-image-field img.is-photo { width: 160px; height: 100px; object-fit: cover; }
.ws-image-empty { width: 96px; height: 96px; border: 1px dashed var(--line); border-radius: 6px; display: grid; place-items: center; color: var(--steel); font-size: 0.8rem; text-align: center; }
.ws-preview { background: var(--well); border-radius: 6px; padding: 0.8rem 1rem; font-size: 0.9rem; color: #3C4552; margin-top: 0.6rem; }
[data-theme="dark"] .ws-preview { color: #C3C9C2; }
.ws-kinds { display: grid; gap: 0.5rem; }
.ws-kind { display: grid; grid-template-columns: auto 1fr auto; gap: 0.75rem; align-items: center; padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.ws-kind input[type="checkbox"] { width: 18px; height: 18px; accent-color: #1C2430; }
.ws-kind small { color: var(--steel); display: block; }
.ws-kind label.ws-main { font-size: 0.82rem; color: var(--steel); display: flex; gap: 0.35rem; align-items: center; white-space: nowrap; }
@media (max-width: 720px) { .ws-setting { grid-template-columns: 1fr; } }

/* ── Sign-in pages: same controls as the app, no entrance choreography ── */
.login-panel, .login-hero, .login-form-card, [class*="login-field-"], .login-inner, .login-legal, .login-alt, .login-submit, .login-aux-links, .login-method-tabs, .login-error { animation: none !important; opacity: 1 !important; transform: none !important; }
.login-panel { box-shadow: none; border: 1px solid var(--line); border-radius: 8px; }
.login-panel .vb-input { border-radius: 6px; background: var(--vb-bg-input); border: 1px solid #CDD2CC; box-shadow: none; }
.login-panel .vb-btn, .login-submit { border-radius: 6px; box-shadow: none; }
.login-hero-name { font-weight: 700; letter-spacing: 0; }
.login-hero-cube { box-shadow: none; filter: none; }

/* Operator overview: one row per service, status on the right, detail underneath */
.ws-health { list-style: none; margin: 0; padding: 0; }
.ws-health li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 0.75rem; padding: 0.65rem 0; border-top: 1px solid #EEF0EC; }
[data-theme="dark"] .ws-health li { border-top-color: var(--line); }
.ws-health li:first-child { border-top: 0; padding-top: 0; }
.ws-health-name { font-weight: 600; min-width: 0; }
.ws-health-detail { grid-column: 1 / -1; color: var(--steel); font-size: 0.85rem; overflow-wrap: anywhere; }
.ws-facts dd { min-width: 0; }
.ws-kind-block { border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.ws-kind-block > summary { list-style: none; border: 0; cursor: pointer; }
.ws-kind-block > summary::-webkit-details-marker { display: none; }
.ws-kind-block[open] > summary { border-bottom: 1px solid var(--line); border-radius: 6px 6px 0 0; }
.ws-kind-edit { padding: 1rem; }

/* ── Mechanic quick view (opened from the label) ───────────────── */
.ws-quick { max-width: 560px; display: grid; gap: 1.5rem; }
.ws-quick-head .ws-title { margin-top: 0.6rem; }
.ws-quick-status { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 0.5rem; }
.ws-quick-status button {
    min-height: 52px; border: 1px solid #CDD2CC; border-radius: 6px; background: var(--card); color: var(--ink);
    font: inherit; font-weight: 650; font-size: 1rem; cursor: pointer;
}
.ws-quick-status button.is-on { background: var(--ink); color: var(--card); border-color: var(--ink); cursor: default; }
.ws-camera { display: grid; justify-items: center; gap: 0.25rem; padding: 1.25rem; border: 1px dashed #AEB4AC; border-radius: 8px; background: var(--card); cursor: pointer; text-align: center; }
.ws-camera input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ws-camera span { display: inline-flex; gap: 0.5rem; align-items: center; font-weight: 700; font-size: 1.1rem; }
.ws-camera small { color: var(--steel); }
.ws-camera:focus-within { outline: 3px solid var(--tag); outline-offset: 2px; }

/* Settings: notices and public-page themes */
.ws-warn { color: var(--pause); margin: 8px 0 0; }
.ws-link { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.ws-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ws-theme { position: relative; display: block; cursor: pointer; }
.ws-theme input { position: absolute; opacity: 0; pointer-events: none; }
.ws-theme-card { display: grid; gap: 4px; height: 100%; padding: 8px 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.ws-theme-card strong { font-size: 0.95rem; margin-top: 4px; }
.ws-theme input:checked + .ws-theme-card { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.ws-theme input:focus-visible + .ws-theme-card { outline: 3px solid var(--tag); outline-offset: 2px; }
.ws-theme-look { display: grid; grid-template-columns: 1fr 1fr; height: 64px; border-radius: 5px; overflow: hidden; }
.ws-theme-look > span { display: grid; place-items: center; padding: 8px; }
.ws-theme-look i { display: grid; gap: 5px; width: 100%; padding: 7px; border: 1px solid; border-radius: 4px; }
.ws-theme-look b { display: block; width: 22px; height: 8px; border-radius: 2px; }
.ws-theme-look em { display: block; width: 70%; height: 5px; border-radius: 2px; opacity: 0.85; }

/* Image fields: crop and logo background */
.ws-image-field .ws-field { flex: 1 1 240px; }
.ws-image-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
.ws-image-actions label { font-weight: 400; }
.ws-image-field img:not(.is-photo), .ws-crop-stage.is-check {
    background-color: #fff;
    background-image: linear-gradient(45deg, #E4E6E2 25%, transparent 25%, transparent 75%, #E4E6E2 75%), linear-gradient(45deg, #E4E6E2 25%, transparent 25%, transparent 75%, #E4E6E2 75%);
    background-size: 14px 14px;
    background-position: 0 0, 7px 7px;
}
.ws-crop { position: fixed; inset: 0; margin: auto; height: fit-content; width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); overflow: auto; }
.ws-crop::backdrop { background: rgba(20, 24, 30, 0.55); }
.ws-crop-head { display: grid; gap: 2px; padding: 14px 16px 10px; }
.ws-crop-stage { position: relative; display: grid; place-items: center; min-height: 200px; margin: 0 16px; padding: 12px; border-radius: 6px; background: var(--well); user-select: none; touch-action: none; }
.ws-crop-stage canvas { display: block; max-width: 100%; }
.ws-crop-box { position: absolute; box-shadow: 0 0 0 9999px rgba(20, 24, 30, 0.45); outline: 2px solid #fff; cursor: move; touch-action: none; }
.ws-crop-stage { overflow: hidden; }
.ws-crop-h { position: absolute; width: 18px; height: 18px; background: #fff; border: 2px solid var(--ink); border-radius: 3px; }
.ws-crop-h--nw { left: -9px; top: -9px; cursor: nwse-resize; }
.ws-crop-h--ne { right: -9px; top: -9px; cursor: nesw-resize; }
.ws-crop-h--sw { left: -9px; bottom: -9px; cursor: nesw-resize; }
.ws-crop-h--se { right: -9px; bottom: -9px; cursor: nwse-resize; }
.ws-crop-tools { padding: 12px 16px 0; }
.ws-crop-tools .ws-toggle { margin: 0; }
.ws-crop-sw { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; border: 1px solid var(--line); border-radius: 2px; }
.ws-crop-foot { display: flex; gap: 8px; align-items: center; padding: 14px 16px 16px; }
.ws-crop-gap { flex: 1; }

/* Quote in lines */
.ws-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ws-quote-lines { list-style: none; margin: 0.75rem 0; padding: 0; border-top: 1px solid var(--line); }
.ws-quote-lines li { display: grid; grid-template-columns: 1fr auto; gap: 2px 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.ws-quote-lines li > span:last-of-type { font-variant-numeric: tabular-nums; font-weight: 600; }
.ws-quote-lines li.is-no > span { color: var(--steel); text-decoration: line-through; }
.ws-quote-lines em { grid-column: 1 / -1; font-style: normal; font-size: 0.8rem; color: var(--alarm); }
.ws-lines { display: grid; gap: 6px; }
.ws-lines-head, .ws-line { display: grid; grid-template-columns: 1fr 110px 72px; gap: 8px; align-items: center; }
.ws-lines-head { font-size: 0.75rem; color: var(--steel); font-weight: 600; }
.ws-lines-head span:last-child { text-align: center; }
.ws-line input[data-line-amount] { text-align: right; font-variant-numeric: tabular-nums; }
.ws-line-opt { display: grid; place-items: center; height: 100%; cursor: pointer; }
.ws-line-opt input { width: 20px; height: 20px; accent-color: var(--ink); }
.ws-lines-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.ws-lines-foot strong { font-variant-numeric: tabular-nums; font-size: 1.15rem; }

/* Inspection */
.ws-inspect { display: grid; gap: 0; border-top: 1px solid var(--line); margin-bottom: 1rem; }
.ws-inspect-row { display: grid; grid-template-columns: minmax(120px, 1fr) auto minmax(140px, 1fr); gap: 8px 12px; align-items: center; margin: 0; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); min-width: 0; }
.ws-inspect-row legend { float: left; padding: 0; font-weight: 600; font-size: 0.9rem; }
.ws-inspect-row--new { grid-template-columns: minmax(120px, 1fr) auto minmax(140px, 1fr); }
.ws-inspect-states { display: flex; gap: 4px; }
.ws-state { position: relative; }
.ws-state input { position: absolute; opacity: 0; pointer-events: none; }
.ws-state span { display: inline-block; padding: 0.3rem 0.6rem; border: 1px solid var(--line); border-radius: 999px; font-size: 0.8rem; font-weight: 600; cursor: pointer; background: var(--card); }
.ws-state input:focus-visible + span { outline: 3px solid var(--tag); outline-offset: 2px; }
.ws-state--ok input:checked + span { background: var(--ready); border-color: var(--ready); color: #fff; }
.ws-state--watch input:checked + span { background: var(--tag); border-color: var(--tag); color: var(--ink); }
.ws-state--urgent input:checked + span { background: var(--alarm); border-color: var(--alarm); color: #fff; }
@media (max-width: 640px) {
    .ws-inspect-row, .ws-inspect-row--new { grid-template-columns: 1fr; }
    .ws-lines-head, .ws-line { grid-template-columns: 1fr 90px 44px; }
}

/* Platform operator pages */
.ws-back { display: inline-block; margin-bottom: 0.75rem; color: var(--steel); font-size: 0.9rem; text-decoration: none; }
.ws-back::before { content: '← '; }
.ws-back:hover { color: var(--ink); }
.ws-notice { margin: -0.5rem 0 1.25rem; padding: 0.7rem 0.9rem; background: var(--tag-soft); border: 1px solid #E9D27A; border-radius: 6px; font-size: 0.92rem; }
.ws-notice a { color: inherit; font-weight: 600; }
.ws-right { text-align: right !important; }
.ws-alarm { color: var(--alarm); }
.ws-big-num { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; font-stretch: var(--wide); margin: 0 0 0.25rem; line-height: 1.1; }
.ws-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.ws-inline-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; margin-top: 1rem; }
.ws-inline-form .ws-field { flex: 1 1 140px; }
.ws-table--flat { border: 0; border-radius: 0; }
.ws-table--flat tbody tr { cursor: default; }
.ws-row-tools { white-space: nowrap; }
.ws-row-tools form { display: inline; }
.ws-table tr.is-off td { opacity: 0.6; }
.ws-h2 .ws-muted { font-weight: 400; }
.ws-nowrap { white-space: nowrap; }
.ws-numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.ws-numbers > div { display: grid; gap: 2px; padding: 1rem 1.2rem; border-left: 1px solid var(--line); }
.ws-numbers > div:first-child { border-left: 0; }
.ws-numbers span { font-size: 0.82rem; color: var(--steel); }
.ws-numbers strong { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; font-stretch: var(--wide); line-height: 1.15; }
.ws-numbers small { font-size: 0.8rem; color: var(--steel); }
.ws-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.ws-roles .ws-theme-card { padding: 12px 14px; }

/* Login with Face ID / fingerprint */
.login-passkey { width: 100%; margin-top: 0.6rem; }
.login-passkey-note { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--alarm); }

/* ══════════════════════════════════════════════════════════════
   REACT BITS INTEGRATION: TechText, FluxLines, BranchedMenu
   ══════════════════════════════════════════════════════════════ */

/* ── 1. TechText Component ── */
.tech-text {
    position: relative;
    width: 100%;
    height: 100%;
    touch-action: pan-y;
    user-select: none;
}
.tech-text-canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.login-hero-techtext {
    position: relative;
    width: 220px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -0.25rem;
    margin-bottom: -0.25rem;
}
.login-hero-techtext .tech-text-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: grab;
}
.login-hero-techtext.is-active .login-hero-name {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── 2. FluxLines Component ── */
.flux-lines-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.flux-lines-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}
.login-flux-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: auto;
}
.login-env {
    position: relative;
}
.login-env-voxel {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

/* ── 3. BranchedMenu Component ── */
.branched-menu {
    --bm-w: 240px;
    --bm-ink: var(--vb-text-primary, #f5f5f5);
    --bm-accent: var(--vb-accent, #6366f1);
    --bm-line: var(--vb-border-subtle, rgba(0, 0, 0, 0.08));
    --bm-font: 0.8125rem;
    --bm-row: 34px;
    --bm-indent: 36px;
    --bm-trunk: 14px;
    --bm-radius: 10px;
    --bm-line-w: 1.5;
    --bm-draw: 400ms;
    --bm-fold: 280ms;
    --bm-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --bm-muted: var(--vb-text-tertiary, #71717a);

    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: min(var(--bm-w), 100%);
    padding-left: 14px;
    color: var(--bm-ink);
    font-family: inherit;
    font-size: var(--bm-font);
    line-height: 1.2;
}

[data-theme="dark"] .branched-menu {
    --bm-line: var(--vb-border-subtle, rgba(255, 255, 255, 0.08));
}

.branched-menu::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 0;
    left: 0;
    width: 2px;
    border-radius: 1px;
    background: linear-gradient(to bottom, var(--bm-line) 0%, var(--bm-line) 65%, transparent 100%);
}

.branched-menu__marker {
    position: absolute;
    top: -1px;
    left: 0;
    z-index: 2;
    width: 2px;
    height: 18px;
    border-radius: 1px;
    background: var(--bm-accent);
    opacity: 0;
    box-shadow: 0 0 8px var(--vb-accent-glow, rgba(99, 102, 241, 0.5));
    transition:
        top 220ms var(--bm-ease-out),
        opacity 150ms ease;
}

.branched-menu__marker[data-on] {
    opacity: 1;
}

.branched-menu__section {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.375rem;
}

.branched-menu__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 7px 8px 7px 0;
    border: 0;
    background: none;
    color: var(--bm-muted);
    font: inherit;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 200ms ease;
}

.branched-menu__section[data-open] .branched-menu__head,
.branched-menu__head[data-active] {
    color: var(--bm-ink);
}

@media (hover: hover) and (pointer: fine) {
    .branched-menu__head:hover {
        color: var(--bm-ink);
    }
}

.branched-menu__head-chevron {
    width: 12px;
    height: 12px;
    opacity: 0.45;
    transition: transform var(--bm-fold) var(--bm-ease-out), opacity 200ms ease;
}

.branched-menu__section[data-open] .branched-menu__head-chevron {
    transform: rotate(90deg);
    opacity: 0.85;
}

.branched-menu__body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--bm-fold) var(--bm-ease-out);
}

.branched-menu__section[data-open] .branched-menu__body {
    grid-template-rows: 1fr;
}

.branched-menu__fold {
    min-height: 0;
    overflow: hidden;
}

.branched-menu__tree {
    position: relative;
    padding: 6px 0;
    box-sizing: border-box;
}

.branched-menu__lines {
    position: absolute;
    top: 0;
    left: 0;
    overflow: visible;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
}

.branched-menu__section[data-open] .branched-menu__lines {
    opacity: 1;
    transition: opacity 250ms ease 100ms;
}

.branched-menu__base,
.branched-menu__reach {
    fill: none;
    stroke-width: var(--bm-line-w);
    stroke-linecap: round;
    stroke-linejoin: round;
}

.branched-menu__base {
    stroke: var(--bm-line);
}

.branched-menu__reach {
    stroke: var(--bm-accent);
    transition: stroke-dashoffset var(--bm-draw) var(--bm-ease-out);
}

.branched-menu__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: var(--bm-row);
    margin: 0;
    padding: 0 8px 0 var(--bm-indent);
    border: 0;
    border-radius: var(--vb-radius-md, 6px);
    background: none;
    color: var(--bm-muted);
    font: inherit;
    font-size: var(--bm-font);
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    outline: none;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: color 150ms ease, background 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .branched-menu__item:hover {
        color: var(--bm-ink);
        background: var(--vb-bg-hover, rgba(0, 0, 0, 0.04));
    }
    [data-theme="dark"] .branched-menu__item:hover {
        background: rgba(255, 255, 255, 0.05);
    }
}

.branched-menu__item[data-active],
.branched-menu__item.active {
    color: var(--bm-accent);
    font-weight: 600;
    background: var(--vb-accent-subtle, rgba(99, 102, 241, 0.08));
}

[data-theme="dark"] .branched-menu__item[data-active],
[data-theme="dark"] .branched-menu__item.active {
    background: rgba(129, 140, 248, 0.1);
}

.branched-menu__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 16px;
    height: 16px;
    color: inherit;
}

.branched-menu__icon svg,
.branched-menu__icon [data-lucide] {
    width: 16px;
    height: 16px;
    stroke-width: 1.75;
}

.branched-menu__label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

@media (prefers-reduced-motion: reduce) {
    .branched-menu__marker {
        transition: opacity 150ms ease;
    }
    .branched-menu__body {
        transition: none;
    }
    .branched-menu__reach {
        transition: none;
    }
}


/* ── Odgovor stranke: customer messages on the order ── */
.ws-reply-new { margin-left: 0.4rem; padding: 1px 8px; border-radius: 10px; background: var(--tag); color: #1C2430; font-size: 0.78rem; font-weight: 700; vertical-align: middle; }
.ws-replies { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.6rem; }
.ws-reply { max-width: 92%; padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--well); }
.ws-reply--customer { justify-self: start; background: var(--card); border-color: var(--steel); }
.ws-reply--customer.is-unread { border-color: var(--tag); box-shadow: inset 3px 0 0 var(--tag); }
.ws-reply:not(.ws-reply--customer) { justify-self: end; }
.ws-reply-meta { font-size: 0.8rem; color: var(--steel); }
.ws-reply-meta strong { color: var(--ink); }
.ws-reply-when { margin-left: 0.4rem; }
.ws-reply-dot { margin-left: 0.3rem; padding: 0 6px; border-radius: 3px; background: var(--tag-soft); color: var(--pause); font-weight: 700; }
.ws-reply-body { margin-top: 0.25rem; white-space: pre-line; overflow-wrap: anywhere; }
.ws-nav-count { margin-left: auto; min-width: 1.4rem; padding: 0 6px; border-radius: 10px; background: var(--tag); color: #1C2430; font-size: 0.75rem; font-weight: 700; text-align: center; }
