/* ── Design tokens (dark mode defaults) ─────────────────── */

:root {
    --bg-primary:   #0c0c0c;
    --bg-surface:   #141414;
    --bg-elevated:  #1e1e1e;
    --teal:         #0fb8ad;
    --teal-dim:     #0a8a82;
    --text-primary: #f0f0f0;
    --text-muted:   #808080;
    --border:       #252525;
    --nav-height:   56px;
}

/* ── Light mode overrides ────────────────────────────────── */

:root.light {
    --bg-primary:   #f0f0f0;
    --bg-surface:   #ffffff;
    --bg-elevated:  #e2e2e2;
    --teal:         #0a9990;
    --teal-dim:     #077870;
    --text-primary: #0f0f0f;
    --text-muted:   #5a5a5a;
    --border:       #d0d0d0;
}

/* ── Reset ───────────────────────────────────────────────── */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.2s, color 0.2s;
}

/* ── Navbar ─────────────────────────────────────────────── */

.navbar {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--nav-height);
    transition: background-color 0.2s, border-color 0.2s;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: stretch;
}

/* Logo */

.nav-logo {
    display: flex;
    align-items: center;
    padding: 0 1.5rem 0 0;
    margin-right: 1rem;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.nav-logo img {
    height: 36px;
    width: auto;
    display: block;
    background: #fff;
    padding: 4px 10px;
}

:root.light .nav-logo img {
    background: transparent;
    padding: 0;
}

/* Nav tabs */

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    height: 100%;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--teal);
    border-bottom-color: var(--teal);
}

/* Right rail */

.nav-right {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 0.25rem;
}

/* Theme toggle */

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0.75rem;
    height: 100%;
    color: var(--text-muted);
    transition: color 0.15s;
}

.theme-toggle:hover {
    color: var(--text-primary);
}

.toggle-icon {
    font-size: 0.75rem;
    line-height: 1;
    user-select: none;
}

.toggle-track {
    width: 30px;
    height: 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
}

.toggle-thumb {
    width: 8px;
    height: 8px;
    background: var(--teal);
    position: absolute;
    top: 2px;
    left: 2px;
    transform: translateX(16px);
    transition: transform 0.2s;
}

:root.light .toggle-thumb {
    transform: translateX(0);
}

/* Login button */

.nav-login {
    height: auto;
    padding: 0.3rem 1rem;
    margin: auto 0;
    border: 1px solid var(--teal-dim);
    border-bottom: 1px solid var(--teal-dim);
    color: var(--teal);
}

.nav-login:hover {
    background: var(--teal);
    color: var(--bg-primary);
    border-color: var(--teal);
}

.nav-login.active {
    background: var(--teal);
    color: var(--bg-primary);
    border-color: var(--teal);
    border-bottom-color: var(--teal);
}

/* ── Page sections ──────────────────────────────────────── */

.page-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--nav-height));
    gap: 0.75rem;
}

.page-section h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    transition: color 0.2s;
}

/* Logout button */

.nav-logout {
    height: auto;
    padding: 0.3rem 1rem;
    margin: auto 0;
    background: none;
    border: 1px solid #e05555;
    border-bottom: 1px solid #e05555;
    color: #e05555;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.nav-logout:hover {
    background: #e05555;
    color: #fff;
}

/* Admin welcome */

.admin-welcome {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ── Login form ─────────────────────────────────────────── */

.login-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    transition: background 0.2s, border-color 0.2s;
}

.login-card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.form-input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, background 0.2s;
}

.form-input:focus {
    border-color: var(--teal);
}

.form-error {
    display: none;
    color: #e05555;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.form-error.visible {
    display: block;
}

.btn-login {
    width: 100%;
    background: var(--teal);
    color: #0c0c0c;
    border: none;
    padding: 0.7rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.btn-login:hover {
    background: var(--teal-dim);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
