/* purpose: All styles for the staff system and the shop */
:root {
    --navy: #233e5a;
    --navy-dark: #1a3049;
    --text: #111827;
    --label: #374151;
    --muted: #8a919b;
    --soft: #6b7280;
    --border: #d8dce2;
    --card-border: #e3e6ea;
    --page: #fbfbfb;
    --sidebar: #f8f9fb;
    --active: #eceff3;
    --green: #1f7a4d;
    --amber: #b7791f;
    --red: #c0392b;
    --slate: #50688a;
}

* { box-sizing: border-box; }
input[type="hidden"] { display: none; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--page);
}

.app { display: flex; min-height: 100vh; }

.sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    width: 12.25rem;
    height: 100vh;
    flex-shrink: 0;
    padding: 1.25rem 0.65rem 1rem;
    background: var(--sidebar);
    border-right: 1px solid #e5e7eb;
}
.brand { padding: 0 0.7rem; margin-bottom: 1.6rem; font-size: 1.05rem; font-weight: 500; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.65rem;
    color: #1f3447;
    font-size: 0.95rem;
    text-decoration: none;
}
a.nav-item:hover { background: #f0f2f5; }
.nav-item.active { background: var(--active); }
.nav-item.disabled { color: #9aa3ad; cursor: default; }
.nav-icon { flex-shrink: 0; }

.sidebar nav { display: flex; flex-direction: column; gap: 0.4rem; }

.user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: auto;
    padding: 0.85rem 0.45rem 0.2rem 0.6rem;
    border-top: 1px solid #e5e7eb;
}
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: #50688a;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
}
.user-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; font-weight: 500; }
.user form { margin: 0; }
.logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    color: var(--muted);
    background: none;
    border: 0;
    border-radius: 0.5rem;
    cursor: pointer;
}
.logout-button:hover { color: var(--text); background: var(--active); }
.logout-button:focus-visible { outline: 2px solid var(--navy); outline-offset: 1px; }

.content { flex: 1; min-width: 0; padding: 2.8rem 3.75rem 3rem; }
.content.centered { display: flex; align-items: center; justify-content: center; padding: 2rem; }

.card {
    width: 100%;
    max-width: 37rem;
    padding: 2rem 1.9rem;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 1.75rem;
}
.card h1 { margin: 0 0 1.1rem; font-size: 1.85rem; font-weight: 700; letter-spacing: -0.03em; }

.field { margin-bottom: 1.1rem; }
.field label { display: block; margin-bottom: 0.4rem; color: var(--label); font-size: 0.95rem; font-weight: 600; }
.field input {
    width: 100%;
    padding: 0.8rem 0.9rem;
    font: inherit;
    font-size: 1rem;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
}
.field input::placeholder { color: #9ca3af; }
.field input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(35, 62, 90, 0.18); }

.forgot {
    display: block;
    margin: 0.7rem 0 1.5rem;
    text-align: right;
    color: #1f3447;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
}
.forgot:hover { text-decoration: underline; }
.forgot.back { text-align: left; margin-bottom: 0; }

button.primary {
    width: 100%;
    padding: 0.85rem;
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    background: var(--navy);
    border: 0;
    border-radius: 0.9rem;
    cursor: pointer;
}
button.primary:hover { background: var(--navy-dark); }
button.primary:focus-visible { outline: 3px solid rgba(35, 62, 90, 0.35); outline-offset: 2px; }

