/**
 * Mobile Navigation Bar
 * Fase 4: Horizontal scrollable nav, cloned from sidebar.
 * Fase 5: Page header component.
 * Added: 2026-08-06 - Mobile refactor v2
 */

/* ── Page Header Component ── */
.ss-page-header { margin-bottom: 1rem; }
.ss-page-header-top {
    display: flex; justify-content: space-between;
    align-items: flex-start; gap: 0.75rem; flex-wrap: wrap;
}
.ss-page-header-titles { min-width: 0; flex: 1 1 auto; }
.ss-page-title {
    font-size: 1.4rem; font-weight: 600; margin: 0;
    line-height: 1.3; color: var(--text-primary, #212529);
}
.ss-page-subtitle {
    font-size: 0.85rem; color: var(--ss-color-muted, #6c757d);
    margin: 0.15rem 0 0 0; line-height: 1.3;
}
.ss-page-header-actions {
    display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0;
}
.ss-page-header-filters { margin-top: 0.75rem; }

@media (max-width: 767.98px) {
    .ss-page-header { margin-bottom: 0.75rem; }
    .ss-page-title { font-size: var(--ss-font-page-title, 1.25rem); }
    .ss-page-subtitle { font-size: var(--ss-font-metadata, 0.75rem); }
    .ss-page-header-top { gap: 0.5rem; }
    .ss-page-header-actions .btn {
        padding: 0.35rem 0.65rem; font-size: var(--ss-font-button, 0.85rem);
    }
}
@media (max-width: 380px) {
    .ss-page-header-actions .btn .btn-text { display: none; }
    .ss-page-header-actions .btn i { margin-right: 0 !important; }
}

/* ── Mobile Navigation Bar ── */
.mobile-nav { display: none; }
@media (max-width: 767.98px) {
    .mobile-nav {
        display: block; background: var(--ss-color-card-bg, #fff);
        border-bottom: 1px solid var(--ss-color-border, #dee2e6);
        height: var(--ss-mobile-nav-height, 48px); overflow: hidden;
    }
    .mobile-nav-inner {
        display: flex; flex-direction: row; flex-wrap: nowrap;
        overflow-x: auto; overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; -ms-overflow-style: none;
        height: 100%; align-items: stretch;
        padding: 0 var(--ss-space-4, 4px);
    }
    .mobile-nav-inner::-webkit-scrollbar { display: none; }
    .mobile-nav-item {
        flex: 0 0 auto; display: flex; flex-direction: column;
        align-items: center; justify-content: center; gap: 2px;
        padding: 0 var(--ss-space-12, 12px); min-width: 56px;
        height: 100%; color: var(--ss-color-muted, #6c757d);
        text-decoration: none; font-size: var(--ss-font-metadata, 0.75rem);
        font-weight: 500; white-space: nowrap;
        border-bottom: 3px solid transparent;
        transition: color 0.15s, border-color 0.15s;
        position: relative; cursor: pointer;
    }
    .mobile-nav-item:hover { color: var(--ss-color-primary, #2d5287); text-decoration: none; }
    .mobile-nav-item.active {
        color: var(--ss-color-primary, #2d5287);
        border-bottom-color: var(--ss-color-primary, #2d5287); font-weight: 600;
    }
    .mobile-nav-item i { font-size: 1.15rem; line-height: 1; }
    .mobile-nav-item span { line-height: 1; }
    .mobile-nav-inner:not(.scroll-end) {
        box-shadow: inset -20px 0 12px -12px rgba(0,0,0,0.12);
    }
    .mobile-nav-separator {
        flex: 0 0 auto; width: 1px; align-self: stretch;
        margin: 8px 4px; background: var(--ss-color-border, #dee2e6);
    }
    .mobile-nav-user-wrap {
        flex: 0 0 auto; position: relative; display: flex;
        align-items: center; margin-left: auto;
    }
    .mobile-nav-user-toggle {
        display: flex; align-items: center; gap: 6px;
        padding: 0 var(--ss-space-10, 10px); height: 100%;
        border: none; background: transparent;
        color: var(--text-primary, #212529);
        font-size: var(--ss-font-metadata, 0.75rem); font-weight: 500;
        cursor: pointer; white-space: nowrap; border-radius: 0;
        transition: background 0.15s;
    }
    .mobile-nav-user-toggle:hover { background: rgba(0,0,0,0.04); }
    .mobile-nav-user-icon { font-size: 1.2rem; flex-shrink: 0; color: var(--ss-color-muted, #6c757d); }
    .mobile-nav-user-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1; }
    .mobile-nav-user-chevron { font-size: 0.55rem; flex-shrink: 0; color: var(--ss-color-muted, #6c757d); transition: transform 0.2s; }
    .mobile-nav-user-toggle[aria-expanded="true"] .mobile-nav-user-chevron { transform: rotate(180deg); }
    .mobile-nav-user-menu {
        background: var(--ss-color-card-bg, #fff);
        border: 1px solid var(--ss-color-border, #dee2e6);
        border-radius: var(--ss-mobile-card-radius, 12px);
        box-shadow: 0 4px 16px rgba(0,0,0,0.15); overflow: hidden;
    }
    .mobile-nav-user-menu .mobile-nav-user-item {
        display: flex; align-items: center; padding: 10px 16px;
        font-size: 0.85rem; color: var(--text-primary, #212529);
        text-decoration: none; white-space: nowrap; transition: background 0.15s;
    }
    .mobile-nav-user-menu .mobile-nav-user-item:hover { background: rgba(0,0,0,0.05); text-decoration: none; }
    .mobile-nav-user-menu .mobile-nav-logout {
        color: #dc3545; border-top: 1px solid var(--ss-color-border, #dee2e6);
        margin-top: 4px; padding-top: 10px;
    }
    .mobile-nav-user-menu .mobile-nav-logout:hover { background: rgba(220,53,69,0.06); }
}
