/**
 * HMS PREMIUM SAAS HEADER
 * Version: 2.0.0
 */

/* 1. MASTER CONTAINER (Glassmorphism Effect) */
.hms-main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* NEW: High transparency + saturated blur */
    background: var(--hms-white-transparent);
    backdrop-filter: blur(30px) saturate(160%);
    -webkit-backdrop-filter: blur(30px) saturate(160%);
    height: 65px; /* Slightly taller for more "air" */
    padding: 5px 15px;
    border-radius:15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.6); /* White frosted edge */
    position: sticky;
    /*top: 32px;*/
    z-index: 1500; /* Ensuring it sits well with the sidebar z-index */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--hms-border);
}

/* 2. BRANDING SECTION (Logo & Pulse) */
.hms-header-brand {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 250px;
}

.hms-logo-wrapper {
    width: 130px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.hms-header-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Prevents logo stretching */
}

/* 1. The Apple-Style Pill Container */
.hms-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(241, 241, 241, 50%); /* Semi-transparent like iOS Control Center */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
        border: 1px solid var(--hms-border-light)!important;
    
    padding: 6px 14px;
    border-radius: 100px; /* Perfect pill shape */
    border: 1px solid rgba(0, 0, 0, 0.05); /* Ultra-thin Apple edge */
    
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
    user-select: none;
}

/* 2. The iPhone Cellular Signal Bars */
.hms-signal-bars {
    display: flex;
    align-items: flex-end;
    gap: 2.5px;
    width: 19px;
    height: 12px;
    margin-bottom: 1px; /* Visual baseline alignment */
}

.hms-bar {
    width: 3px;
    background: #d1d1d6; /* iOS Grey (Off state) */
    border-radius: 4px; /* Fully rounded caps like iPhone */
    transition: background 0.3s ease, height 0.3s ease;
}

/* Apple Proportions */
.hms-bar-1 { height: 35%; }
.hms-bar-2 { height: 55%; }
.hms-bar-3 { height: 80%; }
.hms-bar-4 { height: 100%; }

/* 3. States (Solid, Clean Apple Colors) */

/* Excellent (iPhone Signal Green) */
.status-excellent .hms-bar { 
    background: #34c759; /* Apple Success Green */
}
.status-excellent #hms-connection-text { color: #1a1a1a; }

/* Good (iPhone Signal Blue) */
.status-good .hms-bar-1, 
.status-good .hms-bar-2, 
.hms-bar-3 { 
    background: #007aff; /* Apple Primary Blue */
}
/* Fourth bar stays grey for "Good" (3 out of 4) */
.status-good .hms-bar-4 { background: #d1d1d6; }
.status-good #hms-connection-text { color: #1a1a1a; }

/* Weak (Apple Warning Orange) */
.status-weak .hms-bar-1, .status-weak .hms-bar-2 { background: #ff9500;}
.status-weak #hms-connection-text { color: #1a1a1a; }

/* Offline (Apple Error Red) */
.status-offline .hms-bar { background: #ff3b30; }
.status-offline #hms-connection-text { color: #ff3b30; }

/* 4. Apple Typography */
#hms-connection-text {
    font-size: 11px;
    font-weight: 600; /* Apple uses Semi-bold for status bars */
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", sans-serif;
    letter-spacing: -0.2px; /* iOS uses tighter tracking */
    color: #1a1a1a;
}

/* 5. The "Live" Pulse (Subtle, not neon) */
@keyframes apple-breath {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.status-excellent .hms-signal-bars {
    animation: apple-breath 3s infinite ease-in-out;
}

/* Hover Effect: Apple Dynamic Island expansion feel */
.hms-status-pill:hover {
    background: #ffffff;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* 3. CENTER SEARCH - Liquid Pro Edition */
.hms-search-container {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 500px;
    position: relative;
    /* This ensures the expansion doesn't jitter other elements */
    perspective: 1000px; 
}

.hms-search-bar {
    background: rgba(255, 255, 255, 0.4); 
    backdrop-filter: blur(15px) saturate(160%);
    -webkit-backdrop-filter: blur(15px) saturate(160%);
    
    /* Ultra-light dual border */
    border: 1px solid var(--hms-border-light);
    outline: 1px solid rgba(0, 0, 0, 0.03); 
    
    border-radius: 100px; 
    padding: 0 24px;
    display: flex;
    align-items: center;
    width: 100%;
    height: 48px;
    
    /* Multi-layered shadows for realistic depth */
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 10px 20px rgba(0, 0, 0, 0.03),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
    
    /* Apple-standard cubic bezier for buttery smoothness */
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- THE ULTRA-PREMIUM FOCUS STATE --- */
.hms-search-bar:focus-within {
    background: #ffffff; 
    
    /* 1. Expansion Effect: Grows slightly larger */
    transform: translateY(-2px) scale(1.03)!important; 
    
    /* 2. Color Sync: Border turns to your brand Maroon/Primary */
    border-color: var(--hms-primary);
    
    /* 3. The Glow: A soft neon halo using your brand color */
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.08), 
        0 0 0 5px color-mix(in srgb, var(--hms-primary) 4%, transparent),
        inset 0 1px 1px rgba(255, 255, 255, 1);
    
    /* 4. Width Stretch: Makes the bar feel "Energetic" */
    width: 105%; 
}

/* Icon Animation on Focus */
.hms-search-bar .dashicons-search {
    color: #94a3b8;
    font-size: 18px;
    margin-right: 14px;
    transition: all 0.4s ease;
}

.hms-search-bar:focus-within .dashicons-search {
    color: var(--hms-primary);
    transform: scale(1.2) rotate(5deg); /* Playful little "searching" tilt */
}

/* The Input Field */
.hms-search-bar input {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    
    width: 100%;
    height: 100%;
    font-size: 15px;
    font-weight: 600; /* Bolder text feels more premium */
    color: var(--hms-black);
    padding: 0 !important;
    margin: 0 !important;
}

.hms-search-bar input::placeholder {
    color: #94a3b8;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

/* Hide placeholder slowly when typing */
.hms-search-bar:focus-within input::placeholder {
    opacity: 0.5;
}
/* 4. PROFILE & ACTIONS AREA */
.hms-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 250px;
    justify-content: flex-end;
}

.hms-profile-pill {
    position: relative;
}

/* 4. PROFILE PILL - LIQUID CRYSTAL TRIGGER */
.hms-profile-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(15px);
    
    padding: 6px 14px 6px 6px !important;
    border-radius: 100px;
        border: 1px solid var(--hms-border-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    
    /* Ensure the trigger has a consistent width for the dropdown to match */
    min-width: 200px; 
    position: relative;
    transition: all 0.4s ease;
}

.hms-profile-trigger:hover {
    background: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    border-color: var(--hms-primary) !important;
}

.hms-user-meta {
    display: flex;
    flex-direction: column; /* Stacks name and role vertically */
    justify-content: center;
    flex: 1; /* Pushes the arrow to the far right */
    overflow: hidden;
}

.hms-user-meta strong {
    font-size: 16px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Prevents long names from breaking layout */
    text-transform: capitalize;
}

.hms-user-meta small {
    font-size: 10px;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: -2px; /* Pulls it closer to the name */
}

.hms-header-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--hms-primary) 0%, color-mix(in srgb, var(--hms-primary), #000 15%) 100%) !important;
    color: #fff !important;
    font-weight: 800;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(var(--hms-primary-rgb), 0.3);
}

/* 5. PROFILE DROPDOWN - LIQUID PRO CARD */
.hms-profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    
    /* Matches the parent trigger width exactly */
    width: 100%; 
    min-width: 220px; /* Safety minimum */
    
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 8px;
    z-index: 2000;
    
    display: none;
    transform-origin: top center;
}

.hms-profile-dropdown.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.hms-drop-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    color: #475569;
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.hms-drop-item:hover {
    background: #ffffff;
    color: var(--hms-primary);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

/* Icon Bubble Sync */
.hms-icon-mini {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    color: #64748b;
    transition: all 0.3s ease;
}

.hms-drop-item:hover .hms-icon-mini {
    background: var(--hms-primary);
    color: #ffffff;
    transform: scale(1.1) rotate(-5deg);
}

.hms-logout {
    color: #ef4444 !important;
}

.hms-logout:hover .hms-icon-mini {
    background: #ef4444 !important;
    color: #fff !important;
}

/*.hms-profile-trigger {*/
/*    display: flex;*/
/*    align-items: center;*/
/*    gap: 12px;*/
/*    cursor: pointer;*/
/*    background: rgba(255, 255, 255, 0.45) !important;*/
/*    backdrop-filter: blur(15px);*/
    
/*    padding: 6px 14px 6px 6px !important;*/
/*    border-radius: 100px;*/
/*    border: 1px solid rgba(255, 255, 255, 0.8) !important;*/
/*    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);*/
    
    /* Ensure the trigger has a consistent width for the dropdown to match */
/*    min-width: 200px; */
/*    position: relative;*/
/*    transition: all 0.4s ease;*/
/*}*/
.hms-form-group {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 10px 15px;
    border-radius: 12px;
    transition: border-color 0.2s;
}

.hms-form-group:focus-within {
    border-color: #3b82f6;
    background: #fff;
}

/* Premium Form Groups */
.hms-form-group {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 10px 15px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.hms-form-group:focus-within {
    border-color: #0f172a;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.hms-form-group label {
    display: block;
    font-size: 9px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.hms-form-group input {
    width: 100%;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    outline: none !important;
    box-shadow: none !important;
}

.hms-drop-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none !important;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    transition: background 0.2s;
}

.hms-drop-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}


/* Locked/View-only state */
.hms-profile-form.view-only .hms-form-group {
    background: #fcfcfc;
    border-color: #f1f5f9;
}

/* View Only (Default) */
.hms-profile-form.view-only input {
    cursor: default;
    color: #94a3b8;
}

/* Locked Email (Never Editable) */
.hms-form-group.locked {
    background: #f1f5f9 !important;
}
.hms-form-group.locked input {
    cursor: not-allowed !important;
}

/* Editable Fields when "Edit" is clicked */
.hms-profile-form:not(.view-only) .hms-form-group:not(.locked) {
    background: #fff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.hms-profile-form:not(.view-only) .hms-form-group:not(.locked) input {
    color: #1e293b;
    cursor: text;
}

.pac-container { z-index: 1000000 !important; }

@keyframes hms-pulse-blue {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.1); }
    70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}


.hms-drop-item span.dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #94a3b8;
}

