:root {
  --bg: #05080f;
  --surface: #0c1220;
  --surface-hover: #121a2c;
  --border: rgba(212, 175, 55, 0.2);
  --text: #f3efe6;
  --muted: #94a0b8;
  --accent: #c9a227;
  --accent-hover: #e4c04a;
  --gold: #d4af37;
  --gold-soft: rgba(212, 175, 55, 0.14);
  --success: #34d399;
  --error: #f87171;
  --warning: #fbbf24;
  --radius: 12px;
  --font-display: 'Cinzel', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html,
body {
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  font-family: inherit;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 0.9rem;
}

.wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
}

.card-wide {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 12px;
  outline: none;
  font-size: 0.9rem;
}

.button {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  transition: background var(--radius) ease, opacity 0.15s ease;
}

.button:hover:not(:disabled) {
  background: var(--accent-hover);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.field {
  margin-bottom: 4px;
}

.label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.hidden {
  display: none !important;
}

.loading-text {
  color: var(--gold);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.loading-text {
  color: var(--gold);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

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

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

.balance-badge {
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(212, 175, 55, 0.25);
}

.logout-btn {
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--error);
  font-size: 0.8rem;
  font-weight: 600;
}

.tab-row {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.tab-btn {
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

#clear-selection {
  display: none !important;
}

.selected-banner {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 0.85rem;
  margin-bottom: 12px;
  display: block;
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.selected-banner span {
  min-width: 0;
  flex: 1;
  line-height: 1.45;
  word-break: break-word;
}

.selected-banner #selected-title {
  display: inline;
  word-break: break-word;
}

.selected-banner button {
  background: none;
  border: none;
  color: var(--error);
  font-size: 0.8rem;
}

.voucher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.voucher-card {
  padding: 14px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

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

.voucher-card small {
  color: var(--muted);
  display: block;
  margin: 4px 0;
}

/* User voucher images: uniform 3:2 card frame */
.mcd-voucher-grid .voucher-card img,
#saved-panel .voucher-card img,
.voucher-grid .voucher-card img {
  width: 100% !important;
  aspect-ratio: 3 / 2;
  height: auto !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(212, 175, 55, 0.22);
}

.select-btn {
  margin-top: 10px;
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
}

.log-section {
  margin-top: 20px;
}

.log-tabs {
  margin-bottom: 12px;
}

.history-scroll {
  max-height: 240px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  font-size: 0.82rem;
}

.history-table thead th {
  position: sticky;
  top: 0;
  text-align: left;
  padding: 10px 12px;
  background: var(--surface-hover);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.history-table td {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

.history-table td:first-child {
  white-space: nowrap;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.history-empty-row td {
  color: var(--muted);
  text-align: center;
}

.redirect-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
}

.redirect-card .title {
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.redirect-text {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.redirect-button {
  display: inline-block;
  padding: 14px 24px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.redirect-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.redirect-actions .redirect-button {
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.redirect-actions .mcd-btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.login-field {
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
}

.admin-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
}

.admin-logout {
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 8px 18px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.tab.active {
  background: var(--accent);
  color: #fff;
}

.main {
  flex: 1;
  padding: 24px;
}

.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.form-row .input {
  flex: 1;
  min-width: 140px;
  margin-bottom: 0;
}

.input-sm {
  width: 120px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.add-btn {
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

.table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.table-header {
  display: flex;
  padding: 12px 16px;
  background: var(--bg);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
}

.table-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}

.row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}

.table-empty {
  padding: 16px;
  color: var(--muted);
}

.badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge.on {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.badge.off {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

.badge.info {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
}

.tx-row-unpaid {
  opacity: 0.92;
  background: rgba(239, 68, 68, 0.04);
}

.small-btn {
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface-hover);
  color: var(--text);
  font-size: 0.78rem;
  border: 1px solid var(--border);
}

.small-btn.danger {
  color: var(--error);
}

.mono {
  font-family: monospace;
}

.mono.license-ready {
  color: #ffe08a;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.pw-card {
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}

.pw-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.pw-msg {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.pw-msg.ok {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
  border: 1px solid var(--success);
}

.pw-msg.err {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid var(--error);
}

.col-2 {
  flex: 2;
}

.col-1 {
  flex: 1;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.health-monitor-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.health-monitor-pill {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.health-monitor-pill.ok {
  background: rgba(34, 197, 94, 0.14);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.28);
}

.health-monitor-pill.warn {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.health-monitor-pill.error {
  background: rgba(239, 68, 68, 0.14);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.health-monitor-text {
  font-size: 0.84rem;
  color: var(--muted);
}

.health-monitor-note {
  font-size: 0.82rem;
  color: var(--text-dim);
}

@media (max-width: 640px) {
  input,
  select,
  textarea,
  button,
  .input,
  .button {
    font-size: 16px !important;
  }

  .input,
  .button,
  .logout-btn,
  .admin-logout,
  .topup-btn,
  .tab-btn {
    min-height: 44px;
  }

  .wrapper {
    padding: 12px;
  }

  .card,
  .card-wide {
    padding: 18px 14px;
    border-radius: 14px;
  }

  .redirect-card {
    padding: 20px 14px;
    border-radius: 14px;
  }

  .voucher-grid {
    grid-template-columns: 1fr;
  }

  .history-scroll {
    max-height: 56vh;
  }

  .history-table {
    font-size: 0.9rem;
  }

  .history-table thead th {
    font-size: 0.74rem;
    padding: 10px;
  }

  .history-table td {
    padding: 11px 10px;
  }

  .admin-header {
    padding: 12px 16px;
  }

  .logo {
    font-size: 1.05rem;
  }

  .main {
    padding: 16px;
  }

  .tabs {
    padding: 10px 12px;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar {
    display: none;
  }
  .tab {
    white-space: nowrap;
    flex: 0 0 auto;
    padding: 9px 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .form-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .form-row .input,
  .form-row .input-sm,
  .form-row .add-btn {
    width: 100%;
    min-width: 0;
  }
  .add-btn {
    padding: 12px 18px;
  }

  .table {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
  }
  .table-header {
    display: none;
  }
  .table-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 14px;
    margin-bottom: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
  }
  .row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 14px;
    margin-bottom: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
  }
  .table-row > span {
    flex: none !important;
    width: 100%;
  }
  .row > span {
    flex: none !important;
    width: 100%;
  }
  .table-row > span:first-child {
    display: block;
    padding-bottom: 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
  }
  .row > span:first-child {
    display: block;
    padding-bottom: 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
  }
  .table-row > span[data-label] {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }
  .row > span[data-label] {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }
  .table-row > span[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex: 0 0 auto;
  }
  .row > span[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex: 0 0 auto;
  }
  .table-row span[data-label] .input-sm {
    width: 120px;
  }
  .row-actions {
    width: 100%;
    gap: 8px;
    padding-top: 4px;
  }
  .row-actions .small-btn {
    flex: 1;
    padding: 10px;
    text-align: center;
  }

  .pw-card {
    max-width: 100%;
    padding: 18px;
  }

  .admin-logout {
    min-height: 40px;
    font-size: 0.84rem;
  }

  .license-search-box .button,
  .license-search-box .logout-btn,
  .license-search-box .admin-logout {
    width: 100%;
    min-height: 42px;
  }

  .admin-layout {
    width: 100%;
    overflow-x: hidden;
  }

  .admin-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .header-actions .admin-logout,
  .header-actions button.admin-logout {
    width: 100%;
    min-height: 44px;
    padding: 10px 10px;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
  }

  .main {
    padding: 12px;
  }

  .row-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 8px;
  }

  .row-actions .small-btn {
    width: 100%;
  }

  .table-row > span[data-label],
  .row > span[data-label] {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .table-row > span[data-label]::before,
  .row > span[data-label]::before {
    line-height: 1.1;
  }

  .table-row span[data-label] .input-sm {
    width: 100%;
  }

  .license-search-box {
    grid-template-columns: 1fr;
  }

  .license-metrics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .logo {
    font-size: 0.95rem;
    letter-spacing: 0.04em;
  }

  .header-actions {
    grid-template-columns: 1fr;
  }
}

.voucher-thumb {
  width: 72px;
  height: 48px;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  background: rgba(0, 0, 0, 0.2);
}

.voucher-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-hover);
  color: var(--muted);
  font-size: 1.6rem;
  font-weight: 700;
}

.voucher-form-card {
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
}

.vform {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vform .input {
  margin-bottom: 0;
}

.vform-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.vform-actions .button {
  flex: 1;
  width: auto;
}

.voucher-toggle {
  margin-bottom: 16px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

.file-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
}

.file-field:hover {
  border-color: var(--accent);
  color: var(--text);
}

.img-preview {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.voucher-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vcard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.vcard.is-disabled {
  opacity: 0.55;
}

.vthumb {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 10px;
}

.vthumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-hover);
  color: var(--muted);
  font-size: 1.4rem;
  font-weight: 700;
}

.vbody {
  flex: 1;
  min-width: 0;
}

.vtitle {
  display: block;
}

.vsub {
  display: block;
  color: var(--muted);
  margin: 2px 0;
}

.vtebus {
  display: block;
  color: #d4b76a;
  margin: 2px 0 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.vmeta {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: monospace;
}

.vside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.vactions {
  display: flex;
  gap: 6px;
}

@media (max-width: 640px) {
  .voucher-form-card {
    max-width: 100%;
  }
  .vcard {
    flex-wrap: wrap;
  }
  .vbody {
    flex: 1 1 60%;
  }
  .vside {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .vactions {
    flex: 1;
  }
  .vactions .small-btn {
    flex: 1;
    padding: 9px;
  }
}

.topup-btn {
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
}

.topup-btn:hover {
  background: var(--accent-hover);
}

.topup-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.topup-modal.hidden {
  display: none;
}

.topup-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

@media (max-width: 640px) {
  .topup-card {
    padding: 16px 12px;
    border-radius: 14px;
  }

  .topup-close {
    min-width: 40px;
    min-height: 40px;
  }
}

.topup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.topup-close {
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  padding: 4px 8px;
}

.topup-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 8px 0 12px;
}

.topup-preset {
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.85rem;
}

.topup-preset:hover {
  border-color: var(--accent);
}

.topup-pay-line {
  text-align: center;
  margin: 12px 0 4px;
}

.topup-meta {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

#topup-qr-canvas {
  display: block;
  margin: 0 auto 12px;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.topup-status {
  text-align: center;
  margin-bottom: 12px;
  color: var(--warning);
}

.topup-status.success {
  color: var(--success);
}

.button.secondary {
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
}

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

/* ── FN CREATIVE · MCD Theme ── */
.mcd-body {
  position: relative;
  overflow-x: hidden;
}

.mcd-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 80%, rgba(15, 40, 70, 0.35), transparent 40%),
    linear-gradient(180deg, #030508 0%, #05080f 40%, #070c16 100%);
}

.mcd-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4af37' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.mcd-banner-top,
.mcd-banner-wrap,
.mcd-main,
.mcd-footer,
.mcd-body > .wrapper,
.mcd-body > main,
.mcd-body > .admin-layout {
  position: relative;
  z-index: 1;
}

.mcd-banner-top {
  max-width: 920px;
  margin: 20px auto 0;
  padding: 0 16px;
}

.mcd-banner {
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  display: block;
}

.mcd-main {
  max-width: 920px;
  margin: 0 auto;
  padding: 8px 16px 32px;
}

.mcd-panel {
  background: linear-gradient(145deg, rgba(12, 18, 32, 0.95), rgba(8, 12, 22, 0.98));
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 18px;
  padding: 28px 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.mcd-panel-wide {
  padding: 24px 22px;
}

.mcd-panel-head,
.mcd-dash-header {
  margin-bottom: 20px;
}

.mcd-dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.12);
}

.mcd-user-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.mcd-guide-item {
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(9, 14, 24, 0.75);
  border-radius: 10px;
  padding: 10px 12px;
  color: #d8e0ef;
  font-size: 0.8rem;
  line-height: 1.45;
}

.mcd-guide-item strong {
  color: var(--gold);
}

.mcd-quick-actions-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.mcd-quick-btn {
  min-width: 62px;
  padding: 7px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.08));
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
}

.mcd-quick-btn:hover {
  border-color: rgba(228, 192, 74, 0.55);
  color: #f3d67a;
}

.mcd-quick-hint {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 8px;
  color: #d1b972;
}

.mcd-step {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid rgba(212, 175, 55, 0.2);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.mcd-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

.mcd-desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 18px;
}

.mcd-desc em {
  color: var(--gold);
  font-style: normal;
  font-weight: 600;
}

.mcd-input {
  background: rgba(5, 8, 15, 0.8);
  border-color: rgba(212, 175, 55, 0.18);
}

.mcd-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.mcd-btn-primary {
  background: linear-gradient(135deg, #b8922a, #e4c04a);
  color: #1a1205;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 4px;
  box-shadow: 0 8px 20px rgba(180, 142, 33, 0.25);
}

.mcd-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #d4af37, #f0d78c);
}

.mcd-btn-gold {
  background: linear-gradient(135deg, #b8922a, #d4af37);
  color: #1a1205;
  font-weight: 700;
  border: none;
  min-width: 120px;
}

.mcd-btn-gold:hover {
  background: linear-gradient(135deg, #d4af37, #e8c956);
}

.mcd-btn-ghost {
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--muted);
}

.mcd-btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.mcd-hints {
  list-style: none;
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(212, 175, 55, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.1);
}

.mcd-hints li {
  font-size: 0.82rem;
  color: var(--muted);
  padding: 4px 0 4px 18px;
  position: relative;
  line-height: 1.45;
}

.mcd-hints li::before {
  content: '◆';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 0.55rem;
  top: 8px;
}

.mcd-hints strong {
  color: var(--gold);
}

.mcd-trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.mcd-trust-item {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: #e7cc7a;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.license-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 7px 12px;
  font-size: 0.78rem;
  min-height: 34px;
}

.mcd-inline-action {
  margin-top: 10px !important;
}

.mcd-panel .error {
  border-radius: 10px;
}

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

.mcd-balance {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 120px;
}

.mcd-balance-label {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
}

.mcd-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
  opacity: 0.85;
}

.mcd-tabs .tab-btn.active {
  background: linear-gradient(135deg, #b8922a, #d4af37);
  color: #1a1205;
  border-color: transparent;
}

.mcd-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mcd-field-note {
  margin: 2px 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.mcd-mini-note {
  margin-top: 6px;
  color: #cdb778;
  font-size: 0.78rem;
}

.mcd-voucher-grid {
  margin-bottom: 8px;
  scroll-margin-top: 96px;
  -webkit-overflow-scrolling: touch;
}

.mcd-voucher-grid .voucher-card {
  border-color: rgba(212, 175, 55, 0.25);
  background: linear-gradient(160deg, rgba(8, 12, 20, 0.9), rgba(5, 8, 14, 0.95));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.mcd-voucher-grid .voucher-card:hover {
  transform: translateY(-1px);
  border-color: rgba(212, 175, 55, 0.45);
}

.mcd-table-wrap {
  border-color: rgba(212, 175, 55, 0.15);
}

.mcd-log {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.mcd-footer {
  max-width: 920px;
  margin: 0 auto;
  padding: 16px 20px 28px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.mcd-footer-dot {
  margin: 0 8px;
  color: var(--gold);
  opacity: 0.5;
}

.mcd-modal {
  border: 1px solid rgba(212, 175, 55, 0.25);
  background: linear-gradient(160deg, #0c1220, #080d18);
}

.topup-pay-line {
  font-size: 1rem;
}

.topup-meta {
  color: #d2dbeb;
  font-size: 0.82rem;
}

#topup-status {
  font-weight: 700;
}

.mcd-presets .topup-preset:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.mcd-qr-frame {
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  width: fit-content;
  margin: 0 auto 12px;
  border: 2px solid rgba(212, 175, 55, 0.3);
}

.mcd-qr-frame canvas {
  display: block;
  margin: 0;
  padding: 0;
  background: transparent;
}

#loading.wrapper {
  align-items: flex-start;
  padding-top: 40px;
}

.mcd-body > .wrapper {
  align-items: center;
  padding-top: 16px;
}

.logo {
  font-family: var(--font-display);
  color: var(--gold);
  letter-spacing: 0.08em;
}

.login-title {
  font-family: var(--font-display);
  color: var(--gold);
}

/* Hide loyalty/offer id inputs from user-facing page. */
#tab-manual,
#manual-fields,
#manual-panel .mcd-field-grid,
#manual-panel .field label[for="loyalty-input"],
#manual-panel .field label[for="reward-input"],
#manual-panel #loyalty-input,
#manual-panel #reward-input {
  display: none !important;
}

body.mcd-admin-license #tab-manual {
  display: inline-block !important;
}

body.mcd-admin-license .mcd-claim-tabs.hidden {
  display: flex !important;
}

body.mcd-admin-license:not(.mcd-admin-manual-tab) #manual-fields,
body.mcd-admin-license:not(.mcd-admin-manual-tab) #manual-panel .mcd-field-grid {
  display: none !important;
}

body.mcd-admin-license.mcd-admin-manual-tab #manual-fields,
body.mcd-admin-license.mcd-admin-manual-tab #manual-panel .mcd-field-grid {
  display: grid !important;
}

body.mcd-admin-license.mcd-admin-manual-tab #manual-panel .field label[for="loyalty-input"],
body.mcd-admin-license.mcd-admin-manual-tab #manual-panel #loyalty-input {
  display: block !important;
}

body.mcd-admin-license #admin-reward-core-field {
  display: none !important;
}

body.mcd-admin-license #admin-reward-field {
  display: block !important;
}

.mcd-admin-only-field {
  display: none !important;
}

body.mcd-admin-license .mcd-admin-only-field {
  display: block !important;
}

.mcd-admin-only-hint {
  display: none !important;
}

body.mcd-admin-license .mcd-admin-only-hint {
  display: block !important;
  margin-top: 6px;
}

.mcd-admin-claim-status {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.45;
  border: 1px solid rgba(226, 196, 117, 0.22);
  background: rgba(5, 10, 20, 0.55);
  color: #e8edf7;
}

.mcd-admin-claim-status .admin-res-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  font-size: 0.95rem;
}

.mcd-admin-claim-status .admin-res-ok {
  color: #9fddb5;
  font-weight: 600;
}

.mcd-admin-claim-status .admin-res-fail {
  color: #ffb3b3;
  font-weight: 600;
}

.mcd-admin-claim-status .admin-res-now,
.mcd-admin-claim-status .admin-res-single {
  font-size: 0.9rem;
}

.mcd-admin-claim-status .admin-res-ids {
  margin-top: 8px;
  font-size: 0.86rem;
  line-height: 1.5;
  word-break: break-word;
}

.mcd-admin-claim-status .admin-res-ids span {
  font-weight: 600;
  margin-right: 4px;
}

.mcd-admin-claim-status .admin-res-ok-list {
  color: #c8f5d8;
}

.mcd-admin-claim-status .admin-res-fail-list {
  color: #ffd0d0;
}

.mcd-admin-claim-status .admin-res-hint {
  margin-top: 10px;
  font-size: 0.78rem;
  line-height: 1.45;
  opacity: 0.92;
}

.mcd-admin-claim-status .admin-res-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(226, 196, 117, 0.14);
  display: flex;
  justify-content: flex-end;
}

.mcd-admin-claim-status .admin-batch-stop {
  appearance: none;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  color: rgba(232, 237, 247, 0.55);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(232, 237, 247, 0.22);
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.mcd-admin-claim-status .admin-batch-stop:hover,
.mcd-admin-claim-status .admin-batch-stop:focus-visible {
  color: rgba(255, 200, 200, 0.92);
  text-decoration-color: rgba(255, 180, 180, 0.45);
  outline: none;
}

.admin-catalog-pick-menu {
  display: none;
  margin: 0 0 14px;
  padding: 16px 14px;
  border-radius: 14px;
  border: 1px solid rgba(226, 196, 117, 0.28);
  background: rgba(8, 15, 29, 0.88);
  text-align: center;
  position: relative;
  z-index: 4;
}

body.mcd-admin-license .admin-catalog-pick-menu:not(.hidden) {
  display: block;
}

.member-catalog-pick-menu {
  display: none;
  margin: 0 0 14px;
  padding: 16px 14px;
  border-radius: 14px;
  border: 1px solid rgba(226, 196, 117, 0.28);
  background: rgba(8, 15, 29, 0.88);
  text-align: center;
  position: relative;
  z-index: 4;
}

body:not(.mcd-admin-license) .member-catalog-pick-menu:not(.hidden) {
  display: block;
}

.member-catalog-pick-menu .member-catalog-pick-result {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 8px;
}

.member-catalog-pick-menu .member-catalog-pick-result.is-ok {
  color: #9fddb5;
}

.member-catalog-pick-menu .member-catalog-pick-result.is-fail {
  color: #ffb3b3;
}

.member-catalog-pick-menu .member-catalog-pick-sub {
  margin: 0 0 14px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(232, 237, 247, 0.72);
}

.member-catalog-pick-menu .member-pick-voucher-btn {
  appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid rgba(226, 196, 117, 0.42);
  background: linear-gradient(180deg, rgba(230, 201, 120, 0.18), rgba(185, 145, 62, 0.12));
  color: #f8f2e7;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.member-catalog-pick-menu .member-pick-voucher-btn:hover,
.member-catalog-pick-menu .member-pick-voucher-btn:focus-visible {
  border-color: rgba(230, 201, 120, 0.62);
  outline: none;
  box-shadow: 0 0 0 2px rgba(230, 201, 120, 0.18);
}

.member-catalog-pick-menu .member-pick-voucher-btn:active {
  transform: translateY(1px);
}

.admin-catalog-pick-menu .admin-catalog-pick-result {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 8px;
}

.admin-catalog-pick-menu .admin-catalog-pick-result.is-ok {
  color: #9fddb5;
}

.admin-catalog-pick-menu .admin-catalog-pick-result.is-fail {
  color: #ffb3b3;
}

.admin-catalog-pick-menu .admin-catalog-pick-sub {
  margin: 0 0 14px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(232, 237, 247, 0.72);
}

.admin-catalog-pick-menu .admin-pick-voucher-btn,
.mcd-admin-claim-status .admin-pick-voucher-btn {
  appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid rgba(226, 196, 117, 0.38);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(226, 196, 117, 0.16), rgba(226, 196, 117, 0.08));
  color: #e6c978;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.admin-catalog-pick-menu .admin-pick-voucher-btn:hover,
.admin-catalog-pick-menu .admin-pick-voucher-btn:focus-visible,
.mcd-admin-claim-status .admin-pick-voucher-btn:hover,
.mcd-admin-claim-status .admin-pick-voucher-btn:focus-visible {
  background: linear-gradient(180deg, rgba(226, 196, 117, 0.24), rgba(226, 196, 117, 0.12));
  border-color: rgba(226, 196, 117, 0.55);
  outline: none;
}

.admin-catalog-pick-menu .admin-pick-voucher-btn:active {
  transform: translateY(1px);
}

.mcd-admin-claim-status[data-kind="error"] {
  border-color: rgba(255, 120, 120, 0.45);
  background: rgba(80, 16, 16, 0.45);
  color: #ffd4d4;
}

.mcd-admin-claim-status[data-kind="success"] {
  border-color: rgba(120, 220, 160, 0.45);
  background: rgba(16, 60, 36, 0.45);
  color: #d7ffe8;
}

.mcd-admin-claim-status[data-kind="info"] {
  border-color: rgba(120, 180, 255, 0.35);
  background: rgba(16, 36, 70, 0.45);
  color: #d8eaff;
}

body.mcd-admin-batch-running #claim-btn {
  box-shadow: 0 0 0 2px rgba(120, 180, 255, 0.25);
}

body.mcd-admin-license #retry-helper-box {
  display: none !important;
}

/* Riwayat Proses — tabel desktop, kartu rapat di HP (tema FN) */
body.mcd-log-v2 .log-section > .mcd-section-label {
  margin-bottom: 10px;
  font-size: 0.92rem;
}

body.mcd-log-v2 .log-section > .history-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: min(440px, 55vh);
  border: 1px solid rgba(226, 196, 117, 0.18);
  border-radius: 12px;
  background: rgba(5, 10, 20, 0.5);
}

body.mcd-log-v2 .log-section .history-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.8rem;
}

body.mcd-log-v2 .log-section .history-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--premium-muted, var(--muted));
  background: rgba(12, 18, 32, 0.98);
  border-bottom: 1px solid rgba(226, 196, 117, 0.22);
  white-space: nowrap;
}

body.mcd-log-v2 .log-section .history-table tbody td {
  padding: 10px 8px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(226, 196, 117, 0.1);
}

body.mcd-log-v2 .log-section .history-table th:nth-child(1),
body.mcd-log-v2 .log-section .history-table td:nth-child(1) {
  width: 36px;
  text-align: center;
}

body.mcd-log-v2 .log-section .history-table th:nth-child(2),
body.mcd-log-v2 .log-section .history-table td:nth-child(2) {
  width: 72px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

body.mcd-log-v2.mcd-admin-license .log-section .history-table th:nth-child(3),
body.mcd-log-v2.mcd-admin-license .log-section .history-table td:nth-child(3) {
  width: 64px;
  font-variant-numeric: tabular-nums;
}

body.mcd-log-v2.mcd-admin-license .log-section .history-table th:nth-child(4),
body.mcd-log-v2.mcd-admin-license .log-section .history-table td:nth-child(4) {
  width: 76px;
  font-variant-numeric: tabular-nums;
}

body.mcd-log-v2.mcd-admin-license .log-section .history-table th:nth-child(5),
body.mcd-log-v2.mcd-admin-license .log-section .history-table td:nth-child(5) {
  width: 56px;
  text-align: center;
}

body.mcd-log-v2 .log-section .mcd-hist-col-pesan {
  word-break: break-word;
  line-height: 1.45;
  font-size: 0.78rem;
}

body.mcd-log-v2:not(.mcd-admin-license) .log-section .history-table th:nth-child(3),
body.mcd-log-v2:not(.mcd-admin-license) .log-section .history-table td:nth-child(3) {
  width: auto;
  text-align: left;
}

body.mcd-log-v2:not(.mcd-admin-license) .log-section .history-table th:nth-child(4),
body.mcd-log-v2:not(.mcd-admin-license) .log-section .history-table td:nth-child(4) {
  width: 72px;
  text-align: center;
}

body.mcd-log-v2 .log-section .history-table .mcd-hist-col-status {
  text-align: center;
}

body.mcd-log-v2 .log-section .mcd-hist-col-no {
  color: var(--premium-muted, var(--muted));
  font-weight: 700;
}

body.mcd-log-v2 .log-section .mcd-hist-col-time {
  color: #cbd5e1;
}

body.mcd-log-v2 .log-section .mcd-hist-col-loyalty,
body.mcd-log-v2 .log-section .mcd-hist-col-offer {
  color: #fde68a;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

body.mcd-log-v2 .log-section .mcd-hist-col-paket {
  color: #e8edf7;
  font-weight: 600;
}

body.mcd-log-v2 .log-section .mcd-hist-col-pesan {
  color: #94a3b8;
  font-size: 0.78rem;
  white-space: normal;
  word-break: break-word;
}

body.mcd-log-v2 .log-section .history-table .badge.mcd-status-badge {
  min-width: 64px;
  padding: 4px 10px;
  font-size: 0.72rem;
}

body.mcd-log-v2 .log-section .history-table tr.history-empty-row td {
  text-align: center;
  padding: 20px 12px;
  color: var(--premium-muted, var(--muted));
}

body.mcd-log-v2 #admin-claim-status:not([data-kind="error"]) {
  display: none !important;
}

body.mcd-admin-license #tx-detail-panel,
#tx-detail-panel {
  display: none !important;
}

@media (max-width: 680px) {
  body.mcd-log-v2 .log-section > .history-scroll {
    overflow-x: hidden !important;
    max-height: none !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
  }

  body.mcd-log-v2 .log-section .history-table {
    min-width: 0 !important;
    display: block;
    border-collapse: separate;
    border-spacing: 0;
  }

  body.mcd-log-v2 .log-section .history-table thead {
    display: none !important;
  }

  body.mcd-log-v2 .log-section .history-table tbody {
    display: block;
  }

  body.mcd-log-v2 .log-section .history-table tr:not(.history-empty-row) {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(226, 196, 117, 0.16);
    background: rgba(5, 10, 20, 0.62);
  }

  body.mcd-log-v2 .log-section .history-table tr.history-empty-row {
    display: block;
    padding: 16px;
    border: 1px dashed rgba(226, 196, 117, 0.2);
    border-radius: 12px;
    text-align: center;
  }

  body.mcd-log-v2 .log-section .history-table td {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 4px 0 !important;
    border: none !important;
    text-align: left !important;
    white-space: normal !important;
    word-break: break-word !important;
  }

  body.mcd-log-v2 .log-section .history-table td::before {
    content: attr(data-label) ": ";
    display: inline;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--premium-muted, var(--muted));
    margin-right: 4px;
  }

  body.mcd-log-v2 .log-section .history-table td.mcd-hist-col-status {
    padding-top: 6px !important;
  }

  body.mcd-log-v2 .log-section .history-table td.mcd-hist-col-pesan {
    margin-top: 6px;
    padding-top: 8px !important;
    border-top: 1px solid rgba(226, 196, 117, 0.12) !important;
  }
}

#tx-detail-panel .mcd-tx-col-no {
  width: 6%;
  text-align: center;
  color: var(--premium-muted, var(--muted));
  font-weight: 700;
}

