:root {
  --ink: #17312b;
  --ink-soft: #536762;
  --brand: #1f6f5c;
  --brand-dark: #174f43;
  --brand-pale: #e8f3ef;
  --accent: #f2a541;
  --accent-pale: #fff4df;
  --danger: #b42318;
  --danger-pale: #fff0ee;
  --success: #18794e;
  --success-pale: #eaf8f0;
  --line: #d8e2df;
  --surface: #ffffff;
  --canvas: #f4f7f6;
  --shadow: 0 14px 40px rgba(25, 62, 53, 0.08);
  --radius: 18px;
  --radius-small: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--canvas); line-height: 1.55; }
a { color: var(--brand-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 999;
  background: var(--surface); color: var(--ink); padding: 10px 14px;
  border-radius: 8px; box-shadow: var(--shadow);
}
.skip-link:focus { top: 12px; }

.topbar {
  min-height: 76px; display: flex; align-items: center; gap: 24px;
  padding: 12px clamp(16px, 4vw, 56px); background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: max-content; min-height: 44px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px;
  color: white; background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  font-weight: 850; font-size: 1.35rem; box-shadow: 0 8px 18px rgba(31,111,92,.25);
}
.brand span:last-child { display: grid; line-height: 1.15; }
.brand strong { letter-spacing: -.02em; font-size: 1.06rem; }
.brand small { margin-top: 4px; color: var(--ink-soft); font-size: .73rem; }
.main-nav { display: flex; align-items: center; gap: 5px; flex: 1; flex-wrap: wrap; }
.main-nav a {
  text-decoration: none; color: var(--ink-soft); padding: 8px 10px;
  border-radius: 9px; font-size: .91rem; font-weight: 650; min-height: 44px;
  display: inline-flex; align-items: center;
}
.main-nav a:hover { background: var(--brand-pale); color: var(--brand-dark); }
.account-menu { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.account-copy { display: grid; line-height: 1.25; text-align: right; min-width: max-content; }
.account-copy small { color: var(--ink-soft); font-size: .74rem; }
.nav-toggle { display: none; min-height: 44px; min-width: 44px; }

.page-shell { width: min(1220px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 72px; min-height: calc(100vh - 132px); }
.auth-shell {
  min-height: calc(100vh - 64px); display: grid; place-items: center;
  padding: 32px 16px;
  background:
    radial-gradient(circle at 10% 10%, rgba(242,165,65,.16), transparent 34%),
    radial-gradient(circle at 90% 85%, rgba(31,111,92,.18), transparent 38%),
    var(--canvas);
}
.site-footer {
  min-height: 56px; display: flex; justify-content: space-between; gap: 20px;
  align-items: center; color: var(--ink-soft); padding: 14px clamp(16px, 4vw, 56px);
  border-top: 1px solid var(--line); font-size: .82rem;
}

.page-heading { display: flex; gap: 20px; justify-content: space-between; align-items: end; margin-bottom: 28px; }
.page-heading h1, .page-heading h2 { margin: 0; letter-spacing: -.035em; line-height: 1.12; }
.page-heading h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
.page-heading h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
.eyebrow { color: var(--brand); text-transform: uppercase; letter-spacing: .12em; font-weight: 800; font-size: .73rem; margin: 0 0 8px; }
.lead { color: var(--ink-soft); max-width: 720px; margin: 10px 0 0; font-size: 1.03rem; }

.button-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.button {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; border: 0; border-radius: 11px; padding: 10px 17px; font-weight: 760;
  text-decoration: none; color: white; background: var(--brand);
  box-shadow: 0 6px 16px rgba(31,111,92,.16); transition: transform .15s, background .15s;
}
.button:hover { color: white; background: var(--brand-dark); transform: translateY(-1px); }
.button:focus-visible, .field-control:focus-visible,
.auth-card input:not([type="hidden"]):focus-visible {
  outline: 3px solid rgba(242,165,65,.55); outline-offset: 2px;
}
.button-secondary { background: var(--surface); color: var(--brand-dark); border: 1px solid var(--line); box-shadow: none; }
.button-secondary:hover { color: var(--brand-dark); background: var(--brand-pale); }
.button-warning { background: var(--accent); color: #3f2b0d; box-shadow: none; }
.button-warning:hover { background: #e7952b; color: #3f2b0d; }
.button-danger { background: var(--danger); box-shadow: none; }
.button-ghost { color: var(--ink-soft); background: transparent; border: 1px solid var(--line); box-shadow: none; }
.button-ghost:hover { color: var(--brand-dark); background: var(--brand-pale); }
.button-small { min-height: 44px; min-width: 44px; padding: 7px 12px; font-size: .82rem; }
.button[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.message-stack { display: grid; gap: 10px; margin-bottom: 22px; }
.message { padding: 13px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 620; }
.message-success { background: var(--success-pale); color: var(--success); border-color: #b7e5ca; }
.message-error { background: var(--danger-pale); color: var(--danger); border-color: #f2c2bd; }
.message-warning { background: var(--accent-pale); color: #704a13; border-color: #efd29f; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: clamp(18px, 3vw, 28px);
}
.card h2, .card h3 { margin-top: 0; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.stat-card { position: relative; overflow: hidden; text-decoration: none; color: var(--ink); min-height: 152px; }
.stat-card::after {
  content: ""; position: absolute; width: 110px; height: 110px; border-radius: 50%;
  right: -38px; bottom: -52px; background: var(--brand-pale);
}
.stat-card:hover { color: var(--ink); border-color: #a8ccc2; transform: translateY(-2px); }
.stat-label { display: block; color: var(--ink-soft); font-weight: 700; }
.stat-value { display: block; font-size: 2.7rem; line-height: 1; font-weight: 850; margin-top: 18px; letter-spacing: -.05em; }

.split-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr); gap: 20px; align-items: start; }
.stack { display: grid; gap: 16px; }
.list-card { display: flex; gap: 18px; justify-content: space-between; align-items: center; }
.list-card-copy { min-width: 0; }
.list-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.list-card p { margin: 0; color: var(--ink-soft); overflow-wrap: anywhere; }
.badge {
  display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px;
  border-radius: 999px; background: var(--brand-pale); color: var(--brand-dark);
  font-weight: 750; font-size: .78rem; white-space: nowrap;
}
.badge-muted { background: #eef1f0; color: var(--ink-soft); }
.badge-warning { background: var(--accent-pale); color: #755018; }
.badge-danger { background: var(--danger-pale); color: var(--danger); }

.form-card { width: min(760px, 100%); margin: 0 auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-row { display: grid; gap: 7px; }
.form-row.full { grid-column: 1 / -1; }
.form-row label { font-weight: 740; font-size: .91rem; }
.helptext { color: var(--ink-soft); font-size: .79rem; }
.helptext ul { margin: 4px 0 0; padding-left: 18px; }
.field-control,
.auth-card input:not([type="hidden"]) {
  width: 100%; min-height: 46px; border: 1px solid #b8c8c4; border-radius: 10px;
  background: #fff; color: var(--ink); padding: 10px 12px;
}
textarea.field-control { min-height: 110px; resize: vertical; }
select.field-control[multiple] { min-height: 130px; }
.checkbox { width: 19px; height: 19px; accent-color: var(--brand); }
.errorlist { margin: 4px 0 0; padding: 0; list-style: none; color: var(--danger); font-size: .83rem; font-weight: 650; }
.form-errors { padding: 12px 14px; background: var(--danger-pale); color: var(--danger); border-radius: 10px; margin-bottom: 16px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; min-width: 670px; }
.data-table th, .data-table td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table th { background: #edf5f2; color: var(--brand-dark); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .number { text-align: right; font-variant-numeric: tabular-nums; }
.mobile-cards { display: none; }

.auth-card { width: min(480px, 100%); padding: clamp(24px, 5vw, 42px); }
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 26px; }
.auth-card h1 { margin: 0; font-size: 2rem; letter-spacing: -.04em; }
.auth-card .lead { margin-bottom: 24px; }
.auth-links { display: flex; justify-content: space-between; gap: 14px; margin-top: 20px; font-size: .89rem; }

.child-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; margin-bottom: 22px; }
.child-tab { display: inline-flex; align-items: center; min-width: max-content; min-height: 44px; padding: 10px 14px; border-radius: 999px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); font-weight: 720; }
.child-tab.active { background: var(--brand); border-color: var(--brand); color: white; }
.menu-day { display: grid; grid-template-columns: 120px minmax(0,1fr) auto; gap: 20px; align-items: center; }
.menu-date { display: grid; }
.menu-date strong { font-size: 1.2rem; }
.menu-date span { color: var(--ink-soft); font-size: .82rem; }
.dish-list { display: flex; flex-wrap: wrap; gap: 8px; }
.dish-chip { padding: 7px 10px; border-radius: 9px; background: var(--brand-pale); font-size: .84rem; }
.price { font-weight: 820; font-variant-numeric: tabular-nums; }
.order-choice { display: grid; grid-template-columns: minmax(0,1fr) 105px; gap: 16px; align-items: center; padding: 17px 0; border-bottom: 1px solid var(--line); }
.order-choice:last-child { border-bottom: 0; }
.order-choice h3 { margin: 0 0 4px; }
.order-choice p { margin: 0; color: var(--ink-soft); font-size: .89rem; }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.detail-block { padding: 18px; border-radius: 13px; background: #f7faf9; border: 1px solid var(--line); }
.detail-block h3 { margin: 0 0 12px; }
.detail-block dl { display: grid; grid-template-columns: max-content 1fr; gap: 7px 14px; margin: 0; }
.detail-block dt { color: var(--ink-soft); }
.detail-block dd { margin: 0; font-weight: 650; }
.empty-state { text-align: center; padding: 46px 24px; color: var(--ink-soft); }
.empty-state strong { color: var(--ink); display: block; font-size: 1.1rem; margin-bottom: 5px; }

.toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.toolbar .form-row { min-width: 190px; }
.export-links { display: flex; gap: 7px; flex-wrap: wrap; }
.portion-total { font-size: 1.8rem; font-weight: 850; letter-spacing: -.04em; }
.served { opacity: .64; }
.served td { background: #f3f6f5; }
.invoice-total { display: flex; justify-content: flex-end; align-items: baseline; gap: 14px; font-size: 1.15rem; margin-top: 20px; }
.invoice-total strong { font-size: 1.8rem; }

.muted { color: var(--ink-soft); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.nowrap { white-space: nowrap; }
.spacer-top { margin-top: 22px; }
.spacer-bottom { margin-bottom: 22px; }

@media (max-width: 1050px) {
  .topbar { flex-wrap: wrap; gap: 12px; }
  .nav-toggle {
    display: inline-flex; margin-left: auto; border: 1px solid var(--line);
    background: var(--surface); border-radius: 9px; padding: 8px 12px; font-weight: 740;
  }
  .main-nav { display: none; order: 4; flex-basis: 100%; padding-top: 7px; }
  .main-nav.is-open { display: flex; }
  .account-copy { display: none; }
  .account-menu { margin-left: 0; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .page-shell { width: min(100% - 24px, 1220px); padding-top: 28px; }
  .topbar { padding: 10px 12px; }
  .brand small { display: none; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .account-menu .button { padding: 7px 9px; }
  .page-heading { align-items: start; flex-direction: column; margin-bottom: 21px; }
  .card-grid, .split-grid, .detail-grid, .form-grid { grid-template-columns: 1fr; }
  .form-row.full { grid-column: auto; }
  .card { border-radius: 14px; padding: 18px; }
  .menu-day { grid-template-columns: 1fr; gap: 12px; }
  .menu-day .button { width: 100%; }
  .order-choice { grid-template-columns: minmax(0,1fr) 84px; }
  .list-card { align-items: flex-start; flex-wrap: wrap; }
  .list-card > * { min-width: 0; max-width: 100%; }
  .list-card > :first-child { overflow-wrap: anywhere; }
  .auth-links a { min-height: 44px; display: inline-flex; align-items: center; }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 4px; }
  .desktop-table { display: none; }
  .mobile-cards { display: grid; gap: 12px; }
  .mobile-data-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  .mobile-data-card dl { display: grid; grid-template-columns: minmax(90px, .7fr) 1fr; gap: 6px 10px; margin: 10px 0; }
  .mobile-data-card dt { color: var(--ink-soft); }
  .mobile-data-card dd { margin: 0; text-align: right; font-weight: 650; overflow-wrap: anywhere; }
}

@media (max-width: 440px) {
  .brand strong { font-size: .96rem; }
  .topbar .button-small { font-size: .82rem; width: auto; min-width: 44px; }
  .topbar .button-small::after { content: none; }
  .stat-card { min-height: 128px; }
  .stat-value { font-size: 2.25rem; }
  .auth-links { flex-direction: column; }
}

@media print {
  .topbar, .site-footer, .button, .toolbar, .message-stack { display: none !important; }
  .page-shell { width: 100%; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}
