:root {
  --bg: #080b17;
  --panel: #11162a;
  --panel-2: #171d35;
  --line: #293152;
  --text: #f4f6ff;
  --muted: #959dbb;
  --purple: #8b5cf6;
  --purple-2: #6d4ce8;
  --blue: #3478f6;
  --pink: #e24a8d;
  --green: #38c98b;
  --red: #ff6b7d;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(87, 77, 196, .2), transparent 34rem),
    var(--bg);
  font: 14px/1.55 Arial, Helvetica, sans-serif;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; }

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(36, 111, 227, .78), rgba(95, 57, 191, .76) 48%, rgba(212, 55, 125, .72)),
    #25285f;
}
.auth-card {
  width: min(100%, 390px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 18px;
  background: rgba(13, 17, 42, .78);
  box-shadow: 0 24px 70px rgba(5, 7, 22, .36);
  padding: 32px;
  backdrop-filter: blur(14px);
}
.auth-card h1 { margin: 10px 0 5px; text-align: center; font-size: 29px; letter-spacing: -.03em; }
.auth-card > p { margin: 0 0 24px; color: #c7cae1; text-align: center; }
.auth-switch { display: flex; justify-content: center; margin-top: 20px; color: #d6d9ed; font-size: 12px; }
.brand-round, .mini-logo {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--blue), var(--purple), var(--pink));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(108, 76, 232, .25);
}
.brand-round { width: 58px; height: 58px; margin: 0 auto; border-radius: 17px; font-size: 18px; }
.mini-logo { width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 13px; font-size: 13px; }

.panel-page { padding: 34px 16px; }
.panel-shell { width: min(100%, 720px); margin: 0 auto; }
.panel-shell.narrow { max-width: 460px; }
.page-head { position: relative; margin-bottom: 20px; text-align: center; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.page-head p { max-width: 540px; margin: 7px auto 0; color: var(--muted); font-size: 13px; }
.back-link {
  position: absolute;
  top: 4px;
  left: 0;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  text-decoration: none;
  font-size: 18px;
}
.account-pill {
  display: inline-flex;
  margin: 0 0 9px;
  border: 1px solid rgba(139,92,246,.35);
  border-radius: 999px;
  background: rgba(139,92,246,.09);
  color: #c8b6ff;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
}

.menu-card, .content-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 18px 55px rgba(0,0,0,.18);
}
.menu-card { display: grid; gap: 10px; padding: 18px; }
.content-card { margin-bottom: 15px; padding: 20px; }
.content-card h2 { margin: 0 0 6px; font-size: 18px; }
.content-card > p:first-of-type { margin-top: 0; }
.menu-button {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 13px;
  border: 1px solid #30395e;
  border-radius: 12px;
  background: var(--panel-2);
  padding: 11px 14px;
  text-decoration: none;
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
}
.menu-button:hover { border-color: #6658b6; background: #1b2240; transform: translateY(-1px); }
.menu-button .icon {
  display: grid;
  flex: 0 0 35px;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 10px;
  background: rgba(139,92,246,.13);
  color: #c7b8ff;
  font-size: 15px;
  font-weight: 800;
}
.menu-button strong, .menu-button small { display: block; }
.menu-button strong { font-size: 13px; }
.menu-button small { margin-top: 1px; color: var(--muted); font-size: 11px; }
.menu-button .arrow { margin-left: auto; color: #667096; }
.menu-button.danger .icon { background: rgba(255,107,125,.1); color: #ff92a0; }

label { display: block; margin-bottom: 14px; color: #dfe3f5; font-size: 12px; font-weight: 700; }
input, textarea, select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #343d62;
  border-radius: 10px;
  outline: 0;
  background: #0b0f20;
  color: var(--text);
  padding: 11px 12px;
}
input:focus, textarea:focus, select:focus { border-color: #8064ec; box-shadow: 0 0 0 3px rgba(128,100,236,.12); }
textarea { min-height: 92px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 12px; }
.help, .muted { color: var(--muted); font-size: 11px; }
.help { margin: -6px 0 14px; }
.scan-state { min-height: 18px; margin: -6px 0 12px; color: var(--muted); font-size: 11px; }
.scan-state.ok { color: var(--green); }
.scan-state.bad { color: var(--red); }

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid #3a4367;
  border-radius: 10px;
  background: #202743;
  color: #fff;
  padding: 9px 14px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
}
.button:hover { filter: brightness(1.08); }
.button.primary { border-color: transparent; background: linear-gradient(135deg, var(--purple-2), var(--pink)); }
.button.danger { border-color: rgba(255,107,125,.4); background: rgba(255,107,125,.07); color: #ff9caa; }
.button.small { min-height: 34px; padding: 6px 10px; font-size: 11px; }
.button.wide { width: 100%; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions form { margin: 0; }

.notice { margin-bottom: 15px; border: 1px solid; border-radius: 11px; padding: 11px 13px; font-size: 12px; }
.notice.success { border-color: rgba(56,201,139,.38); background: rgba(56,201,139,.08); color: #8be5bd; }
.notice.error { border-color: rgba(255,107,125,.4); background: rgba(255,107,125,.08); color: #ff9caa; }
.secret-box { margin-bottom: 15px; border: 1px solid #6b56bd; border-radius: 12px; background: #181836; padding: 14px; }
.secret-box strong { display: block; margin-bottom: 7px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { margin: 0; font-family: Consolas, monospace; font-size: 11px; }

.tenant-list { display: grid; gap: 10px; }
.tenant-row { border: 1px solid var(--line); border-radius: 12px; background: #0d1225; padding: 14px; }
.tenant-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tenant-top h3 { margin: 0; font-size: 14px; }
.tenant-top p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.tenant-meta { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 12px 0; }
.tenant-meta div { border: 1px solid #293151; border-radius: 9px; background: #12182d; padding: 9px; }
.tenant-meta span, .tenant-meta strong { display: block; overflow-wrap: anywhere; }
.tenant-meta span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.tenant-meta strong { margin-top: 3px; font-size: 11px; }
.status { display: inline-flex; border-radius: 999px; padding: 4px 8px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.status.on { background: rgba(56,201,139,.1); color: #69dfa9; }
.status.off { background: rgba(255,107,125,.1); color: #ff8998; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { border-bottom: 1px solid #272f4e; padding: 10px 8px; text-align: left; }
th { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
td { font-size: 11px; }
tr:last-child td { border-bottom: 0; }
.empty { border: 1px dashed #364063; border-radius: 11px; padding: 24px; color: var(--muted); text-align: center; }
.code { font-family: Consolas, Monaco, monospace; overflow-wrap: anywhere; }

.qris-active { display: flex; align-items: center; gap: 15px; }
.qris-active img { width: 105px; height: 105px; border: 6px solid #fff; border-radius: 10px; object-fit: cover; }
.qris-active strong, .qris-active span { display: block; }
.qris-active span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.qr-result { display: grid; grid-template-columns: 240px 1fr; align-items: center; gap: 22px; }
.qr-canvas { display: grid; min-height: 220px; place-items: center; border-radius: 12px; background: #fff; padding: 12px; }
.qr-canvas canvas { width: 100% !important; height: auto !important; }
.amount { color: #c8b6ff; font-size: 26px; font-weight: 800; }

.danger-zone { border-color: rgba(255,107,125,.3); }
.footer-note { margin: 18px auto 0; color: #727b9b; text-align: center; font-size: 10px; }

@media (max-width: 600px) {
  .auth-card { padding: 26px 20px; }
  .panel-page { padding: 24px 12px; }
  .page-head { padding-inline: 42px; }
  .page-head h1 { font-size: 22px; }
  .content-card { padding: 16px; }
  .form-grid, .tenant-meta, .qr-result { grid-template-columns: 1fr; }
  .tenant-meta { gap: 6px; }
  .qris-active { align-items: flex-start; }
  .qris-active img { width: 84px; height: 84px; }
  .copy-row { flex-direction: column; }
}