#tx-detail-panel .mcd-tx-col-paket {
  color: #f8fafc;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

#tx-detail-panel .mcd-tx-col-refund {
  color: #fde68a;
  line-height: 1.4;
  word-break: break-word;
}

#tx-detail-panel .mcd-tx-detail-table th:nth-child(1),
#tx-detail-panel .mcd-tx-detail-table td:nth-child(1) { width: 6%; }
#tx-detail-panel .mcd-tx-detail-table th:nth-child(2),
#tx-detail-panel .mcd-tx-detail-table td:nth-child(2) { width: 18%; }
#tx-detail-panel .mcd-tx-detail-table th:nth-child(3),
#tx-detail-panel .mcd-tx-detail-table td:nth-child(3) { width: 26%; }
#tx-detail-panel .mcd-tx-detail-table th:nth-child(4),
#tx-detail-panel .mcd-tx-detail-table td:nth-child(4) { width: 14%; }
#tx-detail-panel .mcd-tx-detail-table th:nth-child(5),
#tx-detail-panel .mcd-tx-detail-table td:nth-child(5) { width: 14%; }
#tx-detail-panel .mcd-tx-detail-table th:nth-child(6),
#tx-detail-panel .mcd-tx-detail-table td:nth-child(6) { width: 22%; }

#tx-detail-panel tr.mcd-tx-row-ok td.mcd-tx-col-paket {
  color: #d1fae5;
}

#tx-detail-panel tr.mcd-tx-row-fail td.mcd-tx-col-paket {
  color: #fecaca;
}

.license-search-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.license-metrics-wrap {
  margin: 0 0 16px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(12, 18, 32, 0.92), rgba(6, 10, 18, 0.96));
}

.license-metrics-head {
  margin-bottom: 12px;
}

.license-metrics-heading {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
  color: #f8e7b8;
  letter-spacing: 0.01em;
}

.license-metrics-desc {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

.license-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.license-metric-card {
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  padding: 12px 14px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.license-metric-wide {
  grid-column: 1 / -1;
}

.license-metric-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(248, 231, 184, 0.72);
  margin-bottom: 6px;
}

.license-metric-value {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  color: #fff8e8;
  letter-spacing: -0.02em;
}

.license-metric-hint {
  margin-top: 6px;
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--muted);
}

.license-metric-good {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.license-metric-good .license-metric-value {
  color: #bbf7d0;
}

.license-metric-warn {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.08);
}

.license-metric-warn .license-metric-value {
  color: #fde68a;
}

.license-metric-gold {
  border-color: rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.1);
}

.license-metric-gold .license-metric-value {
  color: #ffe9a8;
  font-size: 1.5rem;
}

@media (min-width: 900px) {
  .license-metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .license-metric-wide {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .license-metrics-grid {
    grid-template-columns: 1fr;
  }

  .license-metric-wide {
    grid-column: auto;
  }

  .license-metric-value {
    font-size: 1.25rem;
  }
}

.copy-key-btn {
  margin-left: 6px;
  padding: 4px 8px;
  border: 1px solid rgba(212, 175, 55, 0.5);
  background: transparent;
  color: #f8e7b8;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
}

.copy-key-btn:hover {
  border-color: rgba(212, 175, 55, 0.9);
  color: #fff4d4;
}

.balance-history-card {
  margin-top: 14px;
}

.balance-history-note {
  margin: 0 0 8px;
  font-size: 12px;
  opacity: 0.8;
}

@media (max-width: 640px) {
  .mcd-field-grid {
    grid-template-columns: 1fr;
  }

  .mcd-user-guide {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mcd-trust-strip {
    gap: 6px;
  }

  .mcd-trust-item {
    font-size: 0.78rem;
    padding: 6px 10px;
  }

  .mcd-dash-header {
    flex-direction: column;
  }

  .mcd-balance {
    align-items: flex-start;
  }

  .mcd-panel {
    border-radius: 14px;
    padding: 18px 14px;
  }

  .mcd-title {
    font-size: 1.2rem;
    letter-spacing: 0.02em;
  }

  .mcd-desc {
    font-size: 0.86rem;
    margin-bottom: 14px;
  }

  .mcd-field-note,
  .mcd-mini-note {
    font-size: 0.76rem;
  }

  .mcd-main {
    padding-left: 10px;
    padding-right: 10px;
  }

  .mcd-dash-actions {
    width: 100%;
  }

  .mcd-dash-actions .button,
  .mcd-dash-actions .logout-btn,
  .mcd-dash-actions .tab-btn {
    width: 100%;
    min-height: 42px;
  }

  .license-copy-btn {
    display: inline-flex;
    margin-left: 0;
    margin-top: 8px;
    width: fit-content;
    max-width: 100%;
  }

  .mcd-steps-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .mcd-stepper {
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* ── UX refresh: clearer member flow ── */
.mcd-alert-error {
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.mcd-btn-block {
  display: block;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.mcd-btn-secondary {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
}

.mcd-btn-secondary:hover {
  background: rgba(212, 175, 55, 0.2);
}

.mcd-flow-card {
  margin-bottom: 16px;
}

.mcd-field-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin: -6px 0 12px;
  line-height: 1.4;
}

.mcd-field-hint-center {
  text-align: center;
  margin-top: 12px;
}

.mcd-input-license {
  font-family: monospace;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
}

.mcd-info-box {
  background: rgba(9, 14, 24, 0.65);
  border: 1px dashed rgba(212, 175, 55, 0.35);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.mcd-info-title {
  font-weight: 700;
  color: var(--gold);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.mcd-info-text {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.mcd-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mcd-checklist li {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 1px solid rgba(212, 175, 55, 0.08);
  line-height: 1.45;
}

.mcd-checklist li:last-child {
  border-bottom: none;
}

.mcd-checklist-ordered {
  list-style: decimal;
  padding-left: 20px;
  margin: 12px 0 16px;
}

.mcd-checklist-ordered li {
  border-bottom: none;
  padding: 4px 0;
  color: #c8d0e0;
}

.mcd-redirect-panel .mcd-checklist-ordered {
  list-style: none;
  width: 100%;
  max-width: 340px;
  padding: 0;
  margin: 14px auto 18px;
  text-align: left;
  counter-reset: mcd-redirect-step;
}

.mcd-redirect-panel .mcd-checklist-ordered li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  counter-increment: mcd-redirect-step;
}

.mcd-redirect-panel .mcd-checklist-ordered li::before {
  content: counter(mcd-redirect-step);
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  background: linear-gradient(135deg, rgba(230, 201, 120, 0.3), rgba(185, 145, 62, 0.16));
  border: 1px solid rgba(226, 196, 117, 0.28);
  color: #fff3c8;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  box-sizing: border-box;
}

.mcd-redirect-panel .mcd-checklist-ordered li strong {
  color: var(--premium-gold, var(--gold));
}

.mcd-license-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.15);
}

.mcd-license-strip-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mcd-chip-btn {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--gold);
}

.mcd-balance-card {
  min-width: 120px;
}

.mcd-btn-logout {
  color: var(--muted) !important;
  border-color: rgba(148, 160, 184, 0.35) !important;
}

.mcd-steps-inline {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.mcd-steps-inline-item {
  flex: 1;
  min-width: 90px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #c5cede;
  background: rgba(9, 14, 24, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
  line-height: 1.35;
}

.mcd-steps-inline-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  line-height: 1;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.25);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.72rem;
  margin-right: 0;
  box-sizing: border-box;
  font-variant-numeric: tabular-nums;
}

.mcd-section-label-main {
  margin-top: 4px;
  font-size: 1rem;
}

.mcd-section-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin: -8px 0 12px;
  line-height: 1.45;
}

.mcd-inject-guide {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.06);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.45;
}

.mcd-inject-guide strong {
  color: #fff4d4;
}

.mcd-inject-guide span {
  color: var(--muted);
}

.mcd-inject-notice {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  line-height: 1.45;
}

.mcd-inject-notice.ok {
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
  color: #bbf7d0;
}

.mcd-inject-notice.warn {
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.1);
  color: #fde68a;
}

.mcd-session-banner {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
  font-size: 0.86rem;
  line-height: 1.5;
  font-weight: 500;
}

.mcd-new-device-guide {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(30, 58, 138, 0.25);
  color: #bfdbfe;
  font-size: 0.84rem;
  line-height: 1.5;
}

.mcd-new-device-guide p {
  margin: 0 0 10px;
}

.mcd-new-device-guide-dismiss {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(147, 197, 253, 0.45);
  background: rgba(59, 130, 246, 0.15);
  color: #dbeafe;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.mcd-change-voucher-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 160, 184, 0.18);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.mcd-change-voucher-box span {
  min-width: 0;
}

.mcd-change-voucher-box .mcd-chip-btn {
  flex-shrink: 0;
  border-color: rgba(212, 175, 55, 0.38);
  color: #fff4d4;
}

.mcd-claim-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(212, 175, 55, 0.12);
}

.mcd-quantity-field {
  max-width: 240px;
}

.mcd-quantity-field input:focus {
  scroll-margin-bottom: 120px;
}

#claim-btn.mcd-btn-claim {
  margin-top: 4px;
  position: relative;
  z-index: 3;
  pointer-events: auto;
  scroll-margin-bottom: 24px;
}

#manual-panel {
  position: relative;
  z-index: 2;
}

.mcd-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 16px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.mcd-stepper-item {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
}

.mcd-stepper-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  line-height: 1;
  margin: 0 auto 4px;
  border-radius: 50%;
  background: rgba(148, 160, 184, 0.2);
  font-weight: 700;
  font-size: 0.7rem;
  box-sizing: border-box;
  font-variant-numeric: tabular-nums;
}

.mcd-stepper-item.active {
  color: var(--gold);
}

.mcd-stepper-item.active span {
  background: rgba(212, 175, 55, 0.35);
  color: #fff4d4;
}

.mcd-stepper-line {
  width: 12px;
  height: 2px;
  background: rgba(212, 175, 55, 0.2);
  flex-shrink: 0;
}

.mcd-pay-alert {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.45;
  margin-bottom: 12px;
}

.mcd-pay-highlight {
  color: #fff4d4;
  font-weight: 700;
}

.mcd-qr-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 10px;
}

.mcd-qr-expiry {
  text-align: center;
  font-size: 0.82rem;
  color: var(--warning);
  font-weight: 600;
  margin: 0 0 8px;
}

.mcd-pay-summary {
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.mcd-pay-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(212, 175, 55, 0.08);
}

.mcd-pay-summary-row:last-child {
  border-bottom: none;
}

