html, html[data-theme="dark"] {
  --ho-bg: #0f1419;
  --ho-surface: #1a222c;
  --ho-surface2: #243040;
  --ho-text: #e8eef4;
  --ho-muted: #8b9aab;
  --ho-accent: #f0a202;
  --ho-ok: #34c77b;
  --ho-danger: #ef4444;
  --ho-border: #2c3a4a;
}
html[data-theme="light"] {
  --ho-bg: #eef2f6;
  --ho-surface: #ffffff;
  --ho-surface2: #f3f6fa;
  --ho-text: #132033;
  --ho-muted: #5b6b7c;
  --ho-accent: #c98500;
  --ho-ok: #0f766e;
  --ho-danger: #b91c1c;
  --ho-border: #d5dde6;
}

html, body {
  margin: 0;
  background: var(--ho-bg);
  color: var(--ho-text);
  font-family: "Segoe UI", system-ui, sans-serif;
}

.ho {
  min-height: 100dvh;
  background: var(--ho-bg);
  color: var(--ho-text);
}

.ho-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--ho-surface);
  border-bottom: 1px solid var(--ho-border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.ho-bar strong { font-size: 1.1rem; }
.ho-bar span { color: var(--ho-muted); margin-left: 0.4rem; font-size: 0.9rem; }
.ho-nav { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.ho-nav a, .ho-nav button {
  background: var(--ho-surface2);
  border: 1px solid var(--ho-border);
  color: var(--ho-text);
  border-radius: 0.5rem;
  padding: 0.45rem 0.75rem;
  text-decoration: none !important;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 2.35rem;
  line-height: 1.2;
}
.ho-nav a.on, .ho-nav button.on {
  background: var(--ho-accent);
  color: #111;
  border-color: transparent;
  font-weight: 600;
}
.ho-nav-soon {
  color: var(--ho-muted);
  font-size: 0.85rem;
  padding: 0.45rem 0.55rem;
  border: 1px dashed var(--ho-border);
  border-radius: 0.5rem;
  cursor: help;
  user-select: none;
}
.ho-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0 !important;
}
.ho-theme svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ho-note {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: 0.65rem;
  border: 1px solid var(--ho-border);
  background: var(--ho-surface);
  color: var(--ho-muted);
  font-size: 0.92rem;
  max-width: 46rem;
}
.ho-note a { color: var(--ho-accent); font-weight: 600; }

.ho-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.ho-page-head h1 { margin: 0.15rem 0 0.25rem; }
.ho-crumb { margin: 0; color: var(--ho-muted); font-size: 0.85rem; }
.ho-crumb a { color: var(--ho-accent); text-decoration: none; font-weight: 600; }

.ho-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.ho-catalog-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border-radius: 0.85rem;
  border: 1px solid var(--ho-border);
  background: var(--ho-surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.ho-catalog-card:hover {
  border-color: var(--ho-accent);
  transform: translateY(-1px);
}
.ho-catalog-card.on {
  border-color: var(--ho-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ho-accent) 45%, transparent);
}
.ho-catalog-card strong { font-size: 1.05rem; }
.ho-catalog-card span { color: var(--ho-muted); font-size: 0.88rem; line-height: 1.35; }

/* Phase 3: Admin master pages inside HO shell.
   Do NOT use .admin-shell here — that class is a sidebar+main grid and collapses content to ~15rem. */
.ho-masters {
  display: block;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 0.75rem 1.25rem 2.5rem;
  min-height: calc(100dvh - 4rem);
  background: var(--ho-bg);
  color: var(--ho-text);
  /* Bridge Admin component tokens to HO theme */
  --bg: var(--ho-bg);
  --surface: var(--ho-surface);
  --surface-2: var(--ho-surface2);
  --text: var(--ho-text);
  --muted: var(--ho-muted);
  --accent: var(--ho-accent);
  --accent-text: #111;
  --border: var(--ho-border);
  --danger: var(--ho-danger);
  --ok: var(--ho-ok);
  --row-hover: color-mix(in srgb, var(--ho-surface2) 80%, var(--ho-accent) 8%);
}
.ho-masters-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--ho-muted);
}
.ho-masters-crumb a {
  color: var(--ho-accent);
  font-weight: 700;
  text-decoration: none !important;
}
.ho-masters-crumb a:hover { text-decoration: underline !important; }
.ho-masters-crumb .sep { opacity: 0.55; }
.ho-masters-back {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 0.45rem;
  border: 1px solid var(--ho-border);
  background: var(--ho-surface);
  color: var(--ho-text) !important;
  font-weight: 650 !important;
}
.ho-masters-back:hover {
  border-color: var(--ho-accent);
  text-decoration: none !important;
}
.ho-masters-body {
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
}
.ho-masters .panel,
.ho-masters .panel.full {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  background: var(--ho-surface);
  border-color: var(--ho-border);
}
.ho-masters .table-wrap {
  width: 100%;
  max-width: none;
  overflow-x: auto;
}
.ho-masters .table {
  width: 100%;
  min-width: 36rem;
}
.ho-masters .page-head {
  width: 100%;
}
.ho-has-masters .ho-bar { position: sticky; top: 0; z-index: 20; }

