:root {
  --bg: #f5f2eb;
  --paper: #fffdfa;
  --ink: #1e2528;
  --muted: #687174;
  --line: #ddd4c4;
  --accent: #0f8b78;
  --accent-dark: #09685a;
  --accent-soft: #dff4ef;
  --blue: #246eb9;
  --yellow: #f2b84b;
  --red: #cf4e42;
  --green: #27835f;
  --shadow: 0 18px 45px rgba(33, 31, 27, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 139, 120, 0.12), transparent 34rem),
    linear-gradient(180deg, #fbf8f2 0, var(--bg) 42rem);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(16px, 4vw, 44px);
  background: rgba(251, 248, 242, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar h1,
.topbar p,
h2,
h3 {
  margin: 0;
}

.demo-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-brand img {
  width: 48px;
  height: 48px;
  display: block;
  filter: drop-shadow(0 8px 14px rgba(15, 139, 120, 0.16));
}

.topbar h1 {
  font-size: 28px;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(72px, 1fr));
  gap: 6px;
  padding: 5px;
  background: rgba(235, 227, 212, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tab {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}

.tab.active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 8px 18px rgba(30, 37, 40, 0.08);
}

.tab.home-link {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

main {
  padding: 24px clamp(16px, 4vw, 44px) 54px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.event-hero {
  min-height: 360px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 22px;
  padding: clamp(26px, 5vw, 54px);
  color: white;
  background:
    linear-gradient(90deg, rgba(11, 48, 43, 0.82), rgba(11, 48, 43, 0.24)),
    url("https://images.unsplash.com/photo-1528605248644-14dd04022da1?auto=format&fit=crop&w=1600&q=80");
  background-position: center;
  background-size: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.event-hero::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--yellow), var(--blue));
}

.event-hero > * {
  position: relative;
  z-index: 1;
}

.hero-copy {
  max-width: 650px;
}

.hero-copy h2 {
  max-width: 760px;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.95;
}

.hero-copy p:not(.eyebrow) {
  max-width: 540px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  line-height: 1.5;
}

.hero-actions,
.payment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(30, 37, 40, 0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 13px 24px rgba(30, 37, 40, 0.1);
}

.button.primary {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: var(--accent);
}

.button.ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
}

.button.danger {
  color: white;
  background: var(--red);
  border-color: var(--red);
}

.button.small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.hero-panel {
  min-width: 240px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.16);
}

.hero-panel strong,
.hero-panel small {
  display: block;
}

.status-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  margin-right: 6px;
  background: var(--green);
  border-radius: 50%;
}

.status-dot.closed {
  background: var(--red);
}

.public-grid,
.admin-grid,
.workspace {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.public-grid {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.74fr);
}

.workspace {
  grid-template-columns: 360px minmax(0, 1fr);
  margin-top: 0;
}

.admin-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
}

.panel {
  position: relative;
  overflow: hidden;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 253, 250, 0.96)),
    var(--paper);
  border: 1px solid rgba(221, 212, 196, 0.92);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(33, 31, 27, 0.05);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 18px auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.5;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-heading h3 {
  font-size: 18px;
}

.section-heading span {
  color: var(--muted);
  font-size: 13px;
}

.page-heading {
  margin-bottom: 18px;
}

.page-heading h2 {
  font-size: clamp(32px, 5vw, 54px);
}

.menu-list,
.cash-menu,
.admin-menu,
.orders-board {
  display: grid;
  gap: 10px;
}

.menu-item,
.product-row,
.order-card,
.reservation-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #fbf7ee;
  border: 1px solid rgba(221, 212, 196, 0.92);
  border-radius: 8px;
}

.menu-item {
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
}

.menu-photo {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}

.menu-item strong,
.product-row strong {
  display: block;
}

.menu-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.price {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.soldout {
  opacity: 0.48;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline-color: var(--accent);
}

textarea {
  resize: vertical;
}

.full {
  grid-column: 1 / -1;
}

.booking-result {
  margin-top: 14px;
  padding: 12px;
  background: #ecf7f4;
  border: 1px solid #bae1d9;
  border-radius: 8px;
}

.alert {
  padding: 12px;
  background: #fff2cd;
  border: 1px solid #e5bd57;
  border-radius: 8px;
}

.hidden {
  display: none;
}

.qr-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qr-code {
  width: 76px;
  height: 76px;
  background:
    linear-gradient(90deg, #111 8px, transparent 8px) 0 0 / 19px 19px,
    linear-gradient(#111 8px, transparent 8px) 0 0 / 19px 19px,
    #fff;
  border: 8px solid #fff;
  box-shadow: inset 0 0 0 2px #111;
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.table-button {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 8px;
  background: #f7f1e6;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.table-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(30, 37, 40, 0.08);
}

.table-button strong {
  font-size: 17px;
}

.table-button span {
  color: var(--muted);
  font-size: 11px;
}

.table-button.free {
  border-color: #bed8ce;
}

.table-button.open {
  background: #fff2cd;
  border-color: var(--yellow);
}

.table-button.paid {
  background: #e8f6ee;
  border-color: #9bd1b5;
}

.table-button.selected {
  outline: 3px solid rgba(15, 139, 120, 0.22);
  box-shadow: 0 12px 26px rgba(15, 139, 120, 0.12);
}

.product-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.cart-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.cart-items {
  display: grid;
  gap: 8px;
  min-height: 80px;
}

.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}

.orders-board {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
}

.order-column {
  min-height: 380px;
  padding: 12px;
  background: rgba(235, 227, 212, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.order-column h3 {
  margin-bottom: 12px;
}

.order-card {
  margin-bottom: 10px;
  background: var(--paper);
}

.order-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.order-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.metrics div {
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(251, 247, 238, 0.95)),
    #fbf7ee;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metrics span,
.metrics strong {
  display: block;
}

.metrics span {
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  margin-top: 4px;
  font-size: 24px;
}

.availability {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
}

.switch input {
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  background: #c9c0b2;
  border-radius: 999px;
  cursor: pointer;
}

.switch span::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  top: 3px;
  left: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
}

.toast {
  padding: 13px 14px;
  color: white;
  background: #263235;
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toast strong,
.toast span {
  display: block;
}

.toast span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.toast.warning {
  border-left-color: var(--yellow);
}

.toast.success {
  border-left-color: var(--green);
}

@media (max-width: 980px) {
  .topbar,
  .event-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .public-grid,
  .workspace,
  .admin-grid,
  .orders-board {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  main {
    padding-inline: 12px;
  }

  .topbar {
    padding-inline: 12px;
  }

  .event-hero {
    min-height: 460px;
    padding: 24px;
  }

  .form-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .menu-item,
  .product-row {
    grid-template-columns: 1fr;
  }

  .menu-photo {
    width: 100%;
    height: 150px;
  }

  .table-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media print {
  .topbar,
  .page-heading .button,
  .order-actions {
    display: none;
  }

  body {
    background: white;
  }
}
