:root {
  --bg: #0e1218;
  --panel: #171d27;
  --panel2: #1e2633;
  --line: #2c3648;
  --text: #eef3fb;
  --muted: #8f9cb0;
  --accent: #3dd68c;
  --accent2: #6ea8fe;
  --warn: #f5a524;
  --danger: #f07178;
  --radius: 14px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: var(--font); color: var(--text); background: var(--bg); }
button, input, select { font: inherit; }
a { color: var(--accent2); }
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 10% -10%, #1b3a2e 0%, transparent 55%),
    radial-gradient(700px 400px at 100% 0%, #243047 0%, transparent 50%),
    var(--bg);
}
.login-card {
  width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 28px;
}
.login-card h1 { margin: 0 0 6px; font-size: 28px; }
.login-card .sub { color: var(--muted); margin: 0 0 22px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
input, select {
  width: 100%; background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
}
input:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); border-color: var(--accent); }
.btn {
  appearance: none; border: 0; border-radius: 10px; padding: 12px 16px; font-weight: 600;
  cursor: pointer; background: var(--accent); color: #062016;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); color: #1a0505; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.err { color: var(--danger); font-size: 13px; margin: 0 0 12px; min-height: 1.2em; }
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.nav {
  background: var(--panel); border-right: 1px solid var(--line); padding: 20px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.brand { font-weight: 700; letter-spacing: .04em; margin: 0 14px 18px; }
.brand small { display: block; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-top: 4px; }
.nav button {
  text-align: left; background: transparent; border: 0; color: var(--muted); padding: 10px 14px;
  border-radius: 10px; cursor: pointer; font-weight: 500;
}
.nav button.active, .nav button:hover { background: var(--panel2); color: var(--text); }
.nav .spacer { flex: 1; }
.main { padding: 22px 24px 40px; overflow: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.topbar h2 { margin: 0; font-size: 22px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
}
.card .k { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.card .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--panel2); }
tr:last-child td { border-bottom: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: #13281f; color: var(--accent);
}
.pill.off { background: #2a2214; color: var(--warn); }
.pill.err { background: #2a1518; color: var(--danger); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.toolbar input { margin: 0; max-width: 280px; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* POS layout */
.pos-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.pos-head {
  display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.pos-body { display: grid; grid-template-columns: 1.4fr 1fr; min-height: 0; }
.pos-products { padding: 14px; overflow: auto; border-right: 1px solid var(--line); }
.pos-cart { padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #121820; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.prod {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  cursor: pointer; text-align: left; color: inherit;
}
.prod:hover { border-color: var(--accent); }
.prod .name { font-weight: 600; margin-bottom: 6px; }
.prod .price { color: var(--accent); font-family: var(--mono); }
.cart-lines { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.cart-line {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.cart-total { font-size: 28px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.pay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lock-box { max-width: 440px; margin: 0 auto; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .pos-body { grid-template-columns: 1fr; }
}
