:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: rgba(18, 24, 38, .88);
  --panel-soft: rgba(23, 31, 48, .72);
  --line: rgba(148, 163, 184, .15);
  --text: #f8fafc;
  --muted: #8b9ab1;
  --blue: #60a5fa;
  --green: #34d399;
  --red: #fb7185;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 15% 0%, rgba(37, 99, 235, .14), transparent 34rem), radial-gradient(circle at 85% 20%, rgba(124, 58, 237, .1), transparent 30rem), var(--bg); color: var(--text); }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.shell { width: min(1440px, calc(100% - 36px)); margin: 0 auto; padding: 54px 0 32px; }
.admin-login { width: min(430px, 100%); margin: 10vh auto 0; padding: 40px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(150deg, rgba(24, 33, 52, .9), rgba(9, 13, 23, .92)); box-shadow: 0 30px 100px rgba(0, 0, 0, .35); }
.login-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(135deg, #2563eb, #7c3aed); font-weight: 800; letter-spacing: -.05em; margin-bottom: 30px; }
.eyebrow { margin: 0 0 9px; color: #93c5fd; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 20px; letter-spacing: -.02em; }
.muted { color: var(--muted); line-height: 1.6; }
.stack-form { display: grid; gap: 10px; margin-top: 28px; }
label, legend { color: #cbd5e1; font-size: 12px; font-weight: 700; }
label span { color: #64748b; font-weight: 500; }
input { width: 100%; min-height: 44px; padding: 0 13px; border: 1px solid rgba(148, 163, 184, .2); border-radius: 10px; outline: 0; background: rgba(8, 12, 21, .78); color: var(--text); }
input:focus { border-color: rgba(96, 165, 250, .8); box-shadow: 0 0 0 3px rgba(96, 165, 250, .12); }
.primary-button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 10px; background: linear-gradient(135deg, #3b82f6, #6366f1); color: white; font-weight: 800; transition: transform .16s ease, filter .16s ease; }
.primary-button:hover { filter: brightness(1.1); transform: translateY(-1px); }
.primary-button:disabled, button:disabled { cursor: wait; opacity: .6; transform: none; }
.form-message { min-height: 18px; margin: 2px 0 0; font-size: 12px; }
.form-message.error { color: #fda4af; }
.form-message.success { color: #6ee7b7; }
.form-message.info { color: #93c5fd; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 26px; }
.topbar h1 { margin-bottom: 0; }
.topbar-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border: 1px solid rgba(52, 211, 153, .2); border-radius: 999px; color: #a7f3d0; font-size: 12px; }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 11px var(--green); }
.ghost-button { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(15, 23, 42, .65); color: #cbd5e1; font-size: 12px; font-weight: 700; }
.ghost-button:hover { border-color: rgba(148, 163, 184, .35); background: rgba(30, 41, 59, .85); }
.danger-text { color: #fda4af; }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric-card { min-height: 130px; padding: 19px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel-soft); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.metric-card.accent-blue { border-color: rgba(96, 165, 250, .3); background: linear-gradient(145deg, rgba(30, 64, 175, .28), var(--panel-soft)); }
.metric-card.accent-purple { border-color: rgba(167, 139, 250, .3); background: linear-gradient(145deg, rgba(91, 33, 182, .22), var(--panel-soft)); }
.metric-label { display: block; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.metric-card strong { display: block; margin: 14px 0 8px; font-size: 25px; letter-spacing: -.04em; }
.metric-card small { color: #94a3b8; font-size: 11px; }
.metric-card small b { color: #cbd5e1; }
.content-grid { display: grid; grid-template-columns: minmax(300px, 390px) minmax(0, 1fr); gap: 16px; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: inset 0 1px 0 rgba(255,255,255,.035); }
.panel-heading { display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; margin-bottom: 11px; }
.panel-icon, .count-badge { display: grid; place-items: center; min-width: 30px; height: 30px; border: 1px solid rgba(96, 165, 250, .25); border-radius: 9px; color: #93c5fd; background: rgba(59, 130, 246, .12); }
.count-badge { padding: 0 9px; font-size: 12px; }
.key-panel > .muted { margin-bottom: 20px; font-size: 12px; }
.key-form { display: grid; gap: 9px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 54px; }
.input-suffix span { position: absolute; top: 14px; right: 12px; color: #64748b; font-size: 11px; }
.check-line { display: flex; align-items: center; gap: 9px; min-height: 26px; color: #cbd5e1; font-size: 12px; font-weight: 600; }
.check-line input { width: 16px; min-height: 16px; accent-color: #60a5fa; }
fieldset { display: grid; gap: 5px; margin: 7px 0 4px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
legend { padding: 0 5px; }
.field-help { color: #64748b; font-size: 10px; line-height: 1.5; margin-bottom: 6px; }
.table-wrap { overflow: auto; margin: 20px -24px -24px; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 710px; }
th, td { padding: 14px 16px; border-bottom: 1px solid rgba(148, 163, 184, .1); text-align: left; vertical-align: middle; font-size: 12px; }
th { color: #64748b; font-size: 10px; text-transform: uppercase; letter-spacing: .09em; }
td strong { display: block; color: #e2e8f0; }
.key-id, .service-note { display: block; margin-top: 5px; color: #64748b; font-size: 10px; }
.tag { display: inline-block; padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.tag.email { color: #bfdbfe; background: rgba(59, 130, 246, .16); }
.tag.sms { color: #ddd6fe; background: rgba(124, 58, 237, .18); }
.muted-tag { color: #94a3b8; background: rgba(100, 116, 139, .16); }
.status { display: inline-block; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.status.active { color: #a7f3d0; background: rgba(16, 185, 129, .14); }
.status.inactive { color: #fda4af; background: rgba(244, 63, 94, .12); }
.table-action { padding: 5px 8px; border: 1px solid rgba(251, 113, 133, .25); border-radius: 7px; background: transparent; color: #fda4af; font-size: 10px; font-weight: 800; }
.table-action:hover { background: rgba(244, 63, 94, .12); }
.empty-row { padding: 30px; color: #64748b; text-align: center; }
.footer-note { margin-top: 18px; color: #64748b; font-size: 11px; text-align: center; }
.reveal-dialog { width: min(520px, calc(100% - 30px)); padding: 0; border: 0; background: transparent; color: var(--text); }
.reveal-dialog::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(5px); }
.dialog-card { position: relative; padding: 30px; border: 1px solid rgba(96, 165, 250, .32); border-radius: 18px; background: #111827; box-shadow: 0 25px 80px rgba(0,0,0,.5); }
.dialog-close { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; color: #94a3b8; font-size: 24px; }
.key-reveal { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #080b12; }
.key-reveal code { flex: 1; overflow-wrap: anywhere; color: #bfdbfe; font-size: 12px; line-height: 1.5; }
.key-reveal button { padding: 8px 11px; border: 0; border-radius: 7px; background: #2563eb; color: white; font-size: 11px; font-weight: 800; }

@media (max-width: 1180px) { .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .shell { width: min(100% - 22px, 620px); padding-top: 24px; } .topbar { align-items: flex-start; flex-direction: column; } .topbar-actions { justify-content: flex-start; } .content-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .admin-login, .panel { padding: 20px; } .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .metric-card { padding: 14px; } .metric-card strong { font-size: 20px; } .table-wrap { margin-left: -20px; margin-right: -20px; } }