.hms-drop-item.hms-logout {
    color: #ef4444;
}

.hms-drop-item.hms-logout:hover {
    background: #fef2f2;
}

hr {
    border: 0;
    border-top: 1px solid #f1f5f9;
    margin: 8px 0;
}



/* Search Dropdown Results */
.hms-search-dropdown {
    position: absolute;
    top: calc(100% + 22px); /* Floating gap */
    left: 50%;
    transform: translateX(-50%);
    width: 650px; 
    
    /* Liquid Pro Frosting */
    background: rgb(255 255 255 / 72%);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.15), 
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    z-index: 2005;
   max-height:550px; /* Limits the height so it doesn't hit the bottom */
    overflow-y: auto;  /* Enables scrolling for many results */
    overflow-x: hidden;
    
    display: none;
    padding: 10px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    /*transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);*/
}.hms-search-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr; /* Responsive split */
    gap: 24px;
}

/* 2. THE CUTE HIDDEN SCROLLBAR (Premium Finish) */
/* 2. THE CUTE FLOATING SCROLLBAR FIX */
.hms-search-dropdown::-webkit-scrollbar {
    width: 8px; /* Slightly wider to allow for the 'border' margin */
}

.hms-search-dropdown::-webkit-scrollbar-track {
    /* KEY FIX: Transparent background ensures the track 
       doesn't show through the rounded corners */
    background: transparent; 
    margin: 15px 0; /* NEW: Keeps the scrollbar away from the top/bottom curves */
}

