:root {
    --bg: #0b1020;
    --bg-2: #121933;
    --panel: #151d3b;
    --panel-2: #1a2345;
    --border: rgba(255,255,255,0.08);
    --text: #edf2ff;
    --muted: #98a2c7;
    --faint: #6f7aa8;
    --primary: #5da2ff;
    --primary-2: #3f7fe0;
    --success: #29c27f;
    --warning: #e6b450;
    --danger: #f05b6e;
    --shadow: 0 20px 50px rgba(0,0,0,0.35);
    --radius: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: linear-gradient(180deg, #09101f 0%, #0e1530 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

body {
    min-height: 100vh;
}

.auth-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-wrap {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background: rgba(21, 29, 59, 0.92);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 32px;
    backdrop-filter: blur(12px);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.auth-logo,
.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #8c7bff);
    color: white;
    font-weight: 800;
    font-size: 24px;
}

.auth-brand h1,
.topbar h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.1;
}

.auth-brand p,
.topbar p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.auth-form {
    display: grid;
    gap: 12px;
}

.auth-form label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.auth-form input,
.form-select,
.form-textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: #0f1731;
    color: var(--text);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 15px;
    outline: none;
}

.auth-form input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: rgba(93, 162, 255, 0.65);
    box-shadow: 0 0 0 3px rgba(93, 162, 255, 0.12);
}

.auth-links {
    margin-top: 16px;
    text-align: center;
}

.auth-links a {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
}

.auth-links a:hover,
.auth-links a:focus {
    text-decoration: underline;
}

.form-select {
    appearance: none;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: rgba(11, 16, 32, 0.92);
    border-right: 1px solid var(--border);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 6px 8px;
}

.brand-title {
    font-size: 18px;
    font-weight: 700;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 13px;
}

.nav {
    display: grid;
    gap: 8px;
}

.nav-link {
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 600;
    transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(93, 162, 255, 0.12);
    color: var(--text);
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 12px;
}

.user-chip {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    color: var(--muted);
    font-size: 14px;
}

.main {
    min-width: 0;
}

.topbar {
    padding: 28px 30px 12px;
}

.content {
    padding: 0 30px 30px;
}

.panel {
    background: rgba(21, 29, 59, 0.92);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.grid {
    display: grid;
    gap: 18px;
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card {
    background: linear-gradient(180deg, rgba(26,35,69,0.98) 0%, rgba(17,25,52,0.98) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
}

.stat-hint {
    color: var(--faint);
    font-size: 13px;
    margin-top: 8px;
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-info {
    background: rgba(93, 162, 255, 0.12);
    border-color: rgba(93, 162, 255, 0.24);
    color: #dce9ff;
}

.alert-success {
    background: rgba(41, 194, 127, 0.12);
    border-color: rgba(41, 194, 127, 0.24);
    color: #dff8ed;
}

.alert-warning {
    background: rgba(230, 180, 80, 0.12);
    border-color: rgba(230, 180, 80, 0.24);
    color: #fff1ce;
}

.alert-danger {
    background: rgba(240, 91, 110, 0.12);
    border-color: rgba(240, 91, 110, 0.24);
    color: #ffd9df;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
}

.btn-ghost {
    background: rgba(255,255,255,0.05);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-block {
    width: 100%;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 14px;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-weight: 700;
}

td {
    color: var(--text);
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .grid-4,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .topbar,
    .content {
        padding-left: 18px;
        padding-right: 18px;
    }
}