﻿:root {
    color-scheme: light;
    --bf-bg: #f6f8fc;
    --bf-bg-elevated: #fbfdff;
    --bf-bg-soft: #eef5ff;
    --bf-surface: #ffffff;
    --bf-surface-soft: #f8fbff;
    --bf-surface-glass: rgba(255, 255, 255, .86);
    --bf-text: #0f172a;
    --bf-text-soft: #334155;
    --bf-muted: #64748b;
    --bf-border: #dbe5f1;
    --bf-border-strong: #b9cce4;
    --bf-primary: #2563eb;
    --bf-primary-hover: #1d4ed8;
    --bf-primary-soft: #eaf2ff;
    --bf-primary-subtle: #f3f7ff;
    --bf-primary-text: #ffffff;
    --bf-success: #16a34a;
    --bf-success-soft: #ecfdf3;
    --bf-warning: #d97706;
    --bf-warning-soft: #fff7ed;
    --bf-danger: #dc2626;
    --bf-danger-soft: #fff1f2;
    --bf-radius-xs: 6px;
    --bf-radius-sm: 8px;
    --bf-radius-md: 10px;
    --bf-radius-lg: 14px;
    --bf-space-1: 4px;
    --bf-space-2: 8px;
    --bf-space-3: 12px;
    --bf-space-4: 16px;
    --bf-space-5: 20px;
    --bf-space-6: 24px;
    --bf-space-8: 32px;
    --bf-shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
    --bf-shadow-sm: 0 8px 20px rgba(15, 23, 42, .06);
    --bf-shadow-md: 0 18px 44px rgba(15, 23, 42, .10);
    --bf-shadow-lg: 0 28px 80px rgba(15, 23, 42, .16);
    --bf-focus: 0 0 0 4px rgba(37, 99, 235, .14);
    --bf-control-height: 42px;
    --bg: var(--bf-bg);
    --bg-soft: var(--bf-bg-soft);
    --panel: var(--bf-surface);
    --panel-subtle: var(--bf-surface-soft);
    --ink: var(--bf-text);
    --ink-soft: var(--bf-text-soft);
    --muted: var(--bf-muted);
    --line: var(--bf-border);
    --line-strong: var(--bf-border-strong);
    --primary: var(--bf-primary);
    --primary-strong: var(--bf-primary-hover);
    --primary-soft: var(--bf-primary-soft);
    --primary-ink: var(--bf-primary-text);
    --success: var(--bf-success);
    --success-soft: var(--bf-success-soft);
    --warning: var(--bf-warning);
    --warning-soft: var(--bf-warning-soft);
    --danger: var(--bf-danger);
    --danger-soft: var(--bf-danger-soft);
    --shadow-sm: var(--bf-shadow-xs);
    --shadow-md: var(--bf-shadow-md);
    --radius: var(--bf-radius-md);
    --radius-sm: var(--bf-radius-sm);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .12), transparent 34rem),
        linear-gradient(180deg, #fbfdff 0%, var(--bg) 34%, #f4f8ff 100%);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.05; letter-spacing: 0; }
h2 { font-size: 18px; line-height: 1.2; letter-spacing: 0; }
h3 { font-size: 15px; line-height: 1.2; letter-spacing: 0; }
strong { font-weight: 680; }

button,
.button,
input,
select,
textarea {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font: inherit;
    min-width: 0;
}

button,
.button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font-weight: 650;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

button:hover,
.button:hover {
    border-color: var(--line-strong);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
}

button.primary,
.button.primary,
.primary {
    border-color: var(--primary);
    background: linear-gradient(180deg, #3b82f6, var(--primary));
    color: var(--primary-ink);
    box-shadow: 0 12px 24px rgba(37, 99, 235, .22);
}

button.primary:hover,
.button.primary:hover,
.primary:hover {
    border-color: var(--primary-strong);
    background: linear-gradient(180deg, #2f74ef, var(--primary-strong));
}

button:disabled,
.button:disabled {
    cursor: not-allowed;
    transform: none;
    opacity: .58;
    box-shadow: none;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    background: #fff;
    color: var(--ink);
    outline: none;
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, .02);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #8bb8ff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

input[readonly],
select:disabled,
textarea:disabled {
    background: #f7faff;
    color: var(--muted);
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 560;
}

label input,
label select,
label textarea {
    color: var(--ink);
    font-size: 15px;
    font-weight: 400;
}

.app-shell {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(248, 251, 255, .86);
    border-bottom: 1px solid rgba(219, 231, 245, .86);
    backdrop-filter: blur(18px);
}

.topbar {
    position: relative;
    width: min(1180px, 100%);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
    padding: 0 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand > span:last-child {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.brand small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 560;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: linear-gradient(135deg, #60a5fa 0%, var(--primary) 58%, #1e40af 100%);
    color: #fff;
    font-weight: 850;
    box-shadow: 0 12px 28px rgba(37, 99, 235, .28);
}

.brand-mark.large {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    font-size: 23px;
}

.brand-logo-slot {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.brand-logo-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.icon-button {
    width: 40px;
    padding: 0;
    font-size: 18px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-button {
    width: 40px;
    padding: 0;
    display: none;
    flex-direction: column;
    gap: 4px;
}

.menu-button span {
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform .18s ease, opacity .18s ease;
}

.menu-button[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-button[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-button[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.mobile-logout {
    display: none;
}

.tabs {
    width: min(1180px, 100%);
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 0 auto;
    padding: 0 18px 12px;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tabs a {
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 650;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.tabs a:hover {
    border-color: var(--line);
    background: #fff;
    color: var(--primary-strong);
}

.page {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 22px 18px 96px;
    animation: page-in .22s ease;
    overflow-x: hidden;
}

@keyframes page-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 0;
}

.login-panel {
    width: 400px;
    max-width: calc(100vw - 48px);
    display: grid;
    gap: 20px;
    padding: 24px;
    border: 1px solid rgba(219, 231, 245, .9);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--shadow-md);
}

.login-panel h1 { color: var(--ink); }
.login-panel * { min-width: 0; }

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin: 10px 0 16px;
}

.hero-panel,
.panel,
.accordion,
.list,
.metric-card,
.action-card {
    max-width: 100%;
    min-width: 0;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 18px;
    margin-bottom: 14px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, .10), rgba(255, 255, 255, .94) 42%),
        #fff;
}

.panel {
    padding: 16px;
    margin-bottom: 14px;
}

.accordion,
.list {
    margin-bottom: 14px;
    overflow: hidden;
}

.paper-panel {
    max-width: 100%;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .97);
    box-shadow: var(--shadow-sm);
}

.paper-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.shift-close-head {
    margin-bottom: 10px;
}

.shift-close-form {
    gap: 10px;
}

.accordion[open] {
    animation: open-panel .18s ease;
}

@keyframes open-panel {
    from { opacity: .86; transform: translateY(-2px); }
    to { opacity: 1; transform: translateY(0); }
}

.accordion summary,
.panel summary {
    cursor: pointer;
    font-weight: 720;
    color: var(--ink);
    list-style: none;
}

.accordion summary::-webkit-details-marker,
.panel summary::-webkit-details-marker { display: none; }

.accordion summary {
    position: relative;
    padding: 15px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-subtle);
}

.accordion summary::after,
.panel summary::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
    transition: transform .18s ease;
}

.accordion summary,
.panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.accordion[open] summary::after,
.panel[open] summary::after {
    transform: rotate(225deg);
}

.row,
.list-row,
.close-row,
.product-row,
.form-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.between { justify-content: space-between; }

.list-row {
    min-height: 64px;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    transition: background .18s ease;
}

a.list-row:hover,
.list-row:hover {
    background: #f8fbff;
}

.list-row:last-child { border-bottom: 0; }

.history-shift-main {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex: 1;
    color: inherit;
    text-decoration: none;
}

.archive-table {
    overflow: hidden;
}

.archive-row {
    display: grid;
    grid-template-columns: 112px 112px minmax(140px, 1fr) 128px 150px minmax(190px, auto);
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.archive-row:last-child {
    border-bottom: 0;
}

.archive-header {
    background: var(--panel-subtle);
    color: var(--muted);
    font-size: 12px;
    font-weight: 780;
}

.archive-actions {
    justify-content: flex-end;
}

.draft-recovery {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.autosave-status {
    color: var(--muted);
    font-size: 12px;
    font-weight: 720;
}

.autosave-status[data-state="saved"] {
    color: var(--success);
}

.autosave-status[data-state="saving"] {
    color: var(--primary);
}

.autosave-status[data-state="error"] {
    color: var(--danger);
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.user-row {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: #fff;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.user-row.is-readonly {
    cursor: default;
}

.user-row-main {
    display: grid;
    gap: 4px;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check-line input {
    width: auto;
}

.close-row {
    display: grid;
    padding: 0;
    border-bottom: 1px solid var(--line);
}

.close-row:last-child { border-bottom: 0; }

.shift-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.shift-table {
    min-width: 1010px;
}

.shift-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.45fr) 128px 112px 108px 132px 108px 112px 118px;
    align-items: stretch;
    gap: 0;
}

.shift-row > div,
.shift-row > label,
.shift-row > output {
    min-width: 0;
    padding: 8px 9px;
    border-right: 1px solid var(--line);
}

.shift-row > div:last-child,
.shift-row > output:last-child {
    border-right: 0;
}

.shift-header {
    background: var(--panel-subtle);
    color: var(--ink);
    font-size: 12px;
    font-weight: 780;
    text-align: center;
}

.shift-header > div {
    display: flex;
    align-items: center;
    justify-content: center;
}

.shift-row .short-input {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.shift-row .short-input span {
    display: none;
}

.shift-row .paper-input span {
    display: none;
}

.shift-row input {
    min-height: 34px;
    padding: 6px 8px;
}

.shift-product strong {
    font-size: 14px;
    font-weight: 780;
}

.paper-value {
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 680;
    background: #fbfdff;
}

.paper-input {
    color: var(--primary-strong);
    background: #fff;
}

.paper-input input {
    border-color: #9fc4ff;
    background: #fdfefe;
    color: var(--ink);
    font-weight: 720;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .05);
}

.paper-input input:focus {
    border-color: var(--primary);
    background: #fff;
}

.shift-total-cell {
    color: var(--ink);
    font-weight: 780;
}

.shift-price {
    color: var(--muted);
    font-size: 13px;
}

.finance-grid,
.breakdown-grid {
    display: grid;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
}

.finance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.finance-line,
.breakdown-line {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(118px, auto);
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 7px 9px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 680;
}

.finance-line:nth-child(2n),
.breakdown-line:nth-child(2n) {
    border-right: 0;
}

.finance-line:nth-last-child(-n + 2),
.breakdown-line:last-child {
    border-bottom: 0;
}

.finance-line input {
    min-height: 34px;
    padding: 6px 8px;
    text-align: right;
    font-weight: 720;
    border-color: #9fc4ff;
}

.finance-auto {
    background: #f6faff;
}

.finance-auto span::after {
    content: "auto";
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #dbeafe;
    color: #2563eb;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.finance-line output,
.breakdown-line output {
    text-align: right;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    font-weight: 780;
}

.finance-total,
.breakdown-total {
    background: var(--primary-soft);
    color: var(--primary-strong);
}

.finance-total output,
.breakdown-total output,
.finance-difference output {
    color: var(--primary-strong);
}

.breakdown-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.breakdown-total {
    grid-column: 1 / -1;
}

.product-row {
    display: grid;
    grid-template-columns: minmax(170px, 1.25fr) minmax(120px, .85fr) 86px 86px 84px 86px 84px 92px 102px 82px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.product-row:last-child { border-bottom: 0; }

.form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.settings-form {
    margin-bottom: 48px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.settings-grid label:nth-child(4) {
    grid-column: 1 / -1;
}

.settings-logo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px minmax(220px, .8fr);
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-subtle);
}

.company-logo-preview {
    width: 72px;
    height: 72px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.company-logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.stack { display: grid; gap: 12px; }

.grid-form {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
    min-width: 0;
}

.inline-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.quick-actions,
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-grid {
    grid-template-columns: 1.1fr .9fr;
    align-items: start;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.metric-card,
.action-card {
    padding: 15px;
}

.metric-card {
    display: grid;
    gap: 8px;
}

.metric-card .number {
    text-align: left;
    font-size: 24px;
    font-weight: 780;
    color: var(--primary-strong);
}

.card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 12px;
    font-weight: 720;
}

.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: #b45309; }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.neutral { background: #f1f5f9; color: var(--ink-soft); }

.check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
    font-weight: 620;
}

.check input,
.permission-row input {
    width: 36px;
    min-height: 22px;
    appearance: none;
    border-radius: 999px;
    background: #e5edf8;
    border-color: #cfdaea;
    padding: 0;
    position: relative;
    transition: background .18s ease, border-color .18s ease;
}

.check input::after,
.permission-row input::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 2px;
    left: 2px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .18);
    transition: transform .18s ease;
}

.check input:checked,
.permission-row input:checked {
    border-color: var(--primary);
    background: var(--primary);
}

.check input:checked::after,
.permission-row input:checked::after {
    transform: translateX(14px);
}

.permission-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    color: var(--ink);
    border-top: 1px solid var(--line);
}

.short-input input { text-align: right; }

.number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.muted {
    color: var(--muted);
    font-size: 13px;
    margin-top: 3px;
}

.compact { font-size: 12px; }

.eyebrow {
    color: var(--primary-strong);
    font-size: 12px;
    font-weight: 760;
    letter-spacing: 0;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.messages {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.message {
    padding: 11px 13px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.message.error {
    border-color: #fecdd3;
    background: var(--danger-soft);
    color: var(--danger);
}

.message.success {
    border-color: #bbf7d0;
    background: var(--success-soft);
    color: var(--success);
}

.sticky-total {
    position: sticky;
    bottom: 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 44px rgba(29, 78, 216, .16);
    backdrop-filter: blur(16px);
}

.detail-section {
    margin-bottom: 14px;
}

.detail-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.detail-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 13px;
}

.detail-table th,
.detail-table td {
    padding: 10px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    vertical-align: top;
}

.detail-table th:first-child,
.detail-table td:first-child,
.detail-table th:nth-child(2),
.detail-table td:nth-child(2) {
    text-align: left;
}

.detail-table th {
    background: var(--panel-subtle);
    color: var(--ink);
    font-weight: 780;
}

.detail-table tbody tr:last-child td {
    border-bottom: 0;
}

.detail-table td span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.recap-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.note-box {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-subtle);
}

.inventory-head {
    margin-bottom: 12px;
}

.inventory-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.inventory-action-button {
    min-height: 58px;
    justify-content: center;
    font-size: 17px;
    font-weight: 780;
}

.inventory-create {
    display: grid;
    gap: 16px;
    padding: 20px;
    margin-bottom: 18px;
    border: 1px solid rgba(37, 99, 235, .24);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(37, 99, 235, .13), rgba(255, 255, 255, .98) 48%),
        #fff;
    box-shadow: 0 18px 42px rgba(37, 99, 235, .14);
}

.inventory-create-head {
    display: grid;
    gap: 2px;
}

.inventory-create-head h2,
.inventory-section-title h2 {
    font-size: 24px;
}

.inventory-create-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.inventory-save {
    grid-column: 1 / -1;
    min-height: 54px;
    font-size: 17px;
    letter-spacing: .04em;
}

.inventory-separator {
    height: 1px;
    margin: 22px 0;
    border: 0;
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.inventory-movements {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.movement-drawer {
    min-width: 0;
}

.movement-drawer summary {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font-size: 18px;
    font-weight: 780;
    list-style: none;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.movement-drawer summary::-webkit-details-marker {
    display: none;
}

.movement-drawer summary:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
}

.movement-drawer[open] summary {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-strong);
}

.movement-form {
    display: grid;
    gap: 12px;
    padding: 14px;
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-sm);
}

.danger-action {
    border-color: #fecdd3;
    background: var(--danger-soft);
    color: var(--danger);
}

button.danger-action:hover,
.danger-action:hover {
    border-color: #fda4af;
    background: #ffe4e6;
    color: #be123c;
}

.inventory-stock {
    display: grid;
    gap: 10px;
}

.inventory-section-title {
    display: grid;
    gap: 2px;
    margin-bottom: 4px;
}

.stock-category {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-sm);
}

.stock-category > summary,
.stock-product > summary {
    cursor: pointer;
    list-style: none;
}

.stock-category > summary::-webkit-details-marker,
.stock-product > summary::-webkit-details-marker {
    display: none;
}

.stock-category > summary {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
    background: var(--panel-subtle);
    color: var(--ink);
    font-size: 17px;
    font-weight: 780;
}

.stock-category > summary span:first-child::before {
    content: ">";
    display: inline-block;
    margin-right: 9px;
    color: var(--primary-strong);
    transition: transform .18s ease;
}

.stock-category[open] > summary span:first-child::before {
    transform: rotate(90deg);
}

.stock-count {
    min-width: 30px;
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
}

.stock-items {
    display: grid;
}

.stock-product-row {
    width: 100%;
    min-height: 52px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    box-shadow: none;
    text-align: left;
}

.stock-product-row:hover {
    transform: none;
    border-color: var(--line);
    background: #f8fbff;
    box-shadow: none;
}

.stock-product-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-product-row strong {
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

.stock-product {
    border-top: 1px solid var(--line);
    background: #fff;
}

.stock-product > summary {
    min-height: 52px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
}

.stock-product > summary span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-product > summary strong {
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

.stock-product[open] > summary {
    background: #fbfdff;
}

.product-detail {
    display: grid;
    gap: 10px;
    padding: 0 16px 16px;
}

.product-edit-form {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(110px, .6fr) minmax(110px, .6fr) auto;
    gap: 10px;
    align-items: end;
}

.product-delete-form {
    display: flex;
    justify-content: flex-end;
}

.modal {
    width: min(460px, calc(100vw - 28px));
    max-height: min(780px, calc(100vh - 28px));
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink);
}

.modal::backdrop {
    background: rgba(15, 23, 42, .34);
    backdrop-filter: blur(6px);
}

.modal-panel {
    display: grid;
    gap: 13px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 26px 70px rgba(15, 23, 42, .22);
}

.modal-head,
.modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.modal-actions {
    justify-content: flex-end;
    padding-top: 4px;
}

.product-detail-list {
    display: grid;
    gap: 8px;
    margin: 0;
}

.product-detail-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-subtle);
}

.product-detail-list dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 680;
}

.product-detail-list dd {
    margin: 0;
    font-weight: 780;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.labs-shell {
    display: grid;
    gap: var(--bf-space-4);
    min-width: 0;
}

.labs-hero {
    display: grid;
    gap: var(--bf-space-3);
    padding: var(--bf-space-5);
    border: 1px solid rgba(217, 119, 6, .28);
    border-radius: var(--bf-radius-lg);
    background:
        linear-gradient(135deg, rgba(217, 119, 6, .12), rgba(255, 255, 255, .94) 46%),
        var(--bf-surface);
    box-shadow: var(--bf-shadow-sm);
}

.labs-hero h1 {
    overflow-wrap: anywhere;
}

.labs-warning {
    max-width: 740px;
    margin-top: var(--bf-space-2);
    color: #92400e;
    font-weight: 650;
}

.labs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--bf-space-4);
}