.ho-row-acts { white-space: nowrap; }
.ho-row-acts .ho-btn,
.ho-row-acts a.ho-btn { margin-right: 0.25rem; }
.ho-swatch {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  margin-right: 0.35rem;
  vertical-align: middle;
  border: 1px solid var(--ho-border);
}

.ho-main {
  max-width: 70rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2.5rem;
}

.ho-login {
  max-width: 26rem;
  margin: 2rem auto;
  padding: 0 1rem 2rem;
}
.ho-login h1 { margin: 0 0 0.35rem; font-size: 1.5rem; }
.ho-login p { color: var(--ho-muted); margin: 0 0 1rem; }
.ho-login label { display: block; font-size: 0.9rem; margin: 0.75rem 0 0.35rem; color: var(--ho-muted); }
.ho-login input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.85rem;
  border-radius: 0.6rem;
  border: 1px solid var(--ho-border);
  background: var(--ho-surface);
  color: var(--ho-text);
  font-size: 1rem;
}
.ho-btn,
a.ho-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 2.35rem;
  height: auto;
  border-radius: 0.55rem;
  border: 1px solid var(--ho-border);
  background: var(--ho-surface);
  color: var(--ho-text);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
  cursor: pointer;
  padding: 0.45rem 0.9rem;
  text-decoration: none !important;
  vertical-align: middle;
}
.ho-btn.primary,
a.ho-btn.primary {
  background: var(--ho-accent);
  color: #111;
  border-color: transparent;
}
.ho-btn:disabled { opacity: 0.55; cursor: default; }
.ho-btn:hover,
a.ho-btn:hover { filter: brightness(1.03); }
.ho-actions .ho-btn,
.ho-actions a.ho-btn { min-height: 2.35rem; }
.ho-row-acts .ho-btn,
.ho-row-acts a.ho-btn {
  min-height: 1.9rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.85rem;
}

.ho-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  color: var(--ho-text);
  font-weight: 600;
  padding: 0.35rem 0;
  width: fit-content;
  max-width: 100%;
  cursor: pointer;
  user-select: none;
}
.ho-toggle-label { min-width: 0; line-height: 1.2; font-size: 0.92rem; }
.ho-toggle-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  width: 2.6rem;
  height: 1.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ho-muted) 35%, var(--ho-surface2));
  border: 1px solid var(--ho-border);
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.ho-toggle-track.on {
  background: var(--ho-accent);
  border-color: transparent;
}
.ho-toggle-track input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}
.ho-toggle-knob {
  position: absolute;
  top: 50%;
  left: 2px;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
  transform: translateY(-50%);
  transition: left 0.15s ease;
  pointer-events: none;
  z-index: 1;
}
.ho-toggle-track.on .ho-toggle-knob {
  left: calc(100% - 1rem - 2px);
}
.ho-toggle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.25rem;
  grid-column: 1 / -1;
}
.ho-err { color: var(--ho-danger); margin-top: 0.75rem; }
.ho-ok { color: var(--ho-ok); margin-top: 0.75rem; }
.ho-muted { color: var(--ho-muted); }

