/* ============================================
   MODERN PROFESSIONAL DASHBOARD DESIGN
   Premium Medical Software UI
   ============================================ */

/* Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1a1d29;
    background: #f5f7fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Dashboard Container */
.dashboard-container {
    width: 100%;
    margin: 0;
    padding: 0;
    background: #f5f7fa;
    min-height: calc(100vh - 70px);
}

/* Dashboard Header - Modern Design */
.dashboard-header {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
    padding: 32px 0;
    margin: 0;
    width: 100%;
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.15);
    position: relative;
    overflow: hidden;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.dashboard-header .container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    position: relative;
    z-index: 1;
}

.dashboard-header h1 {
    font-family: 'Inter', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
    padding: 0;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.5px;
}

.dashboard-header h1 i {
    font-size: 28px;
    opacity: 0.95;
}

.dashboard-header p {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

.dashboard-header .btn {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: #ffffff;
    color: #dc3545;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dashboard-header .btn:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dashboard-header .btn i {
    margin-right: 6px;
}

/* Main Content Area */
.dashboard-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px;
}

/* KPI Cards - Modern Premium Design */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.kpi-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8eaed;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--kpi-gradient);
    border-radius: 12px 12px 0 0;
}

.kpi-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: var(--kpi-border);
}

.kpi-card-primary { 
    --kpi-gradient: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    --kpi-border: #6366f1;
    --kpi-color: #6366f1;
}

.kpi-card-success { 
    --kpi-gradient: linear-gradient(90deg, #10b981 0%, #059669 100%);
    --kpi-border: #10b981;
    --kpi-color: #10b981;
}

.kpi-card-info { 
    --kpi-gradient: linear-gradient(90deg, #06b6d4 0%, #0891b2 100%);
    --kpi-border: #06b6d4;
    --kpi-color: #06b6d4;
}

.kpi-card-warning { 
    --kpi-gradient: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
    --kpi-border: #f59e0b;
    --kpi-color: #f59e0b;
}

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ffffff;
    background: var(--kpi-gradient);
    margin-bottom: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kpi-label {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    line-height: 1.2;
}

.kpi-value {
    font-family: 'Inter', sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: #1a1d29;
    margin: 0 0 12px 0;
    line-height: 1;
    padding: 0;
    letter-spacing: -1px;
}

.kpi-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kpi-subtitle i {
    font-size: 12px;
    opacity: 0.7;
}

/* Chart Cards - Premium Design */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8eaed;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
}

.chart-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.chart-card .card-header {
    background: #ffffff;
    border-bottom: 2px solid #f1f5f9;
    padding: 20px 24px;
    margin: 0;
}

.chart-card .card-header h5 {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #1a1d29;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.5;
    letter-spacing: -0.2px;
}

.chart-card .card-header h5 i {
    font-size: 18px;
    color: #dc3545;
    width: 20px;
    text-align: center;
}

.chart-card .card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    background: #fafbfc;
}

/* Content Card - Full Width for Tables and Forms */
.content-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8eaed;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    width: 100%;
    margin-bottom: 24px;
}

.content-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.content-card .card-header {
    background: #ffffff;
    border-bottom: 2px solid #f1f5f9;
    padding: 20px 24px;
    margin: 0;
}

.content-card .card-header h5 {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #1a1d29;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.5;
    letter-spacing: -0.2px;
}

.content-card .card-header h5 i {
    font-size: 18px;
    color: #dc3545;
    width: 20px;
    text-align: center;
}

.content-card .card-body {
    padding: 24px;
    flex: 1;
    background: #ffffff;
    width: 100%;
    min-height: auto;
}

/* Override chart-card when used for tables/forms */
.chart-card.table-card .card-body,
.chart-card.form-card .card-body {
    display: block;
    min-height: auto;
    align-items: stretch;
    justify-content: flex-start;
    padding: 24px;
    background: #ffffff;
}

/* Stats Cards - Premium Design */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
}

.stats-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8eaed;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
}

.stats-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.stats-card .card-header {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
    color: #ffffff;
    padding: 20px 24px;
    margin: 0;
    border: none;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

.stats-card .card-header h5 {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.5;
    letter-spacing: -0.2px;
}

.stats-card .card-header h5 i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.stats-card .card-body {
    padding: 24px;
    background: #ffffff;
}

.stats-card .form-label {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #1a1d29;
    margin-bottom: 10px;
    display: block;
    letter-spacing: -0.1px;
}

.stats-card .form-select {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    width: 100%;
    margin-bottom: 20px;
    transition: all 0.2s ease;
    color: #1a1d29;
    font-weight: 500;
}

.stats-card .form-select:focus {
    outline: none;
    border-color: #dc3545;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

/* Stats Display - Modern Design */
.stats-display {
    margin-top: 0;
}

.stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 10px;
    margin-bottom: 12px;
    border-left: 4px solid var(--stat-color);
    transition: all 0.2s ease;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-item:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    transform: translateX(4px);
}

.stat-item-label {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.1px;
}

.stat-item-label i {
    font-size: 16px;
    color: var(--stat-color);
    width: 20px;
    text-align: center;
}

.stat-item-value {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--stat-color);
    letter-spacing: -0.5px;
}

.stat-item-primary { --stat-color: #6366f1; }
.stat-item-success { --stat-color: #10b981; }
.stat-item-info { --stat-color: #06b6d4; }
.stat-item-danger { --stat-color: #dc3545; }

/* Empty State */
.stats-display .text-center {
    padding: 60px 20px;
    color: #94a3b8;
}

.stats-display .text-center i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
    color: #cbd5e1;
}

.stats-display .text-center p {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    margin: 0;
    line-height: 1.5;
}

/* Responsive Design for Content Cards */
@media (max-width: 768px) {
    .content-card .card-body {
        padding: 16px;
    }
    
    .content-card .card-header {
        padding: 16px 20px;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .chart-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        padding: 24px 0;
    }
    
    .dashboard-header .container-fluid {
        padding: 0 20px;
    }
    
    .dashboard-header h1 {
        font-size: 24px;
    }
    
    .dashboard-header p {
        font-size: 14px;
    }
    
    .dashboard-content {
        padding: 20px;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .chart-grid,
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .kpi-value {
        font-size: 32px;
    }
    
    .kpi-card,
    .chart-card,
    .stats-card,
    .content-card {
        padding: 20px;
    }
    
    .content-card .card-body {
        padding: 16px;
    }
}

/* Utility Classes */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.d-none {
    display: none;
}

@media (min-width: 768px) {
    .d-md-block {
        display: block;
    }
}

.me-2 {
    margin-right: 8px;
}