.hms-search-dropdown::-webkit-scrollbar-thumb {
    /* Use a color-mix or rgba so it looks premium on glass */
    background-color: rgba(0, 0, 0, 0.1);
    
    /* THE ROUNDED FIX: 
       By adding a transparent border and background-clip, 
       we force the scrollbar to shrink and float inside the div */
    border: 3px solid transparent; 
    background-clip: content-box;
    border-radius: 20px;
}

.hms-search-dropdown::-webkit-scrollbar-thumb:hover {
    background-color: var(--hms-primary);
}

/* Ensure the JS-generated icons look premium */
.hms-search-cat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hms-search-cat-title .hms-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px; /* Squircle radius */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.hms-search-cat-title .hms-icon svg {
    width: 16px;
    height: 16px;
    color: var(--hms-primary); /* Your Maroon color */
}

.hms-search-content { padding: 20px; }

/* Grid Layout */
.hms-search-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr; /* Responsive split */
    gap: 24px;
}

.hms-search-cat-title {
    font-size: 10px;
    font-weight: 900;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 12px;
}

.hms-search-cat-title .dashicons {
    color: var(--hms-primary);
    font-size: 16px;
}

.hms-search-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    margin-bottom: 4px;
    border-radius: 18px; /* Smooth rounded corners */
    cursor: pointer;
    background: var(--hms-white);
    border: 1px solid transparent;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hms-search-card:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 1);
    /* Energetic Pop effect */
    transform: translateX(6px) scale(1.02); 
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.04);
}

.hms-search-avatar {
    width: 42px;
    height: 42px;
    /* Soft Gradient for energy */
    background: linear-gradient(135deg, var(--hms-primary) 0%, color-mix(in srgb, var(--hms-primary), black 15%) 100%);
    color: #ffffff;
    border-radius: 14px; /* Premium Squircle */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(var(--hms-primary-rgb), 0.2);
    transition: transform 0.3s ease;
}

.hms-search-card:hover .hms-search-avatar {
    transform: rotate(-5deg) scale(1.1); /* Cute little bounce */
}

.hms-card-info strong {
    display: block;
    font-size: 14px;
    color: #0f172a;
    font-weight: 700;
    margin-bottom: 2px;
}

.hms-card-info small {
    display: block;
    font-size: 11.5px;
    color: #64748b;
    font-weight: 500;
    opacity: 0.8;
}

.hms-search-avatar {
    width: 42px;
    height: 42px;
    /* Soft Gradient for energy */
    background: linear-gradient(135deg, var(--hms-primary) 0%, color-mix(in srgb, var(--hms-primary), black 15%) 100%);
    color: #ffffff;
    border-radius: 14px; /* Premium Squircle */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(var(--hms-primary-rgb), 0.2);
    transition: transform 0.3s ease;
}

.hms-search-card:hover .hms-search-avatar {
    transform: rotate(-5deg) scale(1.1); /* Cute little bounce */
}

.hms-card-info strong {
    display: block;
    font-size: 14px;
    color: #0f172a;
    font-weight: 700;
    margin-bottom: 2px;
}

.hms-card-info small {
    display: block;
    font-size: 11.5px;
    color: #64748b;
    font-weight: 500;
    opacity: 0.8;
}

/* Skeleton Loader */
.hms-search-skeleton {
    padding: 15px;
}
.skeleton-line {
    height: 40px;
    background: linear-gradient(90deg, #f1f5f9 25%, #f8fafc 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s infinite;
    border-radius: 10px;
    margin-bottom: 10px;
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}




/* Premium Modal Layout */
.hms-intelligence-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hms-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 20px;
}

.hms-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

/* Skeleton Animation */
.hms-skeleton-box {
    background: linear-gradient(90deg, #f1f5f9 25%, #f8fafc 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: hms-shimmer 1.5s infinite linear;
    border-radius: 8px;
}

@keyframes hms-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


#hms-search-clear {
    position: relative;
    z-index: 10; /* Sits above the input */
    cursor: pointer;
    padding: 5px; /* Bigger hit area for easier clicking */
    margin-right: 5px;
    transition: all 0.2s ease;
    pointer-events: auto; /* Ensures it's definitely clickable */
}

