/* --- 8. ELITE PILL SUB-NAVIGATION (Unified Light Glass Capsule Menu) --- */
.sidebar-premium {
    background: rgba(255, 255, 255, 0.75) !important; /* Premium Light Glass matching identity */
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    height: auto;
    width: fit-content;
    max-width: 95%;
    margin: 100px auto 30px auto;
    border-radius: 100px; /* Fully rounded capsule */
    position: relative;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px; /* Increased outer padding for harmony */
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    top: 0;
}

.sidebar-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

/* Container inside header */
.sidebar-nav-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Nav Group Capsule */
.nav-group-pill {
    display: flex;
    align-items: center;
    position: relative;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 0;
}

/* Group Name Label (Hidden for Ultra-Minimalist Look matching the mockup) */
.nav-group-label {
    display: none !important;
}

/* Vertical divider between organization groups */
.nav-group-pill:not(:last-child)::after {
    content: '';
    width: 1px;
    height: 18px;
    background: rgba(211, 22, 40, 0.35) !important; /* Brand red divider line matching request */
    margin-left: 14px;
    margin-right: 6px;
    align-self: center;
}

.nav-group-items {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Tab Button - Circular Icon Default */
.tab-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px; /* Increased button size for harmony */
    height: 44px; /* Increased button size for harmony */
    border-radius: 50%;
    color: #475569; /* Slate-600 for inactive to match brand header buttons */
    font-weight: 800;
    font-size: 0.85rem;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    position: relative;
    padding: 0;
    overflow: hidden;
}