.mcd-pay-summary-row span {
  color: var(--muted);
}

.mcd-license-success {
  text-align: center;
  padding: 16px;
  margin-bottom: 14px;
  border-radius: 14px;
  border: 1px solid rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.08);
}

.mcd-license-success-title {
  font-size: 0.85rem;
  color: var(--success);
  font-weight: 700;
  margin-bottom: 8px;
}

.mcd-license-success-key {
  font-size: 1.15rem;
  color: #fff4d4;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.mcd-license-success-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 8px;
}

.mcd-redirect-panel {
  max-width: 420px;
  text-align: center;
}

.mcd-redirect-hub {
  max-width: 440px;
  padding-bottom: 22px;
}

.mcd-redirect-notice {
  margin: 14px 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(226, 196, 117, 0.22);
  background: rgba(212, 175, 55, 0.08);
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(248, 242, 231, 0.88);
  text-align: left;
}

.mcd-redirect-notice strong {
  color: var(--gold);
}

.mcd-redirect-disclaimer {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.28);
  text-align: left;
}

.mcd-redirect-disclaimer-title {
  margin: 0 0 6px;
  font-size: 0.84rem;
  color: rgba(248, 242, 231, 0.92);
}

.mcd-redirect-disclaimer-text {
  margin: 0 0 10px;
  font-size: 0.8rem;
  line-height: 1.55;
  color: rgba(248, 242, 231, 0.78);
}

.mcd-redirect-disclaimer-list {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(248, 242, 231, 0.72);
}

.mcd-redirect-disclaimer-list li {
  margin-bottom: 4px;
}

.mcd-redirect-section {
  margin: 0 0 16px;
  padding: 16px 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(226, 196, 117, 0.14);
  background: rgba(6, 12, 24, 0.55);
  text-align: left;
}

.mcd-redirect-section-alt {
  border-color: rgba(120, 180, 255, 0.18);
  background: rgba(8, 16, 32, 0.62);
}

.mcd-redirect-section-title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff4d4;
  letter-spacing: 0.02em;
}

.mcd-redirect-section .mcd-field-hint {
  margin-bottom: 10px;
}

.mcd-redirect-register-btn {
  margin-top: 4px;
}

.mcd-redirect-foot {
  margin: 4px 0 0;
  font-size: 0.76rem;
}

.mcd-redirect-page .wrapper {
  position: relative;
  z-index: 2;
}

.mcd-redirect-page .redirect-card {
  position: relative;
  z-index: 2;
}

.mcd-redirect-action-btn {
  position: relative;
  z-index: 3;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(230, 201, 120, 0.25);
  cursor: pointer;
  user-select: none;
  min-height: 48px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin-top: 8px;
  text-decoration: none;
}

.mcd-redirect-action-btn:active {
  transform: scale(0.98);
  filter: brightness(0.96);
}

.mcd-redirect-fallback {
  margin: 10px 0 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

.mcd-redirect-fallback a {
  color: var(--gold);
  font-weight: 700;
  word-break: break-all;
  pointer-events: auto;
  touch-action: manipulation;
}

.mcd-info-box-compact {
  padding: 12px;
  margin-bottom: 12px;
}

.mcd-info-box-compact .mcd-info-text {
  margin-bottom: 0;
  line-height: 1.45;
}

#saved-panel:not(.hidden) {
  margin-bottom: 8px;
}

.mcd-voucher-nav {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  flex-wrap: wrap;
}

.mcd-voucher-nav.hidden {
  display: none;
}

.mcd-voucher-nav-btn {
  flex: 1 1 140px;
  appearance: none;
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(226, 196, 117, 0.24);
  background: rgba(8, 15, 29, 0.72);
  color: rgba(248, 242, 231, 0.88);
  font-size: 0.88rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.mcd-voucher-nav-btn.is-active {
  border-color: rgba(230, 201, 120, 0.55);
  background: linear-gradient(180deg, rgba(230, 201, 120, 0.16), rgba(185, 145, 62, 0.1));
  color: #f8f2e7;
  box-shadow: 0 0 0 1px rgba(230, 201, 120, 0.12);
}

.mcd-voucher-nav-btn:hover,
.mcd-voucher-nav-btn:focus-visible {
  border-color: rgba(230, 201, 120, 0.48);
  outline: none;
}

.mcd-admin-only-nav {
  display: none !important;
}

body.mcd-admin-license .mcd-admin-only-nav {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* V25 Premium MCD theme: calmer, deeper, and more polished. */
:root {
  --premium-bg-0: #030611;
  --premium-bg-1: #07101f;
  --premium-bg-2: #0c1729;
  --premium-panel: rgba(8, 15, 29, 0.76);
  --premium-panel-strong: rgba(11, 20, 36, 0.92);
  --premium-line: rgba(226, 196, 117, 0.16);
  --premium-line-strong: rgba(226, 196, 117, 0.32);
  --premium-gold: #e6c978;
  --premium-gold-2: #b9913e;
  --premium-text: #f8f2e7;
  --premium-muted: #9facbf;
  --premium-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --premium-radius: 24px;
}

html {
  scroll-behavior: smooth;
}

body.mcd-body {
  background:
    radial-gradient(circle at 18% 8%, rgba(230, 201, 120, 0.12), transparent 30%),
    radial-gradient(circle at 82% 0%, rgba(65, 92, 138, 0.2), transparent 36%),
    linear-gradient(145deg, var(--premium-bg-0), var(--premium-bg-1) 48%, #040814);
  color: var(--premium-text);
}

.mcd-bg {
  background:
    linear-gradient(rgba(226, 196, 117, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226, 196, 117, 0.018) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 0%, black 0%, transparent 72%);
  opacity: 0.85;
}

.mcd-main {
  max-width: 1040px;
  padding: 12px 18px 34px;
}

.mcd-banner-wrap {
  max-width: 1040px;
  padding: 18px 18px 0;
}

.mcd-banner {
  border-radius: 22px;
  border: 1px solid rgba(226, 196, 117, 0.16);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.32);
  opacity: 0.96;
}

.mcd-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--premium-line);
  border-radius: var(--premium-radius);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.055), transparent 28%),
    linear-gradient(160deg, var(--premium-panel), rgba(5, 10, 20, 0.9));
  box-shadow: var(--premium-shadow);
  backdrop-filter: blur(22px);
}

.mcd-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 0%, rgba(230, 201, 120, 0.13), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 42%);
}

.mcd-panel > * {
  position: relative;
}

.mcd-panel-wide {
  max-width: 980px;
}

.mcd-panel-head,
.mcd-dash-header {
  border-bottom: 1px solid rgba(226, 196, 117, 0.1);
  margin-bottom: 18px;
  padding-bottom: 18px;
}

.mcd-step {
  color: var(--premium-gold);
  letter-spacing: 0.18em;
  font-size: 0.66rem;
  opacity: 0.92;
}

.mcd-title {
  color: var(--premium-text);
  font-family: var(--font-body);
  font-size: clamp(1.42rem, 3vw, 2.18rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.mcd-title strong {
  color: var(--premium-gold);
}

.mcd-desc,
.mcd-section-sub,
.mcd-field-hint,
.mcd-info-text,
.mcd-checklist li,
.mcd-quick-hint {
  color: var(--premium-muted);
}

.mcd-flow-card,
.mcd-info-box,
.mcd-inject-guide,
.mcd-change-voucher-box,
.mcd-claim-panel,
.mcd-table-wrap,
.mcd-license-strip,
.mcd-pay-summary {
  border-color: var(--premium-line);
  border-radius: 18px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.045), transparent 32%),
    rgba(5, 10, 20, 0.42);
}

.mcd-flow-card,
.mcd-info-box,
.mcd-claim-panel {
  padding: 16px;
}

.mcd-input,
.input {
  border-color: rgba(226, 196, 117, 0.18);
  border-radius: 14px;
  background: rgba(2, 6, 14, 0.62);
  color: var(--premium-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.mcd-input:focus,
.input:focus {
  border-color: rgba(230, 201, 120, 0.54);
  box-shadow: 0 0 0 4px rgba(230, 201, 120, 0.08);
}

.mcd-btn-primary,
.mcd-btn-gold,
.button.mcd-btn-primary {
  border: 1px solid rgba(255, 234, 178, 0.26);
  background: linear-gradient(135deg, #f3d98b, #c49b3f 48%, #8e6825);
  color: #161006;
  box-shadow: 0 14px 34px rgba(185, 145, 62, 0.23);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.mcd-btn-primary:hover:not(:disabled),
.mcd-btn-gold:hover:not(:disabled),
.button.mcd-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 18px 44px rgba(185, 145, 62, 0.3);
}

.mcd-btn-secondary,
.mcd-btn-ghost,
.logout-btn,
.mcd-chip-btn {
  border-color: rgba(226, 196, 117, 0.22) !important;
  background: rgba(255, 255, 255, 0.035) !important;
  color: #f4dfaa !important;
}

.mcd-balance-card {
  border-color: rgba(230, 201, 120, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(230, 201, 120, 0.16), rgba(230, 201, 120, 0.045));
  color: var(--premium-gold);
}

#balance-value {
  font-size: 1.08rem;
  color: #fff5d8;
}

.mcd-steps-inline {
  gap: 10px;
}

.mcd-steps-inline-item {
  border-color: rgba(226, 196, 117, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  color: #d5deec;
}

.mcd-steps-inline-item span {
  background: linear-gradient(135deg, rgba(230, 201, 120, 0.3), rgba(185, 145, 62, 0.16));
  color: #fff3c8;
  border: 1px solid rgba(226, 196, 117, 0.22);
}

.mcd-section-label,
.mcd-section-label-main {
  color: var(--premium-gold);
}

.mcd-section-label-main {
  font-size: 1.06rem;
  letter-spacing: 0.05em;
}

.mcd-inject-guide {
  padding: 14px 16px;
  background:
    linear-gradient(135deg, rgba(230, 201, 120, 0.09), rgba(59, 86, 132, 0.06));
}

.mcd-change-voucher-box {
  background:
    linear-gradient(135deg, rgba(12, 23, 41, 0.88), rgba(6, 12, 23, 0.82));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.mcd-voucher-grid {
  gap: 14px;
}

.mcd-voucher-grid .voucher-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(226, 196, 117, 0.18);
  border-radius: 22px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.055), transparent 28%),
    linear-gradient(145deg, rgba(12, 23, 41, 0.92), rgba(4, 8, 16, 0.94));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mcd-voucher-grid .voucher-card::after {
  content: '';
  position: absolute;
  inset: auto 14px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230, 201, 120, 0.55), transparent);
  opacity: 0.55;
}

.mcd-voucher-grid .voucher-card:hover,
.mcd-voucher-grid .voucher-card.selected {
  transform: translateY(-3px);
  border-color: rgba(230, 201, 120, 0.48);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.36), 0 0 0 1px rgba(230, 201, 120, 0.08);
}

.mcd-voucher-grid .voucher-card img {
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
}

.mcd-voucher-grid .voucher-card h3,
.voucher-card h3 {
  color: var(--premium-text);
  letter-spacing: -0.02em;
}

.mcd-voucher-grid .voucher-card small,
.voucher-card small {
  color: var(--premium-muted);
}

.mcd-voucher-pricing {
  margin: 6px 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(226, 196, 117, 0.12);
}

.mcd-voucher-pricing-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  line-height: 1.4;
}

.mcd-voucher-pricing-row + .mcd-voucher-pricing-row {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px dashed rgba(226, 196, 117, 0.14);
}

.mcd-voucher-pricing-label {
  color: var(--premium-muted);
  font-size: 0.74rem;
}

.mcd-voucher-pricing-value {
  color: #e8edf7;
  font-weight: 600;
}

.mcd-voucher-pricing-tebus .mcd-voucher-pricing-value {
  color: #f0d995;
}

.mcd-selected-tebus {
  display: block;
  margin-top: 4px;
  color: #f0d995;
  font-size: 0.8rem;
  font-weight: 600;
}

.voucher-card .select-btn,
.select-btn {
  border: 1px solid rgba(230, 201, 120, 0.26);
  border-radius: 999px;
  background: rgba(230, 201, 120, 0.1);
  color: #f6e2ad;
  font-weight: 700;
}

.mcd-log {
  border-top-color: rgba(226, 196, 117, 0.12);
}

.history-table th {
  color: #f0d995;
  background: rgba(230, 201, 120, 0.06);
}

.history-table td {
  color: #d7e0ef;
  border-color: rgba(226, 196, 117, 0.08);
}

.mcd-modal {
  border-radius: 24px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.055), transparent 28%),
    linear-gradient(160deg, var(--premium-panel-strong), rgba(5, 10, 20, 0.96));
  box-shadow: var(--premium-shadow);
}

@media (max-width: 680px) {
  .mcd-main {
    padding: 8px 12px 28px;
  }

  .mcd-banner-wrap {
    padding: 12px 12px 0;
  }

  .mcd-panel {
    border-radius: 22px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .mcd-dash-header,
  .mcd-dash-actions {
    gap: 10px;
  }

  .mcd-steps-inline-item {
    min-width: 100%;
    justify-content: flex-start;
    text-align: left;
  }

  .mcd-change-voucher-box {
    align-items: stretch;
    flex-direction: column;
  }

  .mcd-change-voucher-box .mcd-chip-btn {
    width: 100%;
    padding: 10px 12px;
  }
}

/* ── Member dashboard UI polish (display-only) ── */
#app-view.mcd-panel {
  overflow: visible;
}

#login-view.mcd-panel {
  overflow: hidden;
}

#inject-summary {
  margin: 8px 0 12px;
}

.log-section.mcd-log-hub {
  margin-top: 12px;
}

.mcd-log-compact {
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(226, 196, 117, 0.16);
  background: rgba(255, 255, 255, 0.03);
}

.mcd-log-compact-text {
  margin: 0 0 10px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--premium-muted, var(--muted));
}

.mcd-log-toggle-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(226, 196, 117, 0.28);
  background: rgba(230, 201, 120, 0.1);
  color: #f6e2ad;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.mcd-log-toggle-btn:hover {
  background: rgba(230, 201, 120, 0.16);
}

.mcd-log-detail-body {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(226, 196, 117, 0.12);
}

.mcd-log-detail-body.hidden {
  display: none;
}

.mcd-log-hub > #inject-summary,
.mcd-log-hub > #inject-result-banner {
  margin-bottom: 10px;
}

.mcd-log-detail-body #tx-detail-panel .mcd-tx-detail-title,
.mcd-log-detail-body #tx-detail-panel .mcd-tx-detail-sub {
  display: none;
}

.mcd-log-detail-body .log-section > .history-scroll,
.mcd-log-hub .mcd-log-detail-body > .history-scroll {
  max-height: min(280px, 38vh);
}

@media (min-width: 681px) {
  .mcd-log-toggle-btn {
    width: auto;
    min-width: 220px;
  }
}

.log-section > .history-scroll {
  max-height: min(240px, 34vh);
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.log-section .history-table {
  table-layout: fixed;
  width: 100%;
}

.log-section .history-table th:nth-child(1),
.log-section .history-table td:nth-child(1) {
  width: 24%;
}

.log-section .history-table th:nth-child(2),
.log-section .history-table td:nth-child(2) {
  width: 20%;
}

.log-section .history-table th:nth-child(3),
.log-section .history-table td:nth-child(3) {
  width: 56%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

#tx-detail-panel.mcd-tx-detail-wrap {
  max-height: none;
  overflow: visible;
  margin-top: 14px;
  padding-bottom: 2px;
  border: 1px solid rgba(226, 196, 117, 0.16);
  border-radius: 16px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.04), transparent 30%),
    rgba(5, 10, 20, 0.38);
}

#tx-detail-panel .mcd-tx-detail-title {
  padding: 14px 14px 6px;
  margin: 0;
}

#tx-detail-panel .mcd-tx-detail-sub {
  margin: 0;
  padding: 0 14px 10px;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--premium-muted, var(--muted));
}

#tx-detail-panel .mcd-table-scroll-inner {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: min(520px, 58vh);
  -webkit-overflow-scrolling: touch;
  border-radius: 0 0 16px 16px;
}

#tx-detail-panel .mcd-tx-detail-table {
  width: 100%;
  min-width: 0;
  font-size: 0.8rem;
  table-layout: fixed;
}

#tx-detail-panel .mcd-tx-detail-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(12, 18, 32, 0.96);
  box-shadow: inset 0 -1px 0 rgba(226, 196, 117, 0.1);
}

#tx-detail-panel .mcd-tx-detail-table td,
#tx-detail-panel .mcd-tx-detail-table th {
  padding: 10px 12px;
  vertical-align: top;
}

#tx-detail-panel .mcd-tx-col-time {
  white-space: nowrap;
  min-width: 92px;
  color: var(--premium-muted, var(--muted));
  font-variant-numeric: tabular-nums;
}

#tx-detail-panel .mcd-tx-col-money,
#tx-detail-panel .mcd-tx-col-refund {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

#tx-detail-panel .mcd-tx-col-detail {
  min-width: 120px;
  max-width: 240px;
  word-break: break-word;
  line-height: 1.4;
}

#tx-detail-panel .mcd-tx-status-ok {
  color: #86efac;
  font-weight: 700;
  white-space: nowrap;
}

#tx-detail-panel .mcd-tx-status-fail {
  color: #fca5a5;
  font-weight: 700;
  white-space: nowrap;
}

#tx-detail-panel .history-empty-row td {
  padding: 18px 12px;
}

.mcd-change-voucher-box span,
.mcd-quick-hint,
.mcd-field-hint,
#change-voucher-text {
  word-break: break-word;
  line-height: 1.45;
}

@media (max-width: 680px) {
  .log-section > .history-scroll {
    max-height: none;
    overflow-x: hidden;
    overflow-y: visible;
    border: none;
    background: transparent;
  }

  .log-section .history-table {
    min-width: 0;
    font-size: 0.82rem;
    border-collapse: separate;
    border-spacing: 0 8px;
    background: transparent;
  }

  .log-section .history-table thead {
    display: none;
  }

  .log-section .history-table tbody,
  .log-section .history-table tr,
  .log-section .history-table td {
    display: block;
    width: 100%;
    max-width: 100%;
  }

  .log-section .history-table tr.history-empty-row {
    border: 1px dashed rgba(226, 196, 117, 0.18);
    border-radius: 14px;
    padding: 14px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
  }

  .log-section .history-table tr.history-empty-row td {
    border: none;
    padding: 0;
  }

  .log-section .history-table tr.history-empty-row td::before {
    display: none;
  }

  .log-section .history-table tr:not(.history-empty-row) {
    border: 1px solid rgba(226, 196, 117, 0.16);
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
  }

  .log-section .history-table td {
    padding: 5px 0;
    border: none;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .log-section .history-table td:first-child {
    white-space: normal;
  }

  .log-section .history-table td::before {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--premium-muted, var(--muted));
    margin-bottom: 2px;
  }

  body:not(.mcd-log-v2) .log-section .history-table td:nth-child(1)::before {
    content: 'Waktu';
  }

  body:not(.mcd-log-v2) .log-section .history-table td:nth-child(2)::before {
    content: 'Status';
  }

  body:not(.mcd-log-v2) .log-section .history-table td:nth-child(3)::before {
    content: 'Keterangan';
  }

  body:not(.mcd-log-v2) .log-section .history-table td:nth-child(2) {
    padding-bottom: 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(226, 196, 117, 0.1);
  }

  #tx-detail-panel .mcd-table-scroll-inner {
    overflow-x: hidden;
    max-height: none;
  }

  #tx-detail-panel .mcd-tx-detail-table {
    min-width: 0;
    font-size: 0.78rem;
    border-collapse: separate;
    border-spacing: 0 8px;
  }

  #tx-detail-panel .mcd-tx-detail-table thead {
    display: none;
  }

  #tx-detail-panel .mcd-tx-detail-table tbody,
  #tx-detail-panel .mcd-tx-detail-table tr,
  #tx-detail-panel .mcd-tx-detail-table td {
    display: block;
    width: 100%;
  }

  #tx-detail-panel .mcd-tx-detail-table tr.history-empty-row {
    border: 1px dashed rgba(226, 196, 117, 0.18);
    border-radius: 14px;
    padding: 14px;
    text-align: center;
  }

  #tx-detail-panel .mcd-tx-detail-table tr:not(.history-empty-row) {
    border: 1px solid rgba(226, 196, 117, 0.16);
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
  }

  #tx-detail-panel .mcd-tx-detail-table td {
    padding: 5px 0;
    border: none;
    white-space: normal;
    word-break: break-word;
  }

  #tx-detail-panel .mcd-tx-detail-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--premium-muted, var(--muted));
    margin-bottom: 2px;
  }

  #tx-detail-panel .mcd-tx-detail-table td[data-label="Status"] {
    font-size: 0.92rem;
    padding-bottom: 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(226, 196, 117, 0.1);
  }

  #tx-detail-panel .mcd-tx-detail-table td,
  #tx-detail-panel .mcd-tx-detail-table th {
    padding: 5px 0;
  }
}

/* ── Post-inject result clarity (display-only) ── */
.mcd-log-hint {
  margin: 0 0 10px;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--premium-muted, var(--muted));
}

.mcd-inject-summary-wrap {
  margin: 8px 0 12px;
  position: relative;
  z-index: 2;
}

.mcd-summary-card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(226, 196, 117, 0.18);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.05), transparent 42%),
    rgba(8, 14, 28, 0.55);
}

.mcd-summary-card.mcd-summary-all-ok {
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.08);
}

.mcd-summary-card.mcd-summary-all-fail {
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.08);
}

.mcd-summary-card.mcd-summary-mixed {
  border-color: rgba(251, 191, 36, 0.35);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.08);
}

.mcd-summary-label {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--premium-muted, var(--muted));
}

.mcd-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.mcd-summary-reset-btn {
  position: relative;
  z-index: 5;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(230, 201, 120, 0.25);
  border: 1px solid rgba(226, 196, 117, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #f0d995;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
}

.mcd-summary-reset-btn.confirming {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
}

.mcd-summary-reset-btn:hover {
  background: rgba(230, 201, 120, 0.12);
}

.mcd-summary-reset-note {
  margin-top: 8px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #fde68a;
}

.mcd-summary-stats {
  display: flex;
  gap: 10px;
}

.mcd-summary-stat {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mcd-summary-stat.ok {
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.08);
}

.mcd-summary-stat.fail {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.08);
}

.mcd-summary-num {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.mcd-summary-stat.ok .mcd-summary-num {
  color: #86efac;
}

.mcd-summary-stat.fail .mcd-summary-num {
  color: #fca5a5;
}

.mcd-summary-txt {
  display: block;
  margin-top: 2px;
  font-size: 0.74rem;
  color: var(--premium-muted, var(--muted));
}

.mcd-summary-sync {
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--premium-muted, var(--muted));
}

.mcd-inject-result {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 10px 0 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(226, 196, 117, 0.22);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.06), transparent 38%),
    rgba(6, 12, 24, 0.72);
}

.mcd-inject-result.hidden {
  display: none;
}

.mcd-inject-result-all-ok {
  border-color: rgba(34, 197, 94, 0.42);
  background:
    linear-gradient(150deg, rgba(34, 197, 94, 0.12), transparent 45%),
    rgba(6, 18, 14, 0.82);
}

.mcd-inject-result-all-fail {
  border-color: rgba(239, 68, 68, 0.42);
  background:
    linear-gradient(150deg, rgba(239, 68, 68, 0.12), transparent 45%),
    rgba(20, 8, 10, 0.82);
}

.mcd-inject-result-mixed {
  border-color: rgba(251, 191, 36, 0.42);
  background:
    linear-gradient(150deg, rgba(251, 191, 36, 0.1), transparent 45%),
    rgba(18, 14, 8, 0.82);
}

.mcd-inject-result-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
}

.mcd-inject-result-all-ok .mcd-inject-result-icon {
  color: #86efac;
  background: rgba(34, 197, 94, 0.18);
}

.mcd-inject-result-all-fail .mcd-inject-result-icon {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.18);
}

.mcd-inject-result-mixed .mcd-inject-result-icon {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.18);
}

.mcd-inject-result-title {
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 4px;
}

.mcd-inject-result-sub {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--premium-muted, var(--muted));
  margin-bottom: 10px;
}

.mcd-inject-result-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.mcd-inject-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.mcd-inject-stat.ok {
  border-color: rgba(34, 197, 94, 0.35);
  color: #bbf7d0;
}

.mcd-inject-stat.fail {
  border-color: rgba(239, 68, 68, 0.35);
  color: #fecaca;
}

.mcd-inject-stat strong {
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.mcd-inject-result-foot {
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--premium-muted, var(--muted));
}

.history-table .badge.mcd-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  text-transform: none;
}

.history-table .badge.mcd-hist-ok {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.history-table .badge.mcd-hist-fail {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.history-table .badge.mcd-hist-info {
  display: none !important;
}

body.mcd-log-v2 tr.mcd-hist-row-info {
  display: none !important;
}

body.mcd-admin-license tr.mcd-log-noise-row {
  display: none !important;
}

.mcd-build-stamp {
  margin: 10px 0 0;
  padding: 6px 0 4px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-align: center;
  color: rgba(251, 191, 36, 0.55);
}

.mcd-build-stamp-fixed {
  display: none !important;
}

body.mcd-admin-license.mcd-log-v2 {
  padding-bottom: 0;
}

body.mcd-admin-license.mcd-log-v2 .log-section.mcd-log-hub {
  margin-bottom: 8px;
}

#inject-summary {
  margin-top: 12px;
}

body.mcd-admin-license .mcd-hist-row-wait .mcd-status-badge,
body.mcd-admin-license .mcd-hist-wait {
  background: rgba(251, 191, 36, 0.18);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

body.mcd-admin-license.mcd-log-v2 #proses-rows > tr:not(.mcd-hist-row):not(.history-empty-row) {
  display: none !important;
}

body.mcd-admin-license.mcd-log-v2 #riwayat-rows > tr:not(.mcd-hist-row):not(.history-empty-row) {
  display: none !important;
}

.mcd-admin-log-summary {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(226, 196, 117, 0.18);
  background: rgba(8, 14, 28, 0.65);
  font-size: 0.76rem;
  line-height: 1.35;
  color: rgba(248, 242, 231, 0.9);
}

.mcd-admin-log-ok {
  color: #86efac;
  font-weight: 700;
}

.mcd-admin-log-fail {
  color: #fca5a5;
  font-weight: 700;
}

.mcd-admin-log-stat strong {
  color: #fde68a;
  font-variant-numeric: tabular-nums;
}

.mcd-admin-log-sub {
  color: var(--muted);
  font-size: 0.72rem;
}

.mcd-admin-log-hint {
  flex: 1 1 100%;
  color: var(--muted);
  font-size: 0.72rem;
}

.mcd-admin-log-hint b {
  color: #fde68a;
}

.mcd-admin-log-open-selesai {
  flex: 1 1 100%;
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.14);
  color: #fde68a;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.mcd-admin-log-open-selesai:active {
  transform: scale(0.98);
}

body.mcd-admin-license.mcd-log-v2 tr.history-cap-hint td {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  padding: 10px 8px !important;
  border: 1px dashed rgba(226, 196, 117, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

body.mcd-admin-license.mcd-log-v2 tr.history-cap-hint td::before {
  display: none !important;
}

body.mcd-admin-license.mcd-log-v2 tr.mcd-log-loading td {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 14px 10px !important;
  animation: mcd-log-pulse 1.4s ease-in-out infinite;
}

body.mcd-admin-license.mcd-log-v2 tr.mcd-log-loading td::before {
  display: none !important;
}

@keyframes mcd-log-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

body.mcd-admin-license.mcd-log-v2 .log-tabs .tab-btn.active {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.45);
}

@media (min-width: 520px) {
  .mcd-admin-log-hint {
    flex: 1 1 auto;
    text-align: right;
  }
}

.history-table .badge.mcd-hist-summary-badge {
  background: rgba(251, 191, 36, 0.2);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.45);
}

.history-table tr.mcd-hist-row-summary td {
  background: rgba(251, 191, 36, 0.08);
  border-top: 1px solid rgba(251, 191, 36, 0.22);
  border-bottom: 1px solid rgba(251, 191, 36, 0.22);
  font-weight: 600;
}

.history-table tr.mcd-hist-row-summary td:nth-child(3) {
  line-height: 1.45;
}

.history-table tr.mcd-hist-row-ok td:nth-child(3) {
  color: #d1fae5;
}

.history-table tr.mcd-hist-row-fail td:nth-child(3) {
  color: #fecaca;
}

body.mcd-admin-license.mcd-log-v2 .log-section .history-table tr.mcd-hist-row-ok {
  background: rgba(34, 197, 94, 0.1);
}

body.mcd-admin-license.mcd-log-v2 .log-section .history-table tr.mcd-hist-row-fail {
  background: rgba(239, 68, 68, 0.12);
}

body.mcd-admin-license.mcd-log-v2 .log-section .history-table tr.mcd-hist-row-ok td {
  border-color: rgba(34, 197, 94, 0.15);
}

body.mcd-admin-license.mcd-log-v2 .log-section .history-table tr.mcd-hist-row-fail td {
  border-color: rgba(239, 68, 68, 0.18);
}

body.mcd-admin-license.mcd-log-v2 .mcd-hist-id-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 600;
  letter-spacing: 0.02em;
}

@media (max-width: 680px) {
  .mcd-inject-result {
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
  }

  .mcd-summary-stats {
    flex-direction: row;
  }
}

/* Admin unified navigation + quick overview (read-only) */
.admin-mega-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  padding: 12px 20px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.12));
}

.admin-mega-nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.18);
  background: rgba(0, 0, 0, 0.24);
  min-width: 0;
}

.admin-mega-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-mega-nav-group + .admin-mega-nav-group::before {
  display: none;
}

.admin-mega-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
  line-height: 1.2;
}

.admin-mega-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 175, 55, 0.35);
}

