/* Shared page geometry, loaded after each screen's component styles. */
.page-content { max-width: 960px; min-width: 0; margin-left: auto; margin-right: auto; }
body.has-sidebar .dashboard-container.page-content { max-width: 960px; padding: 0; }
body.has-sidebar {
    --sidebar-width: 280px;
    padding-left: var(--sidebar-width);
    min-width: 0;
    background: #f8fafc;
}
body.has-sidebar > .main-content,
body.has-sidebar > .container {
    width: 100%;
    max-width: 1200px;
    min-width: 0;
    margin: 0 auto;
    padding: clamp(20px, 3vw, 40px);
}
.sidebar { height: 100dvh; width: var(--sidebar-width); }
.sidebar-header, .sidebar-footer { flex-shrink: 0; }
.sidebar-menu { min-height: 0; }
.sidebar .user-avatar { flex-shrink: 0; }
.sidebar .username { display: block; }
.mobile-top-bar .logo { display: flex; align-items: center; gap: 8px; }
.menu-item:hover { color: #136c80; }
.menu-item.active { background: #16758a; color: #fff; }
.approval-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.dashboard-grid-modern { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel-group, .post-author-info, .chat-area { min-width: 0; }
.post-author-name, .post-content, .message-content, .approval-details { overflow-wrap: anywhere; }
body.has-sidebar .modal,
body.has-sidebar [id$="Modal"] { z-index: 3000 !important; }
body.has-sidebar #imagePreviewModal { z-index: 3100 !important; }
body.has-sidebar .modal-content { max-width: calc(100vw - 24px); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
:focus-visible { outline: 3px solid #147d92; outline-offset: 3px; }
@media (max-width: 1000px) {
    .dashboard-grid-modern { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
    body.has-sidebar { padding: 60px 0 0; }
    body.has-sidebar > .main-content,
    body.has-sidebar > .container { padding: 20px 12px; margin: 0; }
    .sidebar { width: min(280px, calc(100vw - 40px)); visibility: hidden; }
    .sidebar.active { visibility: visible; }
    .mobile-hamburger { min-width: 44px; min-height: 44px; }
    .hero-section, .modern-card { padding: 24px 18px; border-radius: 18px; }
    .approval-actions { flex-wrap: wrap; }
    .chat-container, .messaging-container {
        height: calc(100dvh - 100px);
        min-height: 320px;
    }
    input, textarea, select { font-size: 16px; max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Horizontal navigation replaces the former sidebar on every signed-in page. */
body.has-sidebar { --sidebar-width: 0px; padding: 132px 0 0; }
body.has-sidebar > .main-content, body.has-sidebar > .container { min-height: calc(100dvh - 132px); }
body.chat-page .chat-container, body.chat-page .messaging-container { height: calc(100dvh - 337px); }
@media(max-width:1100px) {
    body.has-sidebar { padding: 64px 0 0; }
    body.has-sidebar > .main-content, body.has-sidebar > .container { min-height: calc(100dvh - 64px); }
    body.chat-page .chat-container, body.chat-page .messaging-container { height: calc(100dvh - 269px); }
}
@media(max-width:768px) {
    body.chat-page .chat-container, body.chat-page .messaging-container { height: calc(100dvh - 174px); }
}
