#site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--slate-dark);
    border-bottom: 2px solid #1a202c;
}

.header-brand-row {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px var(--pad-h) 0;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.site-brand:hover {
    color: #ffffff;
    text-decoration: none;
    opacity: 0.9;
}

.site-logo {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: block;
}

.header-nav-row {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px var(--pad-h) 6px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px;
    white-space: nowrap;
}

.header-nav-row::-webkit-scrollbar {
    display: none;
}

#main-nav {
    display: contents;
}

#nav-auth {
    display: contents;
}

.nav-link {
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
    padding: 4px 10px;
    border-radius: var(--radius);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-block;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

.nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

.nav-logout {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    padding: 4px 10px;
    border-radius: var(--radius);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    background: none;
    border: none;
    font-family: var(--font);
    cursor: pointer;
    display: inline-block;
}

.nav-logout:hover {
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.08);
}

.nav-unread-badge {
    display: inline-block;
    background: #cfe8ff;
    color: var(--blue-dark);
    font-size: 11px;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 10px;
    margin-left: 4px;
    vertical-align: middle;
}

.nav-msg-notif {
    color: #cfe8ff !important;
    font-weight: bold;
}

#main {
    position: fixed;
    top: var(--header-h);
    bottom: 0;
    left: 0;
    right: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.page-wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px var(--pad-h) 40px;
}

.page-wrap-admin {
    padding-top: 16px;
}

.breadcrumb {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.breadcrumb a {
    color: var(--blue);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    color: var(--text-light);
}

.page-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--text);
    margin-bottom: 16px;
}

.loading-state {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-dim);
    font-size: 15px;
}

.error-state {
    padding: 16px;
    background: var(--danger-dim);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    color: var(--danger);
    font-size: 15px;
}

.empty-state {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-dim);
    font-size: 15px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

@media (min-width: 540px) {
    :root { --pad-h: 20px; }
}

@media (min-width: 900px) {
    :root { --pad-h: 24px; }
}
