:root {
    --bg: #0b1020;
    --panel: #121a2f;
    --panel-2: #18233d;
    --text: #eef3ff;
    --muted: #9fb0d0;
    --accent: #5b8cff;
    --accent-2: #7c5cff;
    --danger: #ff5b7a;
    --success: #3dd68c;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    --radius: 18px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(91, 140, 255, 0.18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(124, 92, 255, 0.16), transparent 28%),
        var(--bg);
    color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 48px;
}

.auth-card,
.panel {
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(420px, 100%);
    padding: 32px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: grid;
    place-items: center;
    font-weight: 800;
}

h1, h2, h3 { margin: 0 0 12px; }
p { color: var(--muted); line-height: 1.6; }

label {
    display: block;
    margin: 14px 0 6px;
    color: var(--muted);
    font-size: 0.92rem;
}

input, textarea, select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
}

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

button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary {
    background: var(--panel-2);
    border: 1px solid var(--border);
}

.btn-danger { background: var(--danger); }

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

.alert-error { background: rgba(255, 91, 122, 0.12); color: #ffc2cf; }
.alert-success { background: rgba(61, 214, 140, 0.12); color: #b8f5d4; }

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

.layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
}

.sidebar, .main-panel {
    padding: 20px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
}

.sidebar li { margin-bottom: 8px; }

.sidebar a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text);
}

.sidebar a.active,
.sidebar a:hover {
    background: rgba(91, 140, 255, 0.12);
    text-decoration: none;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

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

.table tr.unread td { font-weight: 700; }

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

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

.message-meta {
    color: var(--muted);
    margin-bottom: 20px;
}

.message-body {
    background: var(--panel-2);
    border-radius: 14px;
    padding: 20px;
    line-height: 1.7;
}

.inline-form {
    display: inline;
}

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