.ho-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}
.ho-kpi {
  background: var(--ho-surface);
  border: 1px solid var(--ho-border);
  border-radius: 0.85rem;
  padding: 0.9rem 1rem;
}
.ho-kpi .label { color: var(--ho-muted); font-size: 0.8rem; }
.ho-kpi .value { font-size: 1.35rem; font-weight: 700; margin-top: 0.25rem; }

.ho-outlet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.75rem;
}
.ho-outlet-card {
  background: var(--ho-surface);
  border: 1px solid var(--ho-border);
  border-radius: 0.85rem;
  padding: 0.9rem 1rem;
  text-align: left;
}
.ho-outlet-card strong { display: block; font-size: 1.05rem; }
.ho-outlet-card .meta { color: var(--ho-muted); font-size: 0.85rem; margin-top: 0.25rem; }
.ho-outlet-card .amt { margin-top: 0.55rem; font-weight: 700; }

.ho-panel {
  background: var(--ho-surface);
  border: 1px solid var(--ho-border);
  border-radius: 0.85rem;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.ho-panel h2 { margin: 0 0 0.75rem; font-size: 1.1rem; }
.ho-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.75rem;
  align-items: end;
}
.ho-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: var(--ho-muted); }
.ho-form input, .ho-form select {
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid var(--ho-border);
  background: var(--ho-surface2);
  color: var(--ho-text);
  font: inherit;
}
.ho-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.45rem;
  margin: 0.75rem 0;
}
.ho-checks .ho-toggle {
  padding: 0.55rem 0.7rem;
  border-radius: 0.55rem;
  border: 1px solid var(--ho-border);
  background: var(--ho-surface2);
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
.ho-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.85rem; }
.ho-table { width: 100%; border-collapse: collapse; }
.ho-table th, .ho-table td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--ho-border);
  font-size: 0.92rem;
}
.ho-table th { color: var(--ho-muted); font-weight: 600; }
.ho-empty { color: var(--ho-muted); padding: 1.5rem 0; text-align: center; }

.ho-section-title {
  margin: 1.35rem 0 0.65rem;
  font-size: 1.05rem;
}
.ho-steps {
  margin: 0.35rem 0 0.75rem 1.1rem;
  padding: 0;
  color: var(--ho-text);
  line-height: 1.55;
}
.ho-steps li { margin: 0.35rem 0; }

.ho-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.ho-pill.ok { background: color-mix(in srgb, var(--ho-ok) 28%, transparent); color: var(--ho-ok); }
.ho-pill.off { background: color-mix(in srgb, var(--ho-danger) 22%, transparent); color: var(--ho-danger); }
.ho-pill.warn { background: color-mix(in srgb, #e6a817 28%, transparent); color: #c48a00; }
.ho-indent-card {
  border: 1px solid var(--ho-border);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
  background: var(--ho-surface2);
}
.ho-indent-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.ho-indent-qty {
  width: 6.5rem;
  padding: 0.35rem 0.45rem;
  border-radius: 0.4rem;
  border: 1px solid var(--ho-border);
  background: var(--ho-surface);
  color: var(--ho-text);
  font: inherit;
}
.ho-live-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--ho-muted);
}
.ho-live-filter select {
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid var(--ho-border);
  background: var(--ho-surface2);
  color: var(--ho-text);
  font: inherit;
}

