:root {
    color-scheme: light;
    --ivory: #F5F1E9;
    --white: #FFFFFF;
    --ink: #222A24;
    --muted: #586153;
    --green: #414F3D;
    --dark: #222922;
    --gold: #C89A45;
    --line: #e5ddd0;
    --radius: 10px;
    --interface-font: Arial, sans-serif;
    --brand-font: 'Linux Libertine G', Georgia, serif;
    font: 16px/1.5 var(--interface-font);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--ivory); color: var(--ink); }
a { color: var(--green); text-underline-offset: .2em; }
h1, h2 { margin: 0 0 .5rem; color: var(--dark); line-height: 1.15; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.75rem); letter-spacing: -.035em; }
h2 { font-size: 1.18rem; }
p { margin: .45rem 0 .9rem; color: var(--muted); }
.app-shell { display: grid; grid-template-columns: 225px minmax(0, 1fr); min-height: 100dvh; }
.app-content { min-width: 0; }
.sidebar { display: flex; flex-direction: column; gap: 1.8rem; position: sticky; top: 0; height: 100dvh; overflow-y: auto; padding: 1.5rem .9rem 1rem; }
.sidebar, .login-brand { background: var(--dark); color: var(--ivory); }
.sidebar .brand { padding: 0 .25rem; }
.sidebar .brand img { width: 2.4rem; height: 2.4rem; }
.sidebar .brand-name { font-size: 1.09rem; }
.sidebar .brand-motto { font-size: .69rem; }
.workspace-top, .breadcrumbs { display: flex; gap: .65rem; align-items: center; }
.workspace-top { justify-content: space-between; min-height: 50px; padding: .35rem 1.7rem; border-bottom: 1px solid var(--line); border-top: 1px solid var(--gold); background: #faf8f3; color: var(--muted); font-size: .8rem; }
.workspace-top strong { color: var(--ink); }
.brand { color: var(--ivory); display: flex; flex: 0 0 auto; align-items: center; gap: .65rem; font-family: var(--brand-font); font-weight: 400; text-decoration: none; }
.brand img { width: 3rem; height: 3rem; object-fit: contain; }
.brand-type, .brand-name, .brand-motto { display: block; }
.brand-name { font-size: 1.38rem; line-height: 1.1; }
.brand-motto { margin-top: .3rem; font-size: .76rem; line-height: 1.25; }
.actions, .account { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.sidebar nav { display: grid; gap: .72rem; }
.nav-group { display: grid; gap: .2rem; }
.nav-group p { margin: 0 .65rem .24rem; color: #d8d5c9; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.nav-group a { display: flex; align-items: center; gap: .5rem; min-height: 39px; padding: .43rem .65rem; color: var(--ivory); border-radius: 7px; text-decoration: none; font-size: .83rem; }
.module-icon { color: var(--gold); min-width: 1rem; text-align: center; }
.nav-group a:hover, .nav-group a[aria-current="page"] { background: var(--green); }
.nav-group a[aria-current="page"] { box-shadow: inset 2px 0 var(--gold); font-weight: 700; }
.account { flex-wrap: nowrap; color: var(--muted); font-size: .82rem; }
.account small { display: inline; margin-left: .35rem; }
.account .quiet { min-height: 32px; padding: .35rem .55rem; }
.container { max-width: 1350px; margin: auto; padding: 1.65rem 1.7rem 4rem; }
.page-heading, .section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin: .45rem 0 1.25rem; }
.section-heading { align-items: start; }
.page-heading p, .section-heading p { margin: .25rem 0; }
.back { display: inline-block; margin-bottom: .55rem; font-size: .87rem; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.45rem; margin-bottom: .95rem; }
.table-card { padding: .25rem 1.1rem; }
.dashboard-heading { margin-top: 0; }
.dashboard-heading .primary { background: var(--dark); }
.dashboard-container .card { padding: .85rem; }
.dashboard-container .section-heading { align-items: center; margin: 0 0 .65rem; }
.dashboard-container h2 { font-size: 1.02rem; }
.dashboard-container .section-heading h2 { margin: 0; }
.dashboard-container .section-heading > a { font-size: .8rem; white-space: nowrap; }
.dashboard-container table { font-size: .83rem; }
.dashboard-container th, .dashboard-container td { padding: .5rem .3rem; }
.dashboard-container td:last-child { white-space: nowrap; }
.dashboard-container .pill { font-size: .73rem; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.metric, .workflow a { display: grid; align-content: start; gap: .25rem; min-width: 0; padding: .85rem .9rem; color: var(--ink); background: #faf8f3; border: 1px solid var(--line); border-radius: 9px; text-decoration: none; overflow-wrap: anywhere; }
.metric { align-content: center; min-height: 128px; box-shadow: 0 5px 22px #2229220a; }
.metric:hover, .workflow a:hover { border-color: var(--green); }
.metric strong { font-size: clamp(1.18rem, 2.7vw, 1.65rem); line-height: 1.18; }
.metric span { color: var(--muted); font-size: .8rem; }
.workflow { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .45rem; }
.workflow a { align-content: center; min-height: 67px; padding: .52rem .5rem; font-size: .79rem; }
.workflow strong { display: flex; align-items: baseline; gap: .25rem; line-height: 1.25; overflow-wrap: normal; }
.workflow small { font-size: .74rem; }
.step-dot { display: inline-block; flex: 0 0 .62rem; height: .62rem; border-radius: 50%; border: 1px solid currentColor; color: var(--green); }
.workflow .workflow-ready { border-color: #d1d8cb; background: #ecefe8; }
.workflow-ready .step-dot { background: var(--green); }
.workflow .workflow-current { border-color: var(--gold); box-shadow: inset 0 2px var(--gold); background: #f3ece0; }
.workflow-current .step-dot { color: #854732; }
.dashboard-split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: .9rem; align-items: start; }
.dashboard-split > .card { min-width: 0; }
.dashboard-action { display: flex; justify-content: space-between; align-items: center; gap: .65rem; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.dashboard-action .button { min-height: 34px; padding: .38rem .65rem; font-size: .78rem; }
.dashboard-action:last-child { border-bottom: 0; }
.revision-toggle { margin-bottom: .95rem; }
.stack { display: grid; gap: 1rem; }
.stack .card { margin: 0; }
.grid, .two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.2rem; }
.inquiry-details { margin-bottom: 0; }
.inquiry-details dd { margin: .2rem 0 0; overflow-wrap: anywhere; }
.recipe-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); }
.inset { margin-top: 1rem; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(154px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: .5rem 0 1.15rem; }
.summary div { background: #efefe5; padding: .85rem 1rem; }
.summary strong { display: block; font-size: 1.1rem; overflow-wrap: anywhere; }
small { display: block; color: var(--muted); font-size: .82rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .7rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 650; font-size: .82rem; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td a { overflow-wrap: anywhere; }
.strong { font-weight: 750; }
.pill { border-radius: 20px; background: #e9ede1; color: var(--green); padding: .2rem .55rem; font-size: .83rem; display: inline-block; }
.due { color: #884430; font-weight: 670; }
label { display: grid; gap: .25rem; min-width: 0; color: var(--dark); }
label span { font-size: .83rem; font-weight: 650; }
input, select, textarea, button { font: inherit; }
input, select, textarea { background: #fffefa; border: 1px solid #bbbfb0; border-radius: 8px; color: var(--ink); min-width: 0; width: 100%; padding: .53rem .62rem; }
textarea { resize: vertical; }
:focus-visible { outline: 3px solid #a17a33; outline-offset: 2px; }
button, .button { border: 1px solid var(--green); background: var(--green); color: var(--white); font: 700 .89rem/1.25 var(--interface-font); padding: .63rem .88rem; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; min-height: 42px; }
button:hover, .button:hover { background: var(--dark); color: #fff; }
.secondary { color: var(--green); background: transparent; border-color: #aab5a9; }
.secondary:hover { background: #e7ece0; color: var(--dark); }
.quiet { color: var(--green); background: transparent; border-color: transparent; }
.quiet:hover { background: #dfe7db; color: var(--dark); }
.check { display: flex; align-items: center; gap: .5rem; font-size: .95rem; }
.check input { width: 1rem; height: 1rem; accent-color: var(--green); }
.disclosure summary { color: var(--green); font-weight: 700; cursor: pointer; }
.disclosure[open] > form { padding-top: 1rem; }
.entry { border-top: 1px solid var(--line); padding: .7rem 0; margin-top: .6rem; }
.entry summary { cursor: pointer; }
.entry .button { margin-right: .45rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.history { padding-left: 1.25rem; }
.history li + li { margin-top: .45rem; }
.facts { display: grid; gap: .7rem; margin: .8rem 0 0; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
.facts dt { font-size: .82rem; font-weight: 700; color: var(--muted); }
.facts dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.task { display: flex; justify-content: space-between; gap: .5rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.task + details { margin-top: .75rem; }
.line { display: grid; gap: .5rem .7rem; padding: .55rem 0 .7rem; border-bottom: 1px solid var(--line); align-items: end; }
.sale-line { grid-template-columns: minmax(170px, 2.1fr) repeat(3, minmax(70px, 1fr)) auto; }
.menu-line { grid-template-columns: minmax(160px, 2fr) repeat(3, minmax(70px, 1fr)) minmax(120px, 1.5fr) minmax(90px, 1fr) minmax(130px, 2fr) auto; }
[data-add] { margin-top: .7rem; }
.template-picker { align-items: end; }
.template-picker label { min-width: min(265px, 100%); }
.notice, .problem { background: #efe8cf; color: #373525; border-left: 4px solid #b89b58; border-radius: 6px; padding: .72rem .85rem; }
.problem { background: #f8e8e1; border-color: #a74b3e; }
.login-wrap { min-height: 100dvh; display: grid; place-content: center; grid-template-columns: minmax(0, 440px); padding: 1.2rem; }
.login.card { width: 100%; padding: 0; overflow: hidden; }
.login-brand { padding: 1.1rem 1.6rem; border-bottom: 1px solid var(--gold); }
.login-brand img { width: 3.5rem; height: 3.5rem; }
.login-body { padding: clamp(1.25rem, 6vw, 2rem); }
.login-body h1 { font-size: 1.85rem; }
.login label { margin: .8rem 0; }
.login button { margin-top: .4rem; }
@media (max-width: 1060px) and (min-width: 761px) {
    .app-shell { grid-template-columns: 185px minmax(0, 1fr); }
    .sidebar { padding-inline: .55rem; }
    .sidebar .brand { gap: .4rem; }
    .sidebar .brand img { width: 2rem; height: 2rem; }
    .sidebar .brand-name { font-size: .86rem; }
    .sidebar .brand-motto { font-size: .62rem; }
    .workspace-top, .container { padding-inline: 1.2rem; }
    .dashboard-split > .card { padding-inline: .8rem; }
    .metrics { gap: .55rem; }
    .metric { padding-inline: .64rem; }
    .workflow a { padding-inline: .4rem; }
}
@media (max-width: 980px) { .menu-line { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) {
    .app-shell { display: block; }
    .sidebar { position: static; height: auto; gap: .65rem; padding: .75rem .9rem; }
    .sidebar nav, .sidebar .nav-group { display: flex; gap: .25rem; white-space: nowrap; }
    .sidebar nav { overflow-x: auto; padding-bottom: .25rem; }
    .nav-group p { display: none; }
    .workspace-top { padding-inline: .95rem; }
}
@media (max-width: 660px) {
    .container { padding: 1.4rem .8rem 3rem; }
    .card { padding: 1rem; }
    .page-heading, .section-heading { align-items: start; flex-direction: column; }
    .two-col, .grid, .dashboard-split { grid-template-columns: 1fr; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .workflow { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .account small { display: none; }
    .sale-line, .menu-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .line label:first-child { grid-column: 1 / -1; }
    th, td { padding: .55rem .38rem; }
    .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
    body, .card, .summary div { background: #fff; }
    .sidebar, .workspace-top, .actions, .back, button, [data-add], details, .notice { display: none !important; }
    .app-shell, .dashboard-split { display: block; }
    .container { padding: 0; }
    .two-col { display: block; }
    .card { outline: 0; border: 0; padding: .6rem 0; }
    th, td { break-inside: avoid; }
}

.inline-help { margin: .8rem 0; padding: .45rem .75rem; border-inline-start: 3px solid var(--gold); background: #f6f4ee; }
.inline-help summary { width: fit-content; padding: .2rem 0; }
.inline-help p { margin: .35rem 0 .25rem; }
.field-help { color: var(--muted); font-size: .86rem; margin: .35rem 0 .65rem; }
.inventory-fieldset { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem; }
.inventory-fieldset legend { font-weight: 700; padding: 0 .3rem; }
.inventory-fieldset .check { margin-bottom: .75rem; }
.inventory-horizon { align-items: end; }
.inventory-grid, .plan-lots { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.inventory-card { margin: 0; }
.inventory-card h3, .inventory-lot h3, .plan-line h3 { margin: 0; overflow-wrap: anywhere; font-size: 1rem; }
.inventory-facts { display: grid; gap: .65rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: .7rem 0; }
.inventory-facts dt { font-size: .81rem; color: var(--muted); }
.inventory-facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.inventory-reorder { background: #e9ede1; color: var(--dark); border-radius: 8px; padding: .55rem .7rem; font-weight: 700; }
.inventory-lot { padding-block: .8rem; border-top: 1px solid var(--line); }
.inventory-lot .disclosure + .disclosure { margin-top: .5rem; }
.inventory-list { list-style: none; margin: .5rem 0 .8rem; padding: 0; }
.inventory-list li { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; padding: .43rem 0; border-bottom: 1px solid var(--line); }
.inventory-list li:last-child { border-bottom: 0; }
.inventory-list li strong { flex: 0 0 auto; }
.plan-lines { display: grid; gap: .75rem; }
.plan-navigation { margin: .55rem 0; }
.plan-pending > .plan-lines { margin-top: .7rem; }
.plan-line, .plan-lot { min-width: 0; border: 1px solid var(--line); padding: .72rem .8rem; border-radius: 8px; background: #fffefa; }
.plan-line .section-heading, .inventory-lot .section-heading { align-items: baseline; flex-direction: row; }
.plan-line .section-heading > strong { flex: 0 0 auto; }
.plan-line .inventory-list { margin-bottom: .25rem; }
.plan-lots { margin-bottom: .85rem; }
.plan-lot p { margin: .3rem 0; overflow-wrap: anywhere; }
.plan-pending { margin-top: .8rem; }
.ingredient-line { grid-template-columns: repeat(auto-fit, minmax(min(100%, 125px), 1fr)); }
@media (max-width: 475px) {
    .inventory-horizon > label { flex-basis: 100%; }
    .plan-line .section-heading { gap: .5rem; }
}
@media print {
    .plan-line, .plan-lot, .inventory-card { break-inside: avoid; }
}

.quick-choices { min-width: 0; border: 0; padding: 0; margin: 0; }
.quick-choices legend { padding: 0; margin-bottom: .25rem; font-size: .83rem; font-weight: 650; }
.quick-choices > div { display: flex; flex-wrap: wrap; gap: .35rem; }
.quick-choices label { display: flex; align-items: center; gap: .4rem; min-height: 42px; padding: .35rem .6rem;
    border: 1px solid #bbbfb0; border-radius: 8px; background: #fffefa; cursor: pointer; }
.quick-choices input { flex: 0 0 auto; width: 1rem; height: 1rem; margin: 0; accent-color: var(--green); }
.quick-choices label:has(input:checked) { border-color: var(--green); background: #e9ede1; }
.automatic-code summary code { margin-left: .25em; font-size: .8em; color: var(--muted); overflow-wrap: anywhere; }
.automatic-code[open] label { margin-top: .5rem; }
.ingredient-line label:first-child:has(input[list="stock-ingredients"]) { grid-column: 1 / -1; }

.event-fields { display:grid; grid-template-columns: minmax(9rem,1fr) minmax(7rem,.8fr) minmax(5rem,.6fr) minmax(12rem,2fr); gap:.75rem; align-items:start; }
.quote-editor .sale-line { grid-template-columns: minmax(9rem,1.4fr) minmax(9rem,2fr) 5rem 6.5rem 5.5rem; align-items:end; }
.quote-editor .sale-line select { width:auto; max-width:100%; }
.quote-editor [data-subtotal] { font-weight:700; text-align:right; }
.quote-editor .menu-line { grid-template-columns: repeat(3,minmax(0,1fr)); }
.quote-editor .remove-line { width:fit-content; }
.quote-bar { position:sticky; bottom:0; z-index:2; flex-wrap:wrap; padding:.65rem .85rem; background:white; border:1px solid var(--line); border-radius:var(--radius); }
.quote-bar strong { margin-right:auto; }
@media (max-width: 1050px) {
 .quote-editor .sale-line { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .event-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 660px) {
 .quote-editor .sale-line,.quote-editor .menu-line { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .quote-bar { position:static; }
}
[data-pack-preview] fieldset { border:1px solid var(--line); margin:.6rem 0; border-radius:8px; }
[data-pack-preview] label { display:flex; justify-content:space-between; align-items:center; gap:.7rem; margin:.3rem 0; }
[data-pack-preview] input { max-width:5rem; }
[data-stock-dialog] { max-width:min(27rem,90vw); border:1px solid var(--line); border-radius:12px; }
[data-stock-dialog]::backdrop { background:#151a1770; }
@media (min-width:1100px) {
 .quote-editor .sale-line { display:grid; grid-template-columns:minmax(9rem,1.5fr) minmax(9rem,2fr) 4.5rem 6rem 5.5rem 5.5rem; }
 .quote-editor .sale-line [data-subtotal] { grid-row:1; grid-column:6; }
 .quote-editor .sale-line label:has(select) { grid-column:1 / 3; }
}
