/* Global dark theme */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background-color: #0d1117;
    color: #c9d1d9;
    min-height: 100vh;
}

a {
    color: #3D8EFF;
    text-decoration: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.card {
    background-color: #161b22;
    border-radius: 10px;
    padding: 20px 22px;
    box-shadow: 0 0 0 1px rgba(240, 246, 252, 0.1);
}

.card + .card {
    margin-top: 16px;
}

.page-title {
    font-size: 22px;
    margin-bottom: 18px;
    font-weight: 600;
}

.btn {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: #3D8EFF;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #3477d2;
}

.btn-danger {
    background-color: #da3633;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #b62522;
}

.btn-success {
    background-color: #238636;
    color: #ffffff;
}

.btn-success:hover {
    background-color: #1a6a2a;
}

.btn-warning {
    background-color: #d29922;
    color: #0d1117;
}

.btn-warning:hover {
    background-color: #b38018;
}

.btn-outline {
    background-color: transparent;
    color: #c9d1d9;
    border: 1px solid #30363d;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.top-nav-title {
    font-weight: 600;
    font-size: 18px;
}

.top-nav-actions {
    display: flex;
    gap: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background-color: #161b22;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 0 0 1px rgba(240, 246, 252, 0.08);
}

.stat-label {
    font-size: 12px;
    color: #8b949e;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 20px;
    font-weight: 600;
}

.stat-tag {
    font-size: 11px;
    margin-top: 4px;
    color: #8b949e;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
    font-size: 13px;
}

thead {
    background-color: #0d1117;
}

th,
td {
    padding: 8px 10px;
    border-bottom: 1px solid #30363d;
    text-align: left;
    white-space: nowrap;
}

th {
    font-weight: 500;
    color: #8b949e;
    font-size: 12px;
}

tbody tr:hover {
    background-color: #161b22;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
}

.status-active {
    background-color: rgba(35, 134, 54, 0.25);
    color: #3fb950;
}

.status-blocked {
    background-color: rgba(218, 54, 51, 0.25);
    color: #ff7b72;
}

.status-expired {
    background-color: rgba(210, 153, 34, 0.25);
    color: #e3b341;
}

.badge-online {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #3fb950;
    font-size: 11px;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background-color: #3fb950;
}

.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #8b949e;
}

.form-control,
.form-select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #30363d;
    background-color: #0d1117;
    color: #c9d1d9;
    font-size: 14px;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: #3D8EFF;
    box-shadow: 0 0 0 1px rgba(61, 142, 255, 0.4);
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 380px;
}

.muted {
    color: #8b949e;
    font-size: 12px;
}

.alert {
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 13px;
}

.alert-error {
    background-color: rgba(248, 81, 73, 0.16);
    color: #ff7b72;
    border: 1px solid rgba(248, 81, 73, 0.4);
}

.alert-success {
    background-color: rgba(46, 160, 67, 0.16);
    color: #56d364;
    border: 1px solid rgba(35, 134, 54, 0.4);
}

.generated-key-box {
    background-color: #0d1117;
    border-radius: 8px;
    border: 1px dashed #3D8EFF;
    padding: 10px 12px;
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.generated-key {
    word-break: break-all;
}

.small {
    font-size: 12px;
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .top-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}