.tab-btn i {
    font-size: 1.25rem;
    color: currentColor;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.tab-btn:hover {
    background: var(--primary-light, rgba(211, 22, 40, 0.05)); /* Brand red hover highlight */
    color: var(--primary, #D31628); /* Highlight with brand red */
}

/* Tab Label (Hidden when Inactive, slides open when Active) */
.tab-btn .tab-text {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, margin 0.35s ease;
    margin-left: 0;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase; /* Match uppercase mockup */
    letter-spacing: 0.5px;
}

/* Active State: Morph to Vibrant Brand Pill */
.tab-btn.active {
    width: auto;
    border-radius: 100px; /* Pill active */
    padding: 0 20px; /* Balanced horizontal padding */
    background: var(--primary-gradient, linear-gradient(135deg, #D31628 0%, #A1111E 100%)) !important; /* Premium Brand Gradient */
    color: #ffffff !important;
    box-shadow: 0 8px 16px var(--shadow-primary, rgba(211, 22, 40, 0.25)) !important;
}

.tab-btn.active i {
    color: #ffffff !important;
}

.tab-btn.active .tab-text {
    max-width: 160px;
    opacity: 1;
    margin-left: 8px;
}


/* Notification badges inside icons */
.tab-btn .badge-notify {
    position: absolute;
    top: 4px; /* Repositioned for 44px height */
    right: 4px; /* Repositioned for 44px height */
    background: #ef4444;
    color: white;
    font-size: 0.55rem;
    font-weight: 900;
    padding: 1px 4px;
    border-radius: 10px;
    min-width: 14px;
    text-align: center;
    border: 1px solid #ffffff; /* Border matches light background */
}

.tab-btn.active .badge-notify {
    top: 6px;
    right: 12px;
    border-color: var(--primary, #D31628);
}

/* --- 9. USER PROFILE CAPSULE (Header Right) --- */
.user-profile-capsule {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 6px 16px 6px 6px;
    border-radius: 100px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.user-profile-capsule:hover {
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.user-avatar-blue {
    width: 44px;
    height: 44px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.user-info-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
    cursor: pointer;
    padding-top: 1px; /* Align with avatar better */
}

.user-greeting {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.user-name-title {
    font-size: 1rem;
    color: #0f172a;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
}

.logout-pill-btn {
    width: 40px;
    height: 40px;
    background: #FFF1F2;
    color: #ef4444;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    margin-left: 4px;
}

.logout-pill-btn i {
    font-size: 1.3rem;
}

.logout-pill-btn:hover {
    background: #FECDD3;
    color: var(--primary, #D31628);
    transform: scale(1.1) rotate(5deg);
}

/* --- CURRENCY TOGGLE PREMIUM --- */
.currency-toggle-wrapper {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

.currency-toggle-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Outfit', sans-serif;
}

.currency-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #1e293b;
}

.currency-toggle-btn.active {
    background: white !important;
    color: #0f172a !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transform: scale(1.02);
}

#btn-mode-dual.active {
    background: #ef4444 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.currency-toggle-btn.active:hover {
    background: white !important;
    color: #0f172a !important;
}

#btn-mode-dual.active:hover {
    background: #ef4444 !important;
    color: white !important;
}

/* --- 10. GLOBAL UI REFINEMENTS --- */
.view-section {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@media (min-width: 992px) {
    #view-admin.active {
        display: block !important;
    }

    #view-admin .page-content-wrapper {
        margin: 0 auto;
        width: 100%;
        max-width: 1600px;
        padding: 40px 35px;
        box-sizing: border-box;
    }

    .main-header {
        left: 0;
        margin: 20px auto;
        width: calc(100% - 70px) !important;
        max-width: 1600px;
        border-radius: 25px;
        transition: width 0.3s ease, max-width 0.3s ease;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    #view-admin .page-content-wrapper {
        padding: 30px 35px;
    }
    .main-header {
        width: calc(100% - 70px) !important;
    }
}

@media (max-width: 991.98px) {
    #view-admin .page-content-wrapper {
        padding: 20px 16px;
    }
    .main-header {
        width: 100% !important;
        border-radius: 0;
        margin: 0;
    }
}

@media (max-width: 991.98px) {
    /* Off-canvas sidebar responsive behavior is defined in fixes.css */
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .sidebar-premium {
        max-width: 98% !important;
        padding: 6px 12px !important;
        margin-top: 90px !important;
    }
    .sidebar-nav-container {
        gap: 4px !important;
        flex-wrap: nowrap !important;
    }
    .tab-btn {
        height: 40px !important;
        padding: 0 12px !important;
        font-size: 0.8rem !important;
    }
    .tab-btn .tab-text {
        max-width: 100px !important;
    }
}



/* =========================================
   ELITE HEADER MULTI-BRANCH SELECTOR
   ========================================= */
.nav-branch-container {
    margin-left: 15px;
    padding-left: 15px;
    border-left: 1px solid #f1f5f9;
    display: inline-flex !important;
    align-items: center;
    position: relative;
    height: 40px; /* Match logo height */
}

.nav-branch-container.hidden {
    display: none !important;
}

.branch-selector-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.branch-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: #475569;
    font-weight: 800;
    font-size: 0.85rem;
}

.branch-current:hover {
    background: white;
    border-color: #6366f1;
    color: #6366f1;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.11);
}

.branch-current i {
    font-size: 1.1rem;
    color: #6366f1;
}

.branch-caret {
    font-size: 0.75rem !important;
    opacity: 0.5;
    margin-left: 4px;
    transition: transform 0.3s;
}

.branch-selector-wrapper.active .branch-caret {
    transform: rotate(180deg);
}

.branch-dropdown {
    position: absolute;
    top: calc(100% + 20px);
    left: 0;
    min-width: 260px;
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 20000 !important;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 10px;
}

.branch-dropdown.opaque-dropdown-premium {
    background: #ffffff !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

.branch-selector-wrapper.active .branch-dropdown {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.branch-item i {
    font-size: 1rem;
    color: #64748b;
    width: 18px;
}

.branch-item.active i {
    color: #6366f1;
}

.branch-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.branch-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    text-align: left;
}

.branch-item:hover {
    background: #f1f5f9;
}

.branch-item.active {
    background: rgba(99, 102, 241, 0.06);
}

.branch-item.active .branch-title {
    color: #6366f1;
}

.branch-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
}

.branch-item.active .branch-dot {
    background: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.branch-info {
    text-align: left;
}

.branch-title {
    font-weight: 900;
    font-size: 0.9rem;
    color: #1e293b;
    margin-bottom: 2px;
}

.branch-addr {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
}

.branch-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.btn-add-branch {
    width: 100%;
    padding: 12px;
    border: 1.5px dashed #cbd5e1;
    background: transparent;
    border-radius: 12px;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-add-branch:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.04);
}

.btn-add-branch.locked {
    opacity: 0.7;
    background: #f8fafc;
}

/* --- 19. SYSTEM VERSION BADGE (Header Top-Bar) --- */
.system-version-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(203, 213, 225, 0.6);
    border-radius: 9999px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    color: #334155;
    letter-spacing: 0.4px;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.system-version-badge:hover {
    background: #ffffff;
    border-color: var(--primary, #D31628);
    color: var(--primary, #D31628);
    -webkit-transform: translateY(-1px);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(211, 22, 40, 0.15);
}

.system-version-badge .version-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
    display: inline-block;
    -webkit-animation: pulse-version 2s infinite ease-in-out;
    animation: pulse-version 2s infinite ease-in-out;
}

@-webkit-keyframes pulse-version {
    0%, 100% {
        opacity: 1;
        -webkit-transform: scale(1);
        transform: scale(1);
    }
    50% {
        opacity: 0.45;
        -webkit-transform: scale(1.3);
        transform: scale(1.3);
    }
}

@keyframes pulse-version {
    0%, 100% {
        opacity: 1;
        -webkit-transform: scale(1);
        transform: scale(1);
    }
    50% {
        opacity: 0.45;
        -webkit-transform: scale(1.3);
        transform: scale(1.3);
    }
}

.system-version-badge .version-text {
    font-weight: 800;
    font-size: 0.78rem;
    line-height: 1;
}

@media (max-width: 768px) {
    .system-version-badge {
        padding: 4px 10px;
        font-size: 0.72rem;
    }
    .system-version-badge .version-dot {
        width: 6px;
        height: 6px;
    }
}


