/* Importar componentes CSS */
@import url('bradesco-fonts.css');
@import url('components/SummaryCard.css');
@import url('components/AgenteSummaryCard.css');
@import url('components/CelulaSummaryCard.css');
@import url('components/EPSSummaryCard.css');
@import url('components/SupervisaoSummaryCard.css');
@import url('components/AIChatPanel.css');
@import url('components/LazyLoadingPlaceholder.css');
@import url('components/KpiCardSession.css');
@import url('components/KpiScoreCard.css');
@import url('components/DashboardHeader.css');

/* CSS customizado do projeto */
body {
    font-family: var(--bradesco-font-family, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif);
    margin: 0;
    padding: 0;
}

.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sidebar {
    background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

.main-layout {
    flex: 1;
}

.main > div {
    padding-left: 2rem !important;
    padding-right: 1.5rem !important;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* 🎨 Background limpo e moderno */
.rz-body {
    font-family: "Roboto", sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    position: relative;
}

/* 💫 DASHBOARD HEADER - Design Premium (REMOVIDO - usa DashboardHeader.css) */

/* 🎯 CONTROLES DO DASHBOARD - Glass Design */
.dashboard-controls {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    animation: slideInDown 0.6s ease-out;
}

/* 🎨 KPI CARDS - Premium Hover Effects */
.rz-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.1),
        0 4px 16px rgba(255, 255, 255, 0.2) inset;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.rz-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.rz-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 8px 32px rgba(255, 255, 255, 0.3) inset;
    border-color: rgba(255, 255, 255, 0.5);
}

.rz-card:hover::before {
    left: 100%;
}

/* 📊 CHART CARDS - Enhanced Visual */
.chart-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.08),
        0 6px 24px rgba(255, 255, 255, 0.1) inset;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chart-card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 16px 64px rgba(0, 0, 0, 0.12),
        0 8px 32px rgba(255, 255, 255, 0.15) inset;
}

.chart-title {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.chart-subtitle {
    color: rgba(0, 0, 0, 0.6);
    font-weight: 400;
}

/* 🎭 LOADING ANIMATIONS - Premium */
.rz-progressbar-circular {
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.3));
}

