/* Tambahan di atas app.css (template) untuk halaman EJS. */

.alert.flash { display: block; margin-bottom: 20px; }
.alert.flash + .alert.flash { margin-top: -10px; }
.badge:empty { display: none; }
.flash a { color: var(--primary); font-weight: 600; }

.select--sm { width: auto; padding: 7px 28px 7px 10px; font-size: 12px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 18px;
  align-items: end;
}
.form-grid .field { margin: 0; }
.form-grid .field--wide { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-start; }
.form-grid--inline { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
.form-grid--inline .form-actions .btn { height: 40px; }
.form-grid--products { grid-template-columns: repeat(5, minmax(0, 1fr)) auto; }
.input--color { padding: 4px; height: 40px; cursor: pointer; }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.row-actions form { margin: 0; }
.muted-xs { font-size: 11px; color: var(--t-light); }

details.payload summary { cursor: pointer; font-size: 12px; color: var(--primary); font-weight: 600; }
details.payload pre {
  margin-top: 8px; max-width: 360px; max-height: 220px; overflow: auto;
  padding: 10px; border-radius: 8px;
  background: var(--bg-muted); color: var(--t-base);
  font-family: 'JetBrains Mono', monospace; font-size: 11px; line-height: 1.5;
}

.qr-box img { width: 100%; height: 100%; display: block; object-fit: contain; transition: opacity 300ms, filter 300ms; }
.qr-box.is-expired img { opacity: .12; filter: blur(1px); }
.qr-box img:not([src]) { visibility: hidden; }

.pulsa-error { margin-top: 12px; font-size: 13px; color: var(--danger); text-align: center; }
.pulsa-error[hidden] { display: none; }

a.pager-btn { text-decoration: none; }

@media (max-width: 900px) {
  .form-grid, .form-grid--inline, .form-grid--products { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .form-grid, .form-grid--inline, .form-grid--products { grid-template-columns: 1fr; }
  .form-grid .field--wide { grid-column: auto; }
}
[hidden] { display: none !important; }

/*  Order  */
.order-center { max-width: 880px; margin: 0 auto; }
.oc-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.oc-back {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--t-base);
}
.oc-back:hover { background: var(--bg-muted); }
.oc-back svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; }
.oc-title { font-family: 'Inter Tight', 'Inter', sans-serif; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--t-base); flex: 1; }
.oc-search { width: 260px; }
.oc-search .input { padding-top: 8px; padding-bottom: 8px; }

.oc-tabs { display: flex; gap: 28px; overflow-x: auto; margin-bottom: 18px; scrollbar-width: none; }
.oc-tabs::-webkit-scrollbar { display: none; }
.oc-tab {
  position: relative; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 2px 12px;
  font-size: 16px; font-weight: 500; color: var(--t-base);
  text-decoration: none;
}
.oc-tab:hover { color: var(--primary); }
.oc-tab.is-active { color: var(--primary); }
.oc-tab.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: 0;
  width: 28px; height: 4px; border-radius: 4px;
  background: var(--primary); transform: translateX(-50%);
}
.oc-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: inline-grid; place-items: center;
  background: var(--bg-muted); color: var(--t-muted);
  font-size: 11px; font-weight: 600;
}
.oc-tab.is-active .oc-count { background: var(--primary-soft); color: var(--primary); }

.oc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  min-height: 560px;
  padding: 8px 22px 18px;
  display: flex; flex-direction: column;
}
.oc-empty {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  font-size: 14px; color: var(--t-muted);
  padding: 60px 0;
}
.oc-empty svg { width: 150px; height: auto; }
.oc-empty-shadow { fill: var(--bg-muted); }
.oc-empty-top { fill: #F1F4FA; }
.oc-empty-left { fill: #E2E7F2; }
.oc-empty-right { fill: #D5DCEC; }

.oc-list { list-style: none; margin: 0; padding: 0; flex: 1; }
.oc-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-soft);
}
.oc-item:last-child { border-bottom: 0; }
.oc-item > .op-badge { width: 40px; height: 40px; font-size: 10px; }
.oc-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.oc-name { font-size: 14.5px; font-weight: 600; color: var(--t-base); }
.oc-meta { font-size: 12px; color: var(--t-muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.oc-meta .data-cell-mono { font-size: 11.5px; }
.oc-dot { color: var(--t-light); }
.oc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.oc-side form { margin: 0; }
.oc-amount { font-family: 'Inter Tight', 'Inter', sans-serif; font-size: 16px; font-weight: 700; color: var(--t-base); }

@media (max-width: 720px) {
  .oc-head { flex-wrap: wrap; }
  .oc-search { width: 100%; order: 3; }
  .oc-tabs { gap: 20px; }
  .oc-tab { font-size: 15px; }
  .oc-card { padding: 4px 14px 14px; min-height: 420px; }
  .oc-item { align-items: flex-start; }
}

/* ===== Halaman Top Up: latar gradasi biru seperti referensi ===== */
.page-topup .main {
  background: linear-gradient(180deg, #1f3a9e 0%, #2f5fd6 22%, #6f8fe6 55%, #b9c6f2 85%, #dfe5f8 100%);
  min-height: 100vh;
}
.page-topup .d-topbar { background: #fff; }
.page-topup .content { flex: 1; }
.page-topup .d-footer { color: rgba(255, 255, 255, .85); }

/* Banner menyatu dengan latar */
.page-topup .banner {
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, .18) 0, transparent 45%),
    linear-gradient(135deg, #142a7a, #1f45c4 60%, #2f6bf0);
  box-shadow: 0 10px 30px rgba(10, 25, 80, .25);
}

/* Kartu putih membulat di atas latar biru */
.page-topup .card {
  border: 0;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(15, 30, 90, .12);
}
.page-topup .card-head { border-bottom-color: #eef1f6; }

/* Tombol pilih nominal: abu-abu terang */
.page-topup .nominal {
  background: #f1f3f6;
  border-color: transparent;
}
.page-topup .nominal:hover {
  background: #e8ebf0;
  border-color: transparent;
}
.page-topup .nominal.is-active {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.page-topup .nominal-val { color: #14213d; }
.page-topup .nominal-price { color: #6b7280; }

/* Kartu QRIS & hasil juga putih penuh */
.page-topup .qris-card,
.page-topup .result-card { border: 0; }

/* ===== Login admin ===== */
.login-back { font-size: 12.5px; color: var(--t-muted); display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.login-back:hover { color: var(--t-base); }
.auth-card .alert.flash { margin-bottom: 16px; }
.sidebar-login { justify-content: center; text-decoration: none; }
.sidebar-login svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; fill: none; }
.dd-logout { margin: 0; }
.dd-logout .dd-menu-item { width: 100%; background: none; border: 0; text-align: left; cursor: pointer; font: inherit; }
.topbar-actions .btn--sm { text-decoration: none; }
