:root {
    --bg-0:#111; --bg-1:#161616; --bg-2:#1c1c1c; --border:#2a2a2a;
    --text-1:#e8e8e8; --text-2:#aaa; --accent:#c9a227;
    --danger:#b94545; --success:#2e8540; --warning:#c08a2a;
}
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html, body { height:100%; }
body {
    background:var(--bg-0); color:var(--text-1);
    font:15px/1.55 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
    color-scheme:dark;
}
input, select, textarea {
    color-scheme:dark; background:var(--bg-2); color:var(--text-1);
    border:1px solid var(--border); border-radius:6px;
    padding:8px 10px; font:inherit; width:100%;
}
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--accent); }
a { color:var(--accent); text-decoration:none; }
a:hover { text-decoration:underline; }
h1 { font-size:1.6rem; font-weight:600; }
h2 { font-size:1.15rem; font-weight:600; }
h3 { font-size:1.05rem; font-weight:600; }
.muted { color:var(--text-2); }
.mono { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.82rem; word-break:break-all; }

.layout { display:grid; grid-template-columns:240px 1fr; min-height:100vh; }
.sidebar {
    background:var(--bg-1); border-right:1px solid var(--border);
    display:flex; flex-direction:column; padding:20px 16px;
}
.brand {
    color:var(--text-1); display:flex; gap:10px; align-items:center;
    padding-bottom:18px; border-bottom:1px solid var(--border); margin-bottom:14px;
}
.brand:hover { text-decoration:none; }
.brand strong { display:block; font-size:1rem; }
.brand small { display:block; color:var(--text-2); font-size:.75rem; font-weight:400; }
.brand-mark {
    width:14px; height:14px; border-radius:50%;
    background:var(--accent); box-shadow:0 0 0 4px rgba(201,162,39,.15);
    flex-shrink:0;
}
.nav { display:flex; flex-direction:column; gap:2px; flex:1; }
.nav-link { color:var(--text-2); padding:8px 10px; border-radius:6px; font-size:.95rem; }
.nav-link:hover { background:var(--bg-2); color:var(--text-1); text-decoration:none; }
.nav-link.active { background:var(--bg-2); color:var(--text-1); }
.sidebar-footer {
    display:flex; align-items:center; gap:10px;
    border-top:1px solid var(--border); padding-top:14px; margin-top:14px;
}
.avatar { width:36px; height:36px; border-radius:50%; background:var(--bg-2); }
.user-meta { display:flex; flex-direction:column; min-width:0; }
.user-name { font-size:.92rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:150px; }
.logout-link { color:var(--text-2); font-size:.8rem; }

.main { padding:32px 36px 48px; max-width:1280px; width:100%; }
.main-auth { display:flex; align-items:center; justify-content:center; min-height:100vh; padding:24px; }

.btn {
    display:inline-block; padding:9px 16px; border-radius:6px;
    border:1px solid var(--border); background:var(--bg-2); color:var(--text-1);
    font:inherit; cursor:pointer;
}
.btn:hover { background:#232323; text-decoration:none; }
.btn-primary { background:var(--accent); border-color:var(--accent); color:#111; font-weight:600; }
.btn-primary:hover { filter:brightness(1.08); }
.btn-block { display:block; width:100%; text-align:center; }
.btn-danger { color:#f0b6b6; border-color:var(--danger); }

.flash { padding:10px 14px; border-radius:6px; margin-bottom:14px; border:1px solid var(--border); background:var(--bg-2); }
.flash-success { border-color:var(--success); }
.flash-error { border-color:var(--danger); }
.flash-warning { border-color:var(--warning); }

.auth-card {
    background:var(--bg-1); border:1px solid var(--border); border-radius:10px;
    padding:28px 28px 22px; width:100%; max-width:400px;
}
.auth-card h1 { margin-bottom:8px; font-size:1.25rem; }
.auth-lead { margin-bottom:18px; }
.auth-split {
    margin:16px 0 12px; text-align:center; font-size:.8rem; color:var(--text-2);
}
.auth-form { display:flex; flex-direction:column; gap:12px; }
.auth-form label,
.form-stack label { display:flex; flex-direction:column; gap:6px; font-size:.9rem; color:var(--text-2); }
.auth-alt { margin-top:18px; font-size:.88rem; color:var(--text-2); text-align:center; }
.form-stack { display:flex; flex-direction:column; gap:14px; max-width:560px; margin-top:16px; }
.form-section-title { margin-top:12px; color:var(--text-1); }
.form-actions { display:flex; gap:10px; }
.checkbox-inline { flex-direction:row !important; align-items:center; gap:8px; }
.checkbox-inline input { width:auto; }

@media (max-width: 800px) {
    .layout { grid-template-columns:1fr; }
    .sidebar { border-right:none; border-bottom:1px solid var(--border); }
    .main { padding:20px 16px 36px; }
}
