/* ============================================
   ENTERPRISE DASHBOARD - Professional Theme
   TeKMediApp v2.0 - High-End Management System
   ============================================ */

/* ============================================
   1. GLASSMORPHISM HEADER
   ============================================ */
.enterprise-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.enterprise-header:hover {
    background: rgba(255, 255, 255, 0.92);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item:hover {
    color: #3b82f6;
}

.breadcrumb-item.active {
    color: #0f172a;
    font-weight: 600;
}

.breadcrumb-separator {
    color: #cbd5e1;
}

/* Command Palette Search */
.command-palette-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 280px;
}

.command-palette-trigger:hover {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.command-palette-trigger .search-icon {
    color: #94a3b8;
}

.command-palette-trigger .shortcut {
    margin-left: auto;
    display: flex;
    gap: 4px;
}

.command-palette-trigger .shortcut kbd {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

/* User Profile Dropdown */
.user-profile-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-profile-dropdown:hover {
    background: rgba(59, 130, 246, 0.08);
}

.user-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    transition: border-color 0.3s ease;
}

.user-profile-dropdown:hover .user-avatar {
    border-color: #3b82f6;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #ffffff;
}

.user-status-indicator.online {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.user-status-indicator.busy {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.user-status-indicator.away {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.user-role {
    font-size: 12px;
    color: #64748b;
}

/* ============================================
   2. KPI CARDS - Dashboard Layout
   ============================================ */
.kpi-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 24px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .kpi-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .kpi-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.kpi-card {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 20px 20px 0 0;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* KPI Card Variants */
.kpi-card.appointments::before {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

.kpi-card.appointments .kpi-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(96, 165, 250, 0.1) 100%);
    color: #3b82f6;
}

.kpi-card.occupancy::before {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.kpi-card.occupancy .kpi-icon {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(52, 211, 153, 0.1) 100%);
    color: #10b981;
}

.kpi-card.revenue::before {
    background: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 100%);
}

.kpi-card.revenue .kpi-icon {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(167, 139, 250, 0.1) 100%);
    color: #8b5cf6;
}

.kpi-card.patients::before {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.kpi-card.patients .kpi-icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(251, 191, 36, 0.1) 100%);
    color: #f59e0b;
}

.kpi-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.kpi-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    transition: transform 0.3s ease;
}

.kpi-card:hover .kpi-icon {
    transform: scale(1.1) rotate(-5deg);
}

.kpi-icon .material-icons {
    font-size: 28px;
}

.kpi-sparkline {
    display: flex;
    align-items: center;
}

.kpi-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 12px;
}

.kpi-trend.up {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.kpi-trend.down {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.kpi-content h3 {
    font-size: 32px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.kpi-content p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    font-weight: 500;
}

/* ============================================
   3. DATA GRID STYLING - Airy Design
   ============================================ */
.enterprise-grid-container {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.enterprise-grid-container:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.enterprise-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

.grid-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.grid-title h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.grid-badge {
    padding: 4px 10px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.grid-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Airy Grid Rows */
.e-grid .e-gridheader {
    background: #f8fafc !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

.e-grid .e-headercell {
    background: transparent !important;
    color: #64748b !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 16px 20px !important;
    border: none !important;
}

.e-grid .e-row {
    transition: all 0.3s ease !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.e-grid .e-row:hover {
    background: rgba(59, 130, 246, 0.04) !important;
}

.e-grid .e-rowcell {
    padding: 16px 20px !important;
    color: #334155 !important;
    font-size: 14px !important;
    border: none !important;
    vertical-align: middle !important;
}

.e-grid .e-altrow {
    background: #fafbfc !important;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.confirmed {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.1) 100%);
    color: #059669;
}

.status-badge.confirmed::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
}

.status-badge.pending {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%);
    color: #d97706;
}

.status-badge.pending::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f59e0b;
    animation: pulse 2s infinite;
}

.status-badge.cancelled {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.1) 100%);
    color: #dc2626;
}

.status-badge.cancelled::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
}

.status-badge.in-progress {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.1) 100%);
    color: #2563eb;
}

.status-badge.in-progress::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3b82f6;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* ============================================
   4. SKELETON LOADING STATES
   ============================================ */