.help { margin: 1.4rem 0 0; color: var(--muted); font-size: 0.9rem; }
.plain-link { color: #1f3447; }

.error {
    margin: 0 0 1.1rem;
    padding: 0.7rem 0.9rem;
    color: #b00020;
    background: #fdecea;
    border-radius: 0.7rem;
    font-size: 0.95rem;
}

.page-head .date { margin: 0 0 0.15rem; color: var(--soft); font-size: 0.95rem; }
.greeting { margin: 0; font-size: 2.6rem; font-weight: 500; letter-spacing: -0.035em; line-height: 1.15; }
.subtitle { margin: 0.85rem 0 2rem; color: var(--soft); font-size: 1.02rem; }

.kpis {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 1.1rem;
    overflow: hidden;
}
.kpi { flex: 1 1 9.5rem; min-width: 0; padding: 1.25rem 1.3rem; box-shadow: -1px 0 0 var(--card-border); }
.kpi p { margin: 0; }
.kpi-label { color: var(--soft); font-size: 0.8rem; }
.kpi-value {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.5rem 0 0.3rem !important;
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    white-space: nowrap;
}
.arrow { width: 0.8em; height: 0.8em; flex-shrink: 0; }
.kpi-note { font-size: 0.75rem; color: var(--muted); }
.kpi-note.positive { color: var(--green); }
.kpi-note.negative { color: var(--red); }
.kpi-note.warning { color: var(--amber); }
.kpi-note.muted { color: var(--muted); }

.panels { display: flex; align-items: stretch; gap: 1.2rem; }
.panels > .panel { flex: 1 1 0; }
.panels.two > .panel:first-child { flex: 1.65 1 0; }
.panel {
    min-width: 0;
    min-height: 17.5rem;
    padding: 1.2rem 1.25rem 1.3rem;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 1.1rem;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.9rem; }
.panel-head h2 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 1.1rem; font-weight: 500; letter-spacing: -0.01em; }
.panel-meta { flex-shrink: 0; max-width: 7rem; margin-left: 1rem; color: var(--muted); font-size: 0.78rem; text-align: right; }
.empty { margin: 2rem 0; color: var(--muted); font-size: 0.9rem; }

.chart { display: block; width: 100%; height: auto; }

.alerts { margin: 0; padding: 0; list-style: none; }
.alerts li { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0; border-top: 1px solid #eef0f3; }
.alerts li:first-child { border-top: 0; padding-top: 0.2rem; }
.dot { width: 0.45rem; height: 0.45rem; flex-shrink: 0; border-radius: 50%; }
.dot-red { background: #e5484d; }
.dot-orange { background: #f2a33a; }
.dot-grey { background: #c4c9d0; }
.alert-text { min-width: 0; flex: 1; }
.alert-text p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-title { font-size: 0.82rem; font-weight: 500; }
.alert-detail { margin-top: 0.1rem !important; color: var(--soft); font-size: 0.72rem; }
.alert-time { flex-shrink: 0; color: var(--muted); font-size: 0.75rem; }
.alert-action { flex-shrink: 0; color: #1f3d5c; font-size: 0.75rem; font-weight: 500; text-decoration: none; }
.alert-action:hover { text-decoration: underline; }
.more { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.78rem; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.85rem; background: #fff; }
th, td { padding: 0.4rem 0.6rem; border: 1px solid #ddd; text-align: left; white-space: nowrap; }
th { background: #eef0f3; }

@media (max-width: 1000px) {
    .content { padding: 2rem 1.75rem; }
    .panels.two { flex-direction: column; }
    .panels > .panel, .panels.two > .panel:first-child { flex: none; }
}

@media (max-width: 700px) {
    .app { flex-direction: column; }
    .sidebar { position: static; width: auto; height: auto; padding: 0.8rem 0.9rem; border-right: 0; border-bottom: 1px solid #e5e7eb; }
    .brand { margin-bottom: 0.6rem; }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; gap: 0.3rem; }
    .user { margin-top: 0.75rem; }
    .content { padding: 1.25rem; }
    .content.centered { padding: 1.25rem; }
    .card { padding: 1.5rem 1.25rem; }
    .greeting { font-size: 2.1rem; }
}

.page-title { margin: 0; font-size: 2.6rem; font-weight: 600; letter-spacing: -0.04em; line-height: 1.15; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; margin: -0.6rem 0 0.9rem; }
.toolbar-gap { flex: 1; }
.input {
    height: 2.5rem;
    padding: 0 0.8rem;
    font: inherit;
    font-size: 0.85rem;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
}
input.input[type="search"] { width: 15rem; }
select.input { min-width: 10rem; }

.btn {
    display: inline-flex;
    align-items: center;
    height: 2.5rem;
    padding: 0 0.9rem;
    font: inherit;
    font-size: 0.85rem;
    color: var(--text);
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    cursor: pointer;
}
.btn:hover { background: #f4f5f7; }
.btn-primary { color: #fff; background: var(--slate); border-color: var(--slate); }
.btn-primary:hover { background: #435a78; }

.panel-link { color: #1f3d5c; font-size: 0.8rem; font-weight: 500; text-decoration: none; }
.panel-link:hover { text-decoration: underline; }
.panel-sub { margin: 0.25rem 0 0; color: var(--soft); font-size: 0.8rem; }
.panel-text { margin: 0.4rem 0 1rem; color: var(--soft); font-size: 0.82rem; line-height: 1.5; }
.big-number { margin: 0.6rem 0 0; font-size: 1.9rem; font-weight: 500; letter-spacing: -0.03em; }

.table-panel { margin-top: 1.2rem; padding: 0; min-height: 0; overflow: hidden; }
.panel-head.padded { align-items: center; padding: 1.2rem 1.25rem 1rem; margin: 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; background: #fff; }
.data-table th {
    padding: 0.7rem 0.7rem;
    color: var(--soft);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
    background: #f8f9fb;
    border: 0;
    border-top: 1px solid #eef0f3;
    border-bottom: 1px solid #eef0f3;
}
.data-table td { padding: 0.8rem 0.7rem; white-space: normal; vertical-align: middle; border: 0; border-bottom: 1px solid #eef0f3; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table th:first-child, .data-table td:first-child { padding-left: 1.25rem; }
.data-table strong { font-weight: 500; }
.cell-sub { color: var(--soft); font-size: 0.76rem; }
.nowrap { white-space: nowrap !important; }
.empty-cell { color: var(--muted); text-align: center; padding: 2rem !important; }

.pill { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 500; white-space: nowrap; }
.pill-red { color: #c0392b; background: #fdecec; }
.pill-orange { color: #b7791f; background: #fdf3e3; }
.pill-green { color: #1f7a4d; background: #e8f6ee; }
.pill-grey { color: #6b7280; background: #f0f2f5; }
.pill-blue { color: #3b5b9a; background: #eef2fb; }

.bar { display: inline-block; width: 4.5rem; height: 0.35rem; margin-left: 0.6rem; vertical-align: middle; background: #eef0f3; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; }
.bar-red { background: #e5484d; }
.bar-orange { background: #f2a33a; }
.bar-green { background: #3fae6f; }

.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 0.9rem; color: var(--soft); font-size: 0.82rem; border-top: 1px solid #eef0f3; }

.flash { margin: 0 0 1rem; padding: 0.7rem 0.9rem; border-radius: 0.7rem; font-size: 0.9rem; }
.flash-success { color: #1f7a4d; background: #e8f6ee; }
.flash-error { color: #b00020; background: #fdecea; }

.form-panel { max-width: 40rem; min-height: 0; }
.field select, .field textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
}
.hint { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.78rem; }
.form-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.25rem; }

.toolbar-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; }
.toolbar form { margin: 0; }
.pill-purple { color: #6b46c1; background: #f1ecfb; }
.row-link { color: inherit; text-decoration: none; }
.row-link:hover { text-decoration: underline; }
.btn-danger { color: #c0392b; border-color: #f2c4c0; }
.btn-danger:hover { background: #fdecec; }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 0.45rem 1rem; margin: 0.5rem 0 1rem; font-size: 0.85rem; }
.summary dt { color: var(--soft); }
.summary dd { margin: 0; }
.summary .total { font-weight: 600; color: var(--text); }
.form-actions.start { justify-content: flex-start; flex-wrap: wrap; }
.line-row { display: flex; gap: 0.75rem; }
.line-row .grow { flex: 1; min-width: 0; }
.line-row .qty { width: 6.5rem; }

.btn.square { justify-content: center; width: 2.5rem; padding: 0; }
.toolbar-label { margin-left: 0.4rem; color: var(--soft); font-size: 0.85rem; }
.spaced { margin-top: 1.2rem; }
.page-title.small { font-size: 2rem; }
.rota { width: 100%; border-collapse: collapse; table-layout: fixed; background: #fff; font-size: 0.78rem; }
.rota th, .rota td { padding: 0.3rem; vertical-align: top; text-align: left; white-space: normal; border: 0;
                     border-top: 1px solid #eef0f3; border-left: 1px solid #eef0f3; }
.rota thead th { padding: 0.55rem 0.3rem; color: var(--soft); font-weight: 400; text-align: center; background: #f8f9fb; }
.rota thead th strong { color: var(--text); font-weight: 500; }
.rota thead th.today { background: #eef2fb; }
.rota .rota-person { width: 10rem; padding: 0.6rem 0.7rem; font-weight: 400; border-left: 0; }
.rota th.rota-person { display: table-cell; }
.rota-person strong { font-weight: 500; }
.rota tbody th { background: #fff; }
.person-cell { display: flex; align-items: flex-start; gap: 0.5rem; }
.mini-avatar { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 1.8rem; height: 1.8rem;
               margin-top: 0.1rem; color: var(--soft); font-size: 0.65rem; background: #f0f2f5; border-radius: 50%; }
.mini-avatar.unfilled { color: #b7791f; background: #fdf3e3; }
.slot { display: block; margin-bottom: 0.25rem; padding: 0.45rem 0.45rem; color: #1f3447; text-decoration: none; border-radius: 0.5rem; }
.slot:hover { filter: brightness(0.97); }
.slot-time { display: block; font-weight: 500; white-space: nowrap; }
.slot-sub { display: block; margin-top: 0.15rem; color: var(--soft); font-size: 0.68rem; }
.slot-blue { background: #eef3fb; }
.slot-teal { background: #e8f6f4; }
.slot-purple { background: #f1ecfb; }
.slot-leave { color: var(--soft); background: #f3f4f6; }
.slot-conflict { color: #c0392b; background: #fdecec; }
.slot-conflict .slot-sub { color: #c0392b; }
.slot-unfilled { background: #fff7ec; border: 1px dashed #f2c98a; }
.link-action { padding: 0; font: inherit; font-size: 0.78rem; font-weight: 500; color: #1f3d5c; background: none; border: 0; cursor: pointer; }
.link-action:hover { text-decoration: underline; }
.link-action.muted { color: var(--muted); }
.inline-actions { display: flex; gap: 0.7rem; margin: 0; }
.alerts li form { margin: 0; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.alerts.wrap .alert-text p { white-space: normal; }

.date-input { width: 9.5rem; }
.legend { display: flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.75rem; white-space: nowrap; }
.key { display: inline-block; width: 0.5rem; height: 0.5rem; margin-left: 0.5rem; border-radius: 50%; }
.key-revenue { background: #50688a; }
.key-expenses { background: #d89a3c; }
.periods { min-height: 0; }
form.toolbar { margin-top: 0; }
.dot-green { background: #3fae6f; }
.dot-teal { background: #2bb3a3; }
.dot-blue { background: #50688a; }
.dot-purple { background: #8b6fd6; }
.key { flex-shrink: 0; }
.field.wide { width: 11rem; }

.product-grid { display: flex; flex-wrap: wrap; gap: 1rem; }
.product-card { flex: 1 1 15rem; max-width: 22rem; min-height: 0; }
.product-card h2 { margin: 0.2rem 0 0.2rem; font-size: 1.05rem; font-weight: 500; }
.product-card .price { margin: 0.7rem 0 0.4rem; font-size: 1.35rem; font-weight: 500; }
.add-form { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.8rem; }
.qty-input { width: 4.5rem; }
.btn.full, button.btn.full { justify-content: center; width: 100%; margin-top: 0.6rem; }
.check { display: flex; align-items: center; gap: 0.5rem; margin: 0.4rem 0 0.2rem; font-size: 0.9rem; }
.padded-text { padding: 0 1.25rem 1rem; }
.flash-warning { color: #8a5a12; background: #fdf3e3; }
fieldset.plain { margin: 0; padding: 0; border: 0; min-width: 0; }
.override-forms { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.override-forms form { flex: 1 1 18rem; }
.override-panel { min-height: 0; border-color: #f2c4c0; }

button, input, select, textarea { font: inherit; }
select.input, .field select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 0.7rem;
    cursor: pointer;
}
.input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(35, 62, 90, 0.18); }
input[type="checkbox"], input[type="radio"] { width: 1rem; height: 1rem; accent-color: var(--navy); cursor: pointer; }
input[type="number"]::-webkit-inner-spin-button { opacity: 0.4; }
input[type="date"]::-webkit-calendar-picker-indicator, input[type="time"]::-webkit-calendar-picker-indicator { opacity: 0.5; cursor: pointer; }
input[type="file"] { font-size: 0.85rem; color: var(--soft); }
input[type="file"]::file-selector-button {
    margin-right: 0.8rem; padding: 0.5rem 0.9rem; font: inherit; font-size: 0.85rem; color: var(--text);
    background: #fff; border: 1px solid var(--border); border-radius: 0.6rem; cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: #f4f5f7; }
.btn:focus-visible, .link-action:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.link-action { border-radius: 0.3rem; }
.danger-zone { border-color: #f2c4c0; }
.code { padding: 0.8rem 1rem; overflow-x: auto; font-family: ui-monospace, Menlo, monospace; font-size: 0.78rem;
        background: #f8f9fb; border: 1px solid var(--card-border); border-radius: 0.6rem; white-space: pre; }
.qr-panel { text-align: center; }
.qr svg { width: 14rem; height: 14rem; }

:root { --space-1: 0.5rem; --space-2: 0.75rem; --space-3: 1.25rem; --space-4: 2rem; }

.page-head { margin-bottom: var(--space-3); }
.page-head .subtitle { margin-top: var(--space-1); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3); }
.toolbar-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); flex: 0 1 auto; min-width: 0; }
.toolbar-form input[type="search"], .toolbar-form input[name="q"] { flex: 1 1 15rem; min-width: 0; }
.toolbar-gap { flex: 1 1 0; }
.toolbar form { margin: 0; }
.btn { min-height: 2.6rem; white-space: nowrap; }
.kpis { margin-bottom: var(--space-3); }
.panels { gap: var(--space-3); margin-bottom: var(--space-3); }
.panels:last-child { margin-bottom: 0; }
.spaced { margin-top: var(--space-3); }
.panel-head { gap: var(--space-2); flex-wrap: wrap; }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.form-actions form { margin: 0; }
.field { margin-bottom: var(--space-2); }
.line-row { gap: var(--space-2); }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.inline-actions form { margin: 0; }

.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; padding-right: 2.2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.85rem center; background-size: 0.7rem; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { background-color: var(--active); }
.menu-list { position: absolute; top: calc(100% + 0.4rem); right: 0; z-index: 30; min-width: 15rem; padding: 0.35rem;
    background: #fff; border: 1px solid var(--border); border-radius: 0.75rem; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14); }
.menu-list form { margin: 0; }
.menu-list a, .menu-list button {
    display: block; width: 100%; padding: 0.6rem 0.8rem; color: var(--text); font-size: 0.9rem; text-align: left;
    text-decoration: none; background: none; border: 0; border-radius: 0.5rem; cursor: pointer; }
.menu-list a:hover, .menu-list button:hover:not(:disabled) { background: var(--active); }
.menu-list button:disabled { color: var(--soft); cursor: not-allowed; }
.menu-list .danger { color: #b42318; }

.qr-panel { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); max-width: 26rem; }

@media (max-width: 1000px) {
    .content { padding: var(--space-4) 1.75rem; }
    .panels { flex-direction: column; }
    .panels > .panel, .panels.two > .panel:first-child { flex: none; }
}

@media (max-width: 720px) {
    .app { flex-direction: column; }
    .sidebar { position: sticky; top: 0; z-index: 40; width: 100%; height: auto; flex-direction: row; flex-wrap: wrap;
               align-items: center; gap: var(--space-1); padding: var(--space-2) var(--space-2) var(--space-1);
               background: #fff; border-right: 0; border-bottom: 1px solid #e5e7eb; }
    .brand { margin: 0 auto 0 0.25rem; }
    .user { order: 2; margin: 0; padding: 0; border-top: 0; }
    .user-name { display: none; }
    .sidebar nav { order: 3; width: 100%; flex-direction: row; flex-wrap: nowrap; gap: 0.25rem; overflow-x: auto;
                   padding-bottom: 0.25rem; scrollbar-width: none; }
    .sidebar nav::-webkit-scrollbar { display: none; }
    .nav-item { flex: 0 0 auto; padding: 0.5rem 0.75rem; white-space: nowrap; }

    .content, .content.centered { padding: var(--space-3) 1rem var(--space-4); }
    .page-title { font-size: 1.9rem; }
    .page-title.small { font-size: 1.5rem; }
    .greeting { font-size: 1.9rem; }

    .toolbar { gap: var(--space-1); }
    .toolbar-form { flex: 1 1 100%; }
    .toolbar-form > * { flex: 1 1 8rem; }
    .toolbar-label { flex: 1 1 auto; text-align: center; margin: 0; }
    .toolbar-gap { display: none; }
    .toolbar > .btn, .toolbar > form, .toolbar > .menu { flex: 1 1 auto; }
    .toolbar .btn, .toolbar > form .btn, .menu > summary { width: 100%; justify-content: center; }
    .toolbar > .btn.square { flex: 0 0 auto; width: auto; }
    .menu-list { left: 0; right: 0; min-width: 0; }
    .btn, .input, .field input, .field select { min-height: 2.75rem; }

    .kpi { flex: 1 1 45%; padding: 1rem; }
    .panel { padding: 1rem; }
    .table-panel { padding: 0; }
    .panel-head.padded { padding: 1rem 1rem 0.75rem; }
    .data-table th, .data-table td { padding: 0.6rem 0.75rem; }
    .line-row { flex-direction: column; gap: 0; }
    .field.qty, .field.wide, .date-input { width: 100%; }
    .form-actions .btn, .form-actions form, .form-actions form .btn { flex: 1 1 auto; width: 100%; justify-content: center; }
    .card { width: 100%; padding: 1.5rem 1.25rem; }

    .shop-bar { padding: var(--space-2) 1rem; }
    .shop-links { width: 100%; gap: var(--space-2); }
    .shop-content { padding: var(--space-3) 1rem var(--space-4); }
    .product-card { max-width: none; }
}

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
.kpi { min-width: 0; }
.toolbar-form { flex: 1 1 26rem; max-width: 42rem; }
@media (max-width: 720px) {
    .kpis { grid-template-columns: 1fr 1fr; }
    .toolbar-form { max-width: none; }
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 720px) {
    .user { flex-shrink: 0; gap: var(--space-1); }
    .rota { min-width: 46rem; }
    .data-table { min-width: 34rem; }
    .toolbar > .btn.square { width: 2.75rem; justify-content: center; }
}
@media (max-width: 720px) {
    .sidebar { width: auto; box-sizing: border-box; }
    .toolbar-form .date-input { flex: 1 1 35%; width: auto; min-width: 0; }
    .toolbar-form .toolbar-label { flex: 0 0 auto; }
    .toolbar-form select.input { flex: 1 1 100%; }
}
@media (max-width: 720px) {

    .sidebar { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "brand user" "nav nav";
               align-items: center; row-gap: var(--space-1); }
    .brand { grid-area: brand; margin: 0 0 0 0.25rem; }
    .user { grid-area: user; display: flex; align-items: center; }
    .sidebar nav { grid-area: nav; width: auto; min-width: 0; }
}
.panel-head > span, .panel-head > a { white-space: nowrap; }

.user.guest { flex-direction: column; align-items: stretch; gap: var(--space-1); }
.user.guest .btn { justify-content: center; }
@media (max-width: 720px) { .user.guest { flex-direction: row; } }
.toolbar > .input[type="search"] { flex: 1 1 16rem; max-width: 32rem; }
@media (max-width: 720px) { .toolbar > .input[type="search"] { max-width: none; flex-basis: 100%; } }

a, .panel-link, .forgot, .help a, .link-action { font-size: inherit; }

.basket-table td { vertical-align: middle; }
.basket-quantity { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.basket-quantity form { display: flex; align-items: center; gap: var(--space-1); margin: 0; }
.basket-quantity .add-form { margin: 0; }
.summary.totals { display: grid; grid-template-columns: 1fr auto; row-gap: var(--space-2); column-gap: var(--space-3);
                  margin: var(--space-2) 0 var(--space-3); font-size: 0.95rem; }
.summary.totals dt { margin: 0; color: var(--soft); }
.summary.totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.summary.totals .cell-sub { display: block; margin-top: 0.15rem; }
.summary.totals dt.total, .summary.totals dd.total { padding-top: var(--space-2); color: var(--text); font-size: 1.05rem;
                  font-weight: 600; border-top: 1px solid var(--card-border); }
.summary.totals { column-gap: 0; }
.summary.totals dd { padding-left: var(--space-3); }
@media (max-width: 720px) {
    .basket-table { min-width: 0; }
    .basket-table th:nth-child(2), .basket-table td:nth-child(2) { display: none; }
}
.panels.three > .panel { flex: 1 1 0; min-width: 0; }
.panels.three .btn { margin-top: var(--space-2); }
.padded-chart { padding: 0 var(--space-3) var(--space-2); }

.page-head .date { margin-bottom: var(--space-2); }
.panel { min-height: 0; }
.panels > .panel { align-self: flex-start; }
.panels.two > .panel, .panels.three > .panel { align-self: stretch; }
.panels.three .panel-text { margin-bottom: var(--space-1); }

.menu > summary { background-image: none; padding-right: 2.2rem; position: relative; }
.menu > summary::after { content: ""; position: absolute; right: 0.85rem; top: 50%; width: 0.7rem; height: 0.45rem;
    margin-top: -0.22rem; background-color: currentColor; opacity: 0.7;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain; }
.menu[open] > summary.btn-primary { background-color: var(--navy); }
.panel > :last-child, .panel form:last-child > :last-child, .panel > form:last-child .form-actions { margin-bottom: 0; }
.panel .form-actions:last-child { margin-bottom: 0; }
.panel-text:last-child, .panel p:last-child { margin-bottom: 0; }
.basket-quantity { gap: var(--space-3); }
.basket-quantity .add-form { gap: var(--space-2); }
.alerts .link-action, .alerts .inline-actions .link-action { font-size: 0.8rem; }

.link-action, .link-action:hover, .btn, .btn:hover, .menu-list a, .menu-list a:hover, .panel-link:hover,
.alert-action:hover, .forgot:hover { text-decoration: none; }
.row-actions .inline-actions { justify-content: flex-end; flex-wrap: nowrap; }
.row-menu > summary { display: inline-flex; width: 2rem; height: 2rem; padding: 0; color: var(--soft);
    border-radius: 0.5rem; cursor: pointer; }
.row-menu > summary:hover, .row-menu[open] > summary { background: var(--active); color: var(--text); }
.row-menu > summary::after { right: 50%; margin-right: -0.35rem; }
.row-menu .menu-list { min-width: 9rem; }
@media (min-width: 721px) { .table-wrap { overflow: visible; } }
.panel-head + .empty, .panel-head + p.empty { margin: 0; padding: var(--space-1) 0 0; }
.assign-form { display: flex; align-items: flex-end; gap: var(--space-2); margin-top: var(--space-3); }
.assign-form .field { flex: 1; margin-bottom: 0; }
.scan-row { display: flex; gap: var(--space-1); }
.scan-row input { flex: 1; min-width: 0; }
.scanner { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
           padding: var(--space-3); background: rgba(15, 23, 42, 0.6); }
.scanner[hidden] { display: none; }
.scanner-box { display: flex; flex-direction: column; gap: var(--space-2); width: min(26rem, 100%); padding: var(--space-3);
               background: #fff; border-radius: 0.9rem; }
#scanner-view { width: 100%; overflow: hidden; border-radius: 0.6rem; }