:root {
    --bg: #0f1115;
    --panel: #161a22;
    --panel-2: #1d2330;
    --text: #e8edf7;
    --muted: #9aa4b2;
    --accent: #7c5cff;
    --accent-2: #26c6da;
    --danger: #ff5c77;
    --success: #4caf50;
    --border: #2a3140;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(0,0,0,.25);
    --font: Inter, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    background: linear-gradient(180deg, #0b0d12 0%, #121622 100%);
    color: var(--text);
}

a {
    color: var(--accent-2);
    text-decoration: none;
}

.app-shell, .auth-page {
    min-height: 100vh;
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-box {
    width: 100%;
    max-width: 420px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}

.auth-box h1, .content h1 {
    margin-top: 0;
}

label {
    display: block;
    margin: 14px 0 6px;
    color: var(--muted);
}

input, select, textarea, button {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #0e1218;
    color: var(--text);
    outline: none;
}

button, .btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    padding: 12px 16px;
    border-radius: 10px;
}

.btn-small {
    padding: 8px 12px;
    width: auto;
}

.alert, .flash, .card {
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 16px 0;
    border: 1px solid var(--border);
    background: var(--panel);
}

.alert-error, .flash-error {
    border-color: rgba(255,92,119,.35);
    background: rgba(255,92,119,.08);
}

.alert-success, .flash-success {
    border-color: rgba(76,175,80,.35);
    background: rgba(76,175,80,.08);
}

.layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: calc(100vh - 60px);
}

.topbar {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    background: rgba(15,17,21,.9);
    border-bottom: 1px solid var(--border);
}

.brand {
    font-weight: 800;
    letter-spacing: .3px;
}

.sidebar {
    padding: 18px;
    border-right: 1px solid var(--border);
    background: rgba(22,26,34,.6);
}

.sidebar a {
    display: block;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.content {
    padding: 24px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background: var(--panel);
    border-radius: var(--radius);
    overflow: hidden;
}

.table th, .table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.form-grid {
    max-width: 800px;
}

.small-note {
    margin-top: 16px;
    color: var(--muted);
    font-size: 0.95rem;
}

.question-card .meta {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--muted);
}

.answer {
    margin-top: 12px;
    padding: 12px;
    background: #0e1218;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.list-item {
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: var(--panel);
    border: 1px solid var(--border);
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .page-head {
        flex-direction: column;
        align-items: stretch;
    }
}
