/* 
 * Index Portal Styles - Modernization & Premium Overhaul
 * Scoped logic for index.html lifecycle
 */

html,
body {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    -webkit-text-size-adjust: 100% !important;
    -ms-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
}

.metrouicss {
    background-color: #f8fafc;
    /* Removed !important to allow organizationColor from JS */
}

/* --- Navigation Bar Logic --- */
.nav-bar {
    background-color: #E6E8E8 !important;
    /* Restore legacy grey/light-grey background */
    height: 35px !important;
    position: fixed !important;
    top: 0 !important;
    z-index: 1000 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.nav-bar-inner {
    padding: 0 12px !important;
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
}

#verifyEntityStatus {
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
}

.logo-container {
    display: flex !important;
    align-items: center !important;
}

.logo {
    width: 30px !important;
    height: 30px !important;
}

.appName {
    color: #1e293b !important;
    font-weight: 600 !important;
    margin-left: 10px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 1 !important;
    /* Basic inline-block to let parent flexbox (align-items: center) handle vertical centering naturally */
    display: inline-block !important;
    vertical-align: middle !important;
}

.nav-actions {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-left: auto !important;
}

.nav-actions img,
.nav-actions a {
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
}

/* Counter badges */
.nav-counter {
    background: #ef4444 !important;
    color: white !important;
    font-size: 10px !important;
    padding: 2px 5px !important;
    border-radius: 10px !important;
    margin-left: -10px !important;
    margin-top: -15px !important;
    font-weight: bold !important;
    border: 1px solid white !important;
}

/* Menu-specific badge positioning to prevent text overlap */
.menuList .nav-counter {
    right: -35px !important;
}

.nav-counter-green {
    background: #10b981 !important;
}

.nav-counter-orange {
    background: #f59e0b !important;
}

/* Badge document number dans le titre de page */
.menu .pageTitle .nav-counter {
    display: inline-block !important;
    vertical-align: baseline !important;
    margin: 0 0 0 6px !important;
    font-size: 11px !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    border: none !important;
    font-weight: 600 !important;
    position: relative !important;
    top: 0 !important;
}

/* --- Global Overlay System (Fade) --- */
#fade {
    display: none;
    background: rgba(15, 23, 42, 0.8) !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 9998 !important;
    backdrop-filter: blur(4px) !important;
}

/* --- Premium Loading Popup (popup_name) --- */
.popup_block {
    display: none;
    position: fixed !important;
    height: auto !important;
    min-height: 180px !important;
    width: 320px !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 9999 !important;
    background: #ffffff !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    padding: 30px !important;
    text-align: center !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;

    /* Entry animation */
    animation: popupEntry 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes popupEntry {
    0% {
        opacity: 0;
        transform: translate(-50%, -45%) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.popup_block h4 {
    margin-bottom: 20px !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
}

.popup_block #labelUpdateData {
    color: #1e293b !important;
    font-size: 1.16rem !important;
}

.popup_block .labelUpdateEntity {
    color: #64748b !important;
    font-size: 0.95rem !important;
    margin-top: 10px !important;
}

.popup_block .loader-container {
    margin: 25px 0 !important;
}

.premium-loader {
    width: 48px !important;
    height: 48px !important;
    border: 4px solid #f3f4f6 !important;
    border-top: 4px solid var(--v2-brand-blue, #053B5C) !important;
    border-radius: 50% !important;
    margin: 0 auto !important;
    animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite !important;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Utility classes */
.hide {
    display: none !important;
}

.overflowLine {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}