/* ============================================================
   GeprekPOS — komponen tambahan di atas tema "Nusantara"
   (layar kasir, dashboard realtime, struk, modal, toast)
   ============================================================ */

/* ---------- Utilitas tambahan ---------- */
.grid-3   { grid-template-columns: repeat(3, 1fr); }
.grid-4   { grid-template-columns: repeat(4, 1fr); }
.grid-1-1 { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .grid-3, .grid-4, .grid-1-1 { grid-template-columns: 1fr; } }
.flex-wrap { flex-wrap: wrap; }
.jc-end { justify-content: flex-end; }
.jc-center { justify-content: center; }
.ai-end { align-items: flex-end; }
.gap-1 { gap: 6px; } .gap-3 { gap: 16px; }
.flex-1 { flex: 1; min-width: 0; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fs-11 { font-size: 11px; } .fs-13 { font-size: 13px; } .fs-16 { font-size: 16px; } .fs-20 { font-size: 20px; }
.fw-700 { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.text-good { color: var(--st-good); } .text-crit { color: var(--st-crit); } .text-warn { color: var(--st-warn); }
.text-brand { color: var(--brand); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 6px; }
.hidden { display: none !important; }
.card-body-tight { padding: 12px 16px; }
.divider { border: none; border-top: 1px solid var(--border-soft); margin: 14px 0; }
.nowrap { white-space: nowrap; }

.empty-state { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty-state .lucide { font-size: 34px; color: var(--border); display: block; margin: 0 auto 10px; }

.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border-soft); font-size: 12.5px; color: var(--muted); }

/* ---------- Segmented tabs ---------- */
.tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border-soft); padding: 4px; border-radius: 99px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { border: none; background: transparent; color: var(--ink-2); font: 600 12.5px/1 var(--font); padding: 8px 14px; border-radius: 99px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tabs a:hover, .tabs button:hover { color: var(--brand); }
.tabs a.active, .tabs button.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }

/* ---------- Indikator realtime ---------- */
.live-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 650; color: var(--st-good); }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st-good); box-shadow: 0 0 0 0 rgba(12,163,12,.5); animation: live-pulse 1.8s infinite; }
.live-dot[data-state="reconnect"] { color: var(--st-warn); }
.live-dot[data-state="reconnect"]::before { background: var(--st-warn); }
.live-dot[data-state="off"] { color: var(--st-off); }
.live-dot[data-state="off"]::before { background: var(--st-off); animation: none; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(12,163,12,.45) } 70% { box-shadow: 0 0 0 8px rgba(12,163,12,0) } 100% { box-shadow: 0 0 0 0 rgba(12,163,12,0) } }