.labs-card {
    display: grid;
    gap: var(--bf-space-4);
    min-width: 0;
    padding: var(--bf-space-5);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-lg);
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--bf-shadow-sm);
}

.labs-card .card-title {
    margin-bottom: 0;
}

.labs-card h2 {
    min-width: 0;
    overflow-wrap: anywhere;
}

.labs-card-action {
    justify-self: start;
}

.scanner-placeholder {
    width: 100%;
    min-width: 0;
    padding: var(--bf-space-4);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-lg);
    background:
        linear-gradient(180deg, rgba(234, 242, 255, .62), rgba(255, 255, 255, .94)),
        var(--bf-surface);
    box-shadow: var(--bf-shadow-sm);
}

.scanner-frame {
    position: relative;
    width: min(560px, 100%);
    aspect-ratio: 4 / 3;
    min-height: 260px;
    display: grid;
    place-items: center;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-lg);
    background:
        linear-gradient(rgba(37, 99, 235, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, .08) 1px, transparent 1px),
        var(--bf-surface-soft);
    background-size: 28px 28px;
}

.scanner-frame::before {
    content: "";
    position: absolute;
    inset: 18px;
    border: 1px dashed rgba(37, 99, 235, .38);
    border-radius: var(--bf-radius-md);
}

.scanner-corners::before,
.scanner-corners::after,
.scanner-target::before,
.scanner-target::after {
    content: "";
    position: absolute;
    width: 42px;
    height: 42px;
    border-color: var(--bf-primary);
    border-style: solid;
}

.scanner-corners::before {
    top: 18px;
    left: 18px;
    border-width: 3px 0 0 3px;
}

.scanner-corners::after {
    top: 18px;
    right: 18px;
    border-width: 3px 3px 0 0;
}

.scanner-target::before {
    right: 18px;
    bottom: 18px;
    border-width: 0 3px 3px 0;
}

.scanner-target::after {
    bottom: 18px;
    left: 18px;
    border-width: 0 0 3px 3px;
}

.scanner-line {
    position: absolute;
    left: 32px;
    right: 32px;
    top: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--bf-primary), transparent);
    opacity: .68;
}

.scanner-target {
    width: 94px;
    height: 190px;
    display: grid;
    place-items: end center;
    border: 2px solid rgba(37, 99, 235, .36);
    border-radius: 22px 22px 10px 10px;
    background: rgba(255, 255, 255, .68);
}

.scanner-target span {
    width: 42px;
    height: 26px;
    margin-bottom: 18px;
    border: 1px solid rgba(37, 99, 235, .24);
    border-radius: 999px;
    background: var(--bf-primary-soft);
}

.liquid-vision {
    max-width: 860px;
}

.liquid-stage {
    display: grid;
    gap: var(--bf-space-4);
    min-width: 0;
    padding: var(--bf-space-5);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-lg);
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--bf-shadow-sm);
    animation: page-in .18s ease;
}

.liquid-stage[hidden] {
    display: none;
}

.liquid-primary-action {
    justify-self: start;
}

.liquid-camera-shell,
.liquid-preview-shell {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-lg);
    background:
        linear-gradient(rgba(37, 99, 235, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, .08) 1px, transparent 1px),
        var(--bf-surface-soft);
    background-size: 28px 28px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.liquid-camera-shell {
    aspect-ratio: 4 / 3;
    min-height: 320px;
}

.liquid-camera,
.liquid-preview {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.liquid-preview-shell {
    aspect-ratio: 4 / 3;
    min-height: 280px;
}

.liquid-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bf-space-3);
}

.liquid-analysis {
    min-height: 280px;
    place-items: center;
    text-align: center;
}

.liquid-loader {
    width: 54px;
    height: 54px;
    border: 4px solid var(--bf-primary-soft);
    border-top-color: var(--bf-primary);
    border-radius: 50%;
    animation: liquid-spin .82s linear infinite;
}

.liquid-result {
    display: grid;
    gap: var(--bf-space-1);
    padding: var(--bf-space-4);
    border: 1px solid rgba(37, 99, 235, .18);
    border-radius: var(--bf-radius-md);
    background: var(--bf-primary-subtle);
}

.liquid-result strong {
    color: var(--bf-primary-hover);
    font-size: clamp(32px, 8vw, 54px);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.liquid-manual-head {
    display: grid;
    gap: 4px;
    text-align: center;
}

.liquid-manual-shell {
    position: relative;
    min-height: 360px;
    overflow: hidden;
    touch-action: none;
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-lg);
    background: #020617;
}

.liquid-manual-shell .liquid-preview,
.level-picker__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .92;
}

.level-picker {
    user-select: none;
    cursor: ns-resize;
}

.liquid-manual-bottle {
    position: absolute;
    left: 50%;
    top: 10%;
    width: min(42%, 170px);
    height: 78%;
    transform: translateX(-50%);
    border: 2px solid rgba(248, 251, 255, .72);
    border-radius: 46px 46px 18px 18px;
    box-shadow:
        0 0 0 999px rgba(2, 6, 23, .22),
        inset 0 0 0 1px rgba(37, 99, 235, .32);
}

