:root {
  --bg: #f4f3ef;
  --card: #ffffff;
  --ink: #1f2421;
  --muted: #66706a;
  --line: #dedbd2;
  --accent: #0e8c63;
  --accent-dark: #086145;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--accent-dark); text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 64px;
  padding: 0 24px;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.brand { font-weight: 800; color: var(--ink); font-size: 20px; }
.topbar nav { display: flex; gap: 14px; flex: 1; }
.logout { margin-left: auto; }
.logout button { border: 0; background: transparent; color: var(--muted); }

.shell { width: min(1180px, calc(100% - 32px)); margin: 28px auto 64px; }
.auth-card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.auth-card { width: min(420px, 100%); margin: 8vh auto; }
h1, h2, h3, p { margin-top: 0; }
p, .muted { color: var(--muted); }
.notice, .error, .result {
  padding: 12px;
  border-radius: 8px;
  margin: 14px 0;
}
.notice { background: #e7f4ef; color: var(--accent-dark); }
.error { background: #fee4e2; color: var(--danger); }
.result { background: #111312; color: #f7f7f4; overflow: auto; white-space: pre-wrap; }

.stack { display: grid; gap: 14px; }
.mt { margin-top: 22px; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label { display: grid; gap: 6px; font-weight: 650; }
input, select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}
.primary, .secondary {
  min-height: 42px;
  border-radius: 8px;
  padding: 9px 14px;
  border: 1px solid transparent;
  font-weight: 750;
}
.primary { background: var(--accent); color: #fff; }
.secondary { background: #fff; color: var(--accent-dark); border-color: var(--line); }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 20px;
}
.toolbar h1 { margin-bottom: 4px; }
.badge {
  background: #e7f4ef;
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding-right: 320px;
}
.item-card, .ticket, .bill-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.item-card small, .ticket small { color: var(--muted); }
.item-card h3 { min-height: 48px; margin-bottom: 10px; }
.item-card strong { display: block; margin-bottom: 12px; }

.cart {
  position: fixed;
  right: max(16px, calc((100vw - 1180px) / 2));
  top: 92px;
  width: 292px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
}
.cart-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.kanban, .two-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kanban > div {
  min-height: 520px;
  background: rgba(255,255,255,.54);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.ticket { display: grid; gap: 10px; margin-bottom: 12px; }

.bill-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.qty {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  background: #e7f4ef;
  border-radius: 8px;
  color: var(--accent-dark);
  font-weight: 800;
}
.paybar {
  display: flex;
  justify-content: end;
  gap: 10px;
  margin-top: 18px;
}
.list { display: grid; gap: 8px; }
code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; background: #f4f3ef; padding: 2px 6px; border-radius: 6px; }

@media (max-width: 860px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 14px 16px; }
  .topbar nav { flex-wrap: wrap; }
  .toolbar, .paybar { align-items: stretch; flex-direction: column; }
  .grid-form, .two-col, .kanban { grid-template-columns: 1fr; }
  .menu-grid { padding-right: 0; }
  .cart { position: static; width: 100%; margin-top: 16px; }
  .bill-row { grid-template-columns: 1fr; }
}
