:root {
  --bg: #f6f4ef;
  --panel: #ffffff;
  --panel-2: #ece7dc;
  --text: #232726;
  --muted: #66716d;
  --line: #d8d1c3;
  --primary: #0f766e;
  --primary-strong: #0b5f59;
  --accent: #b45309;
  --danger: #b42318;
  --ok: #207a3c;
  --shadow: 0 16px 36px rgba(30, 35, 32, .10);
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171a19;
    --panel: #202523;
    --panel-2: #2b302d;
    --text: #f1f0ea;
    --muted: #b7bdb7;
    --line: #39413d;
    --primary: #43b3a8;
    --primary-strong: #7dd3ca;
    --accent: #e6a65d;
    --danger: #ff8a7d;
    --ok: #7fd69a;
    --shadow: 0 16px 36px rgba(0, 0, 0, .24);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

button, input, select, textarea { font: inherit; }
button:disabled, input:disabled, select:disabled, textarea:disabled { opacity: .62; cursor: not-allowed; }
button, .button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .65rem .9rem;
  text-decoration: none;
}
button.primary, .button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.ghost, .button.ghost { background: transparent; }
button.danger { color: var(--danger); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: .75rem;
  top: -4rem;
  z-index: 20;
  background: var(--panel);
  padding: .7rem 1rem;
  border-radius: var(--radius);
}
.skip-link:focus { top: .75rem; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 800; letter-spacing: 0; }
.brand-mark { width: 2rem; height: 2rem; border-radius: 6px; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 900; }
.nav { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; padding: .55rem .7rem; border-radius: var(--radius); min-height: 40px; display: inline-flex; align-items: center; }
.nav a.active, .nav a:hover { color: var(--text); background: var(--panel-2); }
.mobile-toggle { display: none; }

.page { min-height: calc(100vh - 65px); }
.container { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.hero {
  min-height: 72vh;
  display: grid;
  align-items: end;
  background: linear-gradient(0deg, rgba(0,0,0,.58), rgba(0,0,0,.16)), var(--hero, url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1600&q=75")) center/cover;
  color: #fff;
}
.hero-inner { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; padding: 5rem 0 4rem; }
.hero h1 { margin: 0; max-width: 780px; font-size: clamp(2.2rem, 7vw, 5.8rem); line-height: .95; letter-spacing: 0; }
.hero p { max-width: 640px; margin: 1rem 0 1.4rem; font-size: clamp(1rem, 2vw, 1.22rem); color: rgba(255,255,255,.88); }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.hero .button.ghost { color: #fff; border-color: rgba(255,255,255,.45); background: rgba(0,0,0,.18); }

.section { padding: 2.3rem 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
h2, h3 { margin: 0; line-height: 1.12; letter-spacing: 0; }
p { margin: .35rem 0; }
.muted { color: var(--muted); }
.loading { color: var(--muted); font-weight: 700; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.event-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; margin-bottom: .85rem; background: var(--panel-2); }
.pill { display: inline-flex; align-items: center; min-height: 26px; border-radius: 999px; padding: .2rem .55rem; background: var(--panel-2); color: var(--muted); font-size: .82rem; }
.price { font-weight: 800; color: var(--primary-strong); }

.hours-list, .menu-list { display: grid; gap: .65rem; }
.row {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) auto;
  align-items: center;
  gap: .8rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.hours-row { grid-template-columns: 4.5rem 1fr; }
.hours-row small { grid-column: 2; }
.menu-row { grid-template-columns: minmax(0, 1fr) auto; }
.menu-row > div { min-width: 0; }
.menu-row strong, .event-card h3 { overflow-wrap: anywhere; }

.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1rem;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow: auto;
}
.side-nav { display: grid; gap: .25rem; margin-top: 1rem; }
.side-nav a { color: var(--muted); text-decoration: none; padding: .7rem .8rem; border-radius: var(--radius); min-height: 44px; display: flex; align-items: center; gap: .55rem; }
.side-nav a.active, .side-nav a:hover { background: var(--panel-2); color: var(--text); }
.admin-main { min-width: 0; }
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 1.5rem);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.admin-content { padding: 1rem clamp(1rem, 3vw, 1.5rem) 2rem; }
.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: 1rem 0; }
.metric { display: grid; gap: .25rem; }
.metric strong { font-size: 1.75rem; }
.status { font-weight: 700; color: var(--primary-strong); }
.status.low { color: var(--danger); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { text-align: left; padding: .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 700; font-size: .88rem; }
tr:last-child td { border-bottom: 0; }

.form-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; }
label { display: grid; gap: .35rem; font-weight: 700; color: var(--muted); font-size: .88rem; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: .65rem .75rem;
}
textarea { min-height: 96px; resize: vertical; }
.notice { border-left: 4px solid var(--primary); }
.inline-notice { padding: .75rem 1rem; background: var(--panel); border: 1px solid var(--line); border-left-color: var(--primary); border-radius: var(--radius); }
.danger-text { border-left-color: var(--danger); color: var(--danger); }
.empty { padding: 1rem; color: var(--muted); text-align: center; }

@media (max-width: 820px) {
  .mobile-toggle { display: inline-flex; }
  .topbar { align-items: flex-start; }
  .topbar .nav { display: none; position: absolute; top: 64px; left: 1rem; right: 1rem; padding: .65rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
  .topbar.open .nav { display: grid; }
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 300px); transform: translateX(-105%); transition: transform .18s ease; z-index: 30; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .admin-header { position: sticky; top: 0; z-index: 8; }
  .admin-content { padding-bottom: 5rem; }
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  table, thead, tbody, tr, th, td { display: block; min-width: 0; }
  thead { display: none; }
  tr { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .75rem; padding: .45rem; }
  td { border: 0; padding: .45rem; }
  td::before { content: attr(data-label); display: block; color: var(--muted); font-size: .78rem; font-weight: 800; }
  .section-head { display: grid; align-items: start; }
  .row { grid-template-columns: 1fr; }
  .hours-row { grid-template-columns: 4rem 1fr; }
  .menu-row { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
