:root {
  --bg: #121212;
  --surface: #1e1e1e;
  --surface2: #0f0f0f;
  --border: #27272a;
  --primary: #f59e0b;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --green: #10b981;
  --red: #ef4444;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  display: flex; min-height: 100vh;
}
h1 { font-size: 32px; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 20px; margin: 0 0 14px; }
.muted { color: var(--muted); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }

.sidebar {
  width: 92px; border-right: 1px solid var(--border); padding: 20px 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0;
}
.logo-box {
  width: 44px; height: 44px; border-radius: 12px; background: var(--primary);
  color: #18181b; display: grid; place-items: center; font-weight: 800; font-size: 18px; margin-bottom: 18px;
}
.sidebar nav { display: flex; flex-direction: column; gap: 6px; width: 100%; align-items: center; }
.sidebar nav a {
  width: 66px; padding: 12px 0; border-radius: 12px; text-align: center; font-size: 12px;
  color: var(--muted); border: 1px solid transparent; transition: background .15s, color .15s;
}
.sidebar nav a:hover { background: #27272a; color: var(--text); }
.sidebar nav a.active { background: rgba(245,158,11,.1); color: var(--primary); border-color: rgba(245,158,11,.4); }
.side-foot { margin-top: auto; text-align: center; font-size: 11px; }
.side-foot .role { display: block; color: #52525b; text-transform: uppercase; margin-bottom: 6px; }
.side-foot .logout { color: var(--muted); }
.side-foot .logout:hover { color: var(--red); }

.content { flex: 1; padding: 26px; min-width: 0; }
.content.full { display: grid; place-items: center; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

input, select, textarea {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 12px; font-size: 14px; width: 100%; font-family: inherit;
}
input:focus, select:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--border);
  background: #27272a; color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: filter .15s, transform .15s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: #18181b; border-color: var(--primary); }
.btn.green { background: var(--green); color: #08130f; border-color: var(--green); }
.btn.danger { background: transparent; color: var(--red); border-color: #7f1d1d; }
.btn.block { width: 100%; }
.btn.sm { height: 34px; padding: 0 10px; font-size: 12px; }

.login-wrap { display: grid; place-items: center; min-height: 100vh; width: 100%; }
.login-card { width: 340px; display: flex; flex-direction: column; gap: 12px; }
.error { color: var(--red); font-size: 13px; margin: 0; }
.ok { color: var(--green); font-size: 13px; margin: 0; }

.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.menu-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; text-align: left; cursor: pointer; color: var(--text); padding: 0;
  transition: border-color .15s, transform .15s;
}
.menu-card:hover { border-color: rgba(245,158,11,.6); transform: translateY(-2px); }
.menu-card[disabled] { opacity: .4; cursor: not-allowed; }
.menu-card .thumb { height: 104px; background: #27272a; display: grid; place-items: center; font-size: 28px; color: #3f3f46; }
.menu-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.menu-card .body { padding: 12px; }
.menu-card .name { font-weight: 600; font-size: 14px; }
.menu-card .price { color: var(--primary); font-weight: 700; margin-top: 5px; }
.menu-card .stock { font-size: 12px; color: var(--muted); margin-top: 3px; }
.menu-card .stock.low { color: var(--red); }

.pos { display: flex; gap: 20px; align-items: flex-start; }
.pos .left { flex: 1; min-width: 0; }
.pos .cart { width: 360px; flex-shrink: 0; position: sticky; top: 20px; }
.cart-item { display: flex; gap: 10px; align-items: center; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.cart-item .grow { flex: 1; min-width: 0; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 32px; height: 32px; border-radius: 8px; border: none; background: #27272a; color: var(--text); cursor: pointer; font-size: 16px; }
.qty button.plus { background: var(--primary); color: #18181b; }
.total-line { display: flex; justify-content: space-between; align-items: flex-end; margin: 10px 0; }
.total-line .big { font-size: 30px; font-weight: 800; color: var(--primary); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 10px; background: var(--surface); }
td { padding: 10px; border-top: 1px solid var(--border); }
tbody tr { background: var(--surface2); }

.chart { display: flex; align-items: flex-end; gap: 8px; height: 220px; padding-top: 10px; }
.chart .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.chart .bar i { display: block; width: 100%; background: linear-gradient(180deg, var(--primary), rgba(245,158,11,.25)); border-radius: 6px 6px 0 0; min-height: 2px; }
.chart .bar span { font-size: 10px; color: var(--muted); }
.badge { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: rgba(245,158,11,.15); color: var(--primary); }
.badge.blue { background: rgba(56,189,248,.15); color: #38bdf8; }
.badge.green { background: rgba(16,185,129,.15); color: var(--green); }

.stat p { margin: 0; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 4px; }
.up { color: var(--green); font-weight: 700; }
.down { color: var(--red); font-weight: 700; }
.logo-preview { width: 76px; height: 76px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--border); object-fit: contain; }

@media (max-width: 900px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; justify-content: space-around; padding: 8px 0; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar .logo-box, .side-foot .role { display: none; }
  .sidebar nav { flex-direction: row; }
  .side-foot { margin: 0; display: flex; align-items: center; }
  .pos { flex-direction: column; }
  .pos .cart { width: 100%; position: static; }
  .cols-4, .cols-2 { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px; }
}