.level-picker__line {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: rgba(79, 209, 255, .6);
    box-shadow: 0 0 18px rgba(79, 209, 255, .42);
    pointer-events: none;
    transition: height .16s ease, opacity .16s ease, box-shadow .16s ease;
    z-index: 3;
}

.level-picker__handle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 2px solid rgba(79, 209, 255, .88);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 7px 20px rgba(2, 6, 23, .34), 0 0 0 6px rgba(79, 209, 255, .14);
    transform: translate(-50%, -50%);
    touch-action: none;
    cursor: ns-resize;
    transition: transform .16s ease, box-shadow .16s ease;
    z-index: 4;
}

.level-picker__readout {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    padding: 5px 9px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(8, 17, 31, .82);
    color: #f8fbff;
    font-size: 12px;
    font-weight: 780;
    font-variant-numeric: tabular-nums;
    z-index: 4;
}

.level-picker__zoom {
    position: absolute;
    left: calc(50% + 32px);
    top: 50%;
    width: 92px;
    height: 92px;
    border: 2px solid rgba(79, 209, 255, .78);
    border-radius: 50%;
    background-color: #020617;
    background-repeat: no-repeat;
    box-shadow: 0 18px 48px rgba(2, 6, 23, .38), inset 0 0 0 1px rgba(255, 255, 255, .2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(.92);
    transition: opacity .16s ease, transform .16s ease;
    z-index: 5;
}

.level-picker.is-dragging .level-picker__line {
    height: 4px;
    opacity: .96;
    box-shadow: 0 0 26px rgba(79, 209, 255, .62);
}

.level-picker.is-dragging .level-picker__handle {
    transform: translate(-50%, -50%) scale(1.18);
    box-shadow: 0 10px 26px rgba(2, 6, 23, .42), 0 0 0 8px rgba(79, 209, 255, .2);
}

.level-picker.is-dragging .level-picker__zoom {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.liquid-manual-live {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    color: rgba(226, 232, 240, .84);
    font-size: 13px;
    font-weight: 680;
}

.liquid-manual-live span {
    padding: 7px 10px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 999px;
    background: rgba(15, 23, 42, .58);
}

.liquid-manual-live strong {
    color: #f8fbff;
    font-variant-numeric: tabular-nums;
}

.liquid-status {
    min-height: 20px;
    color: var(--bf-muted);
    font-size: 13px;
    font-weight: 650;
}

@keyframes liquid-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 700px) {
    .labs-grid {
        grid-template-columns: 1fr;
    }

    .labs-card .card-title,
    .labs-shell .section-head {
        align-items: start;
        flex-direction: column;
    }

    .labs-card-action,
    .labs-shell .section-head .button,
    .liquid-primary-action {
        width: 100%;
    }

    .scanner-placeholder {
        padding: var(--bf-space-3);
    }

    .scanner-frame {
        min-height: 220px;
    }

    .liquid-stage {
        padding: var(--bf-space-4);
    }

    .liquid-camera-shell,
    .liquid-preview-shell {
        min-height: 240px;
    }

    .liquid-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .liquid-actions button {
        width: 100%;
    }
}

/* Sprint C3 premium polish */
:root {
    --bf-accent-stock: #10b981;
    --bf-accent-shift: #8b5cf6;
    --bf-accent-archive: #0ea5e9;
    --bf-accent-settings: #f97316;
    --bf-accent-rose: #f43f5e;
}

body {
    background:
        radial-gradient(circle at 10% -10%, rgba(14, 165, 233, .16), transparent 34rem),
        radial-gradient(circle at 92% 8%, rgba(249, 115, 22, .12), transparent 30rem),
        linear-gradient(180deg, #fbfdff 0%, #f4f7fb 42%, #eef4fb 100%);
}

.app-shell {
    box-shadow: 0 18px 42px rgba(15, 23, 42, .06);
}

.section-head {
    margin-top: var(--bf-space-6);
    margin-bottom: var(--bf-space-5);
}

.section-head h1 {
    max-width: 860px;
    font-size: clamp(32px, 5vw, 52px);
    letter-spacing: 0;
}

.section-head .muted {
    max-width: 620px;
    font-size: 14px;
}

.module-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--bf-space-4);
    margin-bottom: var(--bf-space-5);
}

.module-card {
    position: relative;
    min-height: 118px;
    display: grid;
    align-content: end;
    gap: 5px;
    overflow: hidden;
    padding: var(--bf-space-5);
    border: 1px solid rgba(255, 255, 255, .64);
    border-radius: var(--bf-radius-lg);
    color: #fff;
    box-shadow: var(--bf-shadow-md);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.module-card::before {
    content: "";
    position: absolute;
    inset: -40% -20% auto auto;
    width: 150px;
    height: 150px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .20);
}

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--bf-shadow-lg);
    filter: saturate(1.05);
}

.module-card strong,
.module-card small,
.module-icon {
    position: relative;
    z-index: 1;
}

.module-card strong {
    font-size: 18px;
}

.module-card small {
    color: rgba(255, 255, 255, .78);
    font-weight: 650;
}

.module-icon,
.empty-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, .20);
    color: #fff;
    font-weight: 850;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28);
}

.tone-stock { background: linear-gradient(135deg, #059669, #10b981); }
.tone-shift { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }
.tone-archive { background: linear-gradient(135deg, #0369a1, #0ea5e9); }
.tone-settings { background: linear-gradient(135deg, #c2410c, #f97316); }

.metric-card,
.action-card,
.panel,
.paper-panel,
.list,
.stock-category {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .88)),
        var(--bf-surface);
    box-shadow: 0 12px 34px rgba(15, 23, 42, .07);
}

.metric-card {
    position: relative;
    overflow: hidden;
    min-height: 132px;
}

.metric-card::after {
    content: "";
    position: absolute;
    inset: auto -38px -58px auto;
    width: 122px;
    height: 122px;
    border-radius: 999px;
    opacity: .14;
}

.tone-company::after { background: var(--bf-accent-archive); }
.tone-user::after { background: var(--bf-accent-stock); }
.tone-role::after { background: var(--bf-accent-settings); }

.premium-empty,
.empty-state {
    display: grid;
    justify-items: start;
    gap: var(--bf-space-3);
    padding: var(--bf-space-6);
}

.premium-empty .empty-icon,
.empty-state .empty-icon {
    background: linear-gradient(135deg, var(--bf-primary), var(--bf-accent-shift));
}

.compact-empty {
    padding: var(--bf-space-4);
}

.inventory-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 58px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(248, 251, 255, .92)),
        #fff;
}

.inventory-action-button.primary,
.inventory-action-button.danger-action {
    color: #fff;
}

.modal-panel {
    transform-origin: center;
    animation: modal-rise .18s ease;
}

@keyframes modal-rise {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.messages {
    position: sticky;
    top: 86px;
    z-index: 18;
}

.message {
    border-left: 4px solid var(--bf-primary);
}

@media (max-width: 900px) {
    .module-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .section-head h1 {
        font-size: 34px;
    }

    .module-strip {
        grid-template-columns: 1fr;
    }

    .module-card {
        min-height: 96px;
    }
}

/* Sprint C3.1 identity and navigation */
@media (min-width: 901px) {
    body {
        padding-left: 288px;
    }

    .app-shell {
        position: fixed;
        inset: 0 auto 0 0;
        width: 288px;
        display: grid;
        grid-template-rows: auto 1fr;
        border-right: 1px solid rgba(185, 204, 228, .68);
        border-bottom: 0;
        background:
            radial-gradient(circle at 28% 0%, rgba(37, 99, 235, .18), transparent 18rem),
            linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(247, 250, 255, .90));
        box-shadow: 24px 0 64px rgba(15, 23, 42, .08);
        backdrop-filter: blur(22px) saturate(130%);
    }

    .topbar {
        width: 100%;
        height: auto;
        padding: 28px 24px 18px;
    }

    .brand {
        align-items: center;
        gap: 14px;
    }

    .brand-mark {
        width: 54px;
        height: 54px;
        flex-basis: 54px;
        border-radius: 16px;
        font-size: 24px;
    }

    .brand strong {
        font-size: 22px;
        letter-spacing: .08em;
    }

    .brand small {
        max-width: none;
        font-size: 13px;
    }

    .desktop-logout {
        position: absolute;
        right: 20px;
        bottom: 18px;
    }

    .tabs {
        width: 100%;
        height: 100%;
        display: grid;
        align-content: start;
        gap: 7px;
        overflow: visible;
        padding: 8px 18px 24px;
    }

    .tabs a,
    .mobile-logout button {
        width: 100%;
        min-height: 46px;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0 14px;
        border: 1px solid transparent;
        border-radius: 14px;
        color: var(--bf-text-soft);
        font-size: 15px;
        font-weight: 720;
    }

    .tabs a:hover,
    .mobile-logout button:hover {
        border-color: rgba(37, 99, 235, .14);
        background: rgba(255, 255, 255, .80);
        color: var(--bf-primary-hover);
        transform: translateX(2px);
    }

    .tabs a.is-active {
        border-color: rgba(37, 99, 235, .22);
        background:
            linear-gradient(135deg, rgba(37, 99, 235, .13), rgba(255, 255, 255, .88)),
            #fff;
        color: var(--bf-primary-hover);
        box-shadow: 0 12px 30px rgba(37, 99, 235, .12);
    }

    .page {
        width: min(1240px, 100%);
        padding: 34px 34px 108px;
    }
}

.nav-icon,
.module-icon,
.metric-icon,
.empty-icon {
    --icon-url: none;
    background-color: currentColor;
    -webkit-mask: var(--icon-url) center / 22px 22px no-repeat;
    mask: var(--icon-url) center / 22px 22px no-repeat;
}

.nav-icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    color: currentColor;
}

.module-icon,
.metric-icon,
.empty-icon {
    color: currentColor;
}

.module-icon {
    width: 52px;
    height: 52px;
    background-color: #fff;
    -webkit-mask-size: 28px 28px;
    mask-size: 28px 28px;
}

.metric-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    color: var(--bf-primary-hover);
    -webkit-mask-size: 27px 27px;
    mask-size: 27px 27px;
}

.empty-icon {
    color: #fff;
    -webkit-mask-size: 24px 24px;
    mask-size: 24px 24px;
}

.icon-dashboard { --icon-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 13h8V3H3v10Zm0 8h8v-6H3v6Zm10 0h8V11h-8v10Zm0-18v6h8V3h-8Z'/%3E%3C/svg%3E"); }
.icon-calendar { --icon-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 2h2v2h6V2h2v2h3v18H4V4h3V2Zm13 8H4v10h16V10Z'/%3E%3C/svg%3E"); }
.icon-box { --icon-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m12 2 9 4.8v10.4L12 22l-9-4.8V6.8L12 2Zm0 2.3L5.3 7.9 12 11.5l6.7-3.6L12 4.3ZM5 9.6v6.4l6 3.2v-6.4L5 9.6Zm8 9.6 6-3.2V9.6l-6 3.2v6.4Z'/%3E%3C/svg%3E"); }
.icon-archive { --icon-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 3h16v5H4V3Zm1 7h14v11H5V10Zm5 3v2h4v-2h-4Z'/%3E%3C/svg%3E"); }
.icon-users { --icon-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M8 11a4 4 0 1 1 0-8 4 4 0 0 1 0 8Zm8.5 1a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7ZM2 21v-2a6 6 0 0 1 12 0v2H2Zm13 0v-2a7.9 7.9 0 0 0-1.3-4.3A5 5 0 0 1 22 18.5V21h-7Z'/%3E%3C/svg%3E"); }
.icon-tags { --icon-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20.6 13.4 13.4 20.6a2 2 0 0 1-2.8 0L3 13V4h9l8.6 8.6a2 2 0 0 1 0 2.8ZM7.5 9A1.5 1.5 0 1 0 7.5 6a1.5 1.5 0 0 0 0 3Z'/%3E%3C/svg%3E"); }
.icon-settings { --icon-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m19.4 13.5.1-1.5-.1-1.5 2-1.5-2-3.5-2.4 1a8 8 0 0 0-2.6-1.5L14 2h-4l-.4 2.5A8 8 0 0 0 7 6L4.6 5 2.6 8.5l2 1.5-.1 1.5.1 1.5-2 1.5 2 3.5L7 17a8 8 0 0 0 2.6 1.5L10 21h4l.4-2.5A8 8 0 0 0 17 17l2.4 1 2-3.5-2-1.5ZM12 15.5A3.5 3.5 0 1 1 12 8a3.5 3.5 0 0 1 0 7.5Z'/%3E%3C/svg%3E"); }
.icon-shield { --icon-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 20 5v6c0 5-3.4 9.7-8 11-4.6-1.3-8-6-8-11V5l8-3Zm-1 13.5 5.2-5.2-1.4-1.4L11 12.7 9.2 11 7.8 12.4 11 15.5Z'/%3E%3C/svg%3E"); }
.icon-sparkles { --icon-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m12 2 1.7 5.2L19 9l-5.3 1.8L12 16l-1.7-5.2L5 9l5.3-1.8L12 2Zm7 10 1 3 3 1-3 1-1 3-1-3-3-1 3-1 1-3ZM5 14l1 2.5L8.5 18 6 19l-1 3-1-3-2.5-1L4 16.5 5 14Z'/%3E%3C/svg%3E"); }
.icon-log-out { --icon-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 3h9v2H6v14h7v2H4V3Zm12.6 5.4L20.2 12l-3.6 3.6-1.4-1.4 1.2-1.2H10v-2h6.4l-1.2-1.2 1.4-1.4Z'/%3E%3C/svg%3E"); }
.icon-clipboard { --icon-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M9 2h6l1 2h3v18H5V4h3l1-2Zm0 5h6V5H9v2Zm0 5h6v-2H9v2Zm0 4h4v-2H9v2Z'/%3E%3C/svg%3E"); }
.icon-building { --icon-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 21V3h10v4h6v14h-6v-4h-4v4H4Zm3-14h2V5H7v2Zm4 0h2V5h-2v2Zm-4 4h2V9H7v2Zm4 0h2V9h-2v2Zm5 0h2V9h-2v2Zm0 4h2v-2h-2v2Zm-9 0h2v-2H7v2Zm4 0h2v-2h-2v2Z'/%3E%3C/svg%3E"); }
.icon-user { --icon-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10Zm0 2c-4.4 0-8 2.4-8 5.4V22h16v-2.6c0-3-3.6-5.4-8-5.4Z'/%3E%3C/svg%3E"); }

.module-strip {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.module-card {
    min-height: 152px;
    padding: 26px;
}

.module-icon {
    position: absolute;
    top: 22px;
    right: 22px;
    opacity: .82;
}

.metric-card {
    min-height: 172px;
    align-content: end;
    padding: 24px;
}

.metric-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    opacity: .24;
}

.superadmin-shell {
    display: grid;
    gap: 18px;
    padding: 22px;
    border: 1px solid rgba(96, 165, 250, .22);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, .24), transparent 28rem),
        linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
    color: #e5edff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.superadmin-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.superadmin-head h1 {
    color: #fff;
}

.superadmin-head p:not(.eyebrow) {
    color: #9fb1d1;
    margin-top: 6px;
}

.superadmin-count {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid rgba(147, 197, 253, .28);
    border-radius: 999px;
    background: rgba(15, 23, 42, .72);
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 760;
}

.superadmin-impersonation-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 22px;
    background: #111827;
    color: #fde68a;
    border-bottom: 1px solid rgba(251, 191, 36, .36);
}

.superadmin-impersonation-bar form {
    margin: 0;
}

.superadmin-impersonation-bar button {
    min-height: 32px;
    padding: 0 10px;
    border-color: rgba(251, 191, 36, .42);
    background: rgba(120, 53, 15, .55);
    color: #fffbeb;
    box-shadow: none;
}

.superadmin-kpis,
.superadmin-detail-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.superadmin-kpis article,
.superadmin-detail-grid article {
    min-height: 96px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, .72);
}

.superadmin-kpis span,
.superadmin-detail-grid span {
    display: block;
    color: #9fb1d1;
    font-size: 12px;
    font-weight: 760;
    text-transform: uppercase;
}

.superadmin-kpis strong,
.superadmin-detail-grid strong {
    display: block;
    margin-top: 10px;
    color: #fff;
    font-size: clamp(22px, 3vw, 34px);
}

.superadmin-section-title,
.superadmin-detail-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.superadmin-section-title h2 {
    color: #fff;
}

.superadmin-section-title span {
    color: #9fb1d1;
    font-size: 13px;
    font-weight: 760;
}

.superadmin-detail-actions {
    justify-content: flex-start;
    margin-bottom: 0;
}

.superadmin-table {
    display: grid;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, .78);
}

.superadmin-row {
    display: grid;
    grid-template-columns: minmax(170px, 1.3fr) 70px 120px 90px 100px 120px minmax(300px, 1.5fr);
    align-items: center;
    gap: 12px;
    min-height: 66px;
    padding: 12px 14px;
    border-top: 1px solid rgba(148, 163, 184, .16);
    color: #dbe7ff;
}

.superadmin-row:first-child {
    border-top: 0;
}

.superadmin-row-head {
    min-height: 44px;
    background: rgba(30, 41, 59, .9);
    color: #93c5fd;
    font-size: 12px;
    font-weight: 780;
    text-transform: uppercase;
}

.superadmin-row strong {
    display: block;
    color: #fff;
}

.superadmin-row small {
    display: block;
    color: #8ea2c4;
    margin-top: 2px;
}

.status-pill {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    justify-content: center;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(96, 165, 250, .16);
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 760;
}

.status-pill[data-status="active"] {
    background: rgba(34, 197, 94, .14);
    color: #86efac;
}

.status-pill[data-status="inactive"] {
    background: rgba(148, 163, 184, .16);
    color: #cbd5e1;
}

.status-pill[data-status="trial"] {
    background: rgba(250, 204, 21, .15);
    color: #fde68a;
}

.status-pill[data-status="deleted"] {
    background: rgba(248, 113, 113, .16);
    color: #fecaca;
}

.superadmin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.superadmin-actions form {
    margin: 0;
}

.superadmin-actions a,
.superadmin-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(147, 197, 253, .24);
    border-radius: var(--radius-sm);
    border-color: rgba(147, 197, 253, .24);
    background: rgba(15, 23, 42, .86);
    color: #dbeafe;
    font-size: 13px;
    font-weight: 760;
    text-decoration: none;
    box-shadow: none;
}

.superadmin-actions a:hover,
.superadmin-actions button:hover {
    transform: none;
    border-color: rgba(147, 197, 253, .55);
    background: rgba(30, 64, 175, .35);
}

.superadmin-actions .danger-action {
    border-color: rgba(248, 113, 113, .36);
    background: rgba(127, 29, 29, .32);
    color: #fecaca;
}

.superadmin-empty {
    padding: 18px;
    color: #9fb1d1;
}

@media (max-width: 900px) {
    .dashboard-grid,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .grid-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-row button {
        grid-column: 1 / -1;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .settings-form {
        margin-bottom: 0;
        padding-bottom: calc(92px + env(safe-area-inset-bottom));
    }

    .settings-grid,
    .settings-logo {
        grid-template-columns: 1fr;
    }

    .settings-grid label:nth-child(4) {
        grid-column: auto;
    }

    .settings-form .form-actions {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        z-index: 40;
        display: grid;
        padding: 10px;
        margin: 0;
        border: 1px solid var(--line-strong);
        border-radius: var(--radius);
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 18px 44px rgba(29, 78, 216, .16);
        backdrop-filter: blur(16px);
        grid-template-columns: minmax(0, 1fr);
        box-sizing: border-box;
    }

    .settings-form .form-actions button {
        width: 100%;
        max-width: 100%;
        min-height: 48px;
        justify-self: stretch;
        justify-content: center;
    }

    .inventory-create-form,
    .product-edit-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inventory-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .inventory-save,
    .product-edit-form button {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    html,
    body {
        min-height: 100%;
        overflow-y: auto;
    }
    body { font-size: 14px; }
    h1 {
        font-size: 30px;
        line-height: 1.02;
    }
    h2 {
        font-size: 17px;
    }
    .topbar { height: 60px; padding-inline: 14px; }
    .topbar .brand {
        max-width: calc(100% - 58px);
    }
    .topbar-actions {
        position: absolute;
        top: 10px;
        right: 14px;
    }
    .menu-button {
        display: inline-flex;
        border-color: var(--primary);
        background: var(--primary);
        color: #fff;
        box-shadow: 0 10px 22px rgba(37, 99, 235, .18);
        z-index: 2;
    }
    .desktop-logout { display: none; }
    .tabs {
        display: grid;
        gap: 6px;
        max-height: 0;
        overflow: hidden;
        padding: 0 14px;
        opacity: 0;
        transform: translateY(-4px);
        transition: max-height .22s ease, opacity .18s ease, transform .18s ease, padding .18s ease;
    }
    .tabs.is-open {
        max-height: 360px;
        padding: 0 14px 12px;
        opacity: 1;
        transform: translateY(0);
    }
    .tabs a {
        width: 100%;
        padding: 11px 12px;
        border-color: var(--line);
        background: #fff;
        border-radius: var(--radius);
    }
    .mobile-logout {
        display: block;
    }
    .mobile-logout button {
        width: 100%;
        justify-content: flex-start;
        background: #fff;
        color: var(--ink-soft);
        box-shadow: var(--shadow-sm);
    }
    .page {
        padding: 16px 12px calc(180px + env(safe-area-inset-bottom));
        min-height: auto;
    }
    .page:has(.login-shell) {
        padding: 0;
    }
    .login-panel {
        width: calc(100vw - 76px);
        max-width: 340px;
        padding: 24px;
    }
    .brand small { max-width: 160px; }
    .hero-panel {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    .section-head {
        align-items: start;
        flex-direction: column;
    }
    .paper-panel {
        padding: 8px;
    }
    .paper-panel-head {
        margin-bottom: 7px;
    }
    .paper-panel-head .badge {
        display: none;
    }
    .quick-actions,
    .grid-form,
    .inline-form {
        grid-template-columns: 1fr;
    }
    .archive-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .archive-header {
        display: none;
    }
    .archive-row > div {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    .archive-row > div::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 760;
    }
    .archive-actions {
        justify-content: stretch;
    }
    .archive-actions::before {
        display: none;
    }
    .archive-actions .button {
        flex: 1;
        justify-content: center;
    }
    .draft-recovery {
        align-items: stretch;
        flex-direction: column;
    }
    .draft-recovery .actions-row {
        display: grid;
        grid-template-columns: 1fr;
    }
    .draft-recovery .button,
    .draft-recovery button {
        width: 100%;
        justify-content: center;
    }
    .inventory-create {
        padding: 16px;
        margin-bottom: 16px;
    }
    .inventory-actions {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .inventory-action-button {
        min-height: 52px;
        justify-content: flex-start;
        font-size: 16px;
    }
    .inventory-create-form,
    .inventory-movements,
    .product-edit-form {
        grid-template-columns: 1fr;
    }
    .inventory-save,
    .movement-drawer summary {
        min-height: 58px;
    }
    .movement-drawer summary {
        justify-content: flex-start;
        font-size: 17px;
    }
    .stock-category > summary {
        min-height: 54px;
        padding-inline: 14px;
    }
    .stock-product > summary {
        min-height: 50px;
        padding-inline: 14px;
    }
    .stock-product-row {
        min-height: 50px;
        padding-inline: 14px;
    }
    .product-detail {
        padding: 0 14px 14px;
    }
    .product-delete-form {
        display: grid;
    }
    .product-delete-form button {
        width: 100%;
    }
    .modal {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
    }
    .modal-panel {
        padding: 14px;
    }
    .modal-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .modal-actions button {
        width: 100%;
    }
    .superadmin-shell {
        padding: 14px;
    }
    .superadmin-head {
        display: grid;
    }
    .superadmin-impersonation-bar,
    .superadmin-section-title,
    .superadmin-detail-actions {
        align-items: stretch;
        display: grid;
    }
    .superadmin-kpis,
    .superadmin-detail-grid {
        grid-template-columns: 1fr;
    }
    .superadmin-row,
    .superadmin-row-head {
        grid-template-columns: 1fr;
    }
    .superadmin-row-head {
        display: none;
    }
    .superadmin-row {
        align-items: stretch;
        gap: 8px;
    }
    .superadmin-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .shift-table-wrap {
        overflow: visible;
    }
    .shift-table {
        min-width: 0;
        display: grid;
        gap: 6px;
        padding: 6px;
        background: #f8fbff;
    }
    .shift-header {
        display: none;
    }
    .close-row {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px;
        padding: 6px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: #fff;
        box-shadow: var(--shadow-sm);
    }
    .shift-row > div,
    .shift-row > label,
    .shift-row > output {
        padding: 0;
        border-right: 0;
    }
    .shift-product {
        grid-column: 1 / -1;
        padding-bottom: 0;
    }
    .shift-product strong {
        display: block;
        font-size: 14px;
        line-height: 1.15;
        font-weight: 820;
        overflow-wrap: anywhere;
    }
    .shift-product .muted {
        margin-top: 1px;
        font-size: 11px;
    }
    .shift-opening,
    .shift-closing,
    .shift-delivered,
    .shift-total-cell,
    .shift-secondary,
    .shift-price,
    .shift-revenue {
        min-height: 42px;
        display: grid;
        align-content: start;
        gap: 2px;
        padding: 5px !important;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--panel-subtle);
    }
    .shift-opening::before,
    .shift-closing::before,
    .shift-delivered::before,
    .shift-total-cell::before,
    .shift-secondary::before,
    .shift-price::before,
    .shift-revenue::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 9px;
        font-weight: 760;
        text-transform: uppercase;
        letter-spacing: 0;
    }
    .shift-opening {
        text-align: left;
        font-size: 13px;
        font-weight: 760;
        color: var(--ink);
    }
    .shift-total-cell {
        position: relative;
        border-color: var(--line-strong);
        background: var(--primary-soft);
        color: var(--primary-strong);
        font-size: 13px;
        font-weight: 840;
        text-align: right;
    }
    .shift-total-cell::before {
        color: var(--primary-strong);
    }
    .shift-total-cell::after {
        content: "";
        position: absolute;
        top: 50%;
        left: -8px;
        width: 8px;
        height: 8px;
        border-right: 2px solid var(--primary-strong);
        border-bottom: 2px solid var(--primary-strong);
        transform: translateY(-50%) rotate(-45deg);
        opacity: .65;
    }
    .shift-closing span,
    .shift-delivered span {
        display: none;
    }
    .shift-closing input,
    .shift-delivered input {
        min-height: 28px;
        padding: 4px 5px;
        font-size: 14px;
        font-weight: 760;
        text-align: right;
    }
    .shift-closing,
    .shift-delivered {
        border-color: #9fc4ff;
        background: #fff;
        box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .06);
    }
    .shift-closing::before,
    .shift-delivered::before {
        color: var(--primary-strong);
    }
    .shift-secondary,
    .shift-revenue {
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: #fff;
        padding: 5px !important;
        color: var(--ink-soft);
        font-size: 12px;
        font-weight: 720;
        text-align: right;
    }
    .shift-price {
        display: grid;
        align-content: start;
        gap: 2px;
        grid-column: auto;
        min-height: 42px;
        color: var(--muted);
        font-size: 11px;
        text-align: right;
        background: #fff;
    }
    .shift-revenue {
        margin-top: 0;
        border-color: var(--line-strong);
        background: #fff;
        color: var(--primary-strong);
        font-size: 12px;
        font-weight: 840;
    }
    .shift-revenue::before {
        color: var(--primary-strong);
    }
    .sticky-total {
        grid-template-columns: 1fr auto;
    }
    .sticky-total button {
        grid-column: 1 / -1;
        width: 100%;
    }
    .finance-grid,
    .breakdown-grid {
        grid-template-columns: 1fr;
    }
    .finance-line,
    .breakdown-line {
        grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
        min-height: 40px;
        padding: 6px 8px;
        border-right: 0;
        font-size: 13px;
    }
    .finance-line:nth-last-child(-n + 2) {
        border-bottom: 1px solid var(--line);
    }
    .finance-line:last-child,
    .breakdown-line:last-child {
        border-bottom: 0;
    }
    .finance-line input {
        min-height: 32px;
        padding: 5px 7px;
    }
    .list-row {
        align-items: flex-start;
        gap: 10px;
    }
}

.schedule-head {
    align-items: end;
}

.schedule-week-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.schedule-mobile-list {
    display: none;
}

.schedule-board {
    margin-top: 18px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.schedule-month {
    margin-top: 18px;
    border: 1px solid #d9e4f2;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(31, 78, 121, 0.08);
}

.schedule-month-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border-bottom: 1px solid #e5edf6;
}

.schedule-month-head h2 {
    margin: 0;
    font-size: 1.08rem;
}

.schedule-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(118px, 1fr));
}

.schedule-month-day {
    min-height: 126px;
    padding: 10px;
    border-right: 1px solid #edf2f7;
    border-bottom: 1px solid #edf2f7;
    background: #fff;
}

.schedule-month-day header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 8px;
}

.schedule-month-day header span {
    color: #64748b;
    font-size: 0.78rem;
}

.schedule-month-day.is-empty {
    background: #fbfdff;
}

.schedule-month-shift {
    display: grid;
    gap: 2px;
    margin-top: 6px;
    padding: 7px 8px;
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    background: #eff6ff;
}

.schedule-month-shift strong {
    font-size: 0.84rem;
}

.schedule-month-shift span,
.schedule-month-empty {
    color: #64748b;
    font-size: 0.78rem;
}

.schedule-grid {
    --employee-col: 180px;
    display: grid;
    grid-template-columns: var(--employee-col) repeat(var(--schedule-days), minmax(138px, 1fr));
    min-width: 1120px;
    border: 1px solid #d9e4f2;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(31, 78, 121, 0.08);
    overflow: hidden;
}

.schedule-corner,
.schedule-day-head,
.schedule-employee-name,
.schedule-cell,
.schedule-empty-row {
    border-right: 1px solid #e5edf6;
    border-bottom: 1px solid #e5edf6;
}

.schedule-corner,
.schedule-day-head {
    min-height: 58px;
    padding: 12px;
    background: #f6f9fd;
}

.schedule-day-head {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.schedule-day-head span {
    color: #64748b;
    font-size: 0.86rem;
}

.schedule-employee-name {
    display: flex;
    align-items: center;
    min-height: 96px;
    padding: 12px;
    font-weight: 700;
    background: #fbfdff;
}

.schedule-cell {
    min-height: 96px;
    padding: 8px;
    background: #fff;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.schedule-cell.is-drop-target {
    background: #eff6ff;
    box-shadow: inset 0 0 0 2px #3b82f6;
}

.schedule-shift-card {
    position: relative;
    min-height: 76px;
    padding: 12px 34px 12px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #0f172a;
    cursor: grab;
}

.schedule-shift-card:active {
    cursor: grabbing;
}

.schedule-shift-card strong,
.schedule-shift-card span {
    display: block;
}

.schedule-shift-card span {
    margin-top: 4px;
    color: #2563eb;
    font-size: 0.9rem;
}

.schedule-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    cursor: pointer;
}

.schedule-add-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-add-form select,
.schedule-add-form button {
    width: 100%;
    min-height: 38px;
}

.schedule-empty-row {
    grid-column: 1 / -1;
    padding: 18px;
    color: #64748b;
    background: #fff;
}

.schedule-admin {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.schedule-admin-panel {
    border: 1px solid #d9e4f2;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(31, 78, 121, 0.06);
}

.schedule-admin-panel header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid #e5edf6;
}

.schedule-admin-panel h2 {
    margin: 0;
    font-size: 1rem;
}

.schedule-admin-list {
    display: grid;
}

.schedule-admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    border: 0;
    border-bottom: 1px solid #edf2f7;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.schedule-admin-row:hover {
    background: #f8fbff;
}

.schedule-admin-row span {
    color: #64748b;
    font-size: 0.9rem;
}

.schedule-v2 {
    display: grid;
    gap: 18px;
}

.schedule-v2-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border: 1px solid rgba(180, 204, 235, 0.72);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255,255,255,0.82), rgba(238,246,255,0.62));
    box-shadow: 0 18px 44px rgba(31, 78, 121, 0.11);
    backdrop-filter: blur(18px);
}

.schedule-v2-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 4.6rem);
    letter-spacing: 0;
}

