:root {
  --ink: #172026;
  --muted: #67727d;
  --line: #dce3ea;
  --paper: #ffffff;
  --soft: #f4f7fa;
  --brand: #204f45;
  --brand-2: #2f7d68;
  --warn: #b97813;
  --danger: #b53b3b;
  --ready: #8d4fc4;
  --ok: #357a45;
  --shadow: 0 12px 28px rgba(23, 32, 38, .10);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--soft);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 30px; line-height: 1.15; margin-bottom: 4px; }
h2 { font-size: 18px; margin-bottom: 12px; }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 78px; resize: vertical; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 22px;
  background: #182522;
  color: #fff;
}
.brand { font-weight: 700; white-space: nowrap; }
.nav { display: flex; flex-wrap: wrap; gap: 6px; }
.nav a, .nav button {
  border: 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: transparent;
  color: #dcebe6;
  cursor: pointer;
}
.nav .active, .nav a:hover, .nav button:hover { background: rgba(255,255,255,.12); color: #fff; }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.app-shell { padding: 24px; max-width: 1500px; margin: 0 auto; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 13px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.button.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.button.danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.button.ghost { background: transparent; color: inherit; }
.button.small { min-height: 32px; padding: 6px 9px; font-size: 13px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.eyebrow { color: var(--brand-2); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 5px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack { display: grid; gap: 12px; align-content: start; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar > input, .toolbar > select { width: auto; min-width: 150px; }
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 1px rgba(23, 32, 38, .03);
}
.wide { grid-column: span 2; }
.split-layout { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(320px, 1fr) minmax(420px, 1.4fr); gap: 16px; align-items: start; }
.hostess-grid { display: grid; grid-template-columns: minmax(560px, 1fr) 340px 320px; gap: 16px; align-items: start; }
.login-wrap { min-height: calc(100vh - 112px); display: grid; place-items: center; }
.login-panel {
  width: min(880px, 100%);
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 34px;
}
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.table-card {
  min-height: 140px;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  gap: 8px;
  align-content: space-between;
}
.table-card strong { font-size: 22px; }
.status-pill { display: inline-flex; width: fit-content; padding: 4px 8px; border-radius: 999px; font-size: 12px; text-transform: capitalize; background: #edf1f4; }
.status-empty { border-left: 6px solid #8aa1ac; }
.status-seated { border-left: 6px solid #3b82a0; }
.status-ordered { border-left: 6px solid var(--warn); }
.status-food_ready { border-left: 6px solid var(--ready); }
.status-needs_bill { border-left: 6px solid #6f58a8; }
.status-needs_cleaning, .status-dirty { border-left: 6px solid var(--danger); }
.status-reserved { border-left: 6px solid #46689c; }
.notice-row { display: grid; gap: 8px; margin-bottom: 14px; }
.notice { padding: 10px 12px; border: 1px solid var(--line); border-left: 5px solid var(--ready); background: #fff; border-radius: 6px; }
.menu-list, .guest-menu, .menu-admin { display: grid; gap: 10px; margin-top: 12px; }
.menu-item, .guest-item, .admin-item { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 12px; }
.guest-item { grid-template-columns: 86px 1fr; }
.guest-item img { width: 86px; height: 86px; object-fit: cover; border-radius: 8px; background: var(--soft); }
.price { font-weight: 700; color: var(--brand); }
.cart-line, .item-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-empty { color: var(--muted); padding: 16px 0; }
.tab-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 12px; background: #fff; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 12px 0; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-weight: 700; }
.kds-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ticket { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ticket.late { border-color: var(--danger); }
.ticket-head { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; background: #eef4f1; border-bottom: 1px solid var(--line); }
.ticket.late .ticket-head { background: #fff0f0; }
.ticket-body { padding: 12px 14px; display: grid; gap: 10px; }
.kds-item { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.floor-plan {
  position: relative;
  width: 100%;
  min-height: 560px;
  overflow: auto;
  background:
    linear-gradient(90deg, rgba(0,0,0,.045) 1px, transparent 1px),
    linear-gradient(rgba(0,0,0,.045) 1px, transparent 1px),
    #fff;
  background-size: 32px 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.floor-table { position: absolute; display: grid; place-items: center; padding: 8px; border: 2px solid rgba(23,32,38,.24); background: #f7fafc; cursor: pointer; text-align: center; user-select: none; }
.floor-table.round { border-radius: 999px; }
.floor-table.square, .floor-table.rectangle { border-radius: 8px; }
.floor-table.selected { outline: 4px solid rgba(47,125,104,.28); }
.floor-table.status-empty { background: #eef3f5; }
.floor-table.status-seated { background: #e2f0f5; }
.floor-table.status-ordered { background: #fff3db; }
.floor-table.status-food_ready { background: #f3e7fb; }
.floor-table.status-needs_bill { background: #ede8fb; }
.floor-table.status-needs_cleaning, .floor-table.status-dirty { background: #ffe6e6; }
.list { display: grid; gap: 8px; }
.list-item { padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 13px; font-weight: 700; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 15px; }
.metric strong { display: block; font-size: 24px; margin-top: 8px; }
.check { display: flex; flex-direction: row; gap: 8px; align-items: center; color: var(--ink); }
.check input { width: auto; }
.toast { position: fixed; right: 18px; bottom: 18px; max-width: 360px; padding: 12px 14px; border-radius: 8px; background: #172026; color: #fff; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 1040px) {
  .split-layout, .hostess-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
}
@media (max-width: 720px) {
  .topbar, .page-head, .login-panel { align-items: stretch; flex-direction: column; grid-template-columns: 1fr; }
  .app-shell { padding: 14px; }
  .toolbar > input, .toolbar > select { width: 100%; }
  h1 { font-size: 24px; }
  .floor-plan { min-height: 420px; }
}
