:root {
    color-scheme: light;
    --bg: #f7f6f3;
    --ink: #251d20;
    --muted: #6f6366;
    --wine: #781f19;
    --line: #ebe5e1;
    --control-height: 44px;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #b85245; outline-offset: 3px; }
h1, h2, p { margin: 0; }
.layout { display: grid; grid-template-columns: 246px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 24px 16px; }
.brand { display: grid; place-items: center; margin: 0 0 32px; min-height: 72px; }
.brand img { width: 150px; height: auto; }
nav { display: grid; gap: 5px; }
nav a, .logout button { display: flex; align-items: center; gap: 8px; min-height: var(--control-height); padding: 10px 13px; border-radius: 9px; color: #574a4a; font-size: .9rem; font-weight: 600; }
nav a:hover, .logout button:hover { background: #f8f4f2; }
nav a[aria-current] { background: #f7ebe6; color: var(--wine); }
.nav-icon { display: inline-grid; width: 24px; place-items: center; font-size: 1.25rem; }
.logout { margin-top: auto; padding-top: 24px; }
.logout button { background: transparent; border: 0; cursor: pointer; width: 100%; }
.topbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: #fff; border-bottom: 1px solid var(--line); padding: 16px clamp(16px, 4vw, 48px); min-height: 67px; }
.app-name { font-weight: 750; }
.profile { display: flex; align-items: center; gap: 10px; font-size: .84rem; }
.switch, .primary, .hero-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-height);
    max-width: 100%;
    padding: 8px 12px;
    text-align: center;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.switch { color: var(--wine); border: 1px solid var(--line); border-radius: 8px; font-weight: 650; }
.switch:hover { background: #f7ebe6; }
.avatar { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 50%; background: #f7ebe6; color: var(--wine); font-weight: 750; }
main { max-width: 1450px; margin: auto; padding: 32px clamp(16px, 4vw, 48px) 44px; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 22px; min-height: 205px; padding: clamp(22px, 4vw, 42px); border-radius: 19px; background: radial-gradient(ellipse at 100% 0%, #a33c2b, transparent 70%), #5c1715; color: #fff; }
.scope { display: inline-block; border: 1px solid #ffffff55; border-radius: 20px; padding: 5px 11px; font-size: .78rem; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.045em; line-height: 1.1; }
.hero h1 { margin: 13px 0 10px; }
.hero p { color: #f8e0dc; }
.hero-link { flex-shrink: 0; padding: 11px 15px; background: #fff; border-radius: 8px; color: var(--wine); font-weight: 700; font-size: .9rem; }
.section-heading { margin: 28px 0 13px; }
h2 { font-size: 1.1rem; }
.quick-grid, .module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: 14px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.quick { display: flex; flex-direction: column; position: relative; gap: 8px; padding: 17px 20px; }
.quick:hover { border-color: #b97b70; }
.quick > span:not(.tile-icon, .arrow), .option p, .page-heading p { color: var(--muted); font-size: .92rem; line-height: 1.5; }
.tile-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 10px; background: #f8ece7; color: var(--wine); font-size: 1.25rem; }
.arrow { position: absolute; top: 19px; right: 21px; color: var(--wine); }
.panels { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; margin-top: 23px; }
.panel, .option { padding: 20px; }
.panel-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.tag { display: inline-block; padding: 4px 8px; border-radius: 6px; background: #f4eee8; color: #725744; font-size: .72rem; font-weight: 650; }
.empty { min-height: 118px; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; color: var(--muted); font-size: .88rem; }
.schedule { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.schedule strong { color: var(--wine); font-variant-numeric: tabular-nums; }
small { display: block; color: var(--muted); margin-top: 9px; }
.page-heading { margin: 3px 0 24px; }
.page-heading h1 { margin: 12px 0 8px; }
.option h2 { margin: 12px 0 6px; }
.login {
    --brand-red: #7c1e16;
    --brand-brown: #4f261b;
    --brand-orange: #f59925;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 46% 54%;
    font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.login-brand, .login-form {
    display: grid;
    place-items: center;
    padding: clamp(24px, 6vw, 80px);
}
.login-brand {
    background: radial-gradient(ellipse at 80% 15%, var(--brand-red), transparent 75%), var(--brand-brown);
    border-bottom: 5px solid var(--brand-orange);
}
.login-brand img { width: min(410px, 100%); height: auto; display: block; }
.login-form { margin: 0; max-width: none; background: #fbf7f2; }
.login-form form {
    width: min(100%, 420px);
    padding: clamp(24px, 4vw, 42px);
    background: #fff;
    border: 1px solid #eee2d8;
    border-radius: 18px;
    box-shadow: 0 16px 48px #4f261b0d;
}
.login-app { color: var(--brand-red); font-size: .87rem; font-weight: 750; margin-bottom: 8px; }
.login-form h1 { color: var(--brand-brown); font-size: clamp(1.75rem, 4vw, 2.25rem); margin-bottom: 25px; }
.login .primary { width: 100%; background: var(--brand-red); min-height: 46px; }
.login .primary:hover { background: var(--brand-brown); }
.login :is(input, button):focus-visible { outline-color: var(--brand-red); }
label { display: grid; gap: 7px; margin-bottom: 16px; font-weight: 650; font-size: .9rem; }
input { width: 100%; border: 1px solid #cfc3bd; background: #fff; border-radius: 8px; padding: 10px; }
.primary { background: var(--wine); color: #fff; border: 0; border-radius: 8px; width: auto; cursor: pointer; font-weight: 700; }
.error { color: var(--wine); margin: 0 0 12px; }
@media (max-width: 850px) {
    .layout { grid-template-columns: 190px minmax(0, 1fr); }
    .panels { grid-template-columns: 1fr; }
    .profile-text { display: none; }
}
@media (max-width: 620px) {
    .layout, .login { display: block; }
    .sidebar { padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
    .brand { min-height: 50px; margin-bottom: 8px; }
    .brand img { width: 115px; }
    nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr)); }
    nav a { flex-shrink: 0; padding: 6px 9px; min-height: 38px; font-size: .82rem; }
    .logout { padding-top: 2px; }
    .logout button { padding: 5px 9px; }
    main { padding-top: 18px; }
    .hero { align-items: start; flex-direction: column; }
    .login-brand { padding: 26px 20px; }
    .login-brand img { width: min(245px, 82%); }
    .login-form { padding: 24px 16px; }
}
@media (max-width: 620px) {
    .login { min-height: 100dvh; }
    .login input { font-size: 16px; min-height: 44px; }
    .topbar { flex-wrap: wrap; }
    nav a { min-height: 44px; }
}

.account-link { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; max-width: 220px; }
.account-link .profile-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { overflow: hidden; text-transform: uppercase; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-editor { max-width: 520px; padding: clamp(18px, 4vw, 32px); }
.profile-photo { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.avatar-large { flex-basis: 62px; height: 62px; font-size: 1.5rem; }
.profile-photo small { margin-top: 4px; }
.profile-editor .primary { margin-top: 18px; min-height: 44px; }
.profile-editor input { min-height: 44px; font-size: 16px; }
.profile-editor .remove-photo { display: flex; align-items: center; margin: 12px 0 0; min-height: 44px; }
.profile-editor .remove-photo input { width: auto; min-height: 0; }
.profile-saved { margin-bottom: 14px; color: #245d32; font-weight: 650; }

.ingredient-list, .inventory-scope { margin-top: 18px; }
.ingredient-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 16px; }
.ingredient-row + .ingredient-row { border-top: 1px solid var(--line); }
.ingredient-row small { margin-top: 3px; overflow-wrap: anywhere; }
.ingredient-editor h2, .inventory-scope h2, .inventory-scope p { margin-bottom: 14px; }
@media (max-width: 620px) {
    .ingredient-row { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; }
    .ingredient-row > div:only-of-type:first-child { grid-column: 1 / -1; }
    .ingredient-row .tag { justify-self: start; }
}

.workspace-panel { padding: clamp(16px, 3vw, 24px); margin: 0 0 16px; }
.workspace-panel p, .workspace-panel h2 { margin-bottom: 12px; }
.workspace-panel button { min-height: 44px; width: auto; }
.workspace-panel select { min-height: 44px; width: 100%; font: inherit; border: 1px solid #cfc3bd; border-radius: 8px; padding: 8px; background: #fff; }
.catalog-list [hidden] { display: none; }
.report-filters { display: grid; align-items: end; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.report-filters label { margin: 0; min-width: 0; }
.report-filters input, .workspace-panel input { min-height: 44px; font-size: 16px; }
.report-items { grid-column: 1 / -1; }
.report-filters .primary { justify-self: start; }
@media (max-width: 620px) {
    .report-filters { grid-template-columns: minmax(0, 1fr); }
    .report-filters > .primary { width: 100%; }
}
.purchase-line { grid-template-columns: minmax(0, 1fr) minmax(90px, 140px); align-items: center; gap: 12px; margin: 10px 0; }
@media (max-width: 620px) {
    .purchase-line { grid-template-columns: minmax(0, 1fr) minmax(78px, 100px); }
}
.report-items { border: 1px solid #cfc3bd; border-radius: 8px; padding: 0 12px; }
.report-items summary { cursor: pointer; padding: 12px 0; min-height: 44px; font-weight: 650; }
.report-items summary:focus-visible { outline: 3px solid #b85245; outline-offset: 2px; }
.report-items p { color: var(--muted); font-size: .85rem; margin-bottom: 6px; }
.report-checkboxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); column-gap: 12px; padding-bottom: 8px; }
.report-checkboxes label { display: flex; align-items: center; min-height: 44px; gap: 9px; }
.report-checkboxes input { width: 18px; min-height: 0; height: 18px; accent-color: var(--wine); flex-shrink: 0; }

.ingredient-actions, .inventory-bulk { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.inventory-bulk { justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.inventory-bulk label, .inventory-select { display: flex; align-items: center; gap: 10px; margin: 0; min-height: 44px; }
.inventory-bulk input, .inventory-select input { width: 18px; height: 18px; accent-color: var(--wine); flex-shrink: 0; }
.inventory-bulk button, .inventory-toggle { background: #fff; cursor: pointer; min-height: 44px; }
.inventory-bulk button:disabled { opacity: .5; cursor: default; }
.inventory-toggle[aria-pressed="true"] { background: #e8f3eb; color: #245d32; border-color: #b7d6c1; }
.ingredient-editor { margin-top: 16px; }
.ingredient-editor select { width: 100%; min-height: 44px; padding: 8px; border: 1px solid #cfc3bd; border-radius: 8px; background: #fff; font: inherit; }
.unit-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.unit-form label { margin: 0; flex: 1 1 220px; }
@media (max-width: 620px) {
    .inventory-select { grid-column: 1 / -1; }
    .inventory-toggle { justify-self: start; }
}
.recipe-download { margin-bottom: 14px; }
.recipe-download a { display: inline-flex; align-items: center; min-height: 44px; }
.coverage-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 10px; }
.coverage-metrics div { background: #f8f4f2; border-radius: 9px; padding: 12px; }
.coverage-metrics dt { color: var(--muted); font-size: .85rem; }
.coverage-metrics dd { margin: 6px 0 0; font-size: 1.25rem; font-weight: 700; }
.stock-row + .stock-row { margin-top: 8px; }
.stock-row summary > span { margin-left: 8px; overflow-wrap: anywhere; }
.stock-warning { color: #74410b; background: #fff2dc; border-radius: 7px; padding: 5px 8px; }

.action-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.closing-downloads { margin-bottom: 16px; }
.workspace-panel input, .workspace-panel select { min-width: 0; max-width: 100%; }
.ingredient-row > * { min-width: 0; overflow-wrap: anywhere; }
.sidebar, .module-grid > *, .panels > * { min-width: 0; }
@media (max-width: 620px) {
    .topbar { padding-block: 10px; }
    .sidebar { padding: 12px 16px; }
    .ingredient-row > .inventory-select { grid-column: 1 / -1; }
    .inventory-bulk { align-items: flex-start; }
}

/* Normalize the native single-select box across Safari and Chromium. */
.workspace-panel select, .ingredient-editor select {
    appearance: none;
    -webkit-appearance: none;
    height: var(--control-height);
    padding: 8px 32px 8px 10px;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                      linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: right 15px center, right 10px center;
    background-size: 5px 5px;
    background-repeat: no-repeat;
    text-overflow: ellipsis;
}
.workspace-panel select:focus-visible { outline: 3px solid #b85245; outline-offset: 2px; }
.report-filters > label > input { height: var(--control-height); }
.recipe-notes { grid-column: span 2; }
.recipe-quantities, .stock-task-actions { grid-column: 1 / -1; }
.site-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; }
.recipe-quantities { padding: 12px; min-width: 0; margin: 0; }
.recipe-quantities legend { font-weight: 650; }
.saved-search-list:not(:empty) { margin-bottom: 16px; }
.site-totals h3 { font-size: .95rem; color: var(--wine); }
.site-totals dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.site-totals dd { margin: 0; text-align: right; }
.stock-task { margin-top: 10px; }
.stock-task form { padding-bottom: 12px; }
.workspace-panel .panel-heading h2 { margin: 0; }
@media (max-width: 620px) {
    .recipe-notes { grid-column: 1 / -1; }
}

:root {
    --bg: #f8f7f5;
    --ink: #302825;
    --muted: #675b57;
    --line: #eee7e2;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 600; letter-spacing: -.032em; }
h2 { font-weight: 600; }
strong, label, .primary, .switch, .app-name, .report-items summary { font-weight: 550; }
body { line-height: 1.5; }
.card { border-radius: 11px; }
.page-heading { margin-bottom: 20px; }
.brand { margin-bottom: 18px; }
nav { gap: 5px; }
.nav-group summary, nav > a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 7px;
    color: #514542;
    font-weight: 550;
    font-size: .9rem;
}
.nav-group summary { cursor: pointer; list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: '›'; margin-left: auto; }
.nav-group[open] summary::after { transform: rotate(90deg); }
.nav-group summary:hover, .nav-group .nav-active { color: var(--wine); background: #f8eeea; }
.nav-group ul { list-style: none; margin: 5px 0 8px 20px; padding: 0 0 0 8px; border-left: 1px solid var(--line); }
.nav-group li a { font-size: .85rem; font-weight: 400; padding: 8px 10px; min-height: 44px; }
.nav-group summary:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
.section-guide { color: var(--muted); }
@media (min-width: 621px) {
    .sidebar { position: sticky; inset-block-start: 0; height: 100vh; overflow-y: auto; }
}
@media (max-width: 620px) {
    .sidebar { padding-block: 8px; }
    .brand { margin-bottom: 4px; }
    nav { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .nav-group[open] { grid-column: 1 / -1; }
    .nav-group[open] ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nav-group .nav-icon { flex: 0 0 18px; }
    .section-guide { max-width: 26ch; }
}

.selected-exclusions { list-style: none; padding: 0; margin: 0 0 12px; max-width: 570px; }
.selected-exclusions:empty { display: none; }
.selected-exclusions li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.selected-exclusions li span { min-width: 0; overflow-wrap: anywhere; }
.selected-exclusions button { flex-shrink: 0; background: #fff; }
.product-ranking { margin: 0; padding-left: 24px; }
.product-ranking li { padding: 10px 0 10px 5px; }
.product-ranking li + li { border-top: 1px solid var(--line); }
.product-ranking li div { display: flex; gap: 12px; justify-content: space-between; }
.product-ranking li strong { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.report-filters [data-period][hidden] { display: none; }
.unit-row + .unit-row { border-top: 1px solid var(--line); }
.unit-row summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; min-height: 48px; padding: 10px 16px; cursor: pointer; overflow-wrap: anywhere; }
.unit-row summary::-webkit-details-marker { display: none; }
.unit-edit { color: var(--wine); font-size: .86rem; }
.unit-row .workspace-panel { margin: 0; padding-top: 8px; }

:root, [data-palette="fogon"] { --wine: #781f19; --active-bg: #f8eeea; }
[data-palette="terracota"] { --wine: #923e2b; --active-bg: #f9ebe3; }
[data-palette="cacao"] { --wine: #604031; --active-bg: #f1e8df; }
nav a[aria-current], .nav-group .nav-active, .appearance-active { background: var(--active-bg); color: var(--wine); }
nav a[aria-current]::after, .appearance-active::after { content: ''; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: var(--wine); margin-left: auto; }
.settings-layout { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,245px),1fr)); gap: 16px; }
.appearance-preview img { width: 105px; margin-bottom: 10px; }
.appearance-active { display: flex; align-items: center; margin-bottom: 12px; border-radius: 7px; padding: 10px 12px; }
.app-location { color: var(--muted); font-size: .86rem; }
.checkbox-inline { display: flex; align-items: center; gap: 8px; }
.checkbox-inline input { width: 17px; min-height: 0; }
@media(max-width: 620px) { .app-location { display: block; } }
.dashboard-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.dashboard-kpis { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,180px),1fr)); gap: 12px; }
.dashboard-kpis > div { padding: 16px 20px; border-top: 2px solid var(--wine); }
.dashboard-kpis span { display: block; color: var(--muted); font-size: .88rem; }
.dashboard-kpis strong { font-size: 1.85rem; }
.dashboard-demo { margin-top: 12px; padding: 10px 12px; }
.dashboard-panels { grid-template-columns: repeat(auto-fit,minmax(min(100%,320px),1fr)); }
.dashboard-panels .product-ranking li strong { flex: 0 1 auto; text-align: right; }
button:disabled { opacity: .6; cursor: default; }

.primary, .login .primary { background: var(--action-bg, var(--wine)); color: var(--action-ink, white); }
nav a[aria-current], .nav-group .nav-active, .appearance-active { color: var(--active-ink, var(--wine)); }
nav a[aria-current]::after, .appearance-active::after { background: var(--indicator, var(--wine)); box-shadow: 0 0 0 1px var(--active-ink, var(--wine)); }
.appearance-presets, .appearance-colors { min-width: 0; border: 0; padding: 0; margin: 0 0 18px; }
.appearance-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.appearance-presets legend, .appearance-colors legend { font-weight: 600; margin-bottom: 8px; }
.appearance-presets label { position: relative; display: flex; align-items: center; gap: 6px; margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-height: 44px; cursor: pointer; }
.appearance-presets label:has(:checked) { border-color: var(--wine); background: var(--active-bg); color: var(--active-ink); }
.appearance-presets input { width: 13px; height: 13px; min-height: 0; accent-color: var(--wine); }
.palette-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.appearance-colors label { grid-template-columns: minmax(0,1fr) auto auto; align-items: center; margin-bottom: 8px; }
.appearance-colors output { font-size: .78rem; color: var(--muted); font-family: monospace; }
.appearance-colors input[type="color"] { width: 44px; height: 44px; padding: 3px; cursor: pointer; }
.app-name { overflow-wrap: anywhere; }
[data-user-site][hidden] { display: none; }

.sidebar-navigation { display: flex; flex-direction: column; flex: 1; }
.mobile-menu { display: none; background: #fff; }
.dashboard-next { margin-top: 12px; }
.stock-shortcuts { margin-bottom: 12px; }
#busquedas-guardadas > small { padding-bottom: 10px; }
@media (max-width: 620px) {
    .sidebar-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
    .sidebar-header .brand { justify-content: start; }
    .sidebar.has-mobile-menu .mobile-menu { display: inline-flex; }
    .sidebar.has-mobile-menu:not(:has(.mobile-menu[aria-expanded="true"])) .sidebar-navigation { display: none; }
    .topbar > div:first-child { min-width: 0; }
    .topbar .profile { flex-wrap: wrap; }
}

.purchase-items { min-width: 0; border: 0; border-top: 1px solid var(--line); margin: 18px 0 16px; padding: 10px 0 0; }
.purchase-items legend { padding-right: 10px; font-weight: 600; }
#purchase-form, .purchase-history { max-width: 860px; }
.purchase-picker { margin-bottom: 12px; max-width: 570px; }
.purchase-picker label { flex-basis: 160px; min-width: 0; }
.purchase-remove, [data-add] { background: var(--surface, #fff); }
.purchase-remove:hover, [data-add]:not(:disabled):hover { background: var(--active-bg, #f7f2ef); }
.purchase-picker select { width: 100%; }
.purchase-entry { display: grid; grid-template-columns: minmax(0,1fr) minmax(105px, 135px) 76px; align-items: end; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.purchase-entry label { margin: 0; }
.purchase-entry-product { display: flex; flex-direction: column; justify-content: center; min-width: 0; min-height: 44px; overflow-wrap: anywhere; }
.purchase-entry-product small { margin-top: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 620px) {
    .purchase-entry { grid-template-columns: minmax(0,1fr) 76px; gap: 8px; }
    .purchase-entry-product { grid-column: 1 / -1; min-height: 0; }
}

.task-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.task-link { display: grid; align-content: start; gap: 4px; padding: 16px; }
.task-link:hover { border-color: var(--wine); }
.task-link strong { color: var(--wine); }
.task-link span { color: var(--muted); font-size: .92rem; }
.purchase-confirmation { margin-bottom: 14px; }
.purchase-confirmation .profile-saved { margin: 0; }

:root { --bg: #eef2f6; --ink: #263444; --muted: #506177; --line: #dbe3ec; }
body { font-weight: 400; }
h1 { font-size: clamp(1.65rem, 3vw, 2rem); letter-spacing: -.025em; }
.workspace-panel { box-shadow: 0 1px 2px #24354a08; }
.workspace-panel :is(input, select) { border-color: #becbd9; }
.compact-report .optional-filter { grid-column: auto; padding: 0; border: 0; }
.optional-filter summary { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--wine); width: fit-content; background: #fff; }
.compact-report .optional-filter[open] { grid-column: 1 / -1; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.optional-filter[open] summary { margin-bottom: 10px; }
.app-dialog { width: min(540px, calc(100% - 32px)); padding: 22px; color: var(--ink); max-height: 80vh; }
.app-dialog::backdrop { background: #20304366; }
.app-dialog p { margin-bottom: 12px; }
.app-dialog input { width: 100%; }
.saved-report-list { list-style: none; padding: 0; margin: 0; }
.saved-report-list a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table thead { background: var(--bg); }
.minimum-row input[name="cantidad"] { width: 104px; }
.recipe-list-filters { margin-bottom: 14px; }
.dashboard-kpis > div { border-top: 1px solid var(--line); }
.ranking-bar { display: block; block-size: 5px; inline-size: var(--share); background: var(--wine); opacity: .35; border-radius: 4px; margin-top: 6px; }

.dashboard-week { margin-top: 16px; }
.dashboard-week > p { color: var(--muted); }
.weekly-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(4px, 2vw, 22px); padding: 0; margin: 18px 0 0; list-style: none; }
.weekly-chart li { display: grid; justify-items: center; gap: 4px; min-width: 0; font-size: clamp(.7rem, 1.6vw, .95rem); font-variant-numeric: tabular-nums; }
.weekly-track { display: flex; align-items: flex-end; height: 132px; width: 100%; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0 calc(25% - 1px), var(--line) calc(25% - 1px) 25%); }
.weekly-track span { width: 65%; max-width: 64px; height: var(--share); margin-inline: auto; background: var(--wine); opacity: .7; border-radius: 6px 6px 0 0; }
.weekly-chart time, .weekly-missing strong { color: var(--muted); }
.weekly-empty { padding: 12px; background: var(--bg); border-radius: 8px; }

.dashboard-overview { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(220px, 1fr); gap: 14px; }
.dashboard-overview > .workspace-panel { margin: 0; border-radius: 14px; }
.chart-filter { display: flex; align-items: end; gap: 8px; max-width: 100%; }
.chart-filter label { margin: 0; min-width: 0; font-size: .85rem; }
.chart-filter .switch { background: #fff; }
.dashboard-coverage .coverage-percent { display: block; font-size: 2rem; }
.dashboard-coverage meter { width: 100%; accent-color: var(--wine); }
.dashboard-coverage dl div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dashboard-coverage dd { margin: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 950px) { .dashboard-overview { grid-template-columns: minmax(0, 1fr); } }

.dashboard-home { --dashboard-surface: #fff; --dashboard-track: #edf1f5; }
.dashboard-home .card { border-radius: 15px; background: var(--dashboard-surface); }
.dashboard-home .dashboard-filters { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); padding-block: 15px; }
.dashboard-home .dashboard-filters button { justify-self: start; }
.dashboard-home .dashboard-kpis > div:first-child { background: linear-gradient(140deg, #fff 45%, var(--bg)); border-inline-start: 3px solid var(--wine); }
.dashboard-home .dashboard-kpis strong { font-size: clamp(1.75rem, 3vw, 2.2rem); font-variant-numeric: tabular-nums; }
.dashboard-home .dashboard-kpis small { margin: 3px 0 0; }
.dashboard-home .weekly-track { height: clamp(105px, 17vw, 176px); }
.dashboard-home .weekly-track span { background: linear-gradient(to top, color-mix(in srgb, var(--wine) 40%, white), var(--wine)); opacity: .85; }
.dashboard-home .weekly-chart strong { overflow-wrap: anywhere; text-align: center; }
.dashboard-home .dashboard-overview { grid-template-columns: minmax(0, 2.5fr) minmax(220px, 1fr); }
.coverage-ring { position: relative; isolation: isolate; display: grid; place-content: center; text-align: center; width: 122px; aspect-ratio: 1; margin: 14px auto; border-radius: 50%; background: conic-gradient(var(--wine) var(--coverage), var(--dashboard-track) 0); }
.coverage-ring::before { content: ''; position: absolute; z-index: -1; inset: 9px; border-radius: inherit; background: var(--dashboard-surface); }
.coverage-ring strong { font-size: 1.55rem; font-variant-numeric: tabular-nums; }
.coverage-ring span { font-size: .75rem; color: var(--muted); }
.dashboard-branches { grid-column: 1 / -1; }
.dashboard-home .ranking-bar { background: linear-gradient(to right, var(--wine), color-mix(in srgb, var(--wine) 20%, white)); opacity: .55; }
@media (max-width: 950px) { .dashboard-home .dashboard-overview { grid-template-columns: minmax(0, 1fr); } }

.weekly-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; padding: 0; margin: 10px 0 0; color: var(--muted); font-size: .85rem; }
.weekly-legend li { display: inline-flex; align-items: center; gap: 6px; }
.weekly-legend span { width: 10px; height: 10px; border-radius: 2px; background: var(--site-color); }
.dashboard-home .weekly-stack { flex-direction: column-reverse; align-items: center; }
.dashboard-home .weekly-stack span { flex: 0 0 var(--share); background: var(--site-color); border-radius: 0; opacity: .92; }
.dashboard-home .weekly-stack span:last-child { border-radius: 5px 5px 0 0; }
.weekly-breakdown { margin-top: 12px; }
.weekly-breakdown summary { color: var(--wine); cursor: pointer; padding-block: 6px; }

.dashboard-priorities, .dashboard-commercial { margin-top: 16px; }
.dashboard-commercial { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.dashboard-commercial > .workspace-panel { margin: 0; }
.dashboard-commercial dl div { display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dashboard-commercial dd { margin: 0; color: var(--muted); }

.ingredient-icon-toolbar .switch { gap: 6px; font-size: .83rem; }
.ingredient-action-icon { font-size: 1.1rem; line-height: 1; }
.inventory-row { grid-template-columns: minmax(0, 1fr) auto; }
.ingredient-row-actions { justify-content: flex-end; gap: 4px; }
.ingredient-row-actions .ingredient-icon-action {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 4px 6px;
    min-height: 44px;
    min-width: 72px;
    border-color: transparent;
    background: transparent;
    color: var(--muted);
    font-size: .72rem;
}
.ingredient-row-actions .ingredient-icon-action:hover { background: var(--bg); color: var(--wine); }
.ingredient-row-actions .inventory-toggle[aria-pressed="true"] { color: #245d32; }
.ingredient-row-actions [name="dashboard_priority"][aria-pressed="true"] { color: #805515; }
@media (max-width: 620px) {
    .inventory-row { grid-template-columns: minmax(0, 1fr); }
    .ingredient-row-actions { justify-content: flex-start; }
}

.switch.compact-action, .unit-edit.compact-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 44px;
    padding: 4px 8px;
    border-color: transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--wine);
    font-size: .78rem;
}
.switch.compact-action:hover, summary:hover .unit-edit.compact-action { background: var(--active-bg); }
.compact-action-icon { font-size: 1.1rem; line-height: 1; }

.notification-previews {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 390px), 1fr));
    gap: 16px;
    align-items: start;
}
.notification-email-preview {
    width: 100%;
    height: 480px;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.notification-telegram-preview {
    padding: 16px;
    border-radius: 12px;
    background: #eaf4f7;
    color: #233246;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.user-sites {
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.user-sites legend { font-weight: 600; }
.user-sites label { display: flex; align-items: center; gap: 8px; }
.user-sites input[type="checkbox"] { min-height: 0; width: 16px; height: 16px; margin: 8px 0; }

.ingredient-recipes-dialog { width: min(940px, calc(100% - 32px)); }
.ingredient-recipes-dialog .panel-heading { align-items: start; }
.ingredient-recipes-dialog .data-table th:first-child { min-width: 180px; }
.ingredient-recipes-dialog .data-table td { vertical-align: middle; }
.ingredient-recipes-dialog .data-table td:nth-child(2), .ingredient-recipes-dialog .data-table td:nth-child(3) { white-space: nowrap; }

.nav-section-label {
    padding: 8px 10px 3px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 650;
    letter-spacing: .045em;
    text-transform: uppercase;
}
.nav-section-label:not(:first-child) {
    margin-top: 12px;
    padding-top: 13px;
    border-top: 1px solid var(--line);
}
@media (max-width: 620px) {
    .nav-section-label { grid-column: 1 / -1; }
}

.nav-icon {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    color: var(--wine);
}
.nav-icon svg { display: block; width: 21px; height: 21px; }
nav a[aria-current] .nav-icon, .nav-group .nav-active .nav-icon {
    color: var(--active-ink, var(--wine));
    --nav-icon-cutout: var(--active-bg, white);
}
@media (max-width: 620px) {
    .nav-group .nav-icon, nav > a .nav-icon { flex: 0 0 22px; width: 22px; }
    .nav-icon svg { width: 19px; height: 19px; }
}

/* Shared visual system: controls, typography, surfaces and responsive layout. */
:root {
    --surface: #fff;
    --control-height: 42px;
    --control-border: #bdc9d5;
    --surface-muted: #f5f7fa;
    --radius-control: 8px;
    --radius-panel: 12px;
    --text-size: .9375rem;
}
[hidden] { display: none !important; }
body { font-size: var(--text-size); line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1 { font-size: clamp(1.65rem, 2.5vw, 2rem); font-weight: 650; line-height: 1.2; }
h2 { font-size: 1.0625rem; font-weight: 650; line-height: 1.35; }
h3 { font-size: .95rem; font-weight: 650; line-height: 1.4; margin: 0 0 8px; }
strong { font-weight: 600; }
small { font-size: .8rem; line-height: 1.45; }
label { font-size: .875rem; font-weight: 550; line-height: 1.4; gap: 6px; min-width: 0; }
button, input, select, textarea { font: inherit; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
select, textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 400;
    border: 1px solid var(--control-border);
    border-radius: var(--radius-control);
    background-color: var(--surface);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]), select {
    min-height: var(--control-height);
    height: var(--control-height);
    padding-block: 8px;
}
textarea { min-height: 90px; padding: 10px 12px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #68788a; opacity: 1; }
input[readonly], select:disabled { background: var(--surface-muted); color: var(--muted); }
input[type="file"] { height: auto !important; padding: 5px 8px !important; }
input[type="file"]::file-selector-button { font: inherit; border: 0; background: var(--active-bg); color: var(--wine); padding: 6px 10px; border-radius: 5px; margin-right: 10px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] {
    width: 18px; height: 18px; min-width: 18px; min-height: 18px; max-width: 18px;
    padding: 0; margin: 0; flex: 0 0 18px; accent-color: var(--action-bg, var(--wine)); cursor: pointer;
}
label:has(> input[type="checkbox"]), label:has(> input[type="radio"]),
.checkbox-inline, .remove-photo {
    display: flex; align-items: center; flex-wrap: nowrap; gap: 9px; min-height: 38px;
}
.appearance-presets label:has(> input[type="radio"]) { padding: 8px 10px; }
.report-filters > label > input[type="checkbox"], .report-filters > label > input[type="radio"] { height: 18px; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--wine); outline-offset: 3px; }
.primary, .switch, .hero-link {
    border-radius: var(--radius-control);
    min-height: var(--control-height);
    padding: 9px 14px;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    overflow-wrap: normal;
    transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.switch { background-color: var(--surface); border: 1px solid var(--control-border); cursor: pointer; }
.switch:hover:not(:disabled) { background-color: var(--active-bg); border-color: var(--wine); }
.primary { border: 1px solid transparent; background: var(--action-bg, var(--wine)); color: var(--action-ink, #fff); }
.primary:hover:not(:disabled) { box-shadow: 0 2px 6px #26344426; filter: brightness(.94); }
button:disabled, input:disabled, select:disabled { opacity: .65; cursor: not-allowed; }
button:disabled { background: #edf1f5; color: #526171; border-color: var(--line); }
.switch.compact-action, .unit-edit.compact-action {
    white-space: nowrap; overflow-wrap: normal; flex-shrink: 0; min-height: 38px; padding: 6px 9px;
}
.ingredient-row-actions .ingredient-icon-action { white-space: nowrap; min-width: 72px; min-height: 46px; }
.card, .dashboard-home .card { border-radius: var(--radius-panel); }
.workspace-panel { padding: clamp(16px, 2vw, 24px); margin-bottom: 16px; box-shadow: 0 1px 3px #26344409; }
.workspace-panel > :last-child { margin-bottom: 0; }
.workspace-panel > p { color: var(--muted); }
.workspace-panel h2 { margin-bottom: 10px; }
.page-heading { margin: 0 0 20px; }
.page-heading > .switch { min-height: 34px; padding: 6px 10px; margin-bottom: 8px; font-size: .8rem; }
.page-heading h1 { margin: 0 0 6px; }
.page-heading .panel-heading { margin: 0; }
.panel-heading { gap: 12px; margin-bottom: 16px; align-items: center; }
.panel-heading > h1, .panel-heading > h2 { margin: 0; }
.panel-heading > div { min-width: 0; }
.panel-heading > div > p { margin: 4px 0 0; color: var(--muted); }
.report-filters { gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.report-filters > button, .report-filters > a.switch { justify-self: start; }
.report-filters > :is(.primary,.switch) { min-width: min(100%, 112px); }
.action-group { gap: 10px; }
.action-group > label { margin: 0; }
.form-actions { margin-top: 16px; }
.notification-config-form > label { margin: 16px 0 0; }
.notification-options { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 14px; }
.notification-options label { margin: 0; }
.notification-test-actions { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.notification-previews > .workspace-panel { min-width: 0; }
.notification-previews form { margin-top: 12px; align-items: end; }
.notification-previews form label { margin: 0; flex: 1 1 200px; }
.notification-previews .notification-telegram-preview { font-size: .9rem; line-height: 1.65; }
.error, .profile-saved, .stock-warning {
    padding: 11px 14px; border-radius: 8px; border: 1px solid transparent; font-size: .9rem; line-height: 1.5;
}
.error { color: #932b28; background: #fff1f0; border-color: #ecc9c5; }
.profile-saved { color: #235c3b; background: #eaf5ee; border-color: #c2e3ce; }
.stock-warning { color: #74410b; background: #fff5e3; border-color: #f0d6a5; }
.tag { border-radius: 20px; padding: 4px 9px; font-size: .75rem; line-height: 1.35; font-weight: 600; white-space: nowrap; }
.tag-success { background: #e7f4ec; color: #225a39; }
.tag-warning { background: #fff0d6; color: #7b4c11; }
.tag-error { background: #fce6e4; color: #972d27; }
.tag-neutral { background: #edf1f5; color: #526171; }
.ingredient-row { gap: 12px; padding: 12px 14px; grid-template-columns: minmax(0, 1fr) auto auto; }
.ingredient-row:not(:has(> :nth-child(3))) { grid-template-columns: minmax(0, 1fr) auto; }
.ingredient-row.inventory-row { grid-template-columns: minmax(0, 1fr) auto; }
.ingredient-row > .tag { justify-self: end; }
.ingredient-row > :is(.switch,span,button):last-child { text-align: end; }
.ingredient-row > .switch:last-child { text-align: center; }
.catalog-list .ingredient-row:hover, .workspace-panel .ingredient-row:hover { background: var(--surface-muted); }
.ingredient-row small { margin-top: 4px; }
.table-scroll { border: 1px solid var(--line); border-radius: 9px; max-width: 100%; }
.data-table { font-size: .875rem; }
.data-table thead { background: var(--surface-muted); color: var(--muted); }
.data-table thead th { font-weight: 650; font-size: .8rem; white-space: nowrap; }
.data-table th, .data-table td { padding: 12px; vertical-align: middle; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-muted); }
.data-table tbody th { font-weight: 550; }
.data-table .compact-action { white-space: nowrap; }
.data-table details summary { cursor: pointer; color: var(--wine); white-space: nowrap; }
.data-table details dl { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; margin: 10px 0; }
.data-table details dd { margin: 0; text-align: end; }
.app-dialog { padding: 22px; max-height: min(85vh, 830px); overflow: auto; box-shadow: 0 18px 55px #26344435; }
.app-dialog .panel-heading { align-items: start; }
.app-dialog .panel-heading form { margin: 0; flex-shrink: 0; }
.app-dialog .panel-heading form .switch { min-height: 36px; }
.ingredient-recipes-dialog .data-table td:last-child { min-width: 88px; }
.recipe-quantities { border-color: var(--line); border-radius: 9px; padding: 16px; }
.recipe-quantities legend, .purchase-items legend { padding-inline: 6px; }
.purchase-entry { grid-template-columns: minmax(0,1fr) minmax(110px,160px) auto; }
.purchase-entry .purchase-remove { align-self: end; }
.purchase-entry-product { min-height: 42px; }
.purchase-entry-name { font-weight: 550; }
.purchase-picker { max-width: 640px; }
.purchase-picker label { flex: 1 1 230px; }
[data-empty]:not([hidden]), #exclusion-empty:not([hidden]), #catalog-empty:not([hidden]) {
    color: var(--muted); background: var(--surface-muted); border: 1px dashed var(--line); border-radius: 8px; padding: 12px;
}
.user-sites { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 12px; }
.user-sites legend { padding: 0 5px; font-size: .875rem; }
.user-sites small { width: 100%; margin: 0; }
.user-sites label { margin: 0; }
.appearance-preview { align-self: start; }
.appearance-preview .appearance-active { font-weight: 600; }
.appearance-colors output { color: var(--muted); }
.appearance-preview .primary { width: fit-content; }
.dashboard-home .dashboard-kpis > div { padding: 18px 20px; }
.dashboard-home .dashboard-kpis strong { font-weight: 650; }
.dashboard-home .dashboard-kpis small { line-height: 1.4; }
.dashboard-home .dashboard-overview { gap: 16px; }
.chart-filter { flex-wrap: wrap; align-items: end; }
.chart-filter label { flex: 1 1 180px; }
.weekly-chart { margin-top: 16px; }
.dashboard-commercial dd { text-align: end; }
.nav-group summary, nav > a, .logout button { min-height: 42px; font-weight: 550; color: var(--ink); }
nav a[aria-current], .nav-group .nav-active { background: var(--active-bg); color: var(--active-ink, var(--wine)); }
.nav-group summary:hover { background: var(--active-bg); }
.nav-group summary::after { color: var(--muted); font-size: 1.1rem; }
.nav-group li a { min-height: 38px; font-size: .85rem; }
.nav-icon svg { width: 23px; height: 23px; }
.nav-section-label { line-height: 1.4; }
.topbar { min-height: 64px; }
@media (min-width: 851px) { .layout { grid-template-columns: 252px minmax(0, 1fr); } }
@media (max-width: 950px) and (min-width: 621px) {
    .report-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .recipe-notes { grid-column: 1 / -1; }
    .inventory-row .ingredient-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 620px) {
    :root { --control-height: 44px; }
    main { padding: 20px 14px 30px; }
    .topbar { padding: 12px 14px; }
    nav { grid-template-columns: minmax(0, 1fr); }
    .nav-group[open] ul { grid-template-columns: minmax(0, 1fr); }
    .report-filters, .dashboard-home .dashboard-filters { grid-template-columns: minmax(0, 1fr); }
    .report-filters > button, .report-filters > a.switch { width: 100%; }
    .recipe-notes { grid-column: 1 / -1; }
    .ingredient-row, .ingredient-row.inventory-row { grid-template-columns: minmax(0,1fr) auto; }
    .ingredient-row.inventory-row .ingredient-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
    .ingredient-row-actions .ingredient-icon-action { min-width: 64px; }
    .ingredient-row > div:only-of-type:first-child { grid-column: 1 / -1; }
    .ingredient-row > .tag { justify-self: start; }
    .purchase-entry { grid-template-columns: minmax(0,1fr) auto; }
    .dashboard-heading { align-items: flex-start; }
    .dashboard-home .dashboard-kpis > div { padding: 15px; }
    .app-dialog { padding: 16px; width: calc(100% - 24px); max-height: 85vh; }
    .data-table { min-width: 420px; }
    .notification-options { flex-direction: column; gap: 4px; }
    .notification-previews { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .primary, .switch, .hero-link { transition: none; } }

:root { --control-height: 44px; }
.workspace-panel select, .ingredient-editor select { min-height: var(--control-height); font-weight: 400; }
.report-filters input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) { min-height: var(--control-height); }
.ingredient-action-icon, .compact-action-icon { display: inline-grid; place-items: center; flex-shrink: 0; line-height: 1; }
.ingredient-action-icon svg { width: 20px; height: 20px; display: block; }
.compact-action-icon svg { width: 17px; height: 17px; display: block; }
.site-totals { grid-template-columns: repeat(auto-fit,minmax(min(100%, 340px),1fr)); }
.site-totals > .report-items { grid-column: auto; padding: 15px 16px; border-color: var(--line); }
.site-totals h3 { padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.site-totals dl { margin: 0; gap: 0; grid-template-columns: minmax(0,1fr) minmax(0,auto); }
.site-totals dt, .site-totals dd { padding: 7px 0; border-bottom: 1px solid var(--line); }
.site-totals dd { padding-left: 14px; font-variant-numeric: tabular-nums; }
.site-totals dl > :nth-last-child(-n+2) { border-bottom: 0; }
.catalog-pagination { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.catalog-pagination p { margin: 0; color: var(--muted); font-size: .875rem; }
.catalog-pagination .action-group { margin-left: auto; }

.inventory-bulk button:disabled { opacity: 1; }
@media (max-width: 620px) {
    .ingredient-recipes-dialog .panel-heading {
        display: grid;
        grid-template-columns: minmax(0,1fr) auto;
        align-items: start;
        gap: 8px;
    }
    .ingredient-recipes-dialog .table-scroll { border: 0; overflow: visible; }
    .ingredient-recipes-dialog .data-table { display: block; min-width: 0; }
    .ingredient-recipes-dialog .data-table thead {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
    }
    .ingredient-recipes-dialog .data-table tbody { display: grid; gap: 10px; }
    .ingredient-recipes-dialog .data-table tr {
        display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr);
        gap: 8px 12px; border: 1px solid var(--line); border-radius: 9px; padding: 12px;
    }
    .ingredient-recipes-dialog .data-table th,
    .ingredient-recipes-dialog .data-table td {
        display: block; padding: 0; border: 0; min-width: 0; white-space: normal;
    }
    .ingredient-recipes-dialog .data-table th:first-child { grid-column: 1 / -1; min-width: 0; }
    .ingredient-recipes-dialog .data-table td:nth-child(2)::before,
    .ingredient-recipes-dialog .data-table td:nth-child(3)::before {
        display: block; margin-bottom: 3px; color: var(--muted); font-size: .75rem; font-weight: 550;
    }
    .ingredient-recipes-dialog .data-table td:nth-child(2)::before { content: 'Cantidad'; }
    .ingredient-recipes-dialog .data-table td:nth-child(3)::before { content: 'Vigencia'; }
    .ingredient-recipes-dialog .data-table td:last-child { grid-column: 1 / -1; justify-self: end; min-width: 0; }
}

/* Operational dashboard */
.dashboard-filter-panel { display: grid; gap: 12px; }
.dashboard-filter-row { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.dashboard-filter-group { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dashboard-filter-group > span { font-size: .82rem; color: var(--muted); font-weight: 600; }
.dashboard-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.dashboard-pill { display: inline-flex; align-items: center; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--wine); font-size: .84rem; text-decoration: none; }
.dashboard-pill[aria-current="true"] { background: var(--wine); color: white; border-color: var(--wine); }
.dashboard-custom-range summary { cursor: pointer; font-size: .85rem; color: var(--wine); }
.dashboard-custom-range form { margin-top: 10px; }
.dashboard-operational-kpis { grid-template-columns: repeat(auto-fit,minmax(min(100%,195px),1fr)); }
.dashboard-operational-kpis > .card { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.dashboard-operational-kpis > .kpi-warning { border-inline-start: 3px solid #b66a30; background: #fff8f1; }
.dashboard-operational-kpis .kpi-variation { font-size: .76rem; }
.kpi-site-list { margin-top: 8px; display: grid; gap: 4px; }
.kpi-site-list > div { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; font-size: .78rem; }
.kpi-site-list > div span { font-size: inherit; }
.kpi-site-list b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi-link { align-self: flex-start; margin-top: 8px; }
.kpi-coverage-track, .critical-stock-track { height: 7px; border-radius: 8px; background: var(--bg); overflow: hidden; }
.kpi-coverage-track span, .critical-stock-track span { display: block; width: var(--share); height: 100%; background: #438365; border-radius: inherit; }
.kpi-warning .kpi-coverage-track span, .critical-stock-track span { background: #b66a30; }
.dashboard-home .dashboard-overview { grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); align-items: start; }
.dashboard-critical { min-width: 0; }
.critical-stock-list { padding: 0; margin: 12px 0; list-style: none; display: grid; gap: 12px; }
.critical-stock-list li { display: grid; gap: 5px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.critical-stock-heading, .critical-stock-values { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.critical-stock-values { font-size: .85rem; }
.critical-stock-list .compact-action { justify-self: end; font-size: .76rem; }
.dashboard-empty-state { padding: 14px; border-radius: 9px; background: var(--bg); color: var(--muted); font-size: .88rem; }
.dashboard-empty-success { color: #276447; }
.dashboard-week[aria-busy="true"] { opacity: .78; }
@media(max-width: 1050px) { .dashboard-home .dashboard-overview { grid-template-columns: minmax(0,1fr); } }

dl.notification-options { margin-bottom: 0; }
.notification-options dt { color: var(--muted); font-size: .85rem; }
.notification-options dd { margin: 3px 0 0; font-weight: 600; }
.notification-options input[role="switch"] {
    appearance: none;
    position: relative;
    width: 34px;
    height: 20px;
    min-height: 0;
    padding: 0;
    border-radius: 12px;
    background: var(--bg);
}
.notification-options input[role="switch"]::before {
    content: "";
    position: absolute;
    inset: 3px auto 3px 3px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--muted);
}
.notification-options input[role="switch"]:checked { background: var(--wine); border-color: var(--wine); }
.notification-options input[role="switch"]:checked::before { inset-inline: auto 3px; background: white; }
