/* GOZEN SMART POS — desain oleh KAWARU */
:root {
  --bg: #f6f1eb; --panel: #fff; --panel-2: #fbf8f4; --ink: #22160e; --ink-2: #4a3a2e; --muted: #8b786a; --line: #ece2d8;
  --brand: #1f130c; --brand-2: #3b2416; --gold: #c8924f; --gold-2: #e0b071; --cream: #f3e6d6;
  --ok: #2e8b57; --warn: #d18a1a; --bad: #c84339; --info: #3a6ea5;
  --r: 14px; --shadow: 0 1px 2px rgba(40,22,10,.06), 0 6px 20px rgba(40,22,10,.06);
  --side: 236px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }
#app { display: flex; min-height: 100vh; }
.muted { color: var(--muted); } .small { font-size: 12px; } .tiny { font-size: 10px; } .center { text-align: center; } .right { text-align: right; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; } .bold { font-weight: 700; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .grow { flex: 1; } .nowrap { white-space: nowrap; }
.loading { padding: 60px; text-align: center; color: var(--muted); }

/* ---------- Sidebar ---------- */
.side { width: var(--side); flex-shrink: 0; background: linear-gradient(180deg, #1f130c, #2a1a10); color: #e9dccd; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; }
.brand-img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.brand-name { font-weight: 800; letter-spacing: 3px; font-size: 18px; color: #fff; }
.brand-sub { font-size: 10px; letter-spacing: 2.5px; color: var(--gold-2); }
.side nav { flex: 1; overflow: auto; padding: 4px 10px; display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; color: #cdbcaa; text-decoration: none; font-weight: 500; }
.side nav a svg { width: 20px; height: 20px; flex-shrink: 0; }
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a.on { background: linear-gradient(90deg, rgba(200,146,79,.28), rgba(200,146,79,.08)); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.side-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.07); font-size: 12px; color: #a8927e; display: flex; justify-content: space-between; }
.side-foot b { color: var(--gold-2); letter-spacing: 1px; }

/* ---------- Topbar ---------- */
.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: 62px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 20; }
.top-title { display: flex; flex-direction: column; line-height: 1.2; } .top-title span { font-size: 11px; color: var(--muted); }
.top-right { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.clock { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.menu-btn { display: none; }
.icon-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; width: 40px; height: 40px; cursor: pointer; font-size: 18px; }
.user-chip { position: relative; display: flex; gap: 10px; align-items: center; padding: 5px 10px 5px 5px; border-radius: 99px; border: 1px solid var(--line); cursor: pointer; line-height: 1.15; }
.user-chip span { display: block; font-size: 11px; color: var(--muted); }
.av { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--brand); display: grid; place-items: center; font-weight: 800; }
.dropdown { display: none; position: absolute; right: 0; top: 48px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 210px; padding: 6px; }
.user-chip.open .dropdown { display: block; }
.dropdown a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.dropdown a:hover { background: var(--panel-2); }
.main { flex: 1; padding: 22px; min-width: 0; }
.foot { padding: 10px 22px 16px; font-size: 11px; color: var(--muted); text-align: center; }
.foot b { color: var(--ink-2); }

/* ---------- Komponen ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; letter-spacing: -.3px; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.card { background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; border: 1px solid rgba(0,0,0,.02); }
.card h3 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.span2 { grid-column: span 2; }
.kpi .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.kpi .value { font-size: 26px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.kpi .delta { font-size: 12px; margin-top: 4px; }
.kpi.accent { background: linear-gradient(135deg, #2a1a10, #4a2e1b); color: #fff; } .kpi.accent .label { color: var(--gold-2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); padding: 9px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--ink); transition: .12s; }
.btn:hover { border-color: var(--gold); }
.btn.primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; } .btn.primary:hover { background: var(--brand); }
.btn.gold { background: linear-gradient(135deg, var(--gold-2), var(--gold)); border: 0; color: var(--brand); }
.btn.success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); } .btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.lg { padding: 14px 20px; font-size: 16px; width: 100%; border-radius: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; outline: none; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,146,79,.18); }
textarea { resize: vertical; min-height: 60px; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
label.f input, label.f select, label.f textarea { font-weight: 400; font-size: 14px; color: var(--ink); }
label.chk { display: flex; gap: 8px; align-items: center; font-weight: 500; cursor: pointer; }
.form { display: grid; gap: 12px; } .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .form-grid .full { grid-column: 1 / -1; }
.form-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.table-wrap { overflow: auto; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); background: var(--panel-2); position: sticky; top: 0; font-weight: 700; z-index: 1; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.void td { color: #b5a99f; } tr.void td:first-child { text-decoration: line-through; }
tbody tr:hover td { background: #fdfaf6; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty-state { text-align: center; padding: 40px; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.tag.ok { background: #e3f3ea; color: var(--ok); } .tag.warn { background: #fbefd9; color: #a96c0d; } .tag.bad { background: #f9e1df; color: var(--bad); } .tag.info { background: #e3ecf7; color: var(--info); } .tag.mute { background: #f0ebe5; color: var(--muted); } .tag.gold { background: #f6e8d4; color: #8a5a22; }
.pill { padding: 5px 11px; border-radius: 99px; font-size: 12px; font-weight: 700; } .pill.ok { background: #e3f3ea; color: var(--ok); } .pill.warn { background: #fbefd9; color: #a96c0d; }
.chip { border: 1px solid var(--line); background: var(--panel); padding: 7px 14px; border-radius: 99px; cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; }
.chip.on { background: var(--brand-2); color: #fff; border-color: var(--brand-2); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.period { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 10px 16px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.on { color: var(--ink); border-bottom-color: var(--gold); }
.alert { display: flex; gap: 10px; padding: 11px 13px; border-radius: 11px; margin-bottom: 8px; align-items: flex-start; }
.alert.bad { background: #fbecea; } .alert.warn { background: #fdf3e3; } .alert.ok { background: #e8f5ee; } .alert.info { background: #eaf1f9; }
.bar { height: 8px; border-radius: 99px; background: #f0e7de; overflow: hidden; } .bar > i { display: block; height: 100%; border-radius: 99px; background: var(--gold); }
canvas.chart { width: 100%; height: 280px; display: block; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.demo-badge { background: #fff2d6; color: #8a5a22; border: 1px dashed #d9a95f; padding: 1px 7px; border-radius: 6px; font-size: 10px; font-weight: 800; letter-spacing: .4px; }

.demo-flag { background: #d18a1a; color: #fff; font-weight: 800; font-size: 11px; letter-spacing: 1.5px; padding: 5px 10px; border-radius: 8px; }
.demo-login { border: 1px dashed var(--gold); border-radius: 14px; padding: 14px; background: #fbf3e8; }
.demo-title { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: #8a5a22; margin-bottom: 10px; text-align: center; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .demo-grid .btn { justify-content: flex-start; }

/* ---------- Modal & toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(25,14,7,.5); display: grid; place-items: center; z-index: 100; padding: 16px; backdrop-filter: blur(2px); }
.modal-box { background: var(--panel); border-radius: 18px; width: min(540px, 100%); max-height: 92vh; overflow: auto; padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal-box.wide { width: min(820px, 100%); } .modal-box.xl { width: min(1100px, 100%); }
.modal-box h2 { margin: 0 0 14px; font-size: 19px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
#toasts { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--brand); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); max-width: 380px; opacity: 0; transform: translateY(-8px); transition: .25s; border-left: 4px solid var(--ok); }
.toast.show { opacity: 1; transform: none; } .toast.err { border-left-color: var(--bad); } .toast.warn { border-left-color: var(--warn); }

/* ---------- Login ---------- */
.login-wrap { display: grid; grid-template-columns: 1.1fr 1fr; width: 100%; min-height: 100vh; }
.login-art { background: radial-gradient(circle at 30% 20%, #4a2e1b, #1f130c 60%); color: #f3e6d6; display: grid; place-items: center; padding: 40px; }
.login-art-in { max-width: 420px; }
.login-art h1 { font-size: 52px; line-height: 1; letter-spacing: 6px; margin: 26px 0 16px; color: #fff; } .login-art h1 span { font-size: 22px; letter-spacing: 8px; color: var(--gold-2); }
.login-art p { color: #cdb9a5; font-size: 16px; }
.by-big { margin-top: 40px; font-size: 13px; color: #a8927e; letter-spacing: 1px; } .by-big b { color: var(--gold-2); letter-spacing: 3px; }
.login-card { align-self: center; justify-self: center; width: min(380px, 90%); display: grid; gap: 14px; }
.login-card h2 { margin: 0; font-size: 28px; }
.err { color: var(--bad); min-height: 18px; font-weight: 600; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: 1fr 400px; gap: 18px; height: calc(100vh - 62px - 44px - 40px); min-height: 520px; }
.pos-left { display: flex; flex-direction: column; min-height: 0; gap: 12px; }
.pos-search { display: flex; gap: 10px; } .pos-search input { flex: 1; font-size: 15px; padding: 11px 14px; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); grid-auto-rows: max-content; gap: 12px; overflow: auto; align-content: start; padding: 2px 2px 16px; flex: 1; min-height: 0; }
.prod { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); cursor: pointer; border: 2px solid transparent; text-align: left; padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: .12s; }
.prod:hover { border-color: var(--gold); transform: translateY(-2px); }
.prod .ph { height: 96px; background: linear-gradient(135deg, #f3e6d6, #e7d3bb); display: grid; place-items: center; font-size: 34px; font-weight: 800; color: #b08257; }
.prod .ph img { width: 100%; height: 100%; object-fit: cover; }
.prod .pb { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.prod .nm { font-weight: 700; line-height: 1.25; } .prod .pr { color: var(--gold); font-weight: 800; } .prod .av { font-size: 11px; color: var(--muted); }
.prod.off { opacity: .45; cursor: not-allowed; } .prod.off:hover { transform: none; border-color: transparent; }
.cart { background: var(--panel); border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.cart-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel-2); border-radius: 10px; padding: 3px; border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 8px; border-radius: 8px; cursor: pointer; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--brand-2); color: #fff; }
.cart-items { flex: 1; overflow: auto; padding: 4px 16px; }
.ci { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px dashed var(--line); align-items: flex-start; }
.ci .info { flex: 1; min-width: 0; } .ci .n { font-weight: 700; } .ci .m { font-size: 12px; color: var(--muted); }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 800; font-size: 16px; }
.qty span { min-width: 22px; text-align: center; font-weight: 800; }
.cart-foot { padding: 14px 16px; border-top: 1px solid var(--line); background: var(--panel-2); display: grid; gap: 6px; }
.sumrow { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.sumrow.total { font-size: 22px; font-weight: 800; padding-top: 6px; border-top: 1px solid var(--line); }
.opt-group { margin-bottom: 14px; } .opt-group h4 { margin: 0 0 8px; font-size: 13px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 13px; cursor: pointer; font-weight: 600; }
.opt.on { border-color: var(--gold); background: #fbf1e4; } .opt small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.pay-methods button { padding: 14px 8px; border: 2px solid var(--line); background: #fff; border-radius: 12px; cursor: pointer; font-weight: 700; }
.pay-methods button.on { border-color: var(--gold); background: #fbf1e4; }
.big-input { font-size: 26px !important; font-weight: 800; text-align: right; padding: 12px 14px !important; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.total-box { background: linear-gradient(135deg, #2a1a10, #4a2e1b); color: #fff; border-radius: 14px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; }
.total-box b { font-size: 28px; color: var(--gold-2); }

/* ---------- Barista ---------- */
.kboard { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; align-items: start; }
.kcol { background: rgba(255,255,255,.5); border-radius: 16px; padding: 12px; min-height: 300px; }
.kcol > h3 { margin: 4px 4px 12px; display: flex; justify-content: space-between; }
.ticket { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; border-top: 5px solid var(--info); }
.ticket.processing { border-top-color: var(--warn); } .ticket.ready { border-top-color: var(--ok); }
.ticket.late { animation: pulse 1.5s infinite; } @keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(200,67,57,.25); } }
.ticket .q { font-size: 26px; font-weight: 900; } .ticket .meta { font-size: 12px; color: var(--muted); }
.ticket ul { list-style: none; padding: 0; margin: 10px 0; } .ticket li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.ticket li b { font-size: 15px; } .ticket .mods { font-size: 12px; color: var(--ink-2); } .ticket .note { background: #fff6e0; padding: 4px 8px; border-radius: 6px; font-size: 12px; margin-top: 3px; }

/* ---------- Dashboard / mode TV ---------- */
.dash-hero { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
body.tv { --bg: #140c07; --panel: #21150d; --panel-2: #2a1b11; --ink: #f6ead9; --ink-2: #e3d0bb; --muted: #a8927e; --line: #3a2718; }
body.tv .side, body.tv .top, body.tv .foot { display: none; }
body.tv .main { padding: 26px 34px; } body.tv .kpi .value { font-size: 38px; } body.tv canvas.chart { height: 340px; }
body.tv tbody tr:hover td { background: transparent; } body.tv .btn { background: var(--panel-2); color: var(--ink); }
body.tv input { background: var(--panel-2); }

/* ---------- Cetak ---------- */
#print-area { display: none; }
.receipt { font-family: "Consolas", "Courier New", monospace; font-size: 12px; width: 300px; margin: 0 auto; background: #fff; color: #000; padding: 12px; border: 1px dashed #ccc; }
.receipt .c { text-align: center; } .receipt .r { display: flex; justify-content: space-between; gap: 8px; }
.receipt hr { border: 0; border-top: 1px dashed #777; margin: 6px 0; } .receipt .mod { padding-left: 10px; font-size: 11px; }
.receipt .big { font-size: 15px; font-weight: 800; margin: 4px 0; } .receipt .rname { font-size: 15px; } .receipt .rlogo { max-width: 60px; max-height: 60px; filter: grayscale(1); }
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { display: block; position: absolute; left: 0; top: 0; width: 100%; }
  #print-area .receipt { border: 0; padding: 0; width: 100%; }
  #print-area.w58 .receipt { width: 54mm; font-size: 10.5px; } #print-area.w80 .receipt { width: 76mm; }
  @page { margin: 3mm; }
}

/* ---------- Responsif (tablet & HP) ---------- */
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, 1fr); } .pos { grid-template-columns: 1fr 350px; } }
@media (max-width: 900px) {
  .side { position: fixed; left: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  body.nav-open .side { transform: none; }
  .menu-btn { display: inline-block; }
  .clock, .top-title span { display: none; }
  .main { padding: 14px; }
  .g2, .g3, .kboard { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .pos { grid-template-columns: 1fr; height: auto; }
  .products { overflow: visible; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .cart { min-height: 420px; }
  .login-wrap { grid-template-columns: 1fr; } .login-art { padding: 30px; } .login-art h1 { font-size: 36px; } .login-art p, .by-big { display: none; }
  .form-grid, .form-grid.c3 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .g4 { grid-template-columns: 1fr 1fr; } .kpi .value { font-size: 20px; } .user-chip div:not(.av):not(.dropdown) { display: none; } .top { padding: 0 12px; } }