.rz-progressbar-circular .rz-progressbar-circle {
    stroke: url(#gradient);
    stroke-linecap: round;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 🚨 ALERT CARDS - Enhanced Visual Impact */
.rz-card.alert-card {
    background: rgba(255, 255, 255, 0.92);
    border-left: 4px solid;
    position: relative;
}

.rz-card.alert-card.critical {
    border-left-color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}

.rz-card.alert-card.warning {
    border-left-color: #f59e0b;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}

.rz-card.alert-card.info {
    border-left-color: #3b82f6;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

/* 📱 RESPONSIVE ENHANCEMENTS */
@media (max-width: 768px) {
    .dashboard-controls {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .rz-card:hover {
        transform: translateY(-4px) scale(1.01);
    }
}

/* 🎯 BUTTONS - Enhanced Interactive */
.rz-button {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rz-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.rz-button-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
}

.rz-button-secondary {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    border: none;
}

/* 📊 DATA GRID - Modern Enhancement */
.modern-data-grid {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.modern-data-grid .rz-datatable-data td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

.modern-data-grid .rz-datatable-data tr:hover td {
    background-color: rgba(102, 126, 234, 0.04);
}

.modern-data-grid .rz-datatable-header th {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    color: #334155;
    font-weight: 700;
    padding: 1.25rem 0.75rem;
    border-bottom: 2px solid #e2e8f0;
}

/* 🏷️ BADGES - Premium Styling */
.rz-badge {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.rz-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 📈 PROGRESS BARS - Enhanced Visual */
.rz-progressbar {
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.08);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) inset;
}

.rz-progressbar-value {
    border-radius: 8px;
    background: linear-gradient(90deg, #10b981, #34d399);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    transition: width 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 🎨 ENTRADA ANIMATIONS */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 🔄 UTILITY ANIMATIONS */
.animate-fade-in {
    animation: fadeInUp 0.6s ease-out;
}

.animate-slide-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-right {
    animation: slideInRight 0.6s ease-out;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 🎯 CUSTOM SCROLLBAR */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: all 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

/* 🌟 SPECIAL EFFECTS */
.glow-effect {
    box-shadow: 
        0 0 20px rgba(102, 126, 234, 0.3),
        0 0 40px rgba(102, 126, 234, 0.1);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 🌟 PREMIUM LOADING SPINNER STYLES */

/* 🎭 Premium Loading Container */
.premium-loading-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

.premium-loading-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 8px 32px rgba(255, 255, 255, 0.2) inset;
    min-width: 300px;
    position: relative;
    overflow: hidden;
}

.premium-loading-content::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(102, 126, 234, 0.02);
}

/* 🌀 Premium Spinner */
.premium-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem auto;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

.spinner-ring:nth-child(1) {
    border-top-color: #667eea;
    animation-duration: 1.5s;
}

.spinner-ring:nth-child(2) {
    border-right-color: #764ba2;
    animation-duration: 2s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    border-bottom-color: #f093fb;
    animation-duration: 2.5s;
}

.spinner-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 📝 Loading Text */
.loading-text-container {
    position: relative;
    z-index: 1;
}

.loading-text {
    background: linear-gradient(135deg, #667eea, #764ba2);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    animation: bounce-loading 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

/* 🎨 Loading Specific Animations */
@keyframes bounce-loading {
    0%, 80%, 100% { 
        transform: scale(0);
        opacity: 0.5;
    } 
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}

/* 📱 Responsive Loading */
@media (max-width: 768px) {
    .premium-loading-content {
        margin: 1rem;
        padding: 2rem 1.5rem;
        min-width: unset;
    }
    
    .premium-spinner {
        width: 60px;
        height: 60px;
    }
    
    .spinner-center {
        width: 30px;
        height: 30px;
    }
}

/* 🔄 Loading Field Animation */
.loading-field {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.loading-field::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 8px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid #6366f1;
    border-radius: 50%;
    border-top-color: transparent;
    animation: loading-spin 1s linear infinite;
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}

a {
    color: #6366f1;
    text-decoration: none;
}

a:hover,
a:focus {
    color: #4f46e5;
    text-decoration: underline;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHZpZXdCb3g9IjAgMCA1NiA0OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjUgNi41TDIwLjUgMTIuNUwyNy41IDYuNSIgc3Ryb2tlPSIjMTI0Q0Y0IiBzdHJva2Utd2lkdGg9IjMiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #1b6ec2;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20% + 3.8rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

:root {
    --rz-card-background-color: rgba(215, 219, 224, 0.11);
    --rz-text-h1-color: #424242;
    --rz-text-h3-color: #31363d;
    --rz-text-caption-color: #bdbdbd;
    --rz-text-subtitle2-color: #bdbdbd;
    --rz-text-subtitle1-color: #bdbdbd;
    --rz-text-body1-color: #bdbdbd;
    --rz-text-overline-color: #bdbdbd;
}

.rz-link .rz-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.rz-link:hover .rz-card {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ========================================
   DASHBOARD ESPECÍFICO - KPI CARDS
   ======================================== */

.kpi-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.6s ease-out;
}

.kpi-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2) !important;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kpi-card:hover::before {
    opacity: 1;
}

.kpi-title {
    font-weight: 600;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.kpi-subtitle {
    opacity: 0.9;
    margin: 0;
    font-size: 0.75rem;
}

.kpi-icon {
    font-size: 2.5rem !important;
    opacity: 0.8;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.kpi-value {
    font-weight: 700 !important;
    margin: 0 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.02em;
}

.kpi-badge {
    animation: pulse 2s infinite;
}

.kpi-trend {
    animation: bounce 1s infinite;
}

.kpi-progress {
    background: rgba(255, 255, 255, 0.3) !important;
    border-radius: 6px !important;
}

/* ========================================
   DASHBOARD ESPECÍFICO - GRÁFICOS
   ======================================== */

.chart-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.chart-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
}

.chart-header {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 0.5rem;
}

.chart-title {
    color: #1f2937;
    font-weight: 600;
    margin: 0;
}

.chart-subtitle {
    color: #6b7280;
    margin: 0;
}

.chart-refresh-btn {
    color: #6b7280 !important;
    transition: all 0.2s ease;
}

.chart-refresh-btn:hover {
    color: #6366f1 !important;
    transform: rotate(180deg);
}

.chart-container {
    position: relative;
    padding: 0.5rem;
}

.gauge-text {
    position: absolute;
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.gauge-value {
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.gauge-label {
    color: #6b7280;
    margin: 0;
    margin-top: 0.25rem;
}

.chart-footer {
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 0.5rem;
}

.chart-footer-text {
    color: #6b7280;
    text-align: center;
    margin: 0;
}

/* ========================================
   ANIMAÇÕES
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-8px);
    }
    70% {
        transform: translateY(-4px);
    }
    90% {
        transform: translateY(-2px);
    }
}

/* ========================================
   DASHBOARD LAYOUT (usa DashboardHeader.css)
   ======================================== */

.dashboard-controls {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

/* ========================================
   RESPONSIVIDADE ESPECÍFICA
   ======================================== */

@media (max-width: 768px) {
    .kpi-card {
        height: auto !important;
        min-height: 140px;
    }
    
    .kpi-icon {
        font-size: 2rem !important;
    }
    
    .kpi-value {
        font-size: 1.5rem !important;
    }
    
    .chart-card {
        margin-bottom: 1rem;
    }
}

/* ========================================
   RADZEN CUSTOMIZAÇÕES
   ======================================== */

/* DataGrid melhorado */
.rz-datatable {
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    border: none !important;
}

.rz-datatable-header {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0) !important;
    font-weight: 600 !important;
}

.rz-datatable-data tr:hover {
    background: rgba(99, 102, 241, 0.05) !important;
    transform: scale(1.001);
    transition: all 0.2s ease;
}

/* Buttons melhorados */
.rz-button {
    transition: all 0.2s ease !important;
    border-radius: 8px !important;
}

.rz-button:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Badges customizados */
.rz-badge {
    font-weight: 600 !important;
    letter-spacing: 0.025em !important;
}

/* Progress bars melhoradas */
.rz-progressbar {
    border-radius: 6px !important;
    overflow: hidden !important;
}

.rz-progressbar-value {
    transition: all 0.3s ease !important;
}

/* Cards com efeito glass */
.glass-effect {
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

/* ========================================
   MODERN DATAGRID STYLES
   ======================================== */

/* DataGrid principal */
.modern-data-grid {
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    font-size: 0.9rem !important;
}

/* Header do DataGrid */
.modern-data-grid .rz-datatable-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}

.modern-data-grid .rz-datatable-header th {
    border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 12px 8px !important;
    text-align: center !important;
    user-select: none !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
    position: relative !important;
}

.modern-data-grid .rz-datatable-header th:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Resizable columns */
.modern-data-grid .rz-column-resize-handle {
    width: 4px !important;
    background-color: rgba(255, 255, 255, 0.3) !important;
    cursor: col-resize !important;
    height: 100% !important;
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    transition: background-color 0.2s ease !important;
}

.modern-data-grid .rz-column-resize-handle:hover {
    background-color: rgba(255, 255, 255, 0.6) !important;
}

/* Reorderable columns */
.modern-data-grid .rz-column-reorder-indicator {
    background-color: #667eea !important;
    height: 3px !important;
    position: absolute !important;
    top: 0 !important;
    width: 100% !important;
    z-index: 100 !important;
    border-radius: 2px !important;
}

.modern-data-grid .rz-column-dragging {
    opacity: 0.6 !important;
    background-color: rgba(102, 126, 234, 0.2) !important;
    transform: rotate(2deg) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Data rows */
.modern-data-grid .rz-datatable-data tr {
    transition: all 0.3s ease !important;
}

.modern-data-grid .rz-datatable-data tr:hover {
    background-color: rgba(102, 126, 234, 0.1) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.modern-data-grid .rz-datatable-data td {
    padding: 10px 8px !important;
    border-right: 1px solid rgba(0, 0, 0, 0.05) !important;
    text-align: center !important;
    vertical-align: middle !important;
    transition: all 0.2s ease !important;
}

/* Sorting indicators */
.modern-data-grid .rz-sortable-column {
    position: relative !important;
}

.modern-data-grid .rz-sortable-column::after {
    content: "↕️" !important;
    position: absolute !important;
    right: 4px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    opacity: 0.5 !important;
    font-size: 12px !important;
    transition: opacity 0.2s ease !important;
}

.modern-data-grid .rz-sortable-column:hover::after {
    opacity: 0.8 !important;
}

.modern-data-grid .rz-sortable-column.rz-sort-asc::after {
    content: "⬆️" !important;
    opacity: 1 !important;
    color: #22c55e !important;
}

.modern-data-grid .rz-sortable-column.rz-sort-desc::after {
    content: "⬇️" !important;
    opacity: 1 !important;
    color: #ef4444 !important;
}

/* Grid lines */
.modern-data-grid .rz-datatable {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

/* Compact density */
.modern-data-grid.rz-density-compact .rz-datatable-data td,
.modern-data-grid.rz-density-compact .rz-datatable-header th {
    padding: 8px 6px !important;
    font-size: 0.85rem !important;
}

/* Auto column width adjustments */
.modern-data-grid th[style*="width: auto"],
.modern-data-grid td[style*="width: auto"] {
    min-width: 80px !important;
    max-width: 250px !important;
    width: auto !important;
}

/* Performance optimizations */
.modern-data-grid {
    contain: layout style paint !important;
    will-change: scroll-position !important;
}

/* Loading state */
.modern-data-grid .rz-datatable-loading {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(2px) !important;
}

/* Empty state */
.modern-data-grid .rz-datatable-empty {
    padding: 40px !important;
    text-align: center !important;
    color: #64748b !important;
    font-style: italic !important;
}

/* Pager */
.modern-data-grid .rz-paginator {
    background: #f8fafc !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
    padding: 12px !important;
}

/* Filter inputs */
.modern-data-grid .rz-textbox {
    border-radius: 6px !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
}

.modern-data-grid .rz-textbox:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */

@media (prefers-color-scheme: dark) {
    .chart-card {
        background: #1e293b;
        border: 1px solid #334155;
    }
    
    .chart-title {
        color: #e2e8f0;
    }
    
    .chart-subtitle {
        color: #94a3b8;
    }
    
    .gauge-value {
        color: #e2e8f0;
    }
    
    /* DataGrid Dark Mode */
    .modern-data-grid {
        background: #1e293b !important;
        border-color: #334155 !important;
    }
    
    .modern-data-grid .rz-datatable-data tr:hover {
        background-color: rgba(102, 126, 234, 0.2) !important;
    }
    
    .modern-data-grid .rz-datatable-data td {
        color: #e2e8f0 !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
    }
    
    .modern-data-grid .rz-paginator {
        background: #334155 !important;
        border-color: #475569 !important;
    }
}