:root {
    --opshub-ink: #0f172a;
    --opshub-muted: #64748b;
    --opshub-line: #e5e7eb;
    --opshub-surface: #ffffff;
    --opshub-canvas: #f8fafc;
    --opshub-accent: #2563eb;
    --opshub-sidebar: #0f172a;
    --opshub-danger: #ef4444;
    --opshub-radius: 0.5rem;
}

.user-shell html,
html:has(.user-shell),
.user-shell {
    height: 100%;
}

body.user-shell {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    overflow: hidden;
    background: var(--opshub-canvas);
    color: var(--opshub-ink);
}

.top-navbar {
    background: var(--opshub-surface);
    border-bottom: 1px solid var(--opshub-line);
    padding: 0.9rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.top-nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.top-nav-logo {
    height: 40px;
    width: auto;
}

.top-nav-title {
    margin: 0;
    font-size: 1.15rem;
    color: var(--opshub-ink);
    font-weight: 700;
}

.mobile-nav-toggle {
    display: none;
    border: none;
    border-radius: var(--opshub-radius);
    background: var(--opshub-ink);
    color: #fff;
    padding: 0.5rem 0.75rem;
    font-weight: 700;
}

.top-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.top-nav-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    color: var(--opshub-ink);
    text-decoration: none;
    background: #f1f5f9;
    border: 1px solid var(--opshub-line);
}

.top-nav-bell.has-unread {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.top-nav-bell-badge {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    min-width: 1.15rem;
    height: 1.15rem;
    margin-left: 0;
    font-size: 0.65rem;
}

.layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.sidebar,
.user-sidebar {
    width: 270px;
    background: var(--opshub-sidebar);
    color: #fff;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-height: 0;
    overflow-y: auto;
}

.sidebar-actions {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar .action,
.user-sidebar .action {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 0.85rem 0.75rem;
    border-radius: var(--opshub-radius);
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    transition: background-color 0.2s;
}

.sidebar .action:hover,
.user-sidebar .action:hover {
    background: rgba(255, 255, 255, 0.12);
}

.sidebar .action.active,
.user-sidebar .action.active {
    background: var(--opshub-accent);
    font-weight: 700;
}

.sidebar .action.danger,
.user-sidebar .action.danger {
    background: rgba(239, 68, 68, 0.18);
}

.sidebar-actions .action.action-notifications {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.nav-unread {
    display: inline-flex;
    min-width: 1.25rem;
    height: 1.25rem;
    margin-left: 0.35rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--opshub-danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0 0.3rem;
    line-height: 1;
}

.sidebar-bottom {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

details.contact-admin {
    width: 100%;
}

details.contact-admin > summary {
    list-style: none;
    cursor: pointer;
    color: #fff;
    padding: 0.85rem 0.75rem;
    border-radius: var(--opshub-radius);
    background: rgba(255, 255, 255, 0.06);
    font-weight: 700;
}

details.contact-admin > summary::-webkit-details-marker {
    display: none;
}

details.contact-admin > summary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.contact-admin-list {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.contact-admin-link {
    color: #fff;
    text-decoration: none;
    padding: 0.6rem 0.75rem;
    border-radius: 0.4rem;
    background: rgba(255, 255, 255, 0.06);
}

.main,
.page-content {
    flex: 1;
    min-height: 0;
    min-width: 0;
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--opshub-canvas);
}

.panel {
    background: var(--opshub-surface);
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
    margin-bottom: 1rem;
}

.btn {
    border: none;
    border-radius: var(--opshub-radius);
    padding: 0.58rem 0.8rem;
    color: #fff;
    background: var(--opshub-accent);
    font-weight: 700;
    cursor: pointer;
}

.muted {
    color: var(--opshub-muted);
    font-size: 0.88rem;
}

@media (max-width: 768px) {
    body.user-shell {
        height: auto;
        min-height: 100%;
        overflow: auto;
        display: block;
    }

    .layout {
        display: block;
        overflow: visible;
        flex: none;
        min-height: auto;
    }

    .mobile-nav-toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
    }

    .sidebar,
    .user-sidebar {
        width: 100%;
        display: none;
        min-height: auto;
        overflow-y: visible;
    }

    .sidebar.mobile-open,
    .user-sidebar.mobile-open {
        display: flex;
    }

    .main,
    .page-content {
        overflow-y: visible;
        min-height: auto;
        padding: 1rem 0.85rem;
    }
}
