* { box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: #f0f2f5;
    margin: 0;
    color: #1f2933;
}

/* ------------------------------------------------------------------ */
/* Auth pages (login) — centered card layout                           */
/* ------------------------------------------------------------------ */

body.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    width: 100%;
    max-width: 380px;
}

h1 { margin-top: 0; font-size: 1.4rem; }

label {
    display: block;
    margin: 0.75rem 0 0.25rem;
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.btn {
    display: inline-block;
    margin-top: 1.25rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 4px;
    background: #2563eb;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn:hover { background: #1d4ed8; }

.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }

.error {
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 4px;
    padding: 0.6rem;
    font-size: 0.9rem;
}

/* ------------------------------------------------------------------ */
/* Site shell — branding, menu, footer                                 */
/* ------------------------------------------------------------------ */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 1.25rem;
    background: #1e293b;
    color: #fff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 6px;
    background: #2563eb;
    font-weight: 700;
    font-size: 0.85rem;
}

.brand-name { font-weight: 600; font-size: 1.05rem; }

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-link {
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    font-size: 0.95rem;
}

.nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.nav-link.active { color: #fff; background: #2563eb; }

.nav-user {
    color: #94a3b8;
    font-size: 0.85rem;
    padding: 0 0.5rem;
}

.nav-link-logout { margin-left: 0.5rem; }

.page-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.page-card {
    max-width: 560px;
}

.site-footer {
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.85rem;
    padding: 1rem 1.25rem;
    text-align: center;
}

/* ------------------------------------------------------------------ */
/* Dashboard page                                                      */
/* ------------------------------------------------------------------ */

/* The dashboard renders full-width; no page padding or max-width. */
body.dashboard-page .page-content {
    max-width: none;
    padding: 0;
}

/* Fallback card shown when the submodule is not installed yet. */
.dashboard-missing {
    margin-top: 2rem;
}

.dashboard-missing pre {
    background: #f1f5f9;
    padding: 0.75rem;
    border-radius: 6px;
    overflow-x: auto;
}

/* ------------------------------------------------------------------ */
/* Dashboard embed (cl_dashboard submodule, included without iframe)   */
/* Styles scoped to #dashboard_embed so they never touch the shell.    */
/* Mimics the standalone dashboard's <body> style.                     */
/* ------------------------------------------------------------------ */

#dashboard_embed {
    background: #eee;
    text-align: center;
    min-height: calc(100vh - 4rem);
}
