/* ==========================================================================
   SHARED REUSABLE UI COMPONENTS & INTERACTIVE WIDGETS
   ========================================================================== */

/* --- Elegant SaaS Dashboard Cards --- */
.chart-card {
    background: var(--dash-card);
    border: 1px solid var(--dash-border);
    border-radius: 24px; /* Highly rounded clean corners, matching modern references */
    padding: 2.25rem;
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.chart-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-hover-shadow);
    border-color: rgba(124, 58, 237, 0.2);
}

/* Remove gradient border strips on cards for a cleaner, unified minimalist aesthetic */
.chart-card::before {
    display: none;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Align center vertically for clean side-by-side layout */
    margin-bottom: 1.75rem;
    flex-wrap: wrap; /* Wrap elements gracefully to avoid overlap */
    gap: 1rem;
}

.card-title-section {
    display: flex;
    flex-direction: column;
    flex: 1; /* Allow title to shrink/wrap internally */
    min-width: 0;
}

.card-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title-icon {
    color: var(--accent-purple);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
}

.card-main-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.2px;
    margin: 0;
}

.card-subtitle {
    color: var(--text-sub);
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0.25rem 0 0 0;
}

/* --- Cohesive Warnings & Badges --- */
.warning-pill-footer {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--dash-border);
}

.warning-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(244, 63, 94, 0.05); /* Softer coral red background */
    padding: 0.6rem 1.2rem;
    border-radius: 14px;
    border: 1px solid rgba(244, 63, 94, 0.1);
}

.warning-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-coral);
    display: inline-block;
    box-shadow: 0 0 8px var(--accent-coral);
    animation: warningPulse 1.5s infinite ease-in-out;
}

@keyframes warningPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.5); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(244, 63, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

.warning-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-coral);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* --- Premium Capsule Dropdown Pill Cohesive Theme --- */
.premium-dropdown-pill {
    display: inline-flex;
    align-items: center;
    background: #F8FAFC; /* Sleeker soft background */
    border: 1.5px solid #E2E8F0; /* Much cleaner light slate border */
    border-radius: 14px; /* Matches modern grid borders and rounded design */
    padding: 0 0.5rem 0 0.75rem; /* Tight, sleek internal padding */
    height: 38px; /* Sleeker, tighter vertical height */
    width: 175px; /* Perfect width preventing line wrapping */
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.02);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    position: relative;
    z-index: 10 !important;
}

.premium-dropdown-pill:hover {
    border-color: var(--accent-purple);
    background: #FFFFFF;
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.08);
    transform: translateY(-1px);
}

