:root {
  --brand: #e8541a;
  --brand-dark: #c23f0e;
  --brand-light: #fff0eb;
  --bg: #f7f5f2;
  --card: #fff;
  --text: #1a1a18;
  --muted: #6b6860;
  --border: #e8e4de;
  --green: #1d7a4f;
  --green-bg: #eaf5ee;
  --red: #c0392b;
  --red-bg: #feecec;
  --amber: #a05c00;
  --amber-bg: #fff5e0;
  --radius: 14px;
  --radius-sm: 8px;
}
body.tema-merah { --brand: #d32f2f; --brand-dark: #b71c1c; --brand-light: #ffebee; }
body.tema-hijau { --brand: #2e7d32; --brand-dark: #1b5e20; --brand-light: #e8f5e9; }
body.tema-biru { --brand: #1565c0; --brand-dark: #0d47a1; --brand-light: #e3f2fd; }
body.tema-ungu { --brand: #6a1b9a; --brand-dark: #4a148c; --brand-light: #f3e5f5; }
body.tema-coklat { --brand: #5d4037; --brand-dark: #3e2723; --brand-light: #efebe9; }
* { box-sizing: border-box; }
html { font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
body { margin: 0; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-card { width: min(420px, 100%); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: 0 18px 60px rgba(26,26,24,.08); }
.login-card h1 { margin: 0 0 6px; font-size: 28px; }
.login-card p { color: var(--muted); margin: 0 0 24px; }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field span, label { font-weight: 650; font-size: 13px; color: var(--muted); }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: #fff; color: var(--text); }
textarea { min-height: 92px; resize: vertical; }
.btn { border: 0; border-radius: var(--radius-sm); min-height: 44px; padding: 10px 14px; background: var(--brand); color: #fff; font-weight: 750; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.secondary { background: var(--brand-light); color: var(--brand-dark); }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--red); }
.btn.small { min-height: 34px; padding: 7px 10px; font-size: 13px; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 64px; padding: 10px 18px; display: flex; justify-content: space-between; align-items: center; gap: 14px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px); }
.topbar strong, .topbar span { display: block; }
.topbar span { color: var(--muted); font-size: 13px; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.chip, .badge { border-radius: 999px; min-height: 30px; display: inline-flex; align-items: center; padding: 5px 10px; background: var(--brand-light); color: var(--brand-dark); font-weight: 700; font-size: 12px; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 64px); }
.sidebar { border-right: 1px solid var(--border); padding: 16px; display: grid; align-content: start; gap: 8px; background: #fff; }
.sidebar a { min-height: 42px; border-radius: var(--radius-sm); display: flex; align-items: center; padding: 0 12px; color: var(--muted); font-weight: 700; }
.sidebar a.active, .sidebar a:hover { background: var(--brand-light); color: var(--brand-dark); }
.content { padding: 20px; max-width: 1180px; width: 100%; margin: 0 auto 70px; }
.page-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-title h1 { margin: 0; font-size: 25px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.metric { display: grid; gap: 4px; }
.metric strong { font-size: 24px; }
.metric span { color: var(--muted); font-size: 13px; font-weight: 700; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0; }
tr:last-child td { border-bottom: 0; }
.modal { position: fixed; inset: 0; background: rgba(26,26,24,.45); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal.open { display: flex; }
.modal-box { background: #fff; border-radius: var(--radius); width: min(560px, 100%); max-height: 92vh; overflow: auto; padding: 18px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 20px; }
.toast { position: fixed; right: 16px; bottom: 80px; background: var(--text); color: #fff; padding: 12px 14px; border-radius: var(--radius-sm); z-index: 80; }
.bottom-nav { display: none; }
.kasir-layout { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
.menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.menu-item { border: 1px solid var(--border); background: #fff; border-radius: var(--radius); padding: 12px; min-height: 104px; display: grid; gap: 8px; cursor: pointer; text-align: left; }
.menu-item strong { font-size: 16px; }
.menu-item span { color: var(--muted); font-size: 13px; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.qty { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.qty button { width: 32px; height: 32px; border: 1px solid var(--border); background: #fff; border-radius: 50%; }
.pay-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pay-method { min-height: 44px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; color: var(--text); font-weight: 800; cursor: pointer; }
.pay-method.active { border-color: var(--brand); background: var(--brand); color: #fff; }
.receipt { width: 280px; margin: 0 auto; font-family: "Courier New", monospace; font-size: 12px; color: #000; }
.receipt .center { text-align: center; }
.receipt .line { border-top: 1px dashed #000; margin: 8px 0; }
.progress { height: 9px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--brand); }
.warning { background: var(--amber-bg); color: var(--amber); border: 1px solid #f3d7a0; border-radius: var(--radius); padding: 12px; margin-bottom: 14px; font-weight: 700; }
.stock-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.responsive-list { display: grid; gap: 8px; }
.list-head, .list-row { display: grid; grid-template-columns: minmax(120px, 1.4fr) minmax(64px, .7fr) minmax(54px, .55fr) minmax(70px, auto); gap: 10px; align-items: center; }
.list-head { padding: 0 4px 8px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.list-row { padding: 10px 4px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row small { color: var(--muted); }
.report-item { grid-template-columns: minmax(150px, 1.1fr) minmax(132px, 1fr) minmax(130px, 1fr) 50px 90px 70px; }
@media (max-width: 860px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .content { padding: 14px; }
  .bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(4,1fr); border-top: 1px solid var(--border); background: #fff; z-index: 30; }
  .bottom-nav a { min-height: 58px; display: grid; place-items: center; font-weight: 750; font-size: 12px; color: var(--muted); text-align: center; }
  .kasir-layout, .grid.two, .grid.three, .stock-panels { grid-template-columns: 1fr; }
  .menu-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .topbar { align-items: flex-start; }
  .top-actions span { display: none; }
}
@media (max-width: 560px) {
  .list-head { display: none; }
  .list-row, .list-row.menu-stock, .report-item { grid-template-columns: 1fr auto; gap: 8px 12px; align-items: start; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; }
  .list-row > div:first-child { grid-column: 1 / -1; }
  .report-item > div:nth-child(2), .report-item > div:nth-child(3) { grid-column: 1 / -1; }
  .pay-methods { grid-template-columns: 1fr; }
}