/* ---------- Live feed order ---------- */
.feed { max-height: 420px; overflow-y: auto; }
.feed-item { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border-soft); align-items: center; }
.feed-item:last-child { border-bottom: none; }
.feed-item.is-new { animation: feed-in .5s ease; }
@keyframes feed-in { from { background: var(--brand-soft); transform: translateY(-6px); opacity: 0 } to { background: transparent; transform: none; opacity: 1 } }
.feed-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: 17px; }
.feed-main { flex: 1; min-width: 0; }
.feed-title { font-weight: 600; font-size: 13.5px; }
.feed-sub { font-size: 12px; color: var(--muted); }
.feed-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 300; }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); padding: 12px 16px; font-size: 13.5px; min-width: 260px; max-width: 360px; animation: toast-in .25s ease; }
.toast.good { border-left-color: var(--st-good); } .toast.crit { border-left-color: var(--st-crit); } .toast.warn { border-left-color: var(--st-warn); }
.toast .lucide { font-size: 18px; flex-shrink: 0; }
.toast b { display: block; }
@keyframes toast-in { from { transform: translateX(30px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------- Modal ---------- */
.modal-scrim { position: fixed; inset: 0; background: rgba(8,10,14,.55); backdrop-filter: blur(2px); display: none; place-items: center; z-index: 200; padding: 16px; }
.modal-scrim.open { display: grid; }
.modal { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-md); width: min(560px, 100%); max-height: 92vh; display: flex; flex-direction: column; animation: modal-in .2s ease; }
.modal.modal-lg { width: min(820px, 100%); }
.modal.modal-sm { width: min(420px, 100%); }
@keyframes modal-in { from { transform: translateY(12px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border-soft); }
.modal-head h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border-soft); }
@media (max-width: 640px) { .modal-foot { flex-direction: column-reverse; } .modal-foot .btn { width: 100%; } }

/* ---------- LAYAR KASIR ---------- */
.pos-wrap { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }
@media (max-width: 1180px) { .pos-wrap { grid-template-columns: 1fr; } }

.pos-menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
@media (max-width: 520px) { .pos-menu-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

.menu-card { position: relative; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 12px; cursor: pointer; text-align: left; font: inherit; color: var(--ink); display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, transform .1s, box-shadow .15s; }
.menu-card:hover { border-color: var(--brand); box-shadow: var(--shadow-md); }
.menu-card:active { transform: scale(.97); }
.menu-card .m-thumb { height: 66px; border-radius: 8px; display: grid; place-items: center; font-size: 26px; background: var(--brand-soft); color: var(--brand); }
.menu-card .m-name { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.menu-card .m-price { font-weight: 700; font-size: 13.5px; color: var(--brand); font-variant-numeric: tabular-nums; }
.menu-card .m-code { font-size: 11px; color: var(--muted); }
.menu-card.sold-out { opacity: .5; cursor: not-allowed; }
.menu-card.sold-out::after { content: "HABIS"; position: absolute; top: 8px; right: 8px; background: var(--st-crit); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
.menu-card .m-qty { position: absolute; top: 8px; left: 8px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 99px; display: grid; place-items: center; padding: 0 5px; }

/* Keranjang */
.cart { position: sticky; top: 76px; display: flex; flex-direction: column; max-height: calc(100vh - 96px); }
@media (max-width: 1180px) { .cart { position: static; max-height: none; } }
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
.cart-items { overflow-y: auto; flex: 1; min-height: 120px; }
.cart-item { padding: 11px 16px; border-bottom: 1px solid var(--border-soft); display: flex; gap: 10px; align-items: flex-start; }
.cart-item .ci-main { flex: 1; min-width: 0; }
.cart-item .ci-name { font-weight: 600; font-size: 13.5px; }
.cart-item .ci-opts { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.cart-item .ci-note { font-size: 11.5px; color: var(--st-warn); margin-top: 2px; }
.cart-item .ci-price { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-top: 3px; }
.cart-item .ci-sub { font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qty-ctl { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.qty-ctl button { width: 26px; height: 26px; border: none; background: var(--surface); color: var(--ink-2); cursor: pointer; display: grid; place-items: center; font-size: 14px; }
.qty-ctl button:hover { background: var(--brand-soft); color: var(--brand); }
.qty-ctl span { min-width: 26px; text-align: center; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.cart-sum { padding: 12px 16px; border-top: 1px solid var(--border-soft); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.sum-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); padding: 2.5px 0; }
.sum-row.total { font-size: 18px; font-weight: 700; color: var(--ink); padding-top: 8px; margin-top: 6px; border-top: 1px dashed var(--border); }
.sum-row .num { font-variant-numeric: tabular-nums; }

/* Pilihan opsi (level pedas / topping) */
.opt-group { margin-bottom: 18px; }
.opt-group h4 { font-size: 13px; display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.opt-group h4 .req { color: var(--st-crit); font-size: 11px; }
.opt-list { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-pill { border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 8px 14px; font: 600 12.5px/1 var(--font); color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all .12s; }
.opt-pill:hover { border-color: var(--brand); color: var(--brand); }
.opt-pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.opt-pill .plus { font-size: 11px; opacity: .8; font-variant-numeric: tabular-nums; }

/* Keypad pembayaran */
.pay-total { text-align: center; padding: 14px; background: var(--brand-soft); border-radius: var(--radius-sm); margin-bottom: 16px; }
.pay-total .lbl { font-size: 12px; color: var(--brand); font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.pay-total .val { font-size: 30px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.quick-cash { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
@media (max-width: 480px) { .quick-cash { grid-template-columns: repeat(2, 1fr); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.keypad button { padding: 14px 0; font: 700 17px/1 var(--font); border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: var(--radius-sm); cursor: pointer; }
.keypad button:hover { border-color: var(--brand); color: var(--brand); }
.pay-change { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--st-good-soft); color: var(--st-good); font-weight: 700; margin-top: 12px; }
.pay-change.kurang { background: var(--st-crit-soft); color: var(--st-crit); }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 520px) { .method-grid { grid-template-columns: repeat(2, 1fr); } }
.method-btn { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 12px 8px; font: 600 12.5px/1.2 var(--font); color: var(--ink-2); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.method-btn .lucide { font-size: 20px; }
.method-btn:hover { border-color: var(--brand); color: var(--brand); }
.method-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Bar bawah POS untuk layar kecil */
.pos-bottom { display: none; }
@media (max-width: 1180px) {
  .pos-bottom { display: flex; position: sticky; bottom: 0; z-index: 30; gap: 10px; padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -6px 20px -10px rgba(0,0,0,.3); align-items: center; margin: 0 -16px -40px; }
}

/* ---------- Meter / progres berlabel ---------- */
.meter { display: flex; flex-direction: column; gap: 5px; }
.meter-top { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); }
.meter .progress > span.good { background: var(--st-good); }
.meter .progress > span.warn { background: var(--st-warn); }
.meter .progress > span.crit { background: var(--st-crit); }

/* ---------- Grafik garis ---------- */
.viz .line { fill: none; stroke: var(--viz-series-1); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.viz .area { fill: var(--viz-series-1); opacity: .10; }
.viz .dot { fill: var(--surface); stroke: var(--viz-series-1); stroke-width: 2; }
.viz .hit { fill: transparent; cursor: pointer; }

/* ---------- Struk thermal 58mm ---------- */
.receipt {
  width: 58mm; max-width: 100%; margin: 0 auto; background: #fff; color: #000;
  font: 12px/1.45 "Courier New", ui-monospace, monospace; padding: 6mm 4mm;
}
.receipt .r-center { text-align: center; }
.receipt .r-title { font-size: 14px; font-weight: 700; letter-spacing: .04em; }
.receipt hr { border: none; border-top: 1px dashed #000; margin: 6px 0; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { vertical-align: top; padding: 1px 0; }
.receipt .r-right { text-align: right; white-space: nowrap; }
.receipt .r-item { font-weight: 700; }
.receipt .r-sub { font-size: 11px; padding-left: 6px; }
.receipt .r-total { font-size: 13px; font-weight: 700; }
.receipt .r-qr { margin: 8px auto 0; display: block; }
.receipt-shell { background: var(--surface-2); padding: 24px 12px; border-radius: var(--radius); display: grid; place-items: center; }
.receipt-paper { box-shadow: var(--shadow-md); border-radius: 4px; overflow: hidden; }

@media print {
  @page { size: 58mm auto; margin: 0; }
  body { background: #fff !important; }
  body * { visibility: hidden; }
  .receipt, .receipt * { visibility: visible; }
  .receipt { position: absolute; left: 0; top: 0; width: 58mm; box-shadow: none; padding: 2mm 3mm; }
  .no-print, .sidebar, .topbar, .footer, .scrim, .toast-wrap { display: none !important; }
}

/* ---------- Layar login PIN ---------- */
.pin-dots { display: flex; gap: 10px; justify-content: center; margin: 14px 0 4px; }
.pin-dots span { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border); }
.pin-dots span.filled { background: var(--brand); border-color: var(--brand); }
.user-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.user-pick button { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 14px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; font: 600 12.5px var(--font); color: var(--ink); }
.user-pick button:hover { border-color: var(--brand); }

/* ---------- Mode fullscreen (monitoring TV) ---------- */
body.is-fullscreen .content { max-width: none; }
.icon-btn .ic-minimize { display: none; }
body.is-fullscreen .icon-btn .ic-maximize { display: none; }
body.is-fullscreen .icon-btn .ic-minimize { display: block; }

/* ---------- Pemilih outlet di navbar ---------- */
.outlet-pick { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 6px 12px 6px 14px; font: 600 12.5px/1 var(--font); color: var(--ink-2); cursor: pointer; }
.outlet-pick:hover { border-color: var(--brand); color: var(--brand); }
.outlet-pick select { border: none; background: transparent; font: inherit; color: inherit; outline: none; cursor: pointer; }
@media (max-width: 760px) { .outlet-pick { display: none; } }

/* ---------- Dropdown user ---------- */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); min-width: 210px; padding: 6px; display: none; z-index: 60; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--ink-2); font: 500 13.5px var(--font); border: none; background: none; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); color: var(--ink); }
.dropdown-menu .dd-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--border-soft); margin-bottom: 4px; }
.dropdown-menu .dd-head b { display: block; font-size: 13.5px; }
.dropdown-menu .dd-head span { font-size: 11.5px; color: var(--muted); }

/* ---------- Flash message ---------- */
.flash { margin-bottom: 16px; }
