/* Juragan Kopi — Order Console (navy · gold · cream) */
@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800&family=Source+Sans+3:wght@400;500;600;700&display=swap");

:root {
  --bg: #f3eed8;
  --surface: #faf8f2;
  --surface-2: #eee8d4;
  --border: #d4c9a8;
  --text: #0a0f1d;
  --muted: #5c6478;
  --sidebar: #0a0f1d;
  --sidebar-hover: #121a2e;
  --sidebar-text: #a8b0c4;
  --sidebar-active: #f5f0e6;
  --gold: #c9a227;
  --gold-light: #e8d48a;
  --gold-dark: #8b6914;
  --accent: var(--gold);
  --accent-hover: #b8921f;
  --accent-soft: #f7efd4;
  --accent-2: #3d5a80;
  --accent-2-soft: #e8eef5;
  --success-bg: #ecfdf5;
  --success-text: #047857;
  --danger-bg: #fef2f2;
  --danger-text: #b91c1c;
  --green-badge: #ecfdf5;
  --green-text: #047857;
  --red-badge: #fef2f2;
  --red-text: #b91c1c;
  --tag-bg: #e8ecf4;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  background-image: radial-gradient(ellipse at 20% 0%, rgba(201, 162, 39, 0.08), transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(10, 15, 29, 0.04), transparent 50%);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-size: 14px;
  font-family: inherit;
}

input, select, textarea {
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

#app {
  display: flex;
  min-height: 100vh;
}

/* —— Sidebar —— */
.app-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--sidebar);
  background-image: radial-gradient(circle at 50% 0%, rgba(201, 162, 39, 0.12), transparent 45%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(201, 162, 39, 0.22);
  box-shadow: 4px 0 24px rgba(10, 15, 29, 0.15);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 20px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 20px;
}

.brand-logo-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--gold-light);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(201, 162, 39, 0.35);
}

.brand-block.brand-wordmark {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.brand-wordmark img {
  width: 100%;
  max-width: 210px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.brand-wordmark span {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sidebar-text);
  text-align: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-family: "Cinzel", Georgia, serif;
  color: var(--sidebar-active);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.brand-text span {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sidebar-text);
  margin-top: 2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  text-align: left;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  color: var(--sidebar-text);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.22), rgba(201, 162, 39, 0.08));
  color: var(--gold-light);
  border: 1px solid rgba(201, 162, 39, 0.45);
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-foot .nav-item {
  font-size: 12px;
}

.sidebar-foot .btn-sidebar-primary {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: var(--sidebar);
  font-weight: 700;
  justify-content: center;
  border: 1px solid var(--gold-dark);
}

.sidebar-foot .btn-sidebar-primary:hover {
  filter: brightness(1.06);
  color: var(--sidebar);
}

/* —— Main —— */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 48px;
}

.main-header {
  padding: 20px 28px 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.main-header h1 {
  font-family: "Cinzel", Georgia, serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
}

.main-header p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  max-width: 520px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* legacy topbar hidden — struktur baru pakai sidebar */
.topbar { display: none; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px 0;
  width: 100%;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.pool-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.merchant-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
}

.merchant-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

.count-badge {
  background: var(--surface);
  color: var(--gold-dark);
  border: 1px solid var(--gold);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  margin-left: 10px;
}

.tags-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tag-filter {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag-filter .num {
  color: var(--muted);
  font-weight: 600;
}

.tag-filter.active {
  background: var(--sidebar);
  border-color: var(--gold);
  color: var(--gold-light);
}

.tag-filter.active .num {
  color: rgba(255, 255, 255, 0.85);
}

.acc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

@media (max-width: 720px) {
  #app {
    flex-direction: column;
  }
  .app-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 14px;
  }
  .brand-block {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }
  .brand-wordmark img {
    max-width: 150px;
  }
  .brand-wordmark span {
    display: none;
  }
  .sidebar-nav,
  .sidebar-foot {
    flex-direction: row;
    flex-wrap: wrap;
    border: none;
    padding-top: 0;
  }
  .container {
    padding: 0 16px;
  }
  .ui-error-banner {
    margin: 0 16px 12px;
  }
}

.acc-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.acc-card:hover {
  border-color: #c7d2e8;
  box-shadow: var(--shadow);
}

