:root {
    --bg: #f3f4f6;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
    --success: #16a34a;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #111827;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    background: #111827;
    color: white;
    padding: 22px;
}

.brand {
    margin-bottom: 26px;
}

.brand-title {
    font-size: 21px;
    font-weight: 800;
}

.brand-subtitle {
    color: #9ca3af;
    font-size: 13px;
    margin-top: 5px;
}

.nav a {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    color: #d1d5db;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 14px;
}

.nav a:hover,
.nav a.active {
    background: #1f2937;
    color: white;
}

.main {
    padding: 24px;
}

.topbar {
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-title {
    margin: 0;
    font-size: 24px;
}

.page-subtitle {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
    margin-bottom: 18px;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.kpi {
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
}

.kpi-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.kpi-value {
    font-size: 28px;
    font-weight: 800;
    margin-top: 8px;
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    background: #f9fafb;
    color: #374151;
    font-size: 13px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: top;
}

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.badge-active {
    background: #dcfce7;
    color: #166534;
}

.badge-suspended {
    background: #fef3c7;
    color: #92400e;
}

.badge-revoked {
    background: #fee2e2;
    color: #991b1b;
}

.badge-deactivated {
    background: #e5e7eb;
    color: #374151;
}

.btn {
    border: none;
    border-radius: 11px;
    padding: 10px 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-block;
    font-size: 13px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-muted {
    background: #f3f4f6;
    color: #374151;
}

.btn-dark {
    background: #111827;
    color: white;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.form-group {
    margin-bottom: 14px;
}

label {
    display: block;
    font-size: 13px;
    color: #374151;
    font-weight: 800;
    margin-bottom: 6px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 14px;
    outline: none;
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.flash {
    border-radius: 14px;
    padding: 13px 15px;
    margin-bottom: 16px;
    font-weight: 700;
}

.flash-success {
    background: #dcfce7;
    color: #166534;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: white;
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, .14);
}

.login-title {
    font-size: 26px;
    font-weight: 900;
    margin: 0;
}

.login-subtitle {
    color: var(--muted);
    margin: 8px 0 20px;
}

@media (max-width: 900px) {
    .app {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .grid-4,
    .grid-2,
    .form-grid {
        grid-template-columns: 1fr;
    }
}