.admin-mega-nav a.is-active {
  color: #1a1208;
  background: linear-gradient(135deg, #e8c96a, #d4af37);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.25);
}

.admin-mega-nav-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(248, 231, 184, 0.65);
  margin: 0;
}

.admin-portal-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.08);
  white-space: nowrap;
}

.admin-portal-link::after {
  content: '↗';
  font-size: 0.75rem;
  opacity: 0.85;
}

.admin-portal-link:hover {
  border-color: var(--accent);
  background: rgba(212, 175, 55, 0.16);
  color: #fff8e8;
}

.admin-overview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-overview-note {
  flex: 1;
  min-width: 200px;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.admin-overview-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.admin-overview-link {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.admin-overview-link:hover {
  border-color: var(--accent);
  background: rgba(212, 175, 55, 0.08);
}

.admin-overview-link span {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 4px;
}

.admin-overview-fails {
  margin-top: 12px;
  font-size: 0.85rem;
}

.admin-overview-fails ul {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.admin-topup-live-wrap {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: linear-gradient(160deg, rgba(12, 18, 32, 0.92), rgba(6, 10, 18, 0.96));
}

.admin-topup-live-head-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}

.admin-topup-live-total {
  font-size: 0.88rem;
  font-weight: 700;
  color: #bbf7d0;
}

.admin-topup-live-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-topup-live-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #f8e7b8;
}

.admin-topup-live-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-topup-live-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-topup-live-item {
  display: grid;
  grid-template-columns: minmax(148px, 1fr) 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.22);
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.admin-topup-live-item.is-new {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.1);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.12);
  animation: adminTopupPulse 1.2s ease 2;
}

@keyframes adminTopupPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}

.admin-topup-live-time {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.35;
}

.admin-topup-live-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-topup-live-amount {
  font-size: 0.95rem;
  color: #bbf7d0;
}

.admin-topup-live-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.admin-topup-live-ref {
  font-size: 0.72rem;
  color: rgba(248, 231, 184, 0.65);
  word-break: break-all;
}

.admin-topup-live-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #052e16;
  background: #86efac;
}

.admin-topup-live-more {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #f6e2ad;
  text-decoration: none;
}

.admin-topup-live-more:hover {
  color: #fff8e8;
  text-decoration: underline;
}

@media (max-width: 720px) {
  .admin-topup-live-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .admin-topup-live-badge {
    justify-self: flex-start;
  }
}

.metric-warn .license-metric-value {
  color: #fbbf24;
}

.metric-bad .license-metric-value {
  color: #f87171;
}

.metric-good .license-metric-value {
  color: #86efac;
}

/* ═══ Responsive friendly: HP + komputer ═══ */
html {
  -webkit-text-size-adjust: 100%;
}

body.mcd-body {
  overflow-x: clip;
  min-height: 100dvh;
}

button,
.button,
.tab,
.tab-btn,
.admin-logout,
.admin-mega-nav a,
.small-btn,
.mcd-voucher-nav-btn {
  touch-action: manipulation;
}

@media (min-width: 1100px) {
  .admin-layout .main {
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .license-search-box {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .license-metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  }

  .mcd-main {
    max-width: 960px;
  }
}

@media (max-width: 900px) {
  .admin-mega-nav {
    grid-template-columns: 1fr;
    padding: 10px 12px;
    gap: 8px;
  }

  .admin-mega-nav-group {
    padding: 10px;
  }

  .admin-mega-nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .admin-mega-nav a {
    min-height: 44px;
    padding: 10px 8px;
    font-size: 0.8rem;
  }

  .admin-header .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .admin-portal-link {
    order: -1;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  body.mcd-body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .admin-header .header-actions {
    grid-template-columns: 1fr;
  }

  .mcd-dash-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .mcd-dash-actions .mcd-balance,
  .mcd-dash-actions .mcd-balance-card,
  .mcd-dash-actions .mcd-btn-logout {
    grid-column: 1 / -1;
  }

  .mcd-dash-actions .mcd-balance,
  .mcd-dash-actions .mcd-balance-card {
    align-items: flex-start;
    width: 100%;
  }

  .mcd-license-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  #my-license-value,
  .mono {
    word-break: break-all;
    overflow-wrap: anywhere;
  }

  .mcd-voucher-nav-btn {
    flex: 1 1 100%;
    min-height: 44px;
  }

  .mcd-voucher-grid {
    grid-template-columns: 1fr !important;
  }

  .topup-modal {
    padding: 0;
    align-items: flex-end;
  }

  .topup-card {
    width: 100%;
    max-width: 100%;
    max-height: min(92dvh, 680px);
    overflow-y: auto;
    border-radius: 18px 18px 0 0;
    margin: 0;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .mcd-inject-guide span {
    display: block;
    margin-top: 4px;
  }

  .admin-overview-links {
    grid-template-columns: 1fr;
  }

  .admin-overview-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-overview-toolbar .button {
    width: 100%;
  }

  .wrapper .card,
  .wrapper .mcd-panel {
    width: 100%;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  #inject-log-filter,
  #inject-log-reload {
    width: 100%;
    min-height: 44px;
  }

  .license-search-box .input,
  .license-search-box select,
  .license-search-box .button,
  .license-search-box .logout-btn,
  #voucher-search-input {
    width: 100%;
    min-height: 44px;
  }

  .vcard {
    flex-direction: column;
    align-items: stretch;
  }

  .vthumb {
    width: 100%;
    height: 110px;
  }

  .vside {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .vactions {
    width: 100%;
    flex-direction: column;
  }

  .vactions .small-btn {
    width: 100%;
    min-height: 44px;
  }

  .mcd-tabs,
  .log-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mcd-tabs::-webkit-scrollbar,
  .log-tabs::-webkit-scrollbar {
    display: none;
  }

  .mcd-tabs .tab-btn,
  .log-tabs .tab-btn {
    flex: 1 0 auto;
    min-width: 44%;
    min-height: 44px;
  }

  .mcd-footer {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    text-align: center;
    font-size: 0.78rem;
  }
}

@media (max-width: 380px) {
  .admin-mega-nav a {
    flex: 1 1 100%;
  }

  .topup-presets {
    grid-template-columns: 1fr;
  }

  .mcd-dash-actions {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 641px) {
  .admin-layout .table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* License admin table — kolom sejajar desktop + kartu rapi di HP */
#panel-licenses > .table {
  overflow: hidden;
}

#license-rows > .license-table-row.license-row-filtered-out,
#license-rows > .row.license-row-filtered-out,
#license-rows > .table-row.license-row-filtered-out {
  display: none !important;
}

#license-rows .license-filter-empty {
  display: none;
  padding: 16px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--border);
}

#panel-licenses.license-has-email-col .license-table-header,
#panel-licenses.license-has-email-col #license-rows > .license-table-row {
  grid-template-columns: minmax(140px, 2fr) minmax(72px, 1fr) minmax(150px, 1.8fr) minmax(80px, 0.9fr) minmax(80px, 0.9fr) minmax(240px, 2.4fr);
}

#license-rows .license-col-email {
  word-break: break-all;
  overflow-wrap: anywhere;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--muted);
}

#panel-licenses .license-col-email-header {
  color: var(--muted);
}

#panel-licenses .license-table-header,
#license-rows > .license-table-row {
  display: grid !important;
  grid-template-columns: minmax(150px, 2.2fr) minmax(80px, 1.15fr) minmax(86px, 0.95fr) minmax(86px, 0.95fr) minmax(250px, 2.6fr);
  column-gap: 10px;
  row-gap: 6px;
  align-items: center;
  padding: 12px 14px;
}

#panel-licenses .license-table-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

#panel-licenses .license-col-status {
  display: none !important;
}

#license-rows > .license-table-row {
  border-top: 1px solid var(--border);
  align-items: start;
  font-size: 0.86rem;
}

#license-rows .license-col-key {
  word-break: break-all;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.35;
}

#license-rows .license-col-actions {
  min-width: 0;
}

.license-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.license-row-actions .small-btn,
.license-row-actions .copy-key-btn {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 0.74rem;
  white-space: nowrap;
}

.license-row-actions .mode-nobalance-btn {
  flex: 1 1 100%;
}

#balance-history-card .balance-history-header,
#balance-history-rows > .balance-history-row {
  display: grid !important;
  grid-template-columns: minmax(120px, 1.3fr) minmax(130px, 1.5fr) minmax(80px, 1fr) minmax(70px, 0.8fr) minmax(80px, 0.9fr) minmax(90px, 1fr);
  column-gap: 8px;
  align-items: center;
  padding: 10px 12px;
}

#balance-history-card .balance-history-header {
  background: var(--bg);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
}

#balance-history-rows > .balance-history-row {
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
}

@media (max-width: 768px) {
  #panel-licenses .license-table-header {
    display: none !important;
  }

  #license-rows > .license-table-row {
    grid-template-columns: 1fr !important;
    gap: 8px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    align-items: stretch !important;
    flex-direction: initial !important;
  }

  #license-rows > .license-table-row > span {
    display: flex !important;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    width: 100% !important;
    flex: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
  }

  #license-rows > .license-table-row > span::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex: 0 0 auto;
    margin-right: 8px;
  }

  #license-rows .license-col-actions {
    flex-direction: column;
    align-items: stretch !important;
  }

  #license-rows .license-col-actions::before {
    margin-bottom: 4px;
  }

  #license-rows .license-row-actions {
    justify-content: stretch;
    width: 100%;
  }

  #license-rows .license-row-actions .small-btn,
  #license-rows .license-row-actions .copy-key-btn {
    flex: 1 1 calc(50% - 6px);
    min-height: 44px;
    text-align: center;
  }

  #balance-history-card .balance-history-header {
    display: none !important;
  }

  #balance-history-rows > .balance-history-row {
    grid-template-columns: 1fr !important;
    gap: 6px;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
  }

  #balance-history-rows > .balance-history-row > span {
    display: flex !important;
    justify-content: space-between;
    gap: 8px;
    width: 100% !important;
  }

  #balance-history-rows > .balance-history-row > span::before {
    content: attr(data-label) ': ';
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    flex: 0 0 auto;
  }
}
