/* ============================================
   Platform Switcher Bar
   Global bar for switching between Rossini platforms
   ============================================ */

.platform-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 35px;
    background: #f0efe9;
    color: #3d3d3a;
    border-bottom: 2px solid rgba(31, 30, 29, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 1100;
    font-size: 12px;
    gap: 12px;
}

/* --- Left: Platform Selector --- */
.platform-bar-left {
    display: flex;
    align-items: center;
}

.platform-selector-btn {
    background: none;
    border: none;
    color: #5a5c69;
    font-size: 12px;
    padding: 2px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 4px;
    transition: background 0.2s;
    line-height: 1;
}

.platform-selector-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #3d3d3a;
}

.platform-chevron {
    font-size: 9px;
    opacity: 0.7;
}

.platform-dropdown-menu {
    min-width: 200px;
    margin-top: 4px !important;
}

.platform-dropdown-menu .dropdown-item {
    font-size: 13px;
    padding: 8px 16px;
}

.platform-dropdown-menu .dropdown-item.active,
.platform-dropdown-menu .dropdown-item.active:hover {
    background: #e9ecef;
    color: #212529;
    font-weight: 600;
}

.platform-dropdown-menu .dropdown-item:hover:not(.active) {
    background: #f8f9fa;
}

/* --- Right: User Badge --- */
.platform-bar-right {
    display: flex;
    align-items: center;
}

.platform-user-btn {
    background: none;
    border: none;
    color: #5a5c69;
    font-size: 12px;
    padding: 2px 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 4px;
    transition: background 0.2s;
    line-height: 1;
}

.platform-user-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #3d3d3a;
}

.platform-user-btn::after {
    display: none !important;
}

.platform-user-avatar {
    font-size: 10px !important;
    padding: 3px 5px !important;
    border-radius: 3px;
    line-height: 1;
}

.platform-user-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- User Dropdown Menu --- */
.platform-user-menu {
    min-width: 240px;
    padding: 0;
    margin-top: 4px !important;
}

.platform-user-menu .dropdown-item {
    font-size: 13px;
    padding: 8px 16px;
}

.platform-user-menu .dropdown-item:hover {
    background: #f8f9fa;
}

.platform-user-menu .dropdown-divider {
    margin: 4px 0;
}

/* Header utente */
.platform-user-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
}

.platform-user-header-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.platform-user-header-name {
    font-weight: 600;
    font-size: 13px;
    color: #212529;
}

.platform-user-header-role {
    font-size: 11px;
    color: #6c757d;
}

/* Titolo sezione */
.platform-menu-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #adb5bd;
    padding: 6px 16px 4px;
}

/* Voce app con badge attiva */
.platform-app-item {
    display: flex !important;
    align-items: center;
}

.platform-app-item.active,
.platform-app-item.active:hover {
    background: #e9ecef;
    color: #212529;
    font-weight: 600;
}

/* --- Layout Offsets (when platform bar is present) --- */
body.has-platform-bar .sidebar {
    top: 35px;
    height: calc(100vh - 35px);
}

body.has-platform-bar .sidebar-overlay {
    top: 35px;
}

body.has-platform-bar .main-content {
    margin-top: 35px;
}

/* --- Global Layout (no sidebar) --- */
.main-content-global {
    margin-left: 0;
    min-height: 100vh;
    margin-top: 35px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .platform-user-name {
        display: none;
    }

    .platform-current-name {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.has-platform-bar .sidebar {
        top: 35px;
        height: calc(100vh - 35px);
    }

    body.has-platform-bar .sidebar-overlay {
        top: 35px;
    }
}
