/* ==================== HMIS360 EXECUTIVE DASHBOARD STYLES ==================== */

:root {
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    
    --success-50: #ecfdf5;
    --success-100: #d1fae5;
    --success-500: #10b981;
    --success-600: #059669;
    
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    
    --error-50: #fef2f2;
    --error-100: #fee2e2;
    --error-500: #ef4444;
    --error-600: #dc2626;
    
    --info-50: #eff6ff;
    --info-100: #dbeafe;
    --info-500: #3b82f6;
    --info-600: #2563eb;
    
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    --card-radius: 16px;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.12);
    
    --form-primary: #1a936f;
    --form-primary-light: #88d498;
    --form-primary-dark: #114b5f;
    --form-border: #c4c4c4;
    --form-border-focus: #1a936f;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* ==================== EXECUTIVE DASHBOARD ==================== */

.executive-dashboard {
    padding: 24px;
    background: var(--gray-100);
    min-height: 100vh;
}

/* Executive Header */
.exec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.exec-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900);
    margin: 0;
    letter-spacing: -0.5px;
}

.exec-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 4px 0 0 0;
}

.exec-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.live-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--gray-200);
    border-radius: 24px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-status.connected {
    background: var(--success-100);
    color: var(--success-600);
}

.live-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-400);
}

.live-status.connected .live-pulse {
    background: var(--success-500);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

.period-toggle {
    border-radius: 8px !important;
    overflow: hidden;
}

/* Alerts Banner */
.alerts-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid var(--warning-500);
    border-radius: 12px;
    margin-bottom: 24px;
}

.alert-icon {
    width: 48px;
    height: 48px;
    background: var(--warning-500);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: alert-pulse 1.5s ease-in-out infinite;
}

@keyframes alert-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.alert-content {
    flex: 1;
}

