* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0d1117;
    --surface: #161b22;
    --surface2: #21262d;
    --border: #30363d;
    --text: #e6edf3;
    --text-dim: #8b949e;
    --accent: #58a6ff;
    --green: #3fb950;
    --red: #f85149;
    --yellow: #d29922;
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

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

.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 360px;
    text-align: center;
}

.login-box h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.login-box p {
    color: var(--text-dim);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface2);
    color: var(--text);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.btn:hover { background: var(--border); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600; }
.btn-primary:hover { opacity: 0.85; background: var(--accent); }
.btn-danger { color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: rgba(248, 81, 73, 0.15); }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.75rem; }

.dashboard { display: none; }

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.top-bar h1 { font-size: 1.1rem; color: var(--accent); }

.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 2rem; }

.toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    flex: 1;
    text-align: center;
}

.stat-card .num { font-size: 1.75rem; font-weight: 700; }
.stat-card .label { color: var(--text-dim); font-size: 0.8rem; margin-top: 0.25rem; }
.stat-card .num.green { color: var(--green); }
.stat-card .num.red { color: var(--red); }
.stat-card .num.yellow { color: var(--yellow); }

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 0.825rem;
}

th, td {
    padding: 0.65rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--surface2);
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(88, 166, 255, 0.04); }

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-active { background: rgba(63, 185, 80, 0.15); color: var(--green); }
.badge-expired { background: rgba(210, 153, 34, 0.15); color: var(--yellow); }
.badge-revoked { background: rgba(248, 81, 73, 0.15); color: var(--red); }

.serial-key {
    font-family: 'Consolas', 'Courier New', monospace;
    background: var(--surface2);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    user-select: all;
}

.hwid-cell {
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--text-dim);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    width: 420px;
    max-width: 90vw;
}

.modal h2 { font-size: 1.1rem; margin-bottom: 1rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.8rem; color: var(--text-dim); margin-bottom: 0.3rem; }

.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.5rem; }

.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    z-index: 200;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
}

.toast.show { opacity: 1; transform: translateY(0); }

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
}
