@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@400;600;700&display=swap');

:root {
  --bg: #1a0f0a;
  --surface: #2a1810;
  --border: rgba(232, 184, 74, 0.25);
  --yellow: #e8b84a;
  --muted: #c9b896;
  --red: #cf142b;
  --green: #2ecc71;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: #f5f5f5;
  min-height: 100vh;
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
}

.branch-picker {
  padding: 0 1rem 1rem;
}

.branch-picker label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.branch-picker select {
  width: 100%;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: #fff;
  font-family: inherit;
}

.branch-label {
  font-size: 0.85rem;
  color: var(--yellow);
  margin-right: 0.75rem;
}

.login-card h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: var(--yellow);
  letter-spacing: 0.05em;
}

.muted { color: var(--muted); font-size: 0.9rem; margin: 0.5rem 0 1.5rem; }
.hint { font-size: 0.75rem; color: var(--muted); margin-top: 1rem; }
.hint code { background: #222; padding: 0.15rem 0.4rem; border-radius: 4px; }
.error { color: #ff6b6b; font-size: 0.9rem; margin-bottom: 0.75rem; padding: 0.5rem; background: rgba(231,76,60,0.15); border-radius: 6px; }
.error[hidden] { display: none !important; }

label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

label input, label select, label textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.85rem;
  font: inherit;
  color: #fff;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
}

.admin-app {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0;
}

.brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.75rem;
  padding: 0 1.25rem 1.5rem;
  letter-spacing: 0.05em;
}

.brand span { color: var(--yellow); }

.sidebar-nav button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1.25rem;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.sidebar-nav button.active,
.sidebar-nav button:hover {
  color: var(--yellow);
  background: rgba(226, 247, 6, 0.06);
  border-left-color: var(--yellow);
}

.sidebar-foot {
  margin-top: auto;
  padding: 1rem 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.main {
  padding: 1.5rem 2rem;
  overflow-x: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.topbar h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  color: var(--yellow);
}

.panel { display: none; }
.panel.active { display: block; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}

.stat-card span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
}

.stat-card strong {
  font-size: 2rem;
  color: var(--yellow);
}

.toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.btn-primary { background: var(--yellow); color: #111; }
.btn-ghost { background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.12); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-danger { background: var(--red); color: #fff; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th, td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

th { color: var(--muted); font-weight: 600; font-size: 0.7rem; text-transform: uppercase; }

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pending { background: rgba(241,196,15,0.2); color: #f1c40f; }
.status-confirmed { background: rgba(52,152,219,0.2); color: #3498db; }
.status-preparing { background: rgba(155,89,182,0.2); color: #9b59b6; }
.status-delivery { background: rgba(46,204,113,0.2); color: #2ecc71; }
.status-completed { background: rgba(149,165,166,0.2); color: #bdc3c7; }
.status-cancelled { background: rgba(231,76,60,0.2); color: #e74c3c; }

.options-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.options-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  min-height: 300px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 0.35rem;
}

.list-item:hover, .list-item.selected {
  background: rgba(226, 247, 6, 0.08);
}

.list-item.selected { border: 1px solid var(--border); }

.settings-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  padding-bottom: 0;
  border-bottom: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}

.settings-tabs__btn {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}

.settings-tabs__btn:hover {
  color: var(--text);
}

.settings-tabs__btn.active {
  color: var(--yellow);
  border-bottom-color: var(--yellow);
}

.settings-tab-panels {
  min-height: 200px;
}

.settings-tab-panel[hidden] {
  display: none !important;
}

.settings-form-footer {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--bg);
  z-index: 2;
}

.settings-form fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.settings-form legend {
  color: var(--yellow);
  font-weight: 700;
  padding: 0 0.5rem;
}

.tier-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.payment-row {
  display: grid;
  grid-template-columns: 1fr 7rem 5rem auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.payment-row select {
  width: 100%;
}

.payment-row .checkbox {
  margin: 0;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .payment-row {
    grid-template-columns: 1fr 1fr;
  }
  .payment-row .checkbox {
    grid-column: 1;
  }
  .payment-row [data-rm-payment] {
    grid-column: 2;
    justify-self: end;
  }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal[hidden] { display: none !important; }

.modal__box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal__box h2 {
  color: var(--yellow);
  margin-bottom: 1rem;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.05em;
}

.modal__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  justify-content: flex-end;
}

.checkbox { display: flex; align-items: center; gap: 0.5rem; }
.checkbox input { width: auto; margin: 0; }

.bcv-status {
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(226, 247, 6, 0.06);
  border: 1px solid rgba(226, 247, 6, 0.15);
  border-radius: 8px;
}

.bcv-status a { color: var(--yellow); }
.bcv-ok { color: #2ecc71; }
.bcv-err { color: #ff6b6b; }
.bcv-actions { margin: 0.75rem 0 1rem; }

.bcv-info {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 1rem;
  background: rgba(232, 184, 74, 0.08);
  border: 1px solid rgba(232, 184, 74, 0.25);
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}

.bcv-info a { color: var(--yellow); }
.bcv-info strong { color: #f5e6c8; }

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--yellow);
  color: #111;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 2000;
}

.toast.show { opacity: 1; }

@media (max-width: 768px) {
  .admin-app { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; }
  .sidebar-nav { display: flex; flex-wrap: wrap; width: 100%; }
  .options-layout { grid-template-columns: 1fr; }
}