.alert-count {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--warning-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alert-summary {
    display: block;
    font-size: 0.9rem;
    color: var(--gray-700);
    margin-top: 2px;
}

/* Hero Metrics Section */
.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.hero-card {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 28px;
    border-radius: 20px;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
}

.hero-card.patients {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.hero-card.revenue {
    background: linear-gradient(135deg, #10b981, #059669);
}

.hero-card.occupancy {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.hero-visual {
    flex-shrink: 0;
}

.hero-ring {
    width: 100px;
    height: 100px;
    position: relative;
}

.hero-ring svg {
    width: 100%;
    height: 100%;
}

.ring-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ring-center .mud-icon-root {
    font-size: 32px !important;
    color: white !important;
}

.ring-percent {
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
}

.hero-content {
    flex: 1;
}

.hero-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.hero-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 12px;
}

.hero-stats {
    display: flex;
    gap: 20px;
}

.hero-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

.hero-stat.positive {
    background: rgba(255, 255, 255, 0.25);
}

.hero-stat.warning {
    background: rgba(239, 68, 68, 0.3);
}

.hero-stat .stat-num {
    font-size: 1rem;
    font-weight: 700;
}

.hero-stat .stat-txt {
    font-size: 0.75rem;
    opacity: 0.85;
}

/* Operations Grid */
.operations-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.ops-card {
    background: white;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 20px;
}

.ops-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ops-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.ops-header h3 .mud-icon-root {
    font-size: 20px !important;
    color: var(--primary-500) !important;
}

.ops-time {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* Today's Operations Metrics */
.ops-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.ops-metric {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.ops-metric:hover {
    background: var(--gray-100);
    transform: translateY(-2px);
}

.ops-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ops-icon .mud-icon-root {
    color: white !important;
    font-size: 20px !important;
}

.ops-icon.opd { background: var(--primary-500); }
.ops-icon.emergency { background: var(--error-500); }
.ops-icon.surgery { background: var(--success-500); }
.ops-icon.lab { background: var(--info-500); }
.ops-icon.discharge { background: #8b5cf6; }
.ops-icon.admit { background: var(--warning-500); }

.ops-data {
    display: flex;
    flex-direction: column;
}

.ops-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1;
}

.ops-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.ops-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    width: fit-content;
}

.ops-trend.positive {
    background: var(--success-50);
    color: var(--success-600);
}

.ops-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ops-badge.critical {
    background: var(--error-100);
    color: var(--error-600);
    animation: badge-blink 1s ease-in-out infinite;
}

@keyframes badge-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.ops-progress {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.ops-progress-bar {
    height: 100%;
    background: var(--success-500);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.ops-sub {
    font-size: 0.7rem;
    color: var(--gray-400);
}

/* Department Performance */
.dept-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dept-bar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dept-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dept-bar-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
}

.dept-bar-value {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.dept-bar-track {
    height: 8px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}

.dept-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Financial Card */
.fin-summary {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.fin-main {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--success-50), var(--primary-50));
    border-radius: 12px;
}

.fin-amount {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-800);
}

.fin-label {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.fin-breakdown {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 120px;
    padding: 0 10px;
}

.fin-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.fin-bar {
    width: 32px;
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
}

.fin-bar.opd { background: var(--primary-500); }
.fin-bar.ipd { background: var(--success-500); }
.fin-bar.lab { background: var(--info-500); }
.fin.bar.pharmacy { background: var(--warning-500); }

.fin-cat {
    font-size: 0.7rem;
    color: var(--gray-500);
}

.fin-val {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* Analytics Section */
.analytics-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.analytics-card {
    background: white;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 20px;
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.analytics-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.chart-legend {
    display: flex;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.chart-body {
    min-height: 280px;
}

.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 280px;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.kpi-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--gray-50);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.kpi-item:hover {
    background: var(--gray-100);
}

.kpi-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-50);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon .mud-icon-root {
    color: var(--primary-500) !important;
    font-size: 20px !important;
}

.kpi-info {
    display: flex;
    flex-direction: column;
}

.kpi-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
}

.kpi-label {
    font-size: 0.7rem;
    color: var(--gray-500);
}

/* Quick Actions Section */
.quick-actions-section {
    background: white;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 20px;
}

.quick-actions-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0 0 16px 0;
}

.quick-actions-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.qa-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--gray-50);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.qa-btn:hover {
    background: var(--primary-50);
    border-color: var(--primary-200);
    transform: translateY(-2px);
}

.qa-btn .mud-icon-root {
    color: var(--primary-500) !important;
    font-size: 20px !important;
}

.qa-btn span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
}

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 1400px) {
    .hero-metrics {
        grid-template-columns: 1fr 1fr 1fr;
    }
    
    .operations-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .ops-card.today-ops {
        grid-column: span 2;
    }
}

@media (max-width: 1024px) {
    .hero-metrics {
        grid-template-columns: 1fr;
    }
    
    .operations-grid {
        grid-template-columns: 1fr;
    }
    
    .ops-card.today-ops {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .executive-dashboard {
        padding: 16px;
    }
    
    .exec-title {
        font-size: 1.25rem;
    }
    
    .hero-card {
        padding: 20px;
    }
    
    .hero-value {
        font-size: 2rem;
    }
    
    .hero-ring {
        width: 80px;
        height: 80px;
    }
    
    .ops-metrics {
        grid-template-columns: 1fr;
    }
    
    .fin-breakdown {
        height: 80px;
    }
    
    .fin-bar {
        width: 24px;
    }
}

/* ==================== FORM STYLING - OUTLINED WITH LABEL IN BORDER ==================== */

/* Custom teal/green theme for form inputs (matching the image) */
:root {
    --form-primary: #1a936f;
    --form-primary-light: #88d498;
    --form-primary-dark: #114b5f;
    --form-border: #c4c4c4;
    --form-border-focus: #1a936f;
}

/* Make all MudBlazor outlined inputs have the proper floating label style */
.mud-input-control .mud-input-label {
    background: white;
    padding: 0 6px;
    margin-left: -4px;
    transition: all 0.2s ease;
}

/* Outlined border styling */
.mud-input-outlined-border {
    border-color: var(--form-border) !important;
    border-radius: 4px !important;
    transition: border-color 0.2s ease;
}

/* Primary color for focused state - teal green like the image */
.mud-input-control.mud-input-control-focused .mud-input-label,
.mud-input-control.mud-input-control-margin .mud-input-label-inputcontrol.mud-input-label-animated.mud-input-label-filled {
    color: var(--form-primary) !important;
    font-weight: 500;
}

.mud-input-control.mud-input-control-focused .mud-input-outlined-border {
    border-color: var(--form-primary) !important;
    border-width: 2px !important;
}

/* Required field indicator - red asterisk */
.mud-input-label-required::after {
    content: " *";
    color: #c62828 !important;
    font-weight: bold;
}

/* When label is shrunk/floated */
.mud-input-label-inputcontrol.mud-input-label-animated.mud-input-label-filled,
.mud-input-label-inputcontrol.mud-input-label-animated.mud-input-label-shrunk {
    transform: translate(14px, -9px) scale(0.75) !important;
    background: white;
    padding: 0 6px;
}

/* Date picker label positioning fix */
.mud-picker .mud-input-label-inputcontrol.mud-input-label-animated {
    background: white;
    padding: 0 6px;
}

/* Select label positioning */
.mud-select .mud-input-label-inputcontrol.mud-input-label-animated.mud-input-label-filled {
    transform: translate(14px, -9px) scale(0.75) !important;
    background: white;
    padding: 0 6px;
}

/* Custom form card styling */
.form-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--form-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.form-section-title .mud-icon-root {
    color: var(--form-primary);
}

/* Consistent input slot height - standard Material Design height */
.mud-input-control .mud-input-slot,
.mud-select .mud-input-slot,
.mud-picker .mud-input-slot,
.mud-autocomplete .mud-input-slot,
.mud-numeric-field .mud-input-slot {
    min-height: 40px;
    height: 40px;
}

/* Input field inner padding */
.mud-input-control .mud-input-slot input {
    padding: 8px 12px;
}

/* Better focus shadows */
.mud-input-control:focus-within {
    box-shadow: 0 0 0 2px rgba(26, 147, 111, 0.1);
    border-radius: 4px;
}

/* Placeholder styling */
.mud-input-control .mud-input-slot input::placeholder {
    color: #9e9e9e;
    font-style: normal;
    font-size: 0.9rem;
}

/* Helper text styling */
.mud-input-helper-text {
    font-size: 0.75rem;
    color: #757575;
    margin-top: 4px;
}

/* Error state styling */
.mud-input-control.mud-input-error .mud-input-outlined-border {
    border-color: #d32f2f !important;
}

.mud-input-control.mud-input-error .mud-input-label {
    color: #d32f2f !important;
}

/* Disabled state */
.mud-input-control.mud-disabled .mud-input-slot {
    background: #f5f5f5;
}

/* Textarea styling */
.mud-input-control textarea.mud-input-slot {
    min-height: 80px;
    padding-top: 16px;
}

/* Checkbox and Radio consistent styling */
.mud-checkbox .mud-typography,
.mud-radio .mud-typography {
    font-size: 0.875rem;
}

/* Form grid spacing */
.form-grid {
    display: grid;
    gap: 16px;
}

/* Action buttons at bottom of form */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 24px;
    margin-top: 24px;
    border-top: 1px solid #e0e0e0;
}

/* Primary submit button styling */
.form-actions .mud-button-filled.mud-button-primary {
    min-width: 140px;
    height: 44px;
    font-weight: 600;
}

/* Cancel/secondary button */
.form-actions .mud-button-outlined {
    min-width: 100px;
    height: 44px;
}

/* ==================== PRINT STYLES ==================== */

@media print {
    .executive-dashboard {
        padding: 0;
    }
    
    .exec-header-right,
    .alerts-banner,
    .quick-actions-section {
        display: none !important;
    }
    
    .hero-card,
    .ops-card,
    .analytics-card {
        box-shadow: none;
        border: 1px solid var(--gray-200);
        page-break-inside: avoid;
    }
}

/* ==================== SCROLLBAR STYLING ==================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}