:root { font-family: Inter, system-ui, sans-serif; color: #20201f; background: #f7f2e8; line-height: 1.5; }
* { box-sizing: border-box; }
body { margin: 0; }
.wrap { width: min(69rem, calc(100% - 2rem)); margin-inline: auto; }
.topbar { background: #f0e9dc; color: #20201f; border-bottom: 1px solid #ded2c5; }
nav { display: flex; align-items: center; min-height: 3rem; padding-block: .25rem; gap: .75rem; }
.brand { flex-shrink: 0; color: inherit; text-decoration: none; }
.brand img { display: block; width: 180px; height: auto; }
.motto { color: #382f29; font-family: "Instrument Serif", Georgia, serif; font-size: .96rem; }
main { padding-block: clamp(1.4rem, 4vw, 3rem); }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.12; margin: .55rem 0 1rem; overflow-wrap: anywhere; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
a { color: #1f3028; }
.page-head, .task { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.page-head { margin-block-end: 1rem; }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.panel { background: #fff; border: 1px solid #ded2c5; border-radius: .85rem; padding: clamp(1rem, 3vw, 1.5rem); overflow-wrap: anywhere; }
.narrow { max-width: 34rem; }
.login { margin-inline: auto; max-width: 30rem; }
.records { list-style: none; margin: 0; padding: 0; }
.records li { padding: .85rem 0; border-bottom: 1px solid #eee6db; }
.records li:last-child { border-bottom: 0; }
.records a { font-weight: 650; text-underline-offset: .17em; }
.muted, small, .empty { color: #62544a; }
small { display: block; }
.completed { text-decoration: line-through; }
button, .button { font: inherit; display: inline-flex; align-items: center; min-height: 2.75rem; padding: .5rem .85rem; border: 1px solid transparent; border-radius: .5rem; background: #1f3028; color: #fff; cursor: pointer; font-weight: 650; text-decoration: none; }
.quiet { color: #1f3028; background: #f0e9dc; border-color: #d9ccbd; }
label { display: block; font-weight: 650; margin-bottom: .25rem; }
input, select, textarea { width: 100%; font: inherit; padding: .55rem; border: 1px solid #ab9d8f; border-radius: .4rem; background: #fff; color: inherit; }
:focus-visible { outline: 2px solid #a75331; outline-offset: 3px; }
.entry-form { border-top: 1px solid #eee6db; margin-top: .6rem; }
.errorlist { color: #922b22; }
.preserve { white-space: pre-wrap; }
@media (max-width: 640px) { .columns { grid-template-columns: 1fr; } }
.clock { display: flex; gap: .5rem; align-items: baseline; color: #382f29; font-variant-numeric: tabular-nums; font-size: .92rem; white-space: nowrap; }
.clock strong { color: #20201f; }
.panel { background: #fffdf8; }
.overview-panel > h2 { font-family: "Instrument Serif", Georgia, serif; font-size: 1.85rem; margin: 0 0 .75rem; }
.dashboard-section { padding-block: .75rem; border-top: 1px solid #eee6db; }
.dashboard-section h3 { margin: 0; font-size: 1.03rem; }
.section-heading, .line-item { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .45rem .75rem; }
.line-item > strong { white-space: nowrap; }
.task-counts { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin-bottom: .9rem; }
.task-counts div { display: grid; gap: .25rem; padding: .85rem; border-radius: .5rem; background: #f0e9dc; }
.task-counts strong { font-size: 1.85rem; line-height: 1; font-variant-numeric: tabular-nums; }
.task-counts div:last-child strong { color: #944727; }
.next-task { display: inline-block; margin-top: .4rem; font-weight: 700; }
.records .segments { list-style: none; margin: .45rem 0 0; padding-left: .75rem; border-left: 2px solid #d9ccbd; }
.records .segments li { padding: .15rem 0; border: 0; }
.entry-edit { display: inline-block; margin-top: .35rem; font-size: .9rem; }
@media print { .topbar, .print-action, main > a { display: none; } .panel { border: 0; } }

.logout { margin-left: auto; }
.logout button { min-height: 2rem; padding: .25rem .55rem; }
.dashboard-stack { display: grid; gap: 1rem; min-width: 0; }
@media (max-width: 560px) {
  nav { flex-wrap: wrap; column-gap: .65rem; row-gap: .2rem; }
}

.theme-toggle { margin-left: auto; min-height: 2rem; padding: .25rem .55rem; }
.theme-toggle[hidden] { display: none; }
.theme-toggle + .logout { margin-left: 0; }
.theme-toggle[aria-pressed="true"] { box-shadow: inset 0 0 0 1px currentColor; }
.transport-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.transport-values > div { padding: .7rem .85rem; border-radius: .5rem; background: #f0e9dc; }
.transport-values dd { margin: .25rem 0 0; font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.transport-alert { font-weight: 700; color: #944727; }

:root[data-theme="dark"] { color-scheme: dark; color: #f0e9dc; background: #20201f; }
[data-theme="dark"] .topbar, [data-theme="dark"] .panel { background: #2c2a27; border-color: #524a42; }
[data-theme="dark"] .brand img { border-radius: .25rem; }
[data-theme="dark"] .motto, [data-theme="dark"] .clock strong { color: #f0e9dc; }
[data-theme="dark"] .clock, [data-theme="dark"] .muted, [data-theme="dark"] small, [data-theme="dark"] .empty { color: #d0c3b3; }
[data-theme="dark"] a { color: #f0cfaa; }
[data-theme="dark"] button, [data-theme="dark"] .button { color: #20201f; background: #eed6b9; }
[data-theme="dark"] .quiet { color: #f0e9dc; background: #382f29; border-color: #786958; }
[data-theme="dark"] .task-counts div, [data-theme="dark"] .transport-values > div { background: #382f29; }
[data-theme="dark"] .errorlist, [data-theme="dark"] .task-counts div:last-child strong, [data-theme="dark"] .transport-alert { color: #ffc49e; }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { background: #24221f; color: #f0e9dc; border-color: #8b7c6d; }
[data-theme="dark"] .records li, [data-theme="dark"] .dashboard-section, [data-theme="dark"] .entry-form { border-color: #524a42; }
[data-theme="dark"] :focus-visible { outline-color: #ffc49e; }
@media print {
  :root[data-theme="dark"] { color-scheme: light; color: #20201f; background: white; }
  [data-theme="dark"] .panel { background: white; }
  [data-theme="dark"] small { color: #382f29; }
}

.event-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
#msd-event-form fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
#msd-event-form legend { font-weight: 700; margin-bottom: .5rem; }
.event-fields, .event-segment { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .55rem .75rem; }
.event-location { grid-column: 1 / -1; }
.event-segment { padding-block: .6rem; border-top: 1px solid #ded2c5; }
.event-segment button { align-self: end; justify-self: start; }
.event-schedule [data-add-segment] { margin-top: .45rem; }
[data-theme="dark"] .event-segment { border-color: #524a42; }
@media (max-width: 420px) {
  .event-fields, .event-segment { grid-template-columns: minmax(0, 1fr); }
}

.event-time-label { display: block; font-weight: 650; margin-bottom: .25rem; }
.event-time-selects { display: flex; align-items: center; gap: .3rem; }
.event-time-selects select { min-width: 0; }
.event-menu { min-width: 0; margin: 1rem 0; border: 1px solid #ded2c5; border-radius: .55rem; }
.event-menu legend { font-weight: 700; }
.client-settings input { max-width: 9rem; }
.menu-item {
  display: grid;
  grid-template-columns: minmax(10rem, 2fr) minmax(4.5rem, .7fr) minmax(5.5rem, .9fr) minmax(7rem, 1fr) 4rem auto;
  align-items: start;
  gap: .5rem .7rem;
  padding: .5rem 0;
  font-size: .875rem;
}
.menu-item + .menu-item { border-top: 1px solid #ded2c5; }
.menu-item label, .menu-item dl { margin: 0; min-width: 0; }
.menu-item dt { font-weight: 650; }
.menu-item dd { margin: .2rem 0 0; font-variant-numeric: tabular-nums; }
.menu-item select, .menu-item input, .menu-item button { min-height: 2.2rem; padding: .3rem .45rem; }
.menu-item label > input { display: block; margin-top: .2rem; }
.menu-item .menu-portions input { width: 3.65rem; font-variant-numeric: tabular-nums; }
.menu-item > button { align-self: end; }
@media (max-width: 900px) {
  .menu-item { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .menu-item label:first-child { grid-column: span 2; }
  .menu-item button { justify-self: start; }
}
@media (max-width: 520px) {
  .menu-item { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-item select, .menu-item input { font-size: 1rem; }
  .menu-item select, .menu-item input, .menu-item button { min-height: 2.75rem; }
}
[data-theme="dark"] .event-menu, [data-theme="dark"] .menu-item + .menu-item { border-color: #524a42; }

.offer-row { display: grid; grid-template-columns: minmax(5rem, .8fr) repeat(3, minmax(0, 1.2fr)) auto; align-items: center; gap: .65rem; }
.offer-number { display: inline-block; padding: .12em .46em; border-radius: .35rem; font-weight: 750; text-decoration: none; }
.offer-identity a:hover { text-decoration: underline; }
.offer-number.offer-processed { background: #dcebdd; color: #1f4c32; }
.offer-number.offer-approved { background: #ffe0c2; color: #773612; }
.offer-number.offer-cancelled { background: #f8dcd9; color: #861d1d; }
.offer-number.offer-completed { background: #20201f; color: #fff; box-shadow: inset 0 0 0 1px #70655c; }
.offer-part + .offer-part { margin-top: .8rem; }
.offer-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .35rem .75rem; }
@media (max-width: 780px) { .offer-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .offer-row .button { justify-self: start; } }

.system-menu { min-height: 0; flex-wrap: wrap; gap: .3rem .65rem; padding-block: .15rem .45rem; }
.system-menu a { padding: .35rem .55rem; border-radius: .35rem; font-size: .9rem; text-decoration: none; }
.system-menu a:hover { text-decoration: underline; }
.system-menu [aria-current="page"] { background: #382f29; color: #f0e9dc; }
[data-theme="dark"] .system-menu [aria-current="page"] { background: #eed6b9; color: #20201f; }
.client-list li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, .65fr) auto; align-items: start; gap: .55rem 1rem; }
.client-list li > .button { grid-column: 4; justify-self: end; }
@media (max-width: 640px) {
  .client-list li { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-list li > .button { grid-column: 2; }
}

.delivery-section { margin-top: 1rem; }
.register-filters, .note-row { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem 1rem; }
.register-filters p, .note-row label { margin: 0; }
.note-row input { width: auto; }

.cafe-row { display: grid; grid-template-columns: 1.05fr 1.7fr .55fr 1fr auto; align-items: start; gap: .5rem .8rem; margin-block: .65rem; padding-block: .6rem; border-top: 1px solid #ded2c5; }
.cafe-row input, .cafe-row select { min-width: 0; }
.cafe-remove { align-self: end; white-space: nowrap; padding-bottom: .45rem; }
.cafe-remove input { width: auto; }
[data-theme="dark"] .cafe-row { border-color: #524a42; }
@media (max-width: 760px) { .cafe-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 450px) { .cafe-row { grid-template-columns: minmax(0, 1fr); } }

.cafe-week-day .cafe-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr) auto; }
.cafe-dish-details { display: grid; grid-template-columns: 1fr .65fr 1.2fr; gap: .75rem; margin: 0; }
.cafe-dish-details dt { font-weight: 650; }
.cafe-dish-details dd { margin: .45rem 0 0; }
.searchable-select { position: relative; }
.event-time-selects > .searchable-select { flex: 1; min-width: 0; }
.select-results { position: absolute; z-index: 2; inset-inline: 0; top: 100%; max-height: 14rem; overflow: auto; margin: .2rem 0 0; padding: .25rem; list-style: none; background: #fffdf8; border: 1px solid #ab9d8f; border-radius: .4rem; }
.select-results li { padding: .35rem .5rem; cursor: pointer; }
.select-results li[aria-selected="true"], .select-results li:hover { background: #f0e9dc; }
.select-results time { display: block; }
:is(.select-results time, [data-last-lunch-use]) { font-size: .9rem; color: #20201f; }
:is(.select-date-older, [data-last-lunch-use].cafe-history-older) { color: #24653a; }
[data-theme="dark"] .select-results { background: #24221f; border-color: #8b7c6d; }
[data-theme="dark"] .select-results li[aria-selected="true"], [data-theme="dark"] .select-results li:hover { background: #524a42; }
[data-theme="dark"] :is(.select-results time, [data-last-lunch-use]) { color: #f0e9dc; }
[data-theme="dark"] :is(.select-date-older, [data-last-lunch-use].cafe-history-older) { color: #9bd2a1; }
@media (max-width: 760px) {
  .cafe-week-day .cafe-row { grid-template-columns: minmax(0, 1fr); }
}

.event-time-selects .select-results { min-width: 5rem; }

.stock-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1rem; }
.stock-filters p { margin: 0; }
.stock-filters .event-actions { grid-column: 1 / -1; }
.stock-table-wrap { overflow-x: auto; }
.stock-table { width: 100%; border-collapse: collapse; text-align: start; }
.stock-table th, .stock-table td { padding: .75rem .6rem; border-bottom: 1px solid #ded2c5; vertical-align: top; }
.stock-table th { font-size: .875rem; }
.ingredient-field { margin-bottom: 1rem; }
.ingredient-allergens { border: 1px solid #ded2c5; border-radius: .5rem; margin-top: .75rem; }
.ingredient-allergens legend { font-weight: 650; }
.ingredient-allergens #id_allergens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1rem; }
.ingredient-allergens label { display: flex; gap: .5rem; align-items: baseline; font-weight: 400; }
.ingredient-allergens input { width: auto; }
[data-theme="dark"] .stock-table th, [data-theme="dark"] .stock-table td,
[data-theme="dark"] .ingredient-allergens { border-color: #524a42; }
@media (max-width: 640px) {
  .stock-filters, .ingredient-allergens #id_allergens { grid-template-columns: minmax(0, 1fr); }
}

.ingredient-basics { display: grid; grid-template-columns: minmax(10rem, 2fr) 5rem 10ch minmax(10rem, 1.3fr); gap: .75rem; align-items: start; }
.ingredient-unit_price input { width: 100%; font-variant-numeric: tabular-nums; }
.ingredient-basics label { min-height: 3rem; font-size: .875rem; }
.ingredient-basics input { min-width: 0; }
.management-partners { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.management-partners a { font-weight: 650; text-decoration: none; min-width: 10rem; }
@media (max-width: 760px) {
  .ingredient-basics { grid-template-columns: minmax(0, 1fr) 5rem; }
  .ingredient-basics label { min-height: auto; }
}
@media (max-width: 450px) {
  .ingredient-basics { grid-template-columns: minmax(0, 1fr); }
  .management-partners { flex-wrap: wrap; }
}

[data-company-lookup] [name="registration_number"] { width: 10ch; margin-right: .5rem; }
[data-company-lookup] [name="registration_number"] + button { margin-top: .25rem; }

.item-picker { position: fixed; inset: 0 0 0 auto; margin: 0; height: 100dvh; max-height: 100dvh; width: min(34rem, 100vw); max-width: 100vw; padding: 1.5rem; border: 1px solid #ded2c5; background: #fffdf8; color: inherit; overflow-y: auto; }
.item-picker::backdrop { background: rgb(0 0 0 / .4); }
.item-picker > label { margin-block: .75rem; }
.item-picker .records label { display: flex; gap: .75rem; align-items: baseline; }
.item-picker input[type="checkbox"] { width: auto; }
.item-picker [data-picker-quantity] { display: block; width: 7rem; }
[data-theme="dark"] .item-picker { background: #2c2a27; border-color: #524a42; }

.bulk-remove { margin-top: .75rem; font-weight: 400; }
.bulk-remove input, .ingredient-bulk-row input[type="checkbox"] { width: auto; }
.ingredient-bulk-row details { margin-block: .75rem; }
.ingredient-bulk-row .ingredient-allergens > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }

.client-tabs { margin-bottom: 1.5rem; }
.client-tabs [aria-current="page"] { box-shadow: inset 0 0 0 2px currentColor; }
.client-order-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(9rem, 15rem); gap: 1rem; align-items: center; }
.client-order-row input { max-width: 7rem; }
.client-order-row label { font-size: .875rem; }
@media (max-width: 560px) { .client-order-row { grid-template-columns: minmax(0, 1fr); } }

.grab-offer-row { display: grid; grid-template-columns: minmax(0, 2fr) 1fr 1.4fr minmax(6rem, 1fr); gap: 1rem; align-items: start; }
.grab-offer-check { display: flex; gap: .5rem; align-items: baseline; }
.grab-offer-check input { width: auto; }
.grab-offer-row input[type="number"] { width: 6rem; }
@media (max-width: 700px) { .grab-offer-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.event-items-table { width: 100%; border-collapse: collapse; text-align: left; margin-block: .5rem 1rem; }
.event-items-table th, .event-items-table td { padding: .35rem .65rem .35rem 0; vertical-align: top; border: 0; }
.event-items-table th { font-size: .875rem; }
.event-contact { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-block: .5rem; }
.management-partners { flex-wrap: wrap; }

.product-name { margin-bottom: 1rem; }
.product-name input { font-size: 1.4rem; font-weight: 650; }
.product-header { display: grid; grid-template-columns: 2fr 1.5fr 8rem; gap: 1rem; align-items: start; }
.product-header fieldset, .product-prices fieldset { min-width: 0; border: 1px solid #ab9d8f; border-radius: .5rem; }
.product-tags #id_tags { display: flex; flex-wrap: wrap; gap: .25rem .65rem; }
.product-tags label, .product-module { display: flex; gap: .4rem; align-items: baseline; }
.product-tags input, .product-module input, [name="manual_allergens"] { width: auto; }
.product-tags label { font-size: .875rem; font-weight: 400; }
.product-header details label { font-size: .875rem; font-weight: 400; }
.recipe-table-wrap { overflow-x: auto; padding-bottom: 1rem; }
.recipe-table { width: 100%; min-width: 50rem; border-collapse: collapse; text-align: left; }
.recipe-table th, .recipe-table td { padding: .35rem .5rem; vertical-align: top; font-size: .875rem; }
.recipe-table th:first-child { width: 40%; }
.recipe-table th:nth-child(3) { width: 9rem; }
.recipe-table .searchable-select { min-width: 15rem; }
.recipe-table td input { min-width: 5rem; }
.recipe-table .bulk-remove input { min-width: auto; }
.recipe-table .select-results { position: relative; top: auto; }
.product-cost { display: flex; flex-wrap: wrap; justify-content: space-between; font-size: 1.2rem; border-top: 1px solid #ab9d8f; padding-top: 1rem; }
.product-prices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.product-prices button { margin-top: .5rem; }
@media (max-width: 760px) { .product-header, .product-prices { grid-template-columns: minmax(0, 1fr); } }
@media print { .print-action { display: none !important; } .production-card { padding: 0; } .production-card h1 { font-size: 22pt; } }
