:root {
    color-scheme: dark;
    --bg: #06070b;
    --panel: rgba(17, 19, 27, .86);
    --panel-strong: #11131b;
    --line: rgba(255, 255, 255, .085);
    --line-bright: rgba(255, 255, 255, .14);
    --text: #f7f7fb;
    --muted: #8b90a3;
    --violet: #8b5cf6;
    --violet-light: #a78bfa;
    --green: #35d49a;
    --amber: #f4b740;
    --red: #fb7185;
    --shadow: 0 24px 70px rgba(0, 0, 0, .34);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { 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% -20%, rgba(98, 61, 198, .17), transparent 38%),
        linear-gradient(180deg, #080910 0%, var(--bg) 52%);
}

button, input, select, textarea { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
code { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; }

.ambient {
    position: fixed;
    z-index: -1;
    width: 380px;
    height: 380px;
    border-radius: 999px;
    filter: blur(115px);
    opacity: .11;
    pointer-events: none;
}
.ambient-one { top: 12%; left: -180px; background: var(--violet); }
.ambient-two { right: -220px; bottom: 5%; background: #2563eb; }

.topbar {
    height: 76px;
    padding: 0 max(24px, calc((100vw - 1220px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: rgba(6, 7, 11, .72);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand > span:last-child { display: grid; line-height: 1.1; }
.brand strong { font-size: 15px; letter-spacing: .01em; }
.brand small { margin-top: 5px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .14em; }

.brand-mark {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: white;
    font-size: 25px;
    font-weight: 900;
    background: linear-gradient(145deg, #a78bfa, #6d28d9 70%);
    box-shadow: 0 14px 40px rgba(124, 58, 237, .32), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.brand-mark-small { width: 40px; height: 40px; border-radius: 12px; font-size: 18px; }

.top-actions { display: flex; align-items: center; gap: 8px; }
.top-actions form { margin: 0; }

.page-shell { width: min(1220px, calc(100% - 48px)); margin: 0 auto; padding: 62px 0 42px; }

.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 34px; }
.hero-row h1 { margin: 9px 0 10px; font-size: clamp(32px, 5vw, 48px); line-height: 1; letter-spacing: -.045em; }
.hero-row .muted { margin: 0; max-width: 650px; }

.eyebrow {
    margin: 0;
    color: var(--violet-light);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.muted { color: var(--muted); }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); }

.button {
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text);
    background: transparent;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 12px 30px rgba(109, 40, 217, .22); }
.button-primary:hover { box-shadow: 0 15px 36px rgba(109, 40, 217, .34); }
.button-ghost { border-color: var(--line); color: #c4c7d4; background: rgba(255, 255, 255, .025); }
.button-ghost:hover { border-color: var(--line-bright); background: rgba(255, 255, 255, .055); }
.button-large { min-height: 50px; border-radius: 12px; }
.button-block { width: 100%; }

.create-panel { position: relative; }
.create-panel > summary { list-style: none; user-select: none; }
.create-panel > summary::-webkit-details-marker { display: none; }
.create-panel[open] > summary::after { content: ''; position: fixed; inset: 0; z-index: 25; background: rgba(1, 2, 6, .72); backdrop-filter: blur(5px); }
.create-form {
    position: fixed;
    z-index: 30;
    width: min(460px, calc(100% - 30px));
    max-height: calc(100vh - 40px);
    overflow: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 25px;
    border: 1px solid var(--line-bright);
    border-radius: 18px;
    background: #11131b;
    box-shadow: var(--shadow);
}
.form-head { display: flex; justify-content: space-between; margin-bottom: 19px; }
.form-head div { display: grid; gap: 5px; }
.form-head strong { font-size: 18px; }
.form-head small { color: var(--muted); }
.create-form label, .login-form label { display: grid; gap: 8px; margin-bottom: 14px; }
.create-form label > span:first-child, .login-form label > span:first-child { color: #b8bccb; font-size: 11px; font-weight: 700; }
.create-form em { color: #686d80; font-weight: 500; font-style: normal; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    color: var(--text);
    background: #090a10;
    transition: border-color .18s ease, box-shadow .18s ease;
}
input, select { height: 44px; padding: 0 13px; }
textarea { resize: vertical; padding: 12px 13px; }
input:focus, select:focus, textarea:focus { border-color: rgba(139, 92, 246, .72); box-shadow: 0 0 0 3px rgba(139, 92, 246, .11); }
input::placeholder, textarea::placeholder { color: #555a6b; }

.alert { margin: 18px 0; padding: 13px 16px; border: 1px solid; border-radius: 11px; font-size: 12px; transition: opacity .4s, transform .4s; }
.alert-success { color: #8ef0c9; border-color: rgba(53, 212, 154, .24); background: rgba(53, 212, 154, .08); }
.alert-error { color: #fda4af; border-color: rgba(251, 113, 133, .24); background: rgba(251, 113, 133, .08); }
.fade-out { opacity: 0; transform: translateY(-5px); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card {
    min-height: 112px;
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(145deg, rgba(21, 23, 33, .9), rgba(13, 14, 21, .88));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}
.stat-card > div { display: grid; gap: 5px; }
.stat-card small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.stat-card strong { font-size: 27px; line-height: 1; }
.stat-icon { width: 43px; height: 43px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; }
.stat-icon.violet { color: #b9a3ff; background: rgba(139, 92, 246, .12); }
.stat-icon.green { color: var(--green); background: rgba(53, 212, 154, .1); }
.stat-icon.amber { color: var(--amber); background: rgba(244, 183, 64, .1); }
.stat-icon.red { color: var(--red); background: rgba(251, 113, 133, .1); }

.api-card {
    margin: 17px 0 42px;
    padding: 17px 19px;
    border: 1px solid rgba(139, 92, 246, .19);
    border-radius: 13px;
    display: grid;
    grid-template-columns: minmax(150px, .7fr) minmax(280px, 2fr) auto;
    align-items: center;
    gap: 18px;
    background: linear-gradient(90deg, rgba(139, 92, 246, .075), rgba(15, 17, 25, .75));
}
.api-status { display: grid; gap: 3px; }
.api-status span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.api-status small { color: var(--muted); font-size: 10px; }
.api-card code { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: #c7b8ff; font-size: 11px; white-space: nowrap; }
.copy-button, .mini-copy {
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #bbbfd0;
    background: rgba(255, 255, 255, .035);
    cursor: pointer;
}
.copy-button { height: 34px; padding: 0 11px; font-size: 10px; font-weight: 750; }
.copied { color: var(--green) !important; border-color: rgba(53, 212, 154, .3) !important; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.section-head h2 { margin: 6px 0 0; font-size: 23px; letter-spacing: -.025em; }
.search-box { width: min(320px, 100%); position: relative; }
.search-box span { position: absolute; left: 13px; top: 9px; color: #6d7284; font-size: 20px; }
.search-box input { padding-left: 38px; background: rgba(12, 13, 20, .8); }

.license-list { display: grid; gap: 11px; }
.license-card {
    border: 1px solid var(--line);
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(17, 19, 27, .94), rgba(12, 13, 20, .93));
    overflow: hidden;
    transition: border-color .18s ease, transform .18s ease;
}
.license-card:hover { border-color: var(--line-bright); transform: translateY(-1px); }
.license-main { padding: 19px 21px 16px; }
.license-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.license-title-row h3 { margin: 7px 0 0; color: #a7abbb; font-size: 12px; font-weight: 600; }
.key-row { display: flex; align-items: center; gap: 8px; }
.key-row code { color: #f2efff; font-size: 14px; font-weight: 700; letter-spacing: .025em; }
.mini-copy { padding: 3px 7px; font-size: 9px; }
.status { padding: 6px 9px; border: 1px solid; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.status i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.status-active { color: var(--green); border-color: rgba(53, 212, 154, .22); background: rgba(53, 212, 154, .07); }
.status-pending { color: var(--amber); border-color: rgba(244, 183, 64, .22); background: rgba(244, 183, 64, .07); }
.status-disabled { color: var(--red); border-color: rgba(251, 113, 133, .22); background: rgba(251, 113, 133, .07); }
.license-meta { margin-top: 18px; display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr; gap: 15px; }
.license-meta > div { min-width: 0; display: grid; gap: 6px; }
.license-meta small { color: #626779; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.license-meta span, .license-meta code { overflow: hidden; text-overflow: ellipsis; color: #a9adbd; font-size: 10px; white-space: nowrap; }
.license-meta .request-meta code { color: var(--amber); }
.license-note { margin: 14px 0 0; padding-top: 13px; border-top: 1px dashed var(--line); color: #777c8e; font-size: 11px; }
.license-actions { padding: 10px 13px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; gap: 6px; background: rgba(5, 6, 10, .28); }
.license-actions form { margin: 0; }
.action { height: 29px; padding: 0 10px; border: 1px solid transparent; border-radius: 7px; color: #8d92a3; background: transparent; font-size: 9px; font-weight: 750; cursor: pointer; }
.action:hover { color: #d4d7e1; border-color: var(--line); background: rgba(255, 255, 255, .035); }
.action.approve { color: var(--green); background: rgba(53, 212, 154, .08); }
.action.danger:hover { color: var(--red); border-color: rgba(251, 113, 133, .18); background: rgba(251, 113, 133, .07); }

.empty-state { padding: 72px 20px; border: 1px dashed var(--line-bright); border-radius: 16px; text-align: center; background: rgba(17, 19, 27, .4); }
.empty-icon { color: var(--violet-light); font-size: 42px; }
.empty-state h3 { margin: 12px 0 5px; font-size: 17px; }
.empty-state p, .no-results { color: var(--muted); font-size: 12px; }
.no-results { padding: 40px; text-align: center; }

footer { width: min(1220px, calc(100% - 48px)); margin: 20px auto 0; padding: 24px 0 34px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; color: #575c6c; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }

.login-body { display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 32%, rgba(124, 58, 237, .22), transparent 26%), #06070b; }
.login-body::before { content: ''; position: fixed; inset: 0; opacity: .24; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 42px 42px; mask-image: radial-gradient(circle at center, black, transparent 72%); }
.login-shell { width: min(430px, calc(100% - 32px)); position: relative; z-index: 1; }
.login-card { padding: 39px; border: 1px solid var(--line-bright); border-radius: 22px; text-align: center; background: rgba(15, 16, 24, .9); backdrop-filter: blur(22px); box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.045); }
.login-card .brand-mark { margin: 0 auto 24px; }
.login-card h1 { margin: 8px 0 7px; font-size: 30px; letter-spacing: -.04em; }
.login-copy { margin: 0 auto 28px; font-size: 12px; line-height: 1.6; }
.login-form { text-align: left; }
.password-field { display: block; position: relative; }
.password-field input { padding-right: 58px; }
.password-toggle { position: absolute; top: 6px; right: 6px; height: 32px; padding: 0 9px; border: 0; border-radius: 7px; color: var(--violet-light); background: rgba(139, 92, 246, .09); font-size: 10px; cursor: pointer; }
.login-foot { margin: 24px 0 0; color: #555a6a; font-size: 9px; line-height: 1.5; }

[hidden] { display: none !important; }

@media (max-width: 900px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .api-card { grid-template-columns: 1fr auto; }
    .api-status { grid-column: 1 / -1; }
    .license-meta { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
    .topbar { height: 68px; padding: 0 16px; }
    .brand small, .top-actions .button-ghost:first-child { display: none; }
    .page-shell { width: min(100% - 28px, 1220px); padding-top: 38px; }
    .hero-row { align-items: flex-start; flex-direction: column; }
    .hero-row h1 { font-size: 36px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .stat-card { min-height: 92px; padding: 14px; gap: 11px; }
    .stat-icon { width: 36px; height: 36px; }
    .stat-card strong { font-size: 22px; }
    .api-card { grid-template-columns: minmax(0, 1fr) auto; }
    .api-card code { grid-column: 1 / 2; }
    .section-head { align-items: stretch; flex-direction: column; }
    .search-box { width: 100%; }
    .license-main { padding: 16px; }
    .license-title-row { gap: 10px; }
    .key-row code { font-size: 11px; }
    .license-meta { grid-template-columns: 1fr; }
    .license-actions { flex-wrap: wrap; justify-content: flex-start; }
    footer { width: calc(100% - 28px); flex-direction: column; }
    .login-card { padding: 29px 23px; }
    .form-grid { grid-template-columns: 1fr; gap: 0; }
}