.ho-main.ho-reports { max-width: 90rem; }
.ho-rep-layout {
  display: grid;
  grid-template-columns: minmax(11rem, 14rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 720px) {
  .ho-rep-layout { grid-template-columns: 1fr; }
}
.ho-rep-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: var(--ho-surface);
  border: 1px solid var(--ho-border);
  border-radius: 0.85rem;
  padding: 0.75rem;
  position: sticky;
  top: 4rem;
}
.ho-rep-group {
  margin: 0.55rem 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ho-muted);
  font-weight: 700;
}
.ho-rep-group:first-child { margin-top: 0; }
.ho-rep-item {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ho-text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.45rem 0.55rem;
  border-radius: 0.45rem;
  cursor: pointer;
}
.ho-rep-item:hover { background: var(--ho-surface2); }
.ho-rep-item.on {
  background: var(--ho-accent);
  color: #111;
}
.ho-rep-item:disabled { opacity: 0.55; cursor: default; }
.ho-rep-stage { min-width: 0; }
.ho-rep-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  align-items: end;
  margin-bottom: 1rem;
}
.ho-rep-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--ho-muted);
}
.ho-rep-filters select,
.ho-rep-filters input[type="date"] {
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid var(--ho-border);
  background: var(--ho-surface2);
  color: var(--ho-text);
  font: inherit;
}
.ho-rep-ranges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ho-rep-letter {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.ho-rep-letter strong { display: block; }
.ho-rep-letter span {
  display: block;
  color: var(--ho-muted);
  font-size: 0.88rem;
  margin-top: 0.15rem;
}
.ho-rep-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  color: var(--ho-muted);
  font-size: 0.88rem;
  margin: 0.35rem 0 0.85rem;
}
.ho-rep-meta b { color: var(--ho-text); font-weight: 700; }
.ho-rep-block { margin-top: 1rem; }
.ho-rep-block h2 { margin: 0 0 0.45rem; font-size: 1.05rem; }
.ho-table-wrap { overflow-x: auto; }
.ho-table code {
  font-size: 0.85rem;
  background: var(--ho-surface2);
  padding: 0.1rem 0.35rem;
  border-radius: 0.3rem;
}

@media print {
  .ho-bar, .ho-rep-nav, .ho-rep-filters, .ho-page-head .ho-crumb { display: none !important; }
  .ho-main.ho-reports { max-width: none; padding: 0; }
  .ho-rep-layout { display: block; }
  .ho-panel { border: 0; padding: 0; }
}

/* Cuisine starters */
button.ho-catalog-card {
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  width: 100%;
}
.ho-starter-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}
.ho-starter-head h2 { margin: 0; }
.ho-starter-cat { margin-top: 1rem; }
.ho-starter-cat h3 { margin: 0 0 0.45rem; font-size: 1rem; }
.ho-starter-table tr.off { opacity: 0.45; }
.ho-starter-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  white-space: nowrap;
}
.ho-starter-mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.45rem 0.85rem;
}
.ho-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 1rem;
}
.ho-modal {
  background: var(--ho-surface);
  color: var(--ho-text);
  border: 1px solid var(--ho-border);
  border-radius: 0.85rem;
  padding: 1rem 1.15rem;
  max-width: 32rem;
  width: 100%;
  max-height: min(80vh, 36rem);
  overflow: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.ho-modal-wide { max-width: 40rem; }
.ho-input {
  font: inherit;
  color: var(--ho-text);
  background: var(--ho-surface2, var(--ho-surface));
  border: 1px solid var(--ho-border);
  border-radius: 0.4rem;
  padding: 0.35rem 0.5rem;
}
.ho-starter-recipe-edit .ho-input,
.ho-starter-recipe-edit select.ho-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.ho-starter-recipe-edit input[type="number"] { max-width: 6rem; }
.ho-starter-dl {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0.75rem 0 1rem;
}
.ho-starter-dl dt { color: var(--ho-muted); }
.ho-starter-dl dd { margin: 0; }