.skeleton-container {
    padding: 24px;
}

.skeleton-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.skeleton-kpi-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    border: 1px solid #e2e8f0;
}

.skeleton-animate {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    margin-bottom: 16px;
}

.skeleton-text-lg {
    height: 32px;
    width: 120px;
    margin-bottom: 8px;
}

.skeleton-text-sm {
    height: 16px;
    width: 160px;
}

.skeleton-chart {
    height: 300px;
    border-radius: 20px;
    margin-top: 24px;
}

.skeleton-table {
    margin-top: 24px;
}

.skeleton-table-header {
    height: 48px;
    border-radius: 12px 12px 0 0;
    margin-bottom: 4px;
}

.skeleton-table-row {
    height: 60px;
    margin-bottom: 4px;
    border-radius: 8px;
}

/* ============================================
   5. EMPTY STATES
   ============================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
}

.empty-state-illustration {
    width: 200px;
    height: 200px;
    margin-bottom: 24px;
    opacity: 0.8;
}

.empty-state-illustration svg {
    width: 100%;
    height: 100%;
}

.empty-state h4 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 15px;
    color: #64748b;
    margin: 0 0 24px 0;
    max-width: 360px;
    line-height: 1.6;
}

.empty-state-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.empty-state-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

/* ============================================
   6. ACTIVITY FEED - Modern Design
   ============================================ */
.activity-feed-container {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    overflow: hidden;
}

.activity-feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
}

.activity-feed-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.activity-feed-header .live-indicator {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.activity-feed-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.3s ease;
}

.activity-item:hover {
    background: #fafbfc;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex-shrink: 0;
}

.activity-icon.appointment {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.activity-icon.patient {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.activity-icon.payment {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.activity-icon.lab {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-message {
    font-size: 14px;
    color: #334155;
    margin: 0 0 4px 0;
    line-height: 1.5;
}

.activity-message strong {
    color: #0f172a;
    font-weight: 600;
}

.activity-time {
    font-size: 12px;
    color: #94a3b8;
}

/* ============================================
   7. DOCTOR AVAILABILITY CARDS
   ============================================ */
.doctor-availability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 24px;
}

.doctor-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.doctor-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.doctor-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
}

.doctor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.doctor-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #ffffff;
}

.doctor-status.available {
    background: #10b981;
}

.doctor-status.busy {
    background: #f59e0b;
}

.doctor-status.offline {
    background: #94a3b8;
}

.doctor-info {
    flex: 1;
    min-width: 0;
}

.doctor-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doctor-specialty {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ============================================
   8. CHART CONTAINER STYLING
   ============================================ */
.chart-container-enterprise {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 24px;
    transition: box-shadow 0.3s ease;
}

.chart-container-enterprise:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.chart-legend {
    display: flex;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* ============================================
   9. RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 1024px) {
    .enterprise-header {
        padding: 0 16px;
    }
    
    .command-palette-trigger {
        min-width: 200px;
    }
    
    .kpi-dashboard-grid {
        padding: 16px;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .enterprise-header {
        height: 64px;
    }
    
    .header-breadcrumb {
        display: none;
    }
    
    .command-palette-trigger .shortcut {
        display: none;
    }
    
    .user-info {
        display: none;
    }
    
    .skeleton-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   10. DARK MODE SUPPORT
   ============================================ */
@media (prefers-color-scheme: dark) {
    .enterprise-header {
        background: rgba(15, 23, 42, 0.9);
        border-color: rgba(51, 65, 85, 0.5);
    }
    
    .kpi-card {
        background: #1e293b;
        border-color: rgba(51, 65, 85, 0.5);
    }
    
    .kpi-content h3 {
        color: #f1f5f9;
    }
    
    .enterprise-grid-container {
        background: #1e293b;
        border-color: rgba(51, 65, 85, 0.5);
    }
}

/* ============================================
   11. TRANSITIONS & ANIMATIONS
   ============================================ */
.transition-all {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-transform {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-opacity {
    transition: opacity 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

/* Fade In Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animation-delay-100 { animation-delay: 0.1s; }
.animation-delay-200 { animation-delay: 0.2s; }
.animation-delay-300 { animation-delay: 0.3s; }
.animation-delay-400 { animation-delay: 0.4s; }
