:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --dark: #0f172a;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 32%),
        linear-gradient(135deg, #f8fafc, #eef2ff);
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.auth-brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 22px;
}

.logo-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #14b8a6);
    color: white;
    font-weight: 800;
}

.auth-brand h1 {
    margin: 0;
    font-size: 24px;
}

.auth-brand p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    font-size: 14px;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 15px;
    outline: none;
    background: #fff;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

.btn {
    border: none;
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-light {
    background: #f8fafc;
    color: var(--text);
    border: 1px solid var(--border);
}

.alert {
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.auth-link {
    color: var(--muted);
    text-align: center;
    margin: 18px 0 0;
}

.auth-link a {
    color: var(--primary);
    font-weight: 800;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    background: var(--dark);
    color: white;
    padding: 22px;
}

.sidebar-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.sidebar-brand h2 {
    margin: 0;
    font-size: 18px;
}

.sidebar-brand p {
    margin: 3px 0 0;
    color: #94a3b8;
    font-size: 12px;
}

.nav {
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

.nav a {
    text-decoration: none;
    color: #cbd5e1;
    padding: 12px 14px;
    border-radius: 14px;
    font-weight: 700;
}

.nav a.active,
.nav a:hover {
    background: rgba(255,255,255,0.10);
    color: white;
}

.main {
    padding: 28px;
}

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

.topbar h1 {
    margin: 0;
    font-size: 30px;
}

.topbar p {
    margin: 6px 0 0;
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 18px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 22px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-value {
    margin-top: 10px;
    font-size: 30px;
    font-weight: 900;
}

.stat-note {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
}

.section-title h2 {
    margin: 0;
    font-size: 20px;
}

.section-title p {
    margin: 4px 0 0;
    color: var(--muted);
}

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

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

th,
td {
    padding: 13px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.badge-good {
    background: #dcfce7;
    color: #166534;
}

.badge-risky {
    background: #fef3c7;
    color: #92400e;
}

.badge-bad {
    background: #fee2e2;
    color: #991b1b;
}

.empty-state {
    text-align: center;
    padding: 34px 20px;
    color: var(--muted);
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topbar {
        flex-direction: column;
    }
}

@media (max-width: 620px) {
    .main {
        padding: 18px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 22px;
    }
}