:root {
  --bg: #f4f5f7; --card: #fff; --text: #1d2330; --muted: #6b7280; --line: #e3e6ea; --accent: #2563eb;
  --empty: #16a34a; --seated: #1d4ed8; --waiting_order: #d97706; --in_service: #7c3aed;
  --needs_attention: #dc2626; --bill_open: #ea580c;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
header { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--card);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
header h1 { font-size: 17px; margin: 0; }
nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
nav button { background: none; border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--muted); white-space: nowrap; }
nav button.active { background: #e8efff; color: var(--accent); font-weight: 600; }
main { padding: 16px; max-width: 1300px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 15px; margin: 0 0 12px; }
.btn { background: var(--accent); color: #fff; border: none; border-radius: 6px; padding: 8px 14px; cursor: pointer; font-size: 14px; text-decoration: none; display: inline-block; }
.btn.secondary { background: #eef0f3; color: var(--text); }
.btn.danger { background: #fde8e8; color: #dc2626; }
.btn:disabled { opacity: .5; }
input, select, textarea { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 10px; }
.row > div { display: flex; flex-direction: column; }
.muted { color: var(--muted); font-size: 13px; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list td, table.list th { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
table.list th { color: var(--muted); font-weight: 500; font-size: 13px; }
.banner { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.banner.warn { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.summary .s { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.summary .s b { font-size: 18px; margin-right: 4px; }
.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tcard { background: var(--card); border-radius: 10px; padding: 12px; border: 1px solid var(--line); border-left: 6px solid var(--c); }
.tcard .name { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.tcard .state { display: inline-block; font-size: 12px; font-weight: 700; color: #fff; background: var(--c); padding: 3px 8px; border-radius: 99px; }
.tcard .meta { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.tcard.alert { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 30%, transparent); } }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; }
.bars { display: flex; align-items: end; gap: 4px; height: 120px; padding-top: 8px; }
.bars .b { flex: 1; background: #93c5fd; border-radius: 3px 3px 0 0; position: relative; min-height: 2px; }
.bars .b span { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); }
.progress { height: 8px; background: #eef0f3; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1d2330; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; display: none; z-index: 10; }
#toast.err { background: #dc2626; }
.login { max-width: 340px; margin: 12vh auto; }
.login input, .login button { width: 100%; margin-bottom: 10px; }
@media (max-width: 600px) { main { padding: 10px; } .tables { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }
