:root {
    --bg-1: #071731;
    --bg-2: #0f3a8a;
    --bg-3: #1e88e5;
    --card: rgba(255, 255, 255, 0.94);
    --text: #102033;
    --muted: #64748b;
    --line: rgba(15, 23, 42, 0.12);
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --success: #0f766e;
    --success-bg: #ccfbf1;
    --error: #b91c1c;
    --error-bg: #fee2e2;
    --shadow: 0 30px 90px rgba(2, 8, 23, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.65), transparent 35%),
        linear-gradient(135deg, var(--bg-1), var(--bg-2) 55%, var(--bg-3));
}

a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 700;
}

a:hover {
    color: var(--blue-dark);
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.auth-card {
    width: min(920px, 100%);
    padding: 38px;
    border-radius: 30px;
    background: var(--card);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.auth-card-small {
    width: min(480px, 100%);
}

.brand-mark {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    color: white;
    font-weight: 900;
    letter-spacing: -0.04em;
    box-shadow: 0 16px 35px rgba(37, 99, 235, 0.35);
}

.brand-mark.small {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    flex: 0 0 auto;
}

h1 {
    margin: 24px 0 8px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1;
    letter-spacing: -0.06em;
}

.subtitle {
    margin: 0 0 26px;
    color: var(--muted);
    font-size: 1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.grid-2,
.grid-3 {
    display: grid;
    gap: 18px;
}

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

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

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label span {
    color: #334155;
    font-size: 0.9rem;
    font-weight: 800;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.9);
    font: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input:focus {
    border-color: rgba(37, 99, 235, 0.65);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    background: white;
}

.btn-primary {
    border: 0;
    border-radius: 18px;
    padding: 15px 18px;
    cursor: pointer;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: white;
    font: inherit;
    font-weight: 900;
    box-shadow: 0 18px 35px rgba(37, 99, 235, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 42px rgba(37, 99, 235, 0.38);
}

.alert {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 700;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
}

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

.dashboard-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.sidebar {
    min-height: 100vh;
    padding: 24px;
    background: rgba(3, 7, 18, 0.64);
    color: white;
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
}

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

.sidebar-brand strong,
.sidebar-brand span {
    display: block;
}

.sidebar-brand span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.85rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-nav a,
.logout-link {
    color: rgba(255, 255, 255, 0.82);
    padding: 13px 14px;
    border-radius: 16px;
    font-weight: 800;
}

.sidebar-nav a.active,
.sidebar-nav a:hover,
.logout-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

.logout-link {
    margin-top: auto;
}

.dashboard-content {
    padding: 42px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
    color: white;
}

.dashboard-header h1 {
    margin: 8px 0 0;
}

.eyebrow {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.76rem;
    font-weight: 900;
}

.user-pill {
    border-radius: 999px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.18);
    color: white;
    font-weight: 900;
    backdrop-filter: blur(14px);
}

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

.stat-card,
.panel {
    padding: 24px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 24px 70px rgba(2, 8, 23, 0.18);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-weight: 800;
    margin-bottom: 10px;
}

.stat-card strong {
    display: block;
    font-size: 1.35rem;
    word-break: break-word;
}

.panel h2 {
    margin: 0 0 10px;
    font-size: 1.7rem;
    letter-spacing: -0.04em;
}

.panel p {
    margin: 0;
    color: #475569;
    line-height: 1.7;
}

code {
    background: #e0f2fe;
    color: #075985;
    padding: 2px 6px;
    border-radius: 8px;
}

@media (max-width: 900px) {
    .grid-2,
    .grid-3,
    .stats-grid,
    .dashboard-page {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
    }

    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .auth-page,
    .dashboard-content {
        padding: 18px;
    }

    .auth-card {
        padding: 24px;
        border-radius: 24px;
    }
}
