:root {
    --bg: #0b1120;
    --surface: #151e30;
    --surface-light: #1c2940;
    --border: #293650;
    --text: #edf2fa;
    --muted: #91a0bb;
    --accent: #6c8cff;
    --accent-hover: #85a0ff;
    --green: #32d296;
    --danger: #ff647c;
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

.topbar {
    min-height: 72px;
    padding: 14px 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(21, 30, 48, 0.95);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.brand-icon,
.auth-logo {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6c8cff, #4f68d8);
    border-radius: 13px;
    color: white;
    font-size: 22px;
    font-weight: 800;
    box-shadow: 0 6px 20px rgba(108, 140, 255, 0.2);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.username {
    color: var(--muted);
    font-size: 14px;
}

.logout-btn {
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

h1, h2, h3 {
    margin-top: 0;
    letter-spacing: -0.4px;
}

h1 {
    font-size: 28px;
}

h2 {
    font-size: 21px;
}

p {
    line-height: 1.6;
}

.muted,
.auth-subtitle {
    color: var(--muted);
}

button,
.btn {
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    border-radius: 11px;
    padding: 13px 18px;
    transition: background 0.2s ease, transform 0.15s ease;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
}

.btn-primary,
button[type="submit"] {
    background: var(--accent);
    color: white;
}

.btn-primary:hover,
button[type="submit"]:hover {
    background: var(--accent-hover);
}

.btn-full {
    width: 100%;
}

input,
select,
textarea {
    width: 100%;
    background: #0e1728;
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 13px 14px;
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

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

input::placeholder,
textarea::placeholder {
    color: #64728d;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 18px;
}

.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(80vh - 100px);
}

.auth-card {
    width: 100%;
    max-width: 430px;
    padding: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.auth-logo {
    width: 54px;
    height: 54px;
    margin: 0 auto 20px;
    font-size: 27px;
    border-radius: 16px;
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    text-align: center;
    margin-bottom: 28px;
}

.auth-switch {
    text-align: center;
    margin-top: 22px;
    color: var(--muted);
    font-size: 14px;
}

.auth-switch a {
    font-weight: 600;
    margin-left: 4px;
}

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

.alert-error {
    background: rgba(255, 100, 124, 0.1);
    color: var(--danger);
    border: 1px solid rgba(255, 100, 124, 0.25);
}

.footer {
    text-align: center;
    color: var(--muted);
    padding: 24px 12px;
    font-size: 13px;
}

/* Layout helpers */
.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    margin-top: 8px;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

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

th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

td {
    font-size: 14px;
}

.badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 8px;
    background: rgba(108, 140, 255, 0.12);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
}

/* Mobile */
@media (max-width: 650px) {
    .topbar {
        min-height: 62px;
        padding: 12px 16px;
    }

    .brand {
        font-size: 18px;
    }

    .username {
        display: none;
    }

    .container {
        padding: 20px 14px;
    }

    .card {
        padding: 18px;
        border-radius: 14px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 19px;
    }

    .auth-wrapper {
        min-height: 75vh;
    }

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

    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    button,
    .btn {
        min-height: 46px;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }

    .footer {
        padding: 18px 10px;
    }
}
