:root {
    color-scheme: dark;
    --bg: #07101f;
    --panel: rgba(13, 25, 45, .92);
    --line: rgba(148, 163, 184, .2);
    --text: #f8fafc;
    --muted: #94a3b8;
    --blue: #3b82f6;
    --cyan: #22d3ee;
    --danger: #ef4444;
    font-family: "Be Vietnam Pro", Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--text); background:
    radial-gradient(circle at 20% 20%, rgba(37, 99, 235, .22), transparent 34%),
    radial-gradient(circle at 82% 80%, rgba(6, 182, 212, .14), transparent 28%), var(--bg); }
button, input, select, textarea { font: inherit; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(460px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 30px 80px rgba(0,0,0,.38); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand-mark { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue), var(--cyan)); font-weight: 900; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 22px; margin-bottom: 4px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.6; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: rgba(2, 6, 23, .7); margin-bottom: 18px; }
.tab { border: 0; color: var(--muted); background: transparent; padding: 10px; border-radius: 9px; cursor: pointer; }
.tab.active { color: white; background: #1e3a8a; }
.field { display: grid; gap: 7px; margin: 13px 0; }
.field label { font-size: 12px; color: #cbd5e1; font-weight: 700; }
.input { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: rgba(2, 6, 23, .78); color: white; padding: 12px 13px; outline: none; }
.input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .12); }
.btn { width: 100%; border: 0; border-radius: 10px; padding: 12px 14px; color: white; font-weight: 800; cursor: pointer; background: linear-gradient(135deg, #2563eb, #0891b2); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-secondary { background: #1e293b; border: 1px solid var(--line); }
.message { display: none; margin: 14px 0 0; padding: 10px 12px; border-radius: 9px; font-size: 12px; line-height: 1.5; }
.message.show { display: block; }
.message.error { color: #fecaca; background: rgba(127, 29, 29, .45); }
.message.success { color: #bbf7d0; background: rgba(20, 83, 45, .45); }
.activation { display: none; }
.activation.show { display: block; }
.contact { display: inline-flex; margin-top: 16px; color: #67e8f9; text-decoration: none; font-size: 12px; }
.admin-shell { width: min(1180px, calc(100% - 32px)); margin: 24px auto; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.admin-grid { display: grid; grid-template-columns: 360px 1fr; gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid .wide { grid-column: 1 / -1; }
.inline-check { display: flex; gap: 8px; align-items: center; color: #cbd5e1; font-size: 12px; margin: 12px 0; }
.key-list { display: grid; gap: 10px; max-height: calc(100vh - 150px); overflow: auto; }
.key-row { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: rgba(2, 6, 23, .5); }
.key-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.key-title { font-weight: 800; }
.key-code { color: #67e8f9; font: 12px ui-monospace, monospace; margin-top: 4px; }
.badge { display: inline-flex; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 800; background: rgba(34,197,94,.16); color: #86efac; }
.badge.disabled { background: rgba(239,68,68,.16); color: #fca5a5; }
.key-meta { color: var(--muted); font-size: 11px; line-height: 1.7; margin-top: 9px; }
.row-actions { display: flex; gap: 8px; margin-top: 10px; }
.small-btn { border: 1px solid var(--line); color: white; background: #1e293b; border-radius: 8px; padding: 7px 10px; cursor: pointer; }
.small-btn.danger { color: #fecaca; background: rgba(127,29,29,.35); }
.created-key { display: none; padding: 14px; border: 1px solid #0891b2; background: rgba(8,145,178,.12); border-radius: 10px; margin-bottom: 14px; }
.created-key.show { display: block; }
.panel-divider { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
@media (max-width: 850px) { .admin-grid { grid-template-columns: 1fr; } .key-list { max-height: none; } }