.premium-dropdown-pill:focus-within {
    border-color: var(--accent-purple);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.premium-dropdown-icon {
    color: var(--accent-purple);
    font-size: 0.85rem; /* Sleeker, standard size */
    margin-right: 0.35rem; /* Snug breathing room */
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

/* Hide default Dash dropdown borders & shadows in clean dropdown mode */
.premium-dropdown-pill .dash-dropdown-clean {
    flex-grow: 1;
    width: 100% !important;
}

/* Target and completely remove any inner border, separator or background from React-Select (handles both v1 and v2+) */
.premium-dropdown-pill .Select,
.premium-dropdown-pill .Select-control,
.premium-dropdown-pill .dash-dropdown-clean .Select,
.premium-dropdown-pill .dash-dropdown-clean .Select-control,
.premium-dropdown-pill .Select__control,
.premium-dropdown-pill .Select__control:hover,
.premium-dropdown-pill .Select__control--is-focused,
.premium-dropdown-pill .Select__control--is-focused:hover,
.premium-dropdown-pill .dash-dropdown-clean .Select__control,
.premium-dropdown-pill .dash-dropdown-clean .Select__control:hover,
.premium-dropdown-pill .dash-dropdown-clean .Select__control--is-focused,
.premium-dropdown-pill .dash-dropdown-clean .Select__control--is-focused:hover {
    border: none !important;
    border-color: transparent !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    height: 34px !important; /* Adjusted to center vertically in 38px pill */
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
}

/* Align and clean up the value container and indicators wrapper */
.premium-dropdown-pill .Select__value-container,
.premium-dropdown-pill .Select__indicators,
.premium-dropdown-pill .Select__indicator,
.premium-dropdown-pill .Select__dropdown-indicator,
.premium-dropdown-pill .dash-dropdown-clean .Select-value,
.premium-dropdown-pill .dash-dropdown-clean .Select__value-container,
.premium-dropdown-pill .dash-dropdown-clean .Select__indicators {
    border: none !important;
    border-color: transparent !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    height: 34px !important; /* Adjusted to center vertically in 38px pill */
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
}

/* Hide the ugly react-select vertical separator line */
.premium-dropdown-pill .Select__indicator-separator {
    display: none !important;
}

/* Target placeholders and selected values inside the dropdown */
.premium-dropdown-pill .dash-dropdown-clean .Select-placeholder,
.premium-dropdown-pill .dash-dropdown-clean .Select-value-label,
.premium-dropdown-pill .dash-dropdown-clean .Select__placeholder,
.premium-dropdown-pill .dash-dropdown-clean .Select__single-value {
    padding-left: 2px !important;
    color: var(--text-main) !important;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}

/* Make sure the single-value is centered and doesn't get offset */
.premium-dropdown-pill .dash-dropdown-clean .Select__single-value {
    line-height: normal !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    transform: none !important;
    top: auto !important;
}

/* Input container needs standard typography and zero spacing to prevent pushing text */
.premium-dropdown-pill .dash-dropdown-clean .Select__input-container,
.premium-dropdown-pill .dash-dropdown-clean .Select__input {
    margin: 0 !important;
    padding: 0 !important;
    color: var(--text-main) !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}

.premium-dropdown-pill .dash-dropdown-clean .Select-arrow-zone,
.premium-dropdown-pill .dash-dropdown-clean .Select__indicators {
    padding-right: 2px !important;
}

.premium-dropdown-pill .dash-dropdown-clean .Select-arrow {
    border-color: #64748B transparent transparent !important;
    border-width: 5px 4px 0 !important;
}

.premium-dropdown-pill .dash-dropdown-clean .Select__dropdown-indicator {
    color: #64748B !important;
}

.premium-dropdown-pill .dash-dropdown-clean .is-open .Select-arrow {
    border-color: transparent transparent #64748B !important;
    border-width: 0 4px 5px !important;
}

.premium-dropdown-pill .dash-dropdown-clean .Select-menu-outer,
.premium-dropdown-pill .dash-dropdown-clean .Select__menu {
    border-radius: 16px !important; /* Extremely smooth rounded option menu */
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1) !important;
    background-color: #FFFFFF !important;
    overflow: hidden !important;
    margin-top: 8px !important;
    z-index: 999 !important;
    /* Removed 'left' and 'width' to let React-Select align naturally */
    min-width: 160px !important; /* Ensures plenty of room for option text */
}

.premium-dropdown-pill .dash-dropdown-clean .Select-option,
.premium-dropdown-pill .dash-dropdown-clean .Select__option {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    color: var(--text-sub) !important;
    padding: 10px 16px !important;
    transition: all 0.2s ease !important;
}

.premium-dropdown-pill .dash-dropdown-clean .Select-option.is-focused,
.premium-dropdown-pill .dash-dropdown-clean .Select__option--is-focused {
    background-color: rgba(124, 58, 237, 0.06) !important;
    color: var(--accent-purple) !important;
}

.premium-dropdown-pill .dash-dropdown-clean .Select-option.is-selected,
.premium-dropdown-pill .dash-dropdown-clean .Select__option--is-selected {
    background-color: var(--accent-purple) !important;
    color: #FFFFFF !important;
}

/* --- Common Modals --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px); /* Gorgeous high-end glassmorphism background */
    z-index: 999;
    display: none;
    transition: opacity 0.3s ease;
}

.modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 720px;
    max-width: 92vw;
    max-height: 85vh;
    background: #FFFFFF;
    border-radius: 28px; /* Smooth extra-rounded corners */
    box-shadow: 0 30px 70px -10px rgba(15, 23, 42, 0.3);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.modal-header {
    padding: 2rem 2.5rem 1.5rem 2.5rem;
    border-bottom: 1px solid var(--dash-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FFFFFF;
}

.modal-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--text-main);
    letter-spacing: -0.3px;
    margin: 0;
}

.modal-close-btn {
    background: #F1F5F9;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.25s ease;
}

.modal-close-btn:hover {
    background: var(--accent-coral);
    color: #FFFFFF;
    transform: rotate(90deg);
}

.modal-body {
    padding: 2.25rem 2.5rem;
    flex-grow: 1;
    overflow-y: auto;
}

/* Custom Scrollbar for Modal Body */
.modal-body::-webkit-scrollbar {
    width: 6px;
}
.modal-body::-webkit-scrollbar-track {
    background: transparent;
}
.modal-body::-webkit-scrollbar-thumb {
    background: #E2E8F0;
    border-radius: 10px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
    background: #CBD5E1;
}

