:root {
  color-scheme: dark;
  --bg: #071015;
  --panel: #101b22;
  --border: #20333c;
  --text: #e7f2f4;
  --muted: #91a7ad;
  --brand: #00b894;
  --brand-dark: #083c32;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
header, main { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
header { display: flex; justify-content: space-between; align-items: center; padding: 28px 0 18px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h2 { font-size: 1.05rem; }
.eyebrow { color: var(--brand); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
main { display: grid; gap: 18px; padding-bottom: 40px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.section-title, .setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-title p, small, .empty { color: var(--muted); }
button, select { border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; background: #14252d; color: var(--text); }
input, textarea { width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 9px 10px; background: #0b151a; color: var(--text); }
label { display: grid; gap: 6px; color: var(--muted); font-size: .82rem; }
button:not(:disabled) { cursor: pointer; }
button:disabled { opacity: .45; }
.badge { border-radius: 999px; padding: 6px 10px; background: #1c2930; font-size: .8rem; }
.badge[data-kind="success"] { background: var(--brand-dark); color: #6ef1d3; }
.badge[data-kind="warning"] { background: #3a2c0b; color: #ffd36b; }
.badge[data-kind="danger"] { background: #421b22; color: #ff9fac; }
.settings-grid { display: grid; gap: 10px; margin-top: 18px; }
.config-form { display: grid; grid-template-columns: 1fr 1fr 140px auto; gap: 10px; align-items: end; margin-top: 18px; }
.setting { border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.setting > div { display: grid; gap: 4px; }
.actions { display: flex !important; grid-auto-flow: column; }
.table-wrap { overflow-x: auto; margin-top: 18px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; border-bottom: 1px solid var(--border); padding: 12px 10px; }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr:focus { background: #14252d; outline: none; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; }
.empty { padding: 28px; text-align: center; }
dialog { width: min(760px, calc(100% - 24px)); max-height: calc(100vh - 32px); overflow: auto; border: 1px solid var(--border); border-radius: 16px; padding: 20px; background: var(--panel); color: var(--text); }
dialog::backdrop { background: rgb(0 0 0 / .7); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wide { grid-column: 1 / -1; }
.payment-form { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-items: end; }
.payment-form h3 { grid-column: 1 / -1; margin: 0; }
.payment-list { margin: 14px 0; color: var(--muted); }
.danger-action { border-color: #6e2632; color: #ffb3be; }

@media (max-width: 720px) {
  .section-title, .setting { align-items: flex-start; flex-direction: column; }
  .actions { width: 100%; }
  .actions button { flex: 1; }
  .config-form, .detail-grid, .payment-form { grid-template-columns: 1fr; }
  .wide, .payment-form h3 { grid-column: auto; }
}
