:root {
  --bg: #f7f4ea;
  --card: #fffdf8;
  --olive: #667a37;
  --olive-2: #879b4d;
  --olive-3: #edf1df;
  --gold: #b09147;
  --text: #27301c;
  --muted: #6f7761;
  --line: #dde3cc;
  --danger: #b55050;
  --danger-bg: #f8e9e9;
  --shadow: 0 18px 40px rgba(39,48,28,.08);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; font-family: Inter, Arial, sans-serif; background: linear-gradient(180deg, #faf7ef, var(--bg)); color: var(--text); }
button, input, select, textarea { font: inherit; }
.layout { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.sidebar { padding: 22px 18px; background: linear-gradient(180deg, #596c2f, #425024); color: white; border-right: 1px solid rgba(255,255,255,.08); }
.brand-block { padding: 10px 10px 18px; }
.brand { font-size: 30px; font-weight: 800; letter-spacing: .02em; }
.brand-block small { display:block; margin-top: 4px; color: #e4ebcc; }
.nav { display: grid; gap: 10px; }
.nav a { color: white; text-decoration:none; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.08); transition: .2s ease; }
.nav a.active, .nav a:hover { background: rgba(255,255,255,.18); transform: translateY(-1px); }
.main { padding: 24px; }
.header { display:flex; align-items:center; justify-content:space-between; gap: 18px; margin-bottom: 18px; }
.header.soft { background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,.55)); backdrop-filter: blur(8px); }
.title { font-size: 34px; font-weight: 800; }
.subtitle, .muted { color: var(--muted); }
.header-actions { display:flex; flex-direction:column; align-items:flex-end; gap:8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 18px; box-shadow: var(--shadow); }
.card-head { display:flex; align-items:center; justify-content:space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3, .card h2, .card h4 { margin: 0; }
.grid { display:grid; gap: 18px; margin-bottom: 18px; }
.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.cols-main { grid-template-columns: 1.1fr 1fr; }
.cols-side { grid-template-columns: 1fr 1fr; }
.metric .kpi { font-size: 34px; font-weight: 800; color: var(--olive); margin: 12px 0 6px; }
.badge { display:inline-flex; align-items:center; gap:6px; padding: 6px 10px; background: var(--olive-3); color: var(--olive); border-radius: 999px; font-size: 12px; font-weight: 800; }
.badge.bar { background: #eef6f0; color: #2b7a57; }
.badge.kitchen { background: #f6efe4; color: #8b5c25; }
.badge.closed { background: #eef1f7; color: #52637f; }
.badge.sent, .badge.open, .badge.reopened { background: #f3f0e1; color: #76672a; }
.login-wrap { min-height: 100vh; display:grid; place-items:center; padding: 26px; }
.login-card { width: min(100%, 560px); background: white; border:1px solid var(--line); border-radius: 28px; padding: 28px; box-shadow: 0 26px 50px rgba(39,48,28,.12); }
.hero { background: linear-gradient(135deg, var(--olive), var(--olive-2)); color:white; border-radius: 20px; padding: 20px; margin-bottom: 18px; }
.hero-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; opacity: .9; }
.hero h1 { margin: 8px 0 8px; font-size: 38px; }
.hero p { margin: 0; color: #eef3df; }
.stack { display:grid; gap: 12px; }
.stack.compact { gap: 10px; }
label { font-weight: 700; color: var(--text); }
input, select, textarea, button { width: 100%; border-radius: 16px; border: 1px solid var(--line); padding: 14px 15px; background: white; color: var(--text); }
textarea { min-height: 98px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #d4deb8; border-color: #d4deb8; }
button { background: linear-gradient(135deg, var(--olive), var(--olive-2)); color:white; border: none; font-weight: 800; cursor: pointer; }
button.secondary, .secondary { background: white; color: var(--olive); border:1px solid var(--line); }
button.small, .small { width:auto; padding: 10px 12px; border-radius: 12px; font-size: 13px; }
.error { color: var(--danger); background: var(--danger-bg); border-radius: 14px; padding: 12px 14px; min-height: 24px; }
.footer-note { color: var(--muted); font-size: 14px; margin-top: 8px; }
.row { display:flex; gap: 12px; }
.row.between { justify-content:space-between; align-items:center; }
.toolbar { display:flex; gap: 12px; flex-wrap: wrap; }
.table-grid { display:grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); }
.table-pill { border:1px solid var(--line); background:white; color: var(--text); border-radius: 18px; padding: 16px 14px; text-align:left; box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.table-pill small { display:block; color: var(--muted); margin-top: 6px; }
.table-pill.free { background: #fbfcf8; }
.table-pill.occupied { background: #f7ede7; color: #875747; }
.table-pill.selected { outline: 2px solid var(--olive); }
.segmented { display:flex; gap: 8px; flex-wrap: wrap; }
.seg { width:auto; padding: 11px 16px; background: white; color: var(--olive); border:1px solid var(--line); }
.seg.active { background: linear-gradient(135deg, var(--olive), var(--olive-2)); color:white; }
.product-grid { display:grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(170px,1fr)); }
.product-card { text-align:left; padding: 16px; background: #fff; border:1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.product-card h4 { margin: 10px 0 6px; }
.product-card p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.line-item { display:flex; justify-content:space-between; gap: 12px; align-items:center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line-item small { display:block; color: var(--muted); margin-top: 4px; }
.line-actions { display:flex; align-items:center; gap: 8px; }
.icon-btn { width: 34px; height: 34px; padding: 0; border-radius: 10px; background: white; color: var(--olive); border:1px solid var(--line); }
.icon-btn.danger { color: var(--danger); }
.total-row { display:flex; justify-content:space-between; padding-top: 12px; font-weight: 800; }
.empty-box { border:1px dashed var(--line); border-radius: 18px; background: #fcfcf8; color: var(--muted); padding: 16px; }
.ticket { border: 1px dashed #d7d1b8; border-radius: 16px; padding: 14px; background: #fffdf7; margin-bottom: 10px; }
.ticket h4 { margin: 8px 0; }
.table { width:100%; border-collapse: collapse; }
.table th, .table td { padding: 12px; border-bottom: 1px solid var(--line); text-align:left; vertical-align: top; }
.table th { color: var(--muted); font-size: 13px; }
.actions { white-space: nowrap; }
.steps { margin: 0; padding-left: 18px; display:grid; gap: 8px; }
.chips { display:flex; flex-wrap:wrap; gap: 8px; }
.chips span { background: white; border:1px solid var(--line); padding: 8px 10px; border-radius: 999px; }
.bordered { padding: 12px 0; border-bottom: 1px solid var(--line); }
.top-gap { margin-top: 14px; }
.danger-outline { color: var(--danger); border-color: #f0cbcb; }
@media (max-width: 1100px) { .cols-4, .cols-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } .cols-main, .cols-side, .cols-2 { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .sidebar { padding-bottom: 10px; } }
@media (max-width: 640px) { .main { padding: 14px; } .row { flex-direction: column; } .header { flex-direction: column; align-items: stretch; } .header-actions { align-items: stretch; } .cols-4, .cols-3 { grid-template-columns: 1fr; } }