/* Premium Floating Card Table Inside Centered Modal */
.modal-body .premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px; /* Breathing row gaps */
    margin-top: 0.5rem;
}

.modal-body .premium-table th {
    background: transparent;
    color: var(--text-sub);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.75px;
    padding: 0.25rem 1.25rem;
    border-bottom: none;
}

.modal-body .premium-table tr {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
}

.modal-body .premium-table td {
    padding: 1.15rem 1.25rem;
    background: #F8FAFC;
    border-top: 1px solid #E2E8F0;
    border-bottom: 1px solid #E2E8F0;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
}

.modal-body .premium-table td:first-child {
    border-left: 1px solid #E2E8F0;
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
}

.modal-body .premium-table td:last-child {
    border-right: 1px solid #E2E8F0;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}

/* Floating table row card lift and shadow expansion micro-interactions */
.modal-body .premium-table tr:hover td {
    background: #FFFFFF;
    border-color: rgba(124, 58, 237, 0.3);
}

.modal-body .premium-table tr:hover {
    transform: translateY(-2px);
}

.modal-body .premium-table tr:hover td:first-child {
    border-left: 1px solid rgba(124, 58, 237, 0.3);
}

.modal-body .premium-table tr:hover td:last-child {
    border-right: 1px solid rgba(124, 58, 237, 0.3);
}

/* Call Button Action inside modal */
.modal-action-btn {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-indigo) 100%);
    color: #FFFFFF !important;
    border: none;
    padding: 0.45rem 1rem !important;
    border-radius: 10px !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.15);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.modal-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.25);
    background: linear-gradient(135deg, var(--accent-indigo) 0%, var(--accent-purple) 100%);
}

.modal-action-btn:active {
    transform: translateY(1px);
}

/* --- Premium Unspecified Locations Floating Badge --- */
.unspecified-locations-badge {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.unspecified-locations-badge:hover {
    transform: translateY(-2px);
    background: #FFFFFF !important;
    border-color: var(--accent-purple) !important;
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.16) !important;
}

.unspecified-locations-badge:active {
    transform: translateY(0px);
}

/* --- Unified Command KPI Cards & Tooltips --- */
.command-cards-row-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap; /* Forces cards on a single row on desktop */
    gap: 1.15rem; /* Cozy desktop gap to prevent horizontal overflow */
    width: 100%;
    margin-bottom: 2.25rem;
    box-sizing: border-box;
}

.command-card {
    background: var(--dash-card);
    border: 1px solid var(--dash-border);
    border-radius: 20px;
    padding: 1.25rem 1.15rem; /* Elegant padding to give longer text labels breathing space */
    flex: 1 1 0px; /* Equal widths, scales organically */
    min-width: 140px; /* Secure shrinking boundary */
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 135px; /* Increased from 120px for ample text height spacing */
    position: relative; /* Absolutely required for top-right info tooltip icon */
}

/* Absolute Positioning for KPI Hover Info Tooltip Wrapper Badge */
.command-card-tooltip-wrapper {
    position: absolute;
    bottom: 26px; /* Center aligned horizontally with the metric value */
    right: 23px; /* Center aligned vertically with the header icon wrapper */
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10 !important;
    background: #E2E8F0; /* Slate-200 — very light, unobtrusive */
    border: 1px solid #CBD5E1; /* Slate-300 border */
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.10);
}

/* Child Bootstrap Icon Styling Centered Inside Circular Badge */
.command-card-tooltip-wrapper .command-card-info-icon {
    font-size: 0.78rem;
    color: #64748B !important; /* Slate-500 — balanced contrast on light badge */
    transition: color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.command-card-tooltip-wrapper:hover {
    background: var(--accent-purple) !important; /* Reactive solid purple hover state */
    border-color: var(--accent-purple) !important;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.2);
    z-index: 99999 !important; /* Elevate hovered tooltip above other stacking contexts */
}

.command-card-tooltip-wrapper:hover .command-card-info-icon {
    color: #FFFFFF !important;
}

/* CSS-Based Custom Tooltip Popover (Appears above the bottom-right badge) */
.command-card-tooltip-wrapper::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px); /* Positioned above the badge */
    right: -10px;
    width: 220px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #0F172A; /* Slate 900 midnight theme */
    color: #FFFFFF;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.5;
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif !important;
    text-align: left;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.25), 0 8px 16px -6px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: normal;
    z-index: 999 !important;
}