.schedule-v2-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.schedule-people {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 2px 14px;
    scroll-snap-type: x proximity;
}

.schedule-person-card,
.schedule-empty-glass {
    min-width: 128px;
    min-height: 58px;
    padding: 0 18px;
    border: 1px solid rgba(148, 184, 226, 0.48);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255,255,255,0.75), color-mix(in srgb, var(--employee-color, #94a3b8) 28%, transparent));
    box-shadow: 0 14px 34px color-mix(in srgb, var(--employee-color, #94a3b8) 24%, transparent), inset 0 1px 0 rgba(255,255,255,0.75);
    backdrop-filter: blur(18px);
    color: #0f172a;
    font-weight: 760;
    letter-spacing: 0;
    cursor: grab;
    scroll-snap-align: start;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.schedule-empty-glass {
    display: flex;
    align-items: center;
    min-width: min(100%, 440px);
    cursor: default;
    color: #64748b;
    font-weight: 650;
}

.schedule-person-card:hover,
.schedule-person-card.is-selected {
    transform: translateY(-2px) scale(1.02);
    border-color: color-mix(in srgb, var(--employee-color, #2563eb) 56%, white);
    box-shadow: 0 18px 42px color-mix(in srgb, var(--employee-color, #2563eb) 30%, transparent), inset 0 1px 0 rgba(255,255,255,0.86);
}

.schedule-person-card.is-selected {
    background: linear-gradient(135deg, rgba(255,255,255,0.92), color-mix(in srgb, var(--employee-color, #2563eb) 42%, white));
}

.schedule-calendar {
    border: 1px solid rgba(180, 204, 235, 0.72);
    border-radius: 18px;
    background: rgba(255,255,255,0.72);
    box-shadow: 0 18px 44px rgba(31, 78, 121, 0.1);
    overflow: hidden;
    backdrop-filter: blur(18px);
}

.schedule-calendar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(213, 226, 242, 0.9);
}

.schedule-calendar-head h2 {
    margin: 0;
    font-size: 1.25rem;
}

.schedule-calendar-weekdays,
.schedule-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.schedule-calendar-weekdays span {
    padding: 12px 10px;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 760;
    text-align: center;
}

.schedule-day {
    min-height: 142px;
    padding: 10px;
    border-top: 1px solid rgba(226, 234, 244, 0.92);
    border-right: 1px solid rgba(226, 234, 244, 0.92);
    background: rgba(255,255,255,0.64);
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.schedule-day:nth-child(7n) {
    border-right: 0;
}

.schedule-day.is-muted {
    background: rgba(248,250,252,0.58);
    color: #94a3b8;
}

.schedule-day.is-drop-target {
    background: rgba(219, 234, 254, 0.72);
    box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.42);
}

.schedule-day.is-landing {
    animation: scheduleLanding 0.28s ease-out;
}

.schedule-day header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.schedule-day header span {
    color: #64748b;
    font-size: 0.76rem;
}

.schedule-day-shifts {
    display: grid;
    gap: 6px;
}

.schedule-mini-shift {
    display: grid;
    gap: 1px;
    width: 100%;
    padding: 8px 9px;
    border: 1px solid color-mix(in srgb, var(--employee-color, #93c5fd) 58%, white);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,255,255,0.92), color-mix(in srgb, var(--employee-color, #bfdbfe) 34%, white));
    box-shadow: 0 8px 18px color-mix(in srgb, var(--employee-color, #2563eb) 22%, transparent);
    color: #0f172a;
    text-align: left;
    cursor: pointer;
    animation: scheduleFadeIn 0.22s ease-out;
}

.schedule-mini-shift strong {
    font-size: 0.86rem;
}

.schedule-mini-shift span {
    color: color-mix(in srgb, var(--employee-color, #2563eb) 76%, #0f172a);
    font-size: 0.76rem;
}

.schedule-color-green { --employee-color: #22c55e; }
.schedule-color-blue { --employee-color: #3b82f6; }
.schedule-color-purple { --employee-color: #8b5cf6; }
.schedule-color-orange { --employee-color: #f97316; }
.schedule-color-pink { --employee-color: #ec4899; }
.schedule-color-yellow { --employee-color: #eab308; }
.schedule-color-teal { --employee-color: #14b8a6; }
.schedule-color-neutral { --employee-color: #94a3b8; }

.schedule-color-picker {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.schedule-color-picker legend {
    grid-column: 1 / -1;
    margin-bottom: 2px;
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 700;
}

.schedule-color-option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px;
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.schedule-color-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.schedule-color-option span {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--employee-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--employee-color) 20%, transparent);
}

.schedule-color-option small {
    color: #334155;
    font-size: 0.78rem;
    font-weight: 700;
}

.schedule-color-option:has(input:checked) {
    border-color: color-mix(in srgb, var(--employee-color) 72%, white);
    background: color-mix(in srgb, var(--employee-color) 12%, white);
}

.schedule-employee-admin {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(180, 204, 235, 0.72);
    border-radius: 18px;
    background: rgba(255,255,255,0.72);
    box-shadow: 0 18px 44px rgba(31, 78, 121, 0.08);
}

.schedule-employee-admin h2 {
    margin: 0;
    font-size: 1rem;
}

.schedule-employee-admin-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.schedule-employee-admin-card {
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid color-mix(in srgb, var(--employee-color, #94a3b8) 48%, white);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,255,255,0.9), color-mix(in srgb, var(--employee-color, #94a3b8) 28%, white));
    box-shadow: 0 10px 24px color-mix(in srgb, var(--employee-color, #94a3b8) 20%, transparent);
    color: #0f172a;
    font-weight: 760;
    cursor: pointer;
}

.schedule-edit-dialog .modal-panel {
    max-width: 430px;
}

.schedule-manual-time[hidden] {
    display: none;
}

.schedule-type-settings-list {
    display: grid;
    gap: 8px;
}

.schedule-type-settings-row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) 120px 120px auto auto;
    gap: 8px;
    align-items: center;
}

@keyframes scheduleFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scheduleLanding {
    0% {
        transform: scale(1);
    }
    55% {
        transform: scale(1.025);
    }
    100% {
        transform: scale(1);
    }
}

@media (max-width: 760px) {
    .schedule-mobile-list {
        display: grid;
        gap: 10px;
        margin-top: 14px;
    }
    .schedule-mobile-item {
        display: grid;
        gap: 3px;
        padding: 13px 14px;
        border: 1px solid #d9e4f2;
        border-radius: 8px;
        background: #fff;
    }
    .schedule-mobile-item small {
        color: #2563eb;
    }
    .schedule-board,
    .schedule-admin {
        display: none;
    }
    .schedule-month-grid {
        grid-template-columns: 1fr;
    }
    .schedule-month-day {
        min-height: auto;
    }
    .schedule-month-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .schedule-head {
        align-items: start;
    }
    .schedule-v2-hero,
    .schedule-calendar-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .schedule-v2-actions,
    .schedule-v2-actions .button,
    .schedule-v2-actions button {
        width: 100%;
    }
    .schedule-calendar {
        border-radius: 14px;
    }
    .schedule-calendar-weekdays {
        display: none;
    }
    .schedule-calendar-grid {
        grid-template-columns: 1fr;
    }
    .schedule-day {
        min-height: 96px;
        border-right: 0;
    }
    .schedule-type-settings-row {
        grid-template-columns: 1fr;
    }
    .schedule-color-picker {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* BarFlow Premium UI Foundation */
body {
    background:
        radial-gradient(circle at 12% -8%, rgba(37, 99, 235, .12), transparent 28rem),
        radial-gradient(circle at 90% 0%, rgba(20, 184, 166, .07), transparent 24rem),
        linear-gradient(180deg, var(--bf-bg-elevated) 0%, var(--bf-bg) 42%, #f2f6fb 100%);
    color: var(--bf-text);
}

::selection {
    background: rgba(37, 99, 235, .18);
}

.app-shell {
    background: rgba(246, 248, 252, .82);
    border-bottom-color: rgba(185, 204, 228, .64);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .72), 0 10px 30px rgba(15, 23, 42, .04);
}

.topbar {
    height: 68px;
}

.brand strong {
    color: var(--bf-text);
    font-size: 13px;
    letter-spacing: .08em;
}

.brand small {
    color: var(--bf-muted);
}

.tabs {
    gap: var(--bf-space-2);
    padding-bottom: var(--bf-space-4);
}

.tabs a {
    padding: 9px 13px;
    border-color: transparent;
    border-radius: 999px;
    color: var(--bf-muted);
    background: transparent;
}

.tabs a:hover {
    border-color: rgba(185, 204, 228, .72);
    background: rgba(255, 255, 255, .86);
    color: var(--bf-primary-hover);
    box-shadow: var(--bf-shadow-xs);
}

.page {
    padding-top: var(--bf-space-6);
}

h1 {
    color: var(--bf-text);
    font-weight: 780;
}

h2,
h3 {
    color: var(--bf-text);
    font-weight: 720;
}

.section-head {
    margin: var(--bf-space-4) 0 var(--bf-space-5);
}

.section-head > div,
.paper-panel-head,
.card-title,
.inventory-section-title,
.inventory-create-head {
    min-width: 0;
}

button,
.button {
    min-height: var(--bf-control-height);
    border-color: var(--bf-border);
    border-radius: var(--bf-radius-sm);
    background: linear-gradient(180deg, #fff 0%, #f9fbff 100%);
    color: var(--bf-text-soft);
    box-shadow: var(--bf-shadow-xs);
    font-weight: 680;
}

button:hover,
.button:hover {
    border-color: var(--bf-border-strong);
    background: #fff;
    box-shadow: var(--bf-shadow-sm);
}

button.primary,
.button.primary,
.primary {
    border-color: rgba(29, 78, 216, .92);
    background: linear-gradient(180deg, #3b82f6 0%, var(--bf-primary) 100%);
    color: var(--bf-primary-text);
    box-shadow: 0 12px 26px rgba(37, 99, 235, .24);
}

button.primary:hover,
.button.primary:hover,
.primary:hover {
    background: linear-gradient(180deg, #2f74ef 0%, var(--bf-primary-hover) 100%);
    box-shadow: 0 14px 30px rgba(37, 99, 235, .28);
}

.button.secondary,
button.secondary {
    background: rgba(255, 255, 255, .78);
    color: var(--bf-text-soft);
}

.danger-action,
button.danger-action {
    border-color: #fecdd3;
    background: linear-gradient(180deg, #fff 0%, var(--bf-danger-soft) 100%);
    color: var(--bf-danger);
}

input,
select,
textarea {
    min-height: var(--bf-control-height);
    border-color: var(--bf-border);
    border-radius: var(--bf-radius-sm);
    background: var(--bf-surface);
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, .03), var(--bf-shadow-xs);
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--bf-border-strong);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--bf-primary);
    box-shadow: var(--bf-focus);
}

input[readonly],
select:disabled,
textarea:disabled {
    background: #f3f7fb;
    color: var(--bf-muted);
    box-shadow: none;
}

label {
    color: var(--bf-muted);
    font-weight: 640;
}

.hero-panel,
.panel,
.accordion,
.list,
.metric-card,
.action-card,
.paper-panel,
.stock-category,
.modal-panel,
.schedule-calendar,
.schedule-month,
.schedule-grid,
.schedule-admin-panel,
.schedule-employee-admin,
.settings-schedule-types {
    border-color: rgba(185, 204, 228, .78);
    border-radius: var(--bf-radius-lg);
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--bf-shadow-sm);
}

.hero-panel,
.inventory-create,
.schedule-v2-hero {
    background:
        linear-gradient(135deg, rgba(37, 99, 235, .10), rgba(255, 255, 255, .96) 46%),
        var(--bf-surface);
    box-shadow: var(--bf-shadow-md);
}

.panel,
.paper-panel,
.metric-card,
.action-card {
    padding: var(--bf-space-5);
}

.paper-panel-head,
.card-title {
    margin-bottom: var(--bf-space-4);
}

.accordion summary,
.archive-header,
.shift-header,
.detail-table th,
.stock-category > summary,
.schedule-corner,
.schedule-day-head {
    background: linear-gradient(180deg, #fbfdff 0%, var(--bf-primary-subtle) 100%);
}

.list-row,
.product-row,
.archive-row,
.stock-product-row,
.user-row,
.schedule-admin-row {
    transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.list-row:hover,
a.list-row:hover,
.product-row:hover,
.stock-product-row:hover,
.user-row:hover,
.schedule-admin-row:hover {
    background: var(--bf-primary-subtle);
}

.detail-table,
table {
    border-collapse: separate;
    border-spacing: 0;
}

.detail-table th {
    color: var(--bf-muted);
    font-size: 12px;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.detail-table td {
    background: rgba(255, 255, 255, .72);
}

.detail-table tbody tr:hover td {
    background: var(--bf-primary-subtle);
}

.badge,
.status-pill {
    border: 1px solid rgba(37, 99, 235, .12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .62);
    font-weight: 760;
}

.badge.neutral {
    border-color: rgba(100, 116, 139, .14);
    background: #f3f6fb;
}

.message {
    border-radius: var(--bf-radius-md);
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--bf-shadow-sm);
}

.message.error,
.message.success {
    font-weight: 650;
}

.empty-state,
.superadmin-empty,
.schedule-empty-glass,
.schedule-empty-row,
.schedule-month-empty {
    border: 1px dashed rgba(148, 163, 184, .48);
    border-radius: var(--bf-radius-lg);
    background: rgba(248, 251, 255, .78);
    color: var(--bf-muted);
}

.modal {
    border-radius: var(--bf-radius-lg);
}

.modal::backdrop {
    background: rgba(15, 23, 42, .38);
    backdrop-filter: blur(10px) saturate(120%);
}

.modal-panel {
    padding: var(--bf-space-5);
    box-shadow: var(--bf-shadow-lg);
}

.modal-head h2 {
    font-size: 18px;
}

.icon-button {
    border-radius: var(--bf-radius-sm);
}

.finance-grid,
.breakdown-grid,
.note-box,
.product-detail-list div,
.settings-logo,
.movement-form {
    border-color: var(--bf-border);
    border-radius: var(--bf-radius-md);
    background: rgba(255, 255, 255, .88);
    box-shadow: var(--bf-shadow-xs);
}

.finance-auto {
    background: var(--bf-primary-subtle);
}

.sticky-total,
.settings-form .form-actions {
    border-color: rgba(37, 99, 235, .22);
    border-radius: var(--bf-radius-lg);
    background: rgba(255, 255, 255, .90);
    box-shadow: var(--bf-shadow-md);
}

.metric-card .number,
.finance-difference output,
.finance-total output,
.breakdown-total output {
    color: var(--bf-primary-hover);
}

.schedule-v2,
.stack {
    gap: var(--bf-space-4);
}

.schedule-person-card,
.schedule-mini-shift,
.schedule-employee-admin-card {
    border-radius: var(--bf-radius-md);
    box-shadow: var(--bf-shadow-xs);
}

.schedule-day {
    background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
}

.schedule-day.is-drop-target,
.schedule-cell.is-drop-target {
    background: var(--bf-primary-soft);
    box-shadow: inset 0 0 0 2px var(--bf-primary);
}

@media (max-width: 700px) {
    .topbar {
        height: 62px;
    }

    .page {
        padding-top: var(--bf-space-4);
    }

    .panel,
    .paper-panel,
    .metric-card,
    .action-card,
    .modal-panel {
        padding: var(--bf-space-4);
    }

    .tabs a,
    .mobile-logout button {
        border-radius: var(--bf-radius-md);
        box-shadow: var(--bf-shadow-xs);
    }

    .inventory-action-button {
        border-radius: var(--bf-radius-md);
    }
}

/* Sprint C3.1 premium identity polish */
:root {
    --bf-sidebar-bg: #08111f;
    --bf-sidebar-bg-2: #0d1b2e;
    --bf-sidebar-line: rgba(148, 163, 184, .16);
    --bf-sidebar-text: #c8d3e4;
    --bf-sidebar-muted: #8ea0b8;
    --bf-sidebar-active: #f8fbff;
}

body {
    background:
        radial-gradient(circle at 18% 0%, rgba(37, 99, 235, .16), transparent 34rem),
        radial-gradient(circle at 88% 14%, rgba(16, 185, 129, .12), transparent 34rem),
        linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
}

.brand {
    color: inherit;
}

.brand-mark {
    position: relative;
    overflow: hidden;
    letter-spacing: 0;
    box-shadow:
        0 16px 34px rgba(37, 99, 235, .32),
        inset 0 1px 0 rgba(255, 255, 255, .42);
}

.brand-mark::after {
    content: "";
    position: absolute;
    inset: 7px auto auto 8px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .20);
}

.dashboard-hero {
    position: relative;
    overflow: hidden;
    align-items: end;
    margin-top: 0;
    margin-bottom: 24px;
    padding: 34px 36px;
    border: 1px solid rgba(191, 219, 254, .68);
    border-radius: 28px;
    background:
        radial-gradient(circle at 84% 22%, rgba(37, 99, 235, .16), transparent 18rem),
        radial-gradient(circle at 12% 18%, rgba(16, 185, 129, .12), transparent 18rem),
        linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(241, 247, 255, .84));
    box-shadow: 0 22px 70px rgba(15, 23, 42, .09);
}

.dashboard-hero::after {
    content: "";
    position: absolute;
    right: -54px;
    bottom: -84px;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    border: 34px solid rgba(37, 99, 235, .08);
}

.dashboard-hero > * {
    position: relative;
    z-index: 1;
}

.hero-greeting {
    margin: 4px 0 0;
    color: #0f172a;
    font-size: clamp(22px, 3vw, 34px);
    font-weight: 820;
    letter-spacing: 0;
}

.dashboard-hero h1 {
    margin-top: 2px;
    font-size: clamp(42px, 6vw, 68px);
    line-height: .96;
}

.dashboard-hero .muted {
    margin-top: 12px;
    color: #58708f;
    font-size: 15px;
    font-weight: 650;
}

.shift-welcome-dialog {
    width: min(440px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    padding: 0;
    border: 0;
    border-radius: 28px;
    background: transparent;
    color: var(--bf-text);
    overflow: visible;
}

.shift-welcome-dialog::backdrop {
    background: rgba(2, 6, 23, .58);
    backdrop-filter: blur(18px) saturate(120%);
}

.shift-welcome-dialog[open] {
    animation: shift-welcome-in .25s cubic-bezier(.2, .8, .2, 1) both;
}

.shift-welcome-dialog.is-closing {
    animation: shift-welcome-out .18s ease both;
}

.shift-welcome-panel {
    position: relative;
    display: grid;
    gap: 14px;
    justify-items: center;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, .62);
    border-radius: 28px;
    background:
        radial-gradient(circle at 50% 0%, rgba(37, 99, 235, .16), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 251, 255, .95));
    box-shadow: 0 28px 90px rgba(2, 6, 23, .30), 0 1px 0 rgba(255, 255, 255, .74) inset;
    text-align: center;
}

.shift-welcome-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    color: var(--bf-muted);
    font-size: 20px;
    line-height: 1;
}

.shift-welcome-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 1px solid rgba(37, 99, 235, .18);
    border-radius: 50%;
    background: var(--bf-primary-subtle);
    box-shadow: 0 14px 34px rgba(37, 99, 235, .18);
    font-size: 28px;
}

.shift-welcome-panel h2 {
    margin: 0;
    color: var(--bf-heading);
    font-size: clamp(27px, 6vw, 36px);
    line-height: 1.08;
    letter-spacing: 0;
}

.shift-welcome-copy {
    display: grid;
    gap: 4px;
    color: var(--bf-muted);
    font-size: 15px;
    font-weight: 650;
}

.shift-welcome-copy p {
    margin: 0;
}

.shift-welcome-confirm {
    width: 100%;
    min-height: 54px;
    margin-top: 4px;
    border-radius: 18px;
    font-size: 16px;
    box-shadow: 0 18px 38px rgba(37, 99, 235, .24);
}

@keyframes shift-welcome-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes shift-welcome-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(.98);
    }
}

.module-card {
    isolation: isolate;
    border: 1px solid rgba(255, 255, 255, .52);
    border-radius: 26px;
    box-shadow:
        0 24px 58px rgba(15, 23, 42, .16),
        inset 0 1px 0 rgba(255, 255, 255, .22);
    transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}

.module-card::before {
    width: 190px;
    height: 190px;
    inset: -48px -56px auto auto;
    background: rgba(255, 255, 255, .18);
}

.module-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, .18), transparent 46%);
    opacity: .72;
}

.module-card:hover {
    transform: translateY(-5px) scale(1.012);
    box-shadow:
        0 32px 72px rgba(15, 23, 42, .20),
        inset 0 1px 0 rgba(255, 255, 255, .30);
}

.module-card strong {
    font-size: 21px;
    letter-spacing: 0;
}

.module-card small {
    color: rgba(255, 255, 255, .84);
    font-size: 13px;
}

.module-icon {
    width: 68px;
    height: 68px;
    top: 24px;
    right: 24px;
    opacity: .92;
    -webkit-mask-size: 36px 36px;
    mask-size: 36px 36px;
}

.tone-stock { background: linear-gradient(135deg, #047857 0%, #10b981 54%, #34d399 100%); }
.tone-shift { background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 56%, #a78bfa 100%); }
.tone-archive { background: linear-gradient(135deg, #075985 0%, #0ea5e9 58%, #38bdf8 100%); }
.tone-settings { background: linear-gradient(135deg, #c2410c 0%, #f97316 58%, #fb923c 100%); }

.metric-grid {
    gap: 18px;
}

.metric-card {
    min-height: 190px;
    padding: 28px;
    border: 1px solid rgba(191, 219, 254, .58);
    border-radius: 24px;
    box-shadow: 0 20px 54px rgba(15, 23, 42, .09);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.metric-card:hover {
    transform: translateY(-3px);
    border-color: rgba(37, 99, 235, .22);
    box-shadow: 0 28px 68px rgba(15, 23, 42, .12);
}

.metric-card::after {
    width: 150px;
    height: 150px;
    opacity: .18;
}

.metric-icon {
    width: 64px;
    height: 64px;
    opacity: .22;
    -webkit-mask-size: 36px 36px;
    mask-size: 36px 36px;
}

.metric-card .eyebrow {
    color: #2563eb;
    font-size: 12px;
}

.metric-card .number {
    margin-top: 6px;
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.08;
}

.metric-card .muted {
    margin-top: 10px;
    font-weight: 620;
}

.button.primary,
button.primary,
.inventory-action-button.primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8 52%, #0f766e);
    box-shadow: 0 18px 38px rgba(37, 99, 235, .24);
}

.button.primary:hover,
button.primary:hover,
.inventory-action-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 48px rgba(37, 99, 235, .30);
}

.list-row,
.product-row,
.archive-row,
.stock-product-row,
.user-row {
    min-height: 68px;
    border-color: rgba(226, 232, 240, .84);
}

.list-row:hover,
a.list-row:hover,
.product-row:hover,
.archive-row:hover,
.stock-product-row:hover,
.user-row:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, .08), rgba(255, 255, 255, .88));
    box-shadow: inset 3px 0 0 rgba(37, 99, 235, .42);
}

.badge,
.status-pill {
    border-radius: 999px;
    padding: 6px 10px;
    background: linear-gradient(180deg, #fff, #f4f7fb);
}

.empty-state,
.premium-empty {
    border-radius: 22px;
    background:
        radial-gradient(circle at 14% 12%, rgba(37, 99, 235, .10), transparent 12rem),
        rgba(248, 251, 255, .84);
}

.empty-state strong {
    color: #0f172a;
    font-size: 17px;
}

.modal-panel {
    animation: modal-rise .22s cubic-bezier(.2, .8, .2, 1);
}

.message {
    animation: toast-drop .24s ease both;
}

@keyframes toast-drop {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 901px) {
    body {
        padding-left: 310px;
    }

    .app-shell {
        width: 310px;
        border-right: 1px solid var(--bf-sidebar-line);
        background:
            radial-gradient(circle at 18% 0%, rgba(59, 130, 246, .24), transparent 18rem),
            radial-gradient(circle at 92% 18%, rgba(16, 185, 129, .14), transparent 16rem),
            linear-gradient(180deg, var(--bf-sidebar-bg) 0%, var(--bf-sidebar-bg-2) 100%);
        box-shadow: 28px 0 70px rgba(8, 17, 31, .26);
    }

    .topbar {
        padding: 30px 24px 22px;
        border-bottom: 1px solid var(--bf-sidebar-line);
    }

    .brand {
        gap: 16px;
        color: var(--bf-sidebar-active);
    }

    .brand-mark {
        width: 66px;
        height: 66px;
        flex-basis: 66px;
        border-radius: 21px;
        font-size: 22px;
        background:
            radial-gradient(circle at 28% 18%, rgba(255, 255, 255, .28), transparent 32%),
            linear-gradient(135deg, #38bdf8, #2563eb 54%, #1e40af);
    }

    .brand strong {
        color: #fff;
        font-size: 24px;
        letter-spacing: .11em;
    }

    .brand small {
        margin-top: 5px;
        color: var(--bf-sidebar-muted);
        font-size: 13px;
        font-weight: 680;
    }

    .desktop-logout {
        right: 22px;
        bottom: 22px;
    }

    .desktop-logout .icon-button {
        border-color: rgba(255, 255, 255, .12);
        background: rgba(255, 255, 255, .08);
        color: #dbeafe;
    }

    .desktop-logout .icon-button:hover {
        background: rgba(255, 255, 255, .14);
        color: #fff;
    }

    .tabs {
        gap: 9px;
        padding: 20px 18px 28px;
    }

    .tabs a,
    .mobile-logout button {
        min-height: 52px;
        gap: 13px;
        padding: 0 14px;
        border-radius: 17px;
        color: var(--bf-sidebar-text);
        font-size: 15px;
        font-weight: 760;
        letter-spacing: 0;
    }

    .tabs a .nav-icon,
    .mobile-logout .nav-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        border-radius: 12px;
        color: #a9b8cc;
        background-color: currentColor;
        -webkit-mask-size: 21px 21px;
        mask-size: 21px 21px;
    }

    .tabs a:hover,
    .mobile-logout button:hover {
        border-color: rgba(255, 255, 255, .10);
        background: rgba(255, 255, 255, .075);
        color: #fff;
        transform: translateX(4px);
    }

    .tabs a:hover .nav-icon {
        color: #dbeafe;
    }

    .tabs a.is-active {
        border-color: rgba(96, 165, 250, .34);
        background:
            linear-gradient(135deg, rgba(37, 99, 235, .95), rgba(14, 165, 233, .68)),
            rgba(255, 255, 255, .10);
        color: #fff;
        box-shadow:
            0 18px 38px rgba(37, 99, 235, .28),
            inset 0 1px 0 rgba(255, 255, 255, .22);
    }

    .tabs a.is-active .nav-icon {
        color: #fff;
    }

    .page {
        width: min(1280px, 100%);
        padding: 38px 40px 112px;
    }
}

@media (max-width: 900px) {
    .app-shell {
        background:
            radial-gradient(circle at 12% 0%, rgba(59, 130, 246, .28), transparent 18rem),
            linear-gradient(135deg, var(--bf-sidebar-bg), var(--bf-sidebar-bg-2));
        color: #fff;
    }

    .topbar {
        border-bottom: 1px solid rgba(255, 255, 255, .10);
    }

    .brand {
        color: #fff;
    }

    .brand strong {
        color: #fff;
    }

    .brand small {
        color: rgba(226, 232, 240, .72);
    }

    .menu-button {
        border-color: rgba(255, 255, 255, .14);
        background: rgba(255, 255, 255, .08);
    }

    .menu-button span {
        background: #fff;
    }

    .tabs {
        background:
            radial-gradient(circle at 20% 0%, rgba(59, 130, 246, .18), transparent 18rem),
            linear-gradient(180deg, var(--bf-sidebar-bg), var(--bf-sidebar-bg-2));
    }

    .tabs a,
    .mobile-logout button {
        color: var(--bf-sidebar-text);
        background: rgba(255, 255, 255, .045);
        border-color: rgba(255, 255, 255, .08);
    }

    .tabs a .nav-icon,
    .mobile-logout .nav-icon {
        color: #b9c7dc;
        display: inline-block;
    }

    .tabs a.is-active {
        color: #fff;
        background: linear-gradient(135deg, #2563eb, #0ea5e9);
        border-color: rgba(255, 255, 255, .18);
    }

    .tabs a.is-active .nav-icon {
        color: #fff;
    }

    .dashboard-hero {
        padding: 26px 22px;
        border-radius: 24px;
    }

    .dashboard-hero h1 {
        font-size: clamp(40px, 13vw, 56px);
    }

    .shift-welcome-dialog {
        width: min(420px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
    }

    .shift-welcome-panel {
        gap: 12px;
        padding: 26px 20px 22px;
        border-radius: 24px;
    }

    .shift-welcome-panel h2 {
        font-size: clamp(25px, 8vw, 32px);
    }

    .module-card {
        min-height: 142px;
    }

    .metric-card {
        min-height: 164px;
    }
}

/* MOBILE UX FIX-01: keep the mobile logout action reachable above iOS safe areas. */
@media (max-width: 700px) {
    .tabs {
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .tabs.is-open {
        max-height: calc(100vh - 62px);
        max-height: calc(100dvh - 62px);
        overflow-y: auto;
        padding-bottom: calc(28px + env(safe-area-inset-bottom));
        scroll-padding-bottom: calc(28px + env(safe-area-inset-bottom));
    }

    .mobile-logout {
        margin-bottom: max(10px, env(safe-area-inset-bottom));
    }
}

/* SPRINT AI-02.1: premium Liquid Vision UX polish. */
.liquid-vision {
    max-width: 760px;
    gap: 12px;
}

.liquid-back-link {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--bf-muted);
    font-size: 13px;
    font-weight: 720;
    transition: color .18s ease, transform .18s ease;
}

.liquid-back-link:hover {
    color: var(--bf-primary-hover);
    transform: translateX(-2px);
}

.liquid-hero {
    display: grid;
    gap: 4px;
    padding: 10px 0 4px;
}

.liquid-hero h1 {
    font-size: clamp(30px, 5vw, 46px);
    line-height: .98;
}

.liquid-hero .muted {
    max-width: 590px;
    font-size: 14px;
}

.liquid-entry-card {
    position: relative;
    grid-template-columns: 118px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 18px;
    overflow: hidden;
}

.liquid-entry-copy {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.liquid-entry-copy h2 {
    font-size: 24px;
}

.liquid-badge {
    width: fit-content;
    min-height: 20px;
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border: 1px solid rgba(217, 119, 6, .20);
    border-radius: 999px;
    background: rgba(255, 247, 237, .78);
    color: #92400e;
    font-size: 11px;
    font-weight: 780;
}

.liquid-illustration {
    position: relative;
    width: 104px;
    height: 104px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(37, 99, 235, .12);
    border-radius: 26px;
    background:
        radial-gradient(circle at 50% 52%, rgba(37, 99, 235, .10), transparent 58%),
        linear-gradient(180deg, rgba(255,255,255,.92), rgba(244,248,255,.82));
}

.liquid-bottle {
    position: relative;
    width: 34px;
    height: 70px;
    border: 2px solid var(--bf-text-soft);
    border-radius: 13px 13px 9px 9px;
    opacity: .78;
}

.liquid-bottle::before {
    content: "";
    position: absolute;
    top: -16px;
    left: 8px;
    width: 14px;
    height: 16px;
    border: 2px solid var(--bf-text-soft);
    border-bottom: 0;
    border-radius: 5px 5px 0 0;
}

.liquid-bottle span {
    position: absolute;
    left: 5px;
    right: 5px;
    bottom: 5px;
    height: 34px;
    border-radius: 7px;
    background: linear-gradient(180deg, rgba(37, 99, 235, .10), rgba(37, 99, 235, .34));
}

.liquid-scan-ring {
    position: absolute;
    inset: 20px;
    border: 1px solid rgba(37, 99, 235, .24);
    border-radius: 50%;
}

.liquid-scan-line {
    position: absolute;
    left: 22px;
    right: 22px;
    top: 52px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--bf-primary), transparent);
    opacity: .62;
    animation: liquid-scan-sweep 2.6s ease-in-out infinite;
}

.liquid-primary-action {
    grid-column: 2;
    justify-self: start;
    min-height: 44px;
    padding: 0 18px;
    border-color: var(--bf-primary);
    background: linear-gradient(180deg, #3b82f6 0%, var(--bf-primary) 100%);
    color: var(--bf-primary-text);
    box-shadow: 0 14px 28px rgba(37, 99, 235, .20);
}

.liquid-meta {
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--bf-muted);
    font-size: 12px;
    font-weight: 680;
}

.liquid-meta span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--bf-success);
    box-shadow: 0 0 0 4px rgba(22, 163, 74, .10);
}

.liquid-capacity {
    grid-column: 2;
    display: grid;
    grid-template-columns: minmax(130px, 160px) minmax(130px, 160px);
    gap: 10px;
    align-items: end;
}

.liquid-capacity .compact {
    grid-column: 1 / -1;
    margin: 0;
}

.liquid-capacity label {
    gap: 5px;
}

.liquid-capacity select,
.liquid-capacity input {
    min-height: 38px;
    padding: 7px 10px;
}

.liquid-entry-card .liquid-status {
    grid-column: 2;
}

.liquid-stage {
    transition: opacity .18s ease, transform .18s ease;
}

body.liquid-vision-fullscreen {
    overflow: hidden;
    background: #08111f;
}

body.liquid-vision-fullscreen .app-shell {
    display: none;
}

body.liquid-vision-fullscreen .page {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
}

body.liquid-vision-fullscreen .messages,
body.liquid-vision-fullscreen .liquid-back-link,
body.liquid-vision-fullscreen .liquid-hero {
    display: none;
}

body.liquid-vision-fullscreen .liquid-vision {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 50% 0%, rgba(37, 99, 235, .22), transparent 30rem),
        #08111f;
}

body.liquid-vision-fullscreen .liquid-stage:not([hidden]) {
    width: min(720px, 100%);
    max-height: calc(100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    display: grid;
    align-self: center;
    overflow: hidden;
    border-color: rgba(148, 163, 184, .22);
    background: rgba(8, 17, 31, .92);
    color: #f8fbff;
    box-shadow: 0 24px 90px rgba(0, 0, 0, .36);
    animation: liquid-fullscreen-in .22s ease both;
}

body.liquid-vision-fullscreen .liquid-stage .muted,
body.liquid-vision-fullscreen .liquid-status {
    color: rgba(226, 232, 240, .72);
}

body.liquid-vision-fullscreen .liquid-camera-shell,
body.liquid-vision-fullscreen .liquid-preview-shell,
body.liquid-vision-fullscreen .liquid-manual-shell {
    min-height: min(64dvh, 560px);
    border-color: rgba(148, 163, 184, .22);
    background: #020617;
}

.liquid-capture-guide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, .42fr);
    align-items: center;
    gap: 16px;
    padding: 22px;
    pointer-events: none;
    color: rgba(248, 251, 255, .90);
}

.liquid-capture-guide strong {
    justify-self: center;
    align-self: end;
    grid-column: 1;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    background: rgba(2, 6, 23, .42);
    backdrop-filter: blur(14px);
    color: #fff;
    font-size: 14px;
}

.liquid-guide-bottle {
    position: relative;
    justify-self: center;
    width: min(36vw, 168px);
    height: min(54vh, 420px);
    border: 2px solid rgba(248, 251, 255, .58);
    border-radius: 48px 48px 20px 20px;
    box-shadow:
        0 0 0 999px rgba(2, 6, 23, .18),
        inset 0 0 0 1px rgba(37, 99, 235, .28);
}

.liquid-guide-bottle::before {
    content: "";
    position: absolute;
    width: min(16vw, 62px);
    height: 52px;
    left: 50%;
    top: max(18px, 8%);
    transform: translateX(-50%);
    border: 2px solid rgba(248, 251, 255, .58);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
}

.liquid-capture-guide ul {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 16px;
    background: rgba(2, 6, 23, .42);
    backdrop-filter: blur(14px);
    list-style: none;
    font-size: 13px;
    font-weight: 680;
}

.liquid-capture-guide li::before {
    content: "•";
    margin-right: 7px;
    color: #93c5fd;
}

body.liquid-vision-fullscreen .liquid-analysis {
    min-height: min(56dvh, 420px);
}

body.liquid-vision-fullscreen .liquid-actions {
    justify-content: center;
}

body.liquid-vision-fullscreen .liquid-actions button:not(.primary) {
    border-color: rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .08);
    color: #e2e8f0;
}

.liquid-analysis::before {
    content: "";
    width: min(340px, 72vw);
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, .48), transparent);
    animation: liquid-shimmer 1.35s ease-in-out infinite;
}

@keyframes liquid-scan-sweep {
    0%, 100% { transform: translateY(-18px); opacity: .32; }
    50% { transform: translateY(18px); opacity: .76; }
}

@keyframes liquid-fullscreen-in {
    from { opacity: 0; transform: scale(.985); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes liquid-shimmer {
    0% { transform: translateX(-18px); opacity: .28; }
    50% { transform: translateX(18px); opacity: .86; }
    100% { transform: translateX(-18px); opacity: .28; }
}

@media (max-width: 700px) {
    .liquid-vision {
        gap: 10px;
    }

    .liquid-hero {
        padding-top: 4px;
    }

    .liquid-hero h1 {
        font-size: 34px;
    }

    .liquid-entry-card {
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 12px;
        padding: 14px;
    }

    .liquid-illustration {
        width: 78px;
        height: 78px;
        border-radius: 20px;
    }

    .liquid-bottle {
        width: 26px;
        height: 50px;
        border-radius: 10px 10px 7px 7px;
    }

    .liquid-bottle::before {
        top: -12px;
        left: 6px;
        width: 10px;
        height: 12px;
    }

    .liquid-bottle span {
        height: 24px;
    }

    .liquid-entry-copy h2 {
        font-size: 20px;
    }

    .liquid-entry-copy .muted {
        font-size: 13px;
    }

    .liquid-primary-action,
    .liquid-meta,
    .liquid-capacity,
    .liquid-entry-card .liquid-status {
        grid-column: 1 / -1;
        width: 100%;
    }

    .liquid-capacity {
        grid-template-columns: 1fr;
    }

    body.liquid-vision-fullscreen .liquid-vision {
        padding: max(10px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom));
    }

    body.liquid-vision-fullscreen .liquid-stage:not([hidden]) {
        width: 100%;
        max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        padding: 12px;
        border-radius: 22px;
    }

    body.liquid-vision-fullscreen .liquid-camera-shell,
    body.liquid-vision-fullscreen .liquid-preview-shell,
    body.liquid-vision-fullscreen .liquid-manual-shell {
        min-height: min(62dvh, 470px);
    }

    .level-picker__zoom {
        left: calc(50% + 20px);
        width: 76px;
        height: 76px;
    }

    .liquid-capture-guide {
        grid-template-columns: 1fr;
        align-content: space-between;
        padding: 16px;
    }

    .liquid-capture-guide strong {
        grid-column: auto;
        align-self: start;
        font-size: 13px;
    }

    .liquid-guide-bottle {
        width: min(44vw, 132px);
        height: min(48vh, 330px);
    }

    .liquid-capture-guide ul {
        justify-self: stretch;
        font-size: 12px;
    }
}
