:root {
    --bg: #0f1419;
    --panel: #171d25;
    --panel-2: #1d2530;
    --text: #e8eef7;
    --muted: #93a1b5;
    --accent: #4fd1a5;
    --accent-2: #3b82f6;
    --danger: #ef6b6b;
    --border: #2a3444;
    --success: #17352b;
    --error: #3a1d1d;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, sans-serif;
    background: linear-gradient(180deg, #0b1016 0%, #121820 100%);
    color: var(--text);
    min-height: 100vh;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.user-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-shell {
    width: min(420px, 92vw);
}

.login-card h1 {
    margin-bottom: 8px;
}

.btn.full {
    width: 100%;
    margin-top: 4px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    font-weight: 700;
}

h1 {
    margin: 0 0 8px;
    font-size: 2rem;
}

.subtitle, .hint, .muted, .empty {
    color: var(--muted);
}

.badge {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    white-space: nowrap;
}

.grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    margin-bottom: 20px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.card.highlight {
    background: linear-gradient(135deg, #152033 0%, #13241f 100%);
    border-color: #2f6f57;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

h2 {
    margin: 0 0 16px;
    font-size: 1.15rem;
}

.form label {
    display: block;
    margin-bottom: 14px;
    font-size: 14px;
}

.form input,
.form select {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn {
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
}

.btn.primary {
    background: var(--accent);
    color: #062016;
}

.btn.danger {
    background: #402020;
    color: #ffb4b4;
}

.btn.tiny {
    padding: 6px 10px;
    font-size: 12px;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
}

.license-key {
    white-space: pre-wrap;
    word-break: break-all;
    background: #081018;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    font-size: 13px;
    line-height: 1.5;
}

.notes {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.6;
}

.messages {
    margin-bottom: 16px;
}

.message {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
}

.message.success {
    background: var(--success);
    border: 1px solid #2f6f57;
}

.message.error {
    background: var(--error);
    border: 1px solid #7a3030;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-weight: 600;
}

.status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.status.good {
    background: #17352b;
    color: #8ef0c8;
}

.status.bad {
    background: #3a1d1d;
    color: #ffb4b4;
}

.code-cell {
    min-width: 180px;
}

.mini-code {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    word-break: break-all;
}

code {
    background: #081018;
    padding: 2px 6px;
    border-radius: 6px;
}

.actions {
    margin-top: 12px;
}

@media (max-width: 860px) {
    .grid, .row {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 12px;
}

.stat-box {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
}

@media (max-width: 720px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