/* Custom Tooltip Pointer Arrow (pointing downward toward the badge) */
.command-card-tooltip-wrapper::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    right: 6px;
    border-width: 6px;
    border-style: solid;
    border-color: #0F172A transparent transparent transparent;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999 !important;
}

/* Active Hover Transitions */
.command-card-tooltip-wrapper:hover::before,
.command-card-tooltip-wrapper:hover::after {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Ensure the (i) icon glyph renders with correct font */
.command-card-info-icon::before {
    font-family: 'bootstrap-icons' !important;
}

/* Responsive adaptations for KPI Command Cards */
@media (max-width: 1100px) {
    .command-cards-row-container {
        flex-wrap: wrap !important;
        gap: 1rem !important;
    }
    .command-card {
        flex: 1 1 calc(33.33% - 0.75rem) !important;
        min-width: 160px !important;
    }
}

@media (max-width: 768px) {
    .command-card {
        flex: 1 1 calc(50% - 0.5rem) !important;
        height: 130px !important;
    }
}

@media (max-width: 480px) {
    .command-card {
        flex: 1 1 100% !important;
    }
}

.command-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px -10px rgba(15, 23, 42, 0.08);
}

.command-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.command-card-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-sub);
}

.command-card-icon-wrapper {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

/* Icon theme colors */
.wrapper-indigo { background: rgba(99, 102, 241, 0.08); color: var(--accent-indigo); }
.wrapper-teal { background: rgba(16, 185, 129, 0.08); color: var(--accent-teal); }
.wrapper-orange { background: rgba(249, 115, 22, 0.08); color: var(--accent-orange); }
.wrapper-purple { background: rgba(124, 58, 237, 0.08); color: var(--accent-purple); }
.wrapper-coral { background: rgba(244, 63, 94, 0.08); color: var(--accent-coral); }

.command-card-value {
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    margin-top: 0.75rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Micro-animation for KPI cards loading state */
.command-card-value[data-dash-is-loading="true"] {
    opacity: 0.4;
    filter: blur(1.5px);
    transform: scale(0.97);
    animation: kpiPulseShimmer 1.5s infinite ease-in-out;
    transition: all 0.15s ease-in-out;
}

@keyframes kpiPulseShimmer {
    0% { opacity: 0.4; }
    50% { opacity: 0.75; }
    100% { opacity: 0.4; }
}

/* --- Clickable KPI Card Extensions --- */
.clickable-card {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.clickable-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 30px -10px rgba(124, 58, 237, 0.15), 0 0 0 1px rgba(124, 58, 237, 0.2) !important;
}

.clickable-card:active {
    transform: translateY(-1px) scale(0.99);
}

/* --- Cohesive Premium Table (Standalone & Modal Common Classes) --- */
.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px; /* Gorgeous modern breathing row spacing */
    margin-top: 1rem;
}

.premium-table th {
    background: transparent;
    color: var(--text-sub);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.75px;
    padding: 0.5rem 1.25rem;
    border-bottom: none;
    text-align: left;
}

.premium-table tr {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
}

.premium-table td {
    padding: 1.1rem 1.25rem;
    background: #F8FAFC;
    border-top: 1px solid #E2E8F0;
    border-bottom: 1px solid #E2E8F0;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
}

.premium-table td:first-child {
    border-left: 1px solid #E2E8F0;
    border-top-left-radius: 14px;
    border-bottom-left-radius: 14px;
}

.premium-table td:last-child {
    border-right: 1px solid #E2E8F0;
    border-top-right-radius: 14px;
    border-bottom-right-radius: 14px;
}

/* Row-level hover transitions and floating lift effects */
.premium-table tr:hover td {
    background: #FFFFFF;
    border-color: rgba(124, 58, 237, 0.3);
}

.premium-table tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -8px rgba(124, 58, 237, 0.12);
}

.premium-table tr:hover td:first-child {
    border-left: 1px solid rgba(124, 58, 237, 0.3);
}

.premium-table tr:hover td:last-child {
    border-right: 1px solid rgba(124, 58, 237, 0.3);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 8px;
    letter-spacing: 0.25px;
    text-transform: uppercase;
}

.badge-indigo {
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent-indigo);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.badge-teal {
    background: rgba(16, 185, 129, 0.08);
    color: var(--accent-teal);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.badge-coral {
    background: rgba(244, 63, 94, 0.08);
    color: var(--accent-coral);
    border: 1px solid rgba(244, 63, 94, 0.15);
}

.badge-orange {
    background: rgba(249, 115, 22, 0.08);
    color: var(--accent-orange);
    border: 1px solid rgba(249, 115, 22, 0.15);
}

.badge-slate {
    background: rgba(100, 116, 139, 0.08);
    color: var(--text-sub);
    border: 1px solid rgba(100, 116, 139, 0.15);
}

/* --- Pagination Navigation Controls --- */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--dash-border);
}