#hms-search-clear:hover {
    color: #ef4444 !important;
    transform: scale(1.2);
}

.hms-search-bar {
    display: flex;
    align-items: center;
    position: relative;
}


.hms-support-card:hover {
    border-color: #3b82f6 !important;
    background: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.hms-support-card:active {
    transform: translateY(0);
}


/* Premium Glassmorphism Modal */
#hms-header-intelligence-modal .hms-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 700px;
    width: 90%;
}


/* Base Modal Overlay (Missing CSS) */
#hms-header-intelligence-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6); /* Dark transparent backdrop */
    backdrop-filter: blur(5px);
    z-index: 9999; /* Must be higher than your header (1500) and dropdowns (2000) */
    display: none; /* JavaScript will change this to 'flex' */
    align-items: center;
    justify-content: center;
}


/* Fix for the Dark Header Layout */
#hms-header-intelligence-modal .hms-modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px 25px !important;
    background: #0f172a;
    border-radius: 24px 24px 0 0;
    min-height: 80px; /* Ensures enough height for two lines of text */
}

#hms-header-intelligence-modal .hms-modal-header-text {
    flex: 1;
}

#hms-header-intelligence-modal .hms-modal-header strong, 
#hms-header-intelligence-modal .hms-modal-header h2 {
    display: block;
    margin: 0;
    font-size: 18px;
    color: #fff;
    line-height: 1.2;
}

#hms-header-intelligence-modal .hms-modal-header span, 
#hms-header-intelligence-modal .hms-modal-header p {
    display: block;
    margin: 4px 0 0 0;
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#hms-header-intelligence-modal .hms-radar-close-btn {
    background: #fff !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
    padding: 8px 18px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: 0.4s;
    font-size: 17px !important;
}

#hms-header-intelligence-modal .hms-close-modal{
    position: static !important;
    background: rgba(255, 255, 255, 0.15)!important;
    border: none!important;
    width: 32px!important;
    height: 32px!important;
       border-radius: 8px!important;
    font-size: 30px !important;
    cursor: pointer!important;
    display: flex!important;
    justify-content: center!important;
    /* align-items: center; */
    line-height: 11px!important;
    color: #fff !important;
    transition: 0.5s!important;
}

#hms-header-intelligence-modal .#hms-header-intelligence-modal .hms-close-modal:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: scale(1.05);
}

#hms-header-intelligence-modal .hms-radar-close-btn:hover {
       background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

.hms-intelligence-body {
    padding: 30px;
    color: #1e293b;
}

/* Lifetime Stats Cards */
.hms-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.hms-stat-card {
    background: #fff;
    padding: 15px;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
    text-align: center;
    transition: transform 0.2s;
}

.hms-stat-card:hover { transform: translateY(-3px); }

.hms-stat-card small {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 800;
    color: #94a3b8;
    margin-bottom: 5px;
}

.hms-stat-card strong { font-size: 16px; color: #0f172a; }

/* Timeline History */
.hms-history-timeline {
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
}

.hms-timeline-item {
    display: flex;
    gap: 15px;
    padding-bottom: 15px;
    border-left: 2px solid #f1f5f9;
    margin-left: 10px;
    padding-left: 20px;
    position: relative;
}

.hms-timeline-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 0;
    width: 12px;
    height: 12px;
    background: #3b82f6;
    border-radius: 50%;
    border: 2px solid #fff;
}





#hms-email-modal {
    transition: all 0.3s ease;
}

#hms-email-modal .hms-modal-content {
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

#hms-email-modal.active .hms-modal-content {
    transform: scale(1);
}




/* Notification Container Position */
.hms-header-actions {
    position: relative; /* Crucial for alignment */
}

