/* ============================================================
   topbar.css — sitewide top bar
   Loaded alongside topbar.php. Variables come from homeV0.01.css
   (--panel, --panel-light, --border, --text, --text-dim, --accent,
   --accent-soft, --success). Kept in its own file so the strict
   CSP can serve it as 'self' without inline rules.
============================================================ */

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
}

/* brand: logo + site name, both inside the same clickable link */
.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    line-height: 1;
}

.topbar-brand:hover,
.topbar-brand:focus {
    color: var(--accent-soft);
    outline: none;
}

.topbar-logo {
    display: block;
    height: 32px;
    width: auto;
}

.topbar-name {
    letter-spacing: 0.2px;
}

/* right-side cluster */
.topbar-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* the login / logout toggle */
.topbar-auth {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 8px;
    background: var(--panel-light);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.topbar-auth:hover,
.topbar-auth:focus {
    background: #1b2a4d;
    border-color: var(--accent);
    color: var(--text);
    outline: none;
}

.topbar-auth-label {
    line-height: 1;
}

/* the status dot */
.topbar-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
}

.topbar-dot-red {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.topbar-dot-green {
    background: var(--success);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

/* ------------------------------------------------------------
   Push site content below the fixed bar.
   Scoped to body.has-topbar so pages that do not include the
   partial are unaffected. We also shorten the sidebar's
   100vh min-height so it does not overflow.
------------------------------------------------------------ */
body.has-topbar {
    padding-top: 56px;
}

body.has-topbar .sidebar {
    min-height: calc(100vh - 56px);
}

/* small screens — keep the bar usable */
@media (max-width: 480px) {
    .topbar {
        padding: 0 12px;
    }
    .topbar-name {
        display: none;
    }
    .topbar-auth-label {
        display: none;
    }
    .topbar-auth {
        padding: 6px 10px;
    }
}

input[type="range"] {
    accent-color: var(--accent);
