:root {
  color-scheme: dark;
  --bg: #08090c;
  --surface: #111319;
  --surface-2: #171a22;
  --line: #2b2f3a;
  --text: #f6f7fa;
  --muted: #9ca3b3;
  --red: #ef233c;
  --red-2: #b90f29;
  --green: #2fd083;
  --shadow: 0 22px 60px rgba(0, 0, 0, .34);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 88% 0, rgba(239,35,60,.12), transparent 32rem), var(--bg); color: var(--text); min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: 16px max(24px, calc((100vw - 1240px)/2)); background: rgba(8,9,12,.88); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand > div:last-child { display: grid; gap: 2px; }
.brand span { color: var(--muted); font-size: 12px; }
.brand-mark { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(145deg, var(--red), #8f0920); color: white; font-weight: 900; font-size: 28px; box-shadow: 0 14px 35px rgba(239,35,60,.3); }
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; font-size: 20px; }
.container { width: min(1240px, calc(100% - 32px)); margin: 32px auto 64px; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin: 28px 0; }
.hero h1 { font-size: clamp(32px, 5vw, 58px); max-width: 760px; margin: 8px 0 12px; letter-spacing: -.045em; line-height: 1; }
.hero p:not(.eyebrow) { color: var(--muted); max-width: 650px; }
.eyebrow { color: #ff4b63; font-weight: 800; font-size: 12px; letter-spacing: .16em; margin: 0; }
.health { white-space: nowrap; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; background: var(--surface); }
.health span { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); margin-right: 8px; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin: 24px 0; }
.stats article { background: linear-gradient(145deg, #151821, #101218); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.stats span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.stats strong { font-size: 30px; }
.panel { background: rgba(17,19,25,.94); border: 1px solid var(--line); border-radius: 24px; padding: 24px; margin-top: 18px; box-shadow: var(--shadow); }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.panel h2 { margin: 5px 0 0; font-size: 23px; }
.create-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; align-items: end; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
input, select { width: 100%; border: 1px solid #343946; border-radius: 12px; padding: 12px 13px; color: var(--text); background: #0d0f14; outline: none; }
input:focus, select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(239,35,60,.12); }
.wide { grid-column: span 4; }
.primary, .ghost, .copy-button, .action-menu button { border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 800; color: white; background: linear-gradient(145deg, var(--red), var(--red-2)); }
.primary:hover { filter: brightness(1.1); }
.ghost { background: #171a22; border: 1px solid var(--line); color: var(--text); }
.full { width: 100%; }
.search { display: flex; gap: 8px; width: min(440px, 100%); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 920px; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; text-align: left; padding: 12px; border-bottom: 1px solid var(--line); }
td { padding: 16px 12px; border-bottom: 1px solid #222631; vertical-align: middle; }
td strong, td small { display: block; }
td small { color: var(--muted); margin-top: 5px; }
code { color: #ff9aaa; }
.badge { display: inline-block; border-radius: 999px; padding: 7px 10px; font-weight: 900; font-size: 10px; letter-spacing: .06em; }
.badge.active { color: #77efb5; background: rgba(47,208,131,.12); }
.badge.disabled { color: #ff9aaa; background: rgba(239,35,60,.12); }
.actions { position: relative; }
.actions summary { list-style: none; cursor: pointer; display: inline-block; border: 1px solid var(--line); padding: 8px 12px; border-radius: 10px; }
.actions summary::-webkit-details-marker { display: none; }
.action-menu { position: absolute; right: 0; top: 38px; z-index: 5; width: 220px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #171a22; box-shadow: var(--shadow); display: grid; gap: 8px; }
.action-menu form { display: flex; gap: 7px; }
.action-menu button, .action-menu select { width: 100%; padding: 9px; font-size: 12px; }
.action-menu button { background: #262b37; }
.action-menu button.danger { background: #7d1022; }
.row-actions { display: flex; align-items: center; gap: 8px; }
.row-actions > form { margin: 0; }
.key-button { white-space: nowrap; border: 1px solid rgba(239,35,60,.48); border-radius: 10px; padding: 9px 12px; color: #fff; font-weight: 800; background: rgba(239,35,60,.14); }
.key-button:hover { background: rgba(239,35,60,.25); }
.danger-button { white-space: nowrap; border: 1px solid rgba(239,35,60,.5); border-radius: 10px; padding: 9px 12px; color: #ffb3bd; font-weight: 800; background: #5e0d1b; }
.panel-help { max-width: 900px; margin: -7px 0 20px; color: var(--muted); line-height: 1.6; }
.panel-help code { padding: 3px 7px; border-radius: 7px; background: #090b0f; }
.signed-badge { padding: 8px 12px; border: 1px solid rgba(47,208,131,.35); border-radius: 999px; color: #77efb5; background: rgba(47,208,131,.08); font-size: 12px; font-weight: 800; }
.update-upload-grid { display: grid; grid-template-columns: 2fr 2fr 1fr auto; gap: 14px; align-items: end; }
.update-upload-grid input[type=file] { padding: 9px; }
.update-table { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 12px; }
.badge.beta { color: #b8a5ff; background: rgba(117,83,255,.15); }
.update-success { color: #77efb5; }
.update-failure { color: #ff9aaa; }
.empty { color: var(--muted); text-align: center; padding: 42px; }
.alert { width: min(1240px, 100%); margin: 16px auto; border: 1px solid var(--line); border-radius: 16px; padding: 15px 18px; background: #171a22; }
.alert.success { border-color: rgba(47,208,131,.4); }
.alert.error { border-color: rgba(239,35,60,.5); }
.secret-row { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.secret-row code { flex: 1; display: block; padding: 12px; border-radius: 10px; background: #090b0f; font-size: 17px; overflow-wrap: anywhere; }
.license-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: rgba(3,4,7,.82); backdrop-filter: blur(12px); }
.license-modal-card { position: relative; width: min(620px, 100%); padding: 30px; border: 1px solid rgba(239,35,60,.45); border-radius: 24px; background: linear-gradient(145deg, #171a22, #0e1016); box-shadow: 0 35px 100px rgba(0,0,0,.62); }
.license-modal-card h2 { margin: 8px 42px 10px 0; font-size: clamp(25px, 5vw, 36px); letter-spacing: -.035em; }
.license-modal-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.license-modal-card code { display: block; margin: 20px 0; padding: 18px; border: 1px solid #343946; border-radius: 14px; color: #fff; background: #08090c; font-size: clamp(17px, 4vw, 24px); font-weight: 900; letter-spacing: .05em; text-align: center; overflow-wrap: anywhere; user-select: all; }
.license-modal-actions { display: flex; gap: 10px; }
.license-modal-actions .copy-button { flex: 1; }
.modal-close { position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: #fff; background: #20242e; font-size: 25px; line-height: 1; }
.login-body { display: grid; place-items: center; }
.login-shell { width: min(440px, calc(100% - 28px)); }
.login-card { background: rgba(17,19,25,.96); border: 1px solid var(--line); border-radius: 28px; padding: 34px; box-shadow: var(--shadow); }
.login-card .brand-mark { margin-bottom: 28px; }
.login-card h1 { font-size: 36px; letter-spacing: -.04em; margin: 7px 0 10px; }
.login-card .muted, .security-note { color: var(--muted); line-height: 1.6; }
.login-card form { display: grid; gap: 16px; margin-top: 24px; }
.security-note { font-size: 12px; text-align: center; margin: 20px 0 0; }
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .update-upload-grid { grid-template-columns: repeat(2, 1fr); }
  .create-grid { grid-template-columns: repeat(2, 1fr); }
  .wide { grid-column: span 2; }
  .hero { align-items: start; flex-direction: column; }
}
@media (max-width: 620px) {
  .container { width: min(100% - 20px, 1240px); margin-top: 20px; }
  .topbar { padding: 12px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 9px; }
  .panel { padding: 16px; border-radius: 18px; }
  .create-grid { grid-template-columns: 1fr; }
  .update-upload-grid { grid-template-columns: 1fr; }
  .wide { grid-column: span 1; }
  .list-title { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  .hero h1 { font-size: 39px; }
  .login-card { padding: 25px; }
  .license-modal-card { padding: 24px 18px 18px; }
  .license-modal-actions { flex-direction: column; }
}