/* 1. The Bell Trigger */
/* 1. The Bell Trigger - Liquid Crystal Overhaul */
.hms-notif-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    position: relative;
    cursor: pointer;
    
    /* NEW: High-Refractive Glass Background */
    background: rgba(255, 255, 255, 0.45); 
    backdrop-filter: blur(15px) saturate(160%);
    -webkit-backdrop-filter: blur(15px) saturate(160%);
    
    /* NEW: Double-Stroke Apple Border (Very Sharp) */
    border: 1.5px solid var(--hms-border-light);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.04),            /* Ambient Shadow */
        inset 0 1px 2px rgba(255, 255, 255, 1),    /* Top Edge Light Reflection */
        inset 0 -1px 2px rgba(0, 0, 0, 0.02);      /* Bottom Depth */
    
    border-radius: 50%; 
    color: #475569;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 2. Energetic Interaction */
.hms-notif-trigger:hover {
    background: #ffffff;
    /* Turns the border into your primary brand color with a glow */
    border-color: var(--hms-primary);
    transform: translateY(-3px) scale(1.08);
    box-shadow: 
        0 12px 25px rgba(0, 0, 0, 0.08), 
        0 0 0 5px color-mix(in srgb, var(--hms-primary) 15%, transparent);
    color: var(--hms-primary);
}

/* 3. The Bell Icon Itself */
.hms-notif-trigger .dashicons-bell {
    font-size: 20px;
    width: 20px;
    height: 20px;
    transition: transform 0.4s ease;
}

.hms-notif-trigger:hover .dashicons-bell {
    animation: hms-bell-swing 0.8s ease-out; /* Energetic Swing */
}

/* 4. The "Apple-Style" Count Badge */
.hms-notif-count {
    position: absolute;
    top: 0px;
    right: 0px;
    background: #ff3b30; /* iOS System Red */
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    min-width: 20px;
    height: 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* This 2px WHITE border makes it look built-in */
    border: 2px solid #ffffff; 
    box-shadow: 0 4px 8px rgba(255, 59, 48, 0.3);
    z-index: 10;
}


/* When dropdown is open, dim the other icons slightly */
.hms-main-header:has(.hms-notif-dropdown[style*="display: block"]) .hms-search-container,
.hms-main-header:has(.hms-notif-dropdown[style*="display: block"]) .hms-profile-pill {
    opacity: 0.4;
    filter: blur(1px);
    transition: all 0.4s ease;
}


/* Energetic Bell Animation */
@keyframes hms-bell-swing {
    0% { transform: rotate(0); }
    20% { transform: rotate(25deg); }
    40% { transform: rotate(-20deg); }
    60% { transform: rotate(15deg); }
    80% { transform: rotate(-10deg); }
    100% { transform: rotate(0); }
}


/* When dropdown is open, dim the other icons slightly */
.hms-main-header:has(.hms-notif-dropdown[style*="display: block"]) .hms-search-container,
.hms-main-header:has(.hms-notif-dropdown[style*="display: block"]) .hms-profile-pill {
    opacity: 0.4;
    filter: blur(1px);
    transition: all 0.4s ease;
}

/* =========================================
   NOTIFICATION DROPDOWN - LIQUID PRO
   ========================================= */

/* 2. The Main Dropdown Panel */
.hms-notif-dropdown {
    position: absolute;
    top: calc(100% + 22px);
    right: -10px;
    width: 380px; /* Slightly wider for better breathing room */
    
    /* Liquid Pro Frosting */
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(25px) saturate(170%);
    -webkit-backdrop-filter: blur(25px) saturate(170%);
    
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    overflow: hidden;
    transform-origin: top right;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 3. The "Beak" Arrow (Frosted) */
.hms-notif-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 25px;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(25px);
    transform: rotate(45deg);
    border-top: 1px solid rgba(255, 255, 255, 0.6);
    border-left: 1px solid rgba(255, 255, 255, 0.6);
    z-index: 1;
}

/* 4. Header Polish */
.hms-notif-header {
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hms-notif-header strong { 
    font-size: 16px; 
    color: #0f172a; 
    font-weight: 800;
    letter-spacing: -0.4px;
}

#hms-mark-read {
    /*background: var(--hms-primary);*/
    border: none;
    color: var(--hms-primary);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: opacity 0.2s;
}

