/* ============================================================
   CORE: reset, base typography, app shell, responsive layout.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    transition: background .2s ease, color .2s ease;
}

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

h1, h2, h3, h4 { margin: 0 0 .4em; font-weight: 700; line-height: 1.25; }

code {
    background: var(--surface-2);
    padding: 1px 6px;
    border-radius: 5px;
    font-size: .85em;
    border: 1px solid var(--border);
}

/* ── App shell (sidebar + main) ── */
.app-shell { display: flex; min-height: 100vh; }

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-content {
    padding: 28px 32px;
    flex: 1;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}

/* ── Auth (login) layout ── */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    gap: 16px;
    background:
        radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--primary) 16%, transparent), transparent),
        var(--bg);
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 36px 32px;
    box-shadow: var(--shadow);
}
.auth-brand { font-weight: 800; font-size: 20px; color: var(--primary); margin-bottom: 18px; text-align: center; }
.auth-title { font-size: 22px; text-align: center; }
.auth-sub { color: var(--muted); text-align: center; margin: 0 0 22px; font-size: 14px; }
.auth-hint { margin-top: 16px; text-align: center; color: var(--muted); font-size: 12px; }
.auth-foot { color: var(--muted); font-size: 12px; }

/* ── Page header ── */
.page-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-title { font-size: 24px; margin: 0; }
.page-sub { color: var(--muted); margin: 4px 0 0; font-size: 14px; }

/* ── Utilities ── */
.muted { color: var(--muted); }
.inline-form { display: inline; }
.hidden { display: none !important; }

/* ── Responsive ── */
@media (max-width: 880px) {
    .app-content { padding: 20px 16px; }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
        transform: translateX(-100%); transition: transform .22s ease;
    }
    .sidebar.open { transform: translateX(0); }
}