.acc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--sidebar);
  color: var(--gold-light);
  border: 1px solid rgba(201, 162, 39, 0.45);
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.acc-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.acc-code {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.acc-meta {
  font-size: 12px;
  color: var(--muted);
}

.acc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.mini-tag {
  background: var(--tag-bg);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mini-tag.dashed {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}

.acc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  gap: 10px;
}

.acc-actions-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-outline {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}

.btn-outline:hover {
  background: var(--surface-2);
}

.btn-pakai {
  background: linear-gradient(180deg, #d4b84a, var(--gold));
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 13px;
  color: var(--sidebar);
  border: 1px solid var(--gold-dark);
}

.btn-pakai:hover {
  filter: brightness(1.05);
}

.pill-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pill-btn:hover {
  background: var(--surface-2);
}

.pill-btn.gold,
.pill-btn.gold:hover {
  background: var(--sidebar);
  border-color: var(--gold);
  color: var(--gold-light);
}

.sub-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.outlet-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.menu-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  margin-top: 16px;
}

@media (max-width: 820px) {
  .menu-layout {
    grid-template-columns: 1fr;
  }
}

.cat-sidebar {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: fit-content;
}

.cat-btn {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
}

.cat-btn:hover {
  background: var(--surface);
  color: var(--text);
}

.cat-btn.active {
  background: var(--surface);
  border-color: var(--gold);
  color: var(--gold-dark);
  box-shadow: 0 1px 4px rgba(201, 162, 39, 0.2);
}

.prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.prod-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.prod-img {
  width: 100%;
  height: 130px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.prod-name {
  font-weight: 800;
  font-size: 13px;
  line-height: 1.35;
}

.prod-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.prod-price {
  font-weight: 800;
  font-size: 14px;
  color: var(--gold-dark);
}

.btn-plus {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--sidebar);
  color: var(--gold-light);
  border: 1px solid var(--gold);
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 920px) {
  .checkout-grid {
    grid-template-columns: 1fr;
  }
}

.setting-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.pay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.pay-card {
  border: 2px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
}

.pay-card.active {
  border-color: var(--gold);
  background: var(--accent-soft);
}

.summary-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 16px 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}

.summary-row.total {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 8px;
  font-weight: 800;
  font-size: 17px;
  color: var(--text);
}

.btn-bayar-full {
  width: 100%;
  background: linear-gradient(180deg, #d4b84a, var(--gold-dark));
  padding: 15px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 14px;
  color: var(--sidebar);
  border: 1px solid var(--gold-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-bayar-full:hover {
  filter: brightness(1.05);
}

.btn-bayar-full:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ui-error-banner {
  margin: 0 28px 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  color: var(--danger-text);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.scan-progress-panel {
  border-color: var(--gold) !important;
  background: var(--accent-soft) !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 26, 0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  background: var(--surface);
  border-radius: 18px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 16px;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  gap: 12px;
}

.opt-group {
  margin-bottom: 16px;
}

.opt-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
}

.opt-title span {
  color: var(--accent-2);
}

.opt-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.opt-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}

.opt-pill.active {
  background: var(--accent-soft);
  border-color: var(--gold);
  color: var(--gold-dark);
  font-weight: 800;
}

.native-receipt-wrap {
  max-width: 420px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.native-top {
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface) 100%);
  padding: 20px;
  text-align: center;
}

.native-steps {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin: 16px 0;
}

.native-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sidebar);
  color: var(--gold-light);
  border: 1px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin: 0 auto 6px;
  font-size: 13px;
}

.native-card {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 12px 16px;
  text-align: left;
  border: 1px solid var(--border);
}

.queue-giant {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  margin: 10px 0;
  color: var(--gold-dark);
  font-family: "Cinzel", Georgia, serif;
}

.progress-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}

.progress-bar-seg {
  height: 6px;
  border-radius: 99px;
  background: var(--gold);
  margin-bottom: 6px;
}

.debug-panel {
  background: #0b0f1a !important;
  color: #cbd5e1 !important;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  border-color: #1e293b !important;
}

.debug-panel-title {
  color: var(--gold-light) !important;
}

.sales-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.sales-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.sales-card .lbl { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sales-card .num { font-size: 26px; font-weight: 800; margin-top: 4px; }
.sales-card .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.sales-card.gold { border-color: rgba(201,162,39,.45); background: linear-gradient(180deg, #fffdf6, var(--surface)); }
.ref-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.ref-block h3 { font-size: 16px; margin-bottom: 4px; }
.ref-meta { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.sales-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sales-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.sales-table td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.sales-table tr:last-child td { border-bottom: none; }
.drink-line { color: var(--muted); font-size: 12px; margin-top: 2px; }