#hms-mark-read:hover, #hms-mark-read:focus {
    opacity: 0.7;
    text-decoration: underline;
    background: var(--hms-primary);
    color: var(--hms-white);
    text-decoration: none;
}

 #hms-mark-read:focus {
    opacity: 1;
     
 }

/* 5. Notification List Area & Scrollbar Sync */
#hms-notif-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px; /* Space for the floating cards */
    background: var(--hms-white);
}

/* Matching the cute floating scrollbar from Search Results */
#hms-notif-list::-webkit-scrollbar {
    width: 8px;
}
#hms-notif-list::-webkit-scrollbar-track {
    background: transparent;
    margin: 15px 0;
}
#hms-notif-list::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border: 3px solid transparent;
    background-clip: content-box;
    border-radius: 20px;
}

/* 6. The Notification Card (Energetic) */
.hms-notif-item {
    padding: 14px 16px;
    margin-bottom: 6px;
    border-radius: 18px;
    display: flex;
    gap: 15px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    border: 1px solid transparent;
}

.hms-notif-item:hover { 
    background: #ffffff;
    border-color: rgba(255, 255, 255, 0.9);
    transform: translateX(-5px) scale(1.02); /* Slides left toward the bell */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

/* Unread State (Liquid Blue Tint) */
.hms-notif-item.is-unread {
    background: color-mix(in srgb, var(--hms-primary) 5%, transparent);
}

/* Icon Box (Squircle Sync) */
.notif-icon-box {
    width: 42px;
    height: 42px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 14px; /* Premium Squircle */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease;
}

.hms-notif-item:hover .notif-icon-box {
    transform: rotate(8deg) scale(1.1);
    color: var(--hms-primary);
}

/* 7. Footer & Tabs */
.hms-notif-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.hms-notif-tabs button {
    background: rgba(0, 0, 0, 0.04);
    border: none;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.hms-notif-tabs button.active {
    background: var(--hms-primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(var(--hms-primary-rgb), 0.3);
}

.hms-notif-footer {
    padding: 16px;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.hms-notif-footer a {
    font-size: 12px;
    color: #64748b;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}

.hms-notif-footer a:hover { color: var(--hms-primary); }

/* Bell Swing Animation */
@keyframes hms-bell-swing {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(15deg); }
    30% { transform: rotate(-12deg); }
    45% { transform: rotate(10deg); }
    60% { transform: rotate(-8deg); }
}

.hms-notif-pulse {
    animation: hms-bell-swing 0.8s ease-out;
    color: #ef4444 !important;
}

/* The Wave Animation */
@keyframes hms-signal-wave {
    0% { opacity: 1; transform: scaleY(1); }
    30% { opacity: 0.7; transform: scaleY(1.2); filter: brightness(1.2); }
    100% { opacity: 1; transform: scaleY(1); }
}

/* Class to trigger the animation */
.hms-signal-active .hms-bar {
    animation: hms-signal-wave 0.6s ease-in-out;
}

/* Stagger the bars for a "wave" effect */
.hms-signal-active .hms-bar-1 { animation-delay: 0.0s; }
.hms-signal-active .hms-bar-2 { animation-delay: 0.1s; }
.hms-signal-active .hms-bar-3 { animation-delay: 0.2s; }
.hms-signal-active .hms-bar-4 { animation-delay: 0.3s; }


.hms-notif-item.is-unread .notif-title { color: #0f172a; font-weight: 800; }

/* Read Style (Faded) */
.hms-notif-item.is-read {
    background: #fff;
    opacity: 0.7; /* Makes it look "checked" */
}

.notif-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevents icon from squishing */
}

.notif-icon-box span.dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Specific Tweak for Dashicons alignment */
.dashicons-admin-network:before { content: "\f494"; } /* Door/Key icon alternative */

.hms-notif-item.is-read .notif-title { color: #64748b; font-weight: 600; }
.hms-notif-item.is-read .notif-icon-box { background: #f1f5f9 !important; color: #94a3b8 !important; }

/* The little blue dot for new items */
.unread-dot {
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    align-self: center;
}



/* Filter Tabs Container */
.hms-notif-tabs {
    display: flex;
    gap: 10px;
    padding: 10px 20px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
}

.hms-notif-tabs button {
    background: #f1f5f9;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.hms-notif-tabs button.active {
    background: #0f172a;
    color: #fff;
}

.hms-notif-tabs button:hover:not(.active) {
    background: #e2e8f0;
    color: #0f172a;
}

/* Mini Badge next to "Notifications" title */
.hms-notif-badge-mini {
    display: inline-block;
    background: #eff6ff;
    color: #3b82f6;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 6px;
    margin-left: 8px;
    font-weight: 800;
}

.notif-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevents icon from squishing */
}

.notif-icon-box span.dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Specific Tweak for Dashicons alignment */
.dashicons-admin-network:before { content: "\f494"; } /* Door/Key icon alternative */









/*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa*/

/* --- BULLETPROOF MODAL VISIBILITY --- */
.hms-hidden {
    display: none !important;
}
.hms-force-show {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Fix for the footer close button to look premium */
/* Make the Radar Modal footer button look like a real premium button */
.hms-footer-actions .hms-radar-close-btn {
    background: #fff !important;
    color: #ef4444 !important; /* Red text for 'Close' */
    border: 1.5px solid #fee2e2 !important;
    padding: 10px 25px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

.hms-footer-actions .hms-radar-close-btn:hover {
    background: #fef2f2 !important;
    border-color: #ef4444 !important;
    transform: translateY(-1px);
}

.hms-modal-content h2{
    color: var(--hms-black)!important;
}


/* Fix the content area to stay large during loading */
#hms-radar-details-content {
    min-height: 500px; /* Adjust this to the average height of your modals */
    display: flex;
    flex-direction: column;
}

/* Make sure the skeleton shimmer is smooth */
.hms-skeleton {
    background: #f1f5f9;
    background-image: linear-gradient(90deg, #f1f5f9 0px, #f8fafc 40px, #f1f5f9 80px);
    background-size: 600px;
    animation: hms-shimmer 1.6s infinite linear;
}

@keyframes hms-shimmer {
    0% { background-position: -150px; }
    100% { background-position: 450px; }
}







/* =========================================================
   HEADER INTELLIGENCE MODAL FIX
   Prevents conflict with dashboard radar modal
========================================================= */

#hms-header-intelligence-modal.hms-force-show,
#hms-header-intelligence-modal.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    align-items: center !important;
    justify-content: center !important;
}

#hms-header-intelligence-modal.hms-hidden {
    display: none;
}

#hms-header-intelligence-modal .hms-modal-content {
    position: relative;
    z-index: 2;
}

#hms-close-header-intelligence-modal {
    cursor: pointer;
}








/* =========================================================
   HEADER INTELLIGENCE MODAL FINAL FIX
========================================================= */

#hms-header-intelligence-modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.62) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 9999999 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
}

#hms-header-intelligence-modal.hms-force-show,
#hms-header-intelligence-modal.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

#hms-header-intelligence-modal.hms-hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#hms-header-intelligence-modal .hms-modal-content {
    position: relative !important;
    z-index: 2 !important;
    max-height: 90vh !important;
    overflow: hidden !important;
}

#hms-header-intelligence-modal .hms-modal-body-scroll {
    max-height: calc(90vh - 150px) !important;
    overflow-y: auto !important;
}






/* Header modal close button clickable fix */
#hms-close-header-intelligence-modal,
#hms-close-radar-modal-footer,
#hms-header-intelligence-modal .hms-radar-close-btn,
#hms-header-intelligence-modal #hms-header-intelligence-modal .hms-close-modal {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 99999999 !important;
}





#hms-close-header-intelligence-footer,
#hms-header-intelligence-modal .hms-modal-footer .hms-btn-discard {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 99999999 !important;
}