.btn-page-nav {
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 0.5rem 1.15rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-sub);
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-page-nav:hover:not(:disabled) {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.08);
}

.btn-page-nav:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-page-nav:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #F8FAFC;
    border-color: #E2E8F0;
    color: var(--text-muted);
}

.page-indicator {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
}

@keyframes tablePulseShimmer {
    0% { opacity: 0.45; }
    50% { opacity: 0.8; }
    100% { opacity: 0.45; }
}

/* --- Profile Metric Card Tooltip Styling --- */
.profile-metric-item {
    position: relative; /* Absolutely required for bottom-right info tooltip icon */
}

/* Absolute Positioning for Profile Metric Hover Info Tooltip Wrapper Badge */
.profile-metric-tooltip-wrapper {
    position: absolute;
    bottom: 12px;
    right: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10 !important;
    background: #E2E8F0; /* Slate-200 — very light, unobtrusive */
    border: 1px solid #CBD5E1; /* Slate-300 border */
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.10);
}

/* Child Bootstrap Icon Styling Centered Inside Circular Badge */
.profile-metric-tooltip-wrapper .profile-metric-info-icon {
    font-size: 0.72rem;
    color: #64748B !important; /* Slate-500 — balanced contrast */
    transition: color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.profile-metric-tooltip-wrapper:hover {
    background: var(--accent-purple) !important; /* Reactive solid purple hover state */
    border-color: var(--accent-purple) !important;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.2);
    z-index: 99999 !important; /* Elevate hovered tooltip above other stacking contexts */
}

.profile-metric-tooltip-wrapper:hover .profile-metric-info-icon {
    color: #FFFFFF !important;
}

/* CSS-Based Custom Tooltip Popover (Appears above the bottom-right badge) */
.profile-metric-tooltip-wrapper::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px); /* Positioned above the badge */
    right: -10px;
    width: 220px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #0F172A; /* Slate 900 midnight theme */
    color: #FFFFFF;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.5;
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif !important;
    text-align: left;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.25), 0 8px 16px -6px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: normal;
    z-index: 999 !important;
}

/* Custom Tooltip Pointer Arrow (pointing downward toward the badge) */
.profile-metric-tooltip-wrapper::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    right: 4px;
    border-width: 6px;
    border-style: solid;
    border-color: #0F172A transparent transparent transparent;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999 !important;
}

/* Active Hover Transitions */
.profile-metric-tooltip-wrapper:hover::before,
.profile-metric-tooltip-wrapper:hover::after {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.profile-metric-info-icon::before {
    font-family: 'bootstrap-icons' !important;
}

/* --- Generic Responsive Flex and Grid Utilities --- */
.responsive-flex-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem 0;
    width: 100%;
    box-sizing: border-box;
}

.card-half-width {
    flex: 1 1 calc(50% - 0.75rem);
    min-width: 450px;
    height: 500px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.card-full-width {
    flex: 1 1 100%;
    min-width: 100%;
    height: 650px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .card-half-width {
        min-width: 100% !important;
        height: auto !important;
        min-height: 480px;
    }
    
    .card-full-width {
        height: auto !important;
        min-height: 500px;
        margin-top: 1rem !important;
    }
    
    .chart-card {
        padding: 1.5rem !important;
        border-radius: 18px !important;
    }
}

/* --- Slide-Out Drawer Portal structure --- */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(6px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-backdrop-open {
    opacity: 1;
    pointer-events: auto;
}

.drawer-container {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 480px;
    max-width: 90vw;
    background: #FFFFFF;
    z-index: 2001;
    box-shadow: -10px 0 40px rgba(15, 23, 42, 0.08);
    transform: translateX(100%);
    transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.drawer-open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    background: #FFFFFF;
}

.drawer-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.drawer-title-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.drawer-title-icon {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
}

.drawer-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0F172A;
    margin: 0;
}

.drawer-count-badge {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.drawer-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    color: var(--text-sub);
    margin: 0;
}

.drawer-close-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: #94A3B8;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-close-btn:hover {
    color: #0F172A;
}

.drawer-body {
    flex-grow: 1;
    padding: 1.75rem;
    overflow-y: auto;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
