/* Polished SaaS Dashboard Design with Enterprise Polish */

/* Header Band */
.dashboard-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: flex-start;
    justify-content: space-between;
    padding: 2rem;
}

@media (min-width: 768px) {
    .header-content {
        flex-direction: row;
        align-items: center;
    }
}

.header-left {
    flex: 1;
}

.header-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.header-subtitle {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: #64748b;
    line-height: 1.5;
}

/* Freshness Badge */
.freshness-badge {
    display: inline-flex;
    align-items: center;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    padding: 0.5rem 1rem;
    margin: 0 0 1.5rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.freshness-badge:hover {
    background: #dcfce7;
    border-color: #86efac;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

.freshness-badge i {
    font-size: 1rem;
    margin-right: 0.5rem;
}

.freshness-label {
    margin-right: 0.5rem;
}

.freshness-time {
    font-weight: 600;
}

.summary-link {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.summary-link:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-divider {
    margin: 0;
    border: none;
    border-top: 1px solid #f1f5f9;
}

/* Risk Donut */
.risk-donut {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.donut-chart {
    position: relative;
    width: 8rem;
    height: 8rem;
}

.donut-segment {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 10px solid transparent;
    transform: rotate(-90deg);
}

.donut-segment.high-risk {
    border-top-color: #ef4444;
    border-right-color: #ef4444;
    clip-path: polygon(50% 0%, 100% 0%, 100% 100%, 50% 100%);
}

.donut-segment.medium-risk {
    border-bottom-color: #f59e0b;
    border-left-color: #f59e0b;
    clip-path: polygon(0% 0%, 50% 0%, 50% 100%, 0% 100%);
}

.donut-segment.low-risk {
    border-top-color: #10b981;
    border-right-color: #10b981;
    clip-path: polygon(50% 0%, 100% 0%, 100% 50%, 50% 50%);
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.donut-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* KPI Chips */
.kpi-chips {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.kpi-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.875rem;
    background: white;
    min-width: 80px;
    transition: all 0.2s ease;
}

.kpi-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.kpi-label {
    color: #64748b;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-chip strong {
    color: #1e293b;
    font-weight: 700;
    font-size: 1.125rem;
}

.kpi-value.high { color: #ef4444; }
.kpi-value.medium { color: #f59e0b; }
.kpi-value.low { color: #10b981; }

/* Assessment Grid */
.assessment-grid {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .assessment-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .assessment-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Assessment Cards with Enhanced Hover States */
.assessment-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
}

.assessment-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: #3b82f6;
}

.assessment-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.assessment-card:hover::before {
    transform: scaleX(1);
}

.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card-icon {
    width: 3rem;
    height: 3rem;
    background: #f8fafc;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-size: 1.25rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.assessment-card:hover .card-icon {
    background: #3b82f6;
    color: white;
    transform: scale(1.1);
}

.card-title-section {
    flex: 1;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.card-description {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* Grade Badge */
.grade-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    background: white;
    align-self: flex-start;
    transition: all 0.2s ease;
}

.grade-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.grade-label {
    color: #64748b;
    font-weight: 500;
}

.grade-value {
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.875rem;
}

.grade-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.grade-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fed7aa;
}

.grade-danger {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

/* Score Meter */
.score-meter {
    margin-bottom: 1rem;
}

.score-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.score-label {
    color: #64748b;
    font-weight: 500;
}

.score-value {
    font-weight: 600;
    color: #1e293b;
}

.score-bar {
    height: 0.5rem;
    width: 100%;
    overflow: hidden;
    border-radius: 9999px;
    background: #f1f5f9;
}

.score-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 9999px;
    transition: width 0.3s ease;
    width: var(--score-width, 0%);
}

/* Risk Rows */
.risk-rows {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.risk-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #fafafa;
    transition: all 0.2s ease;
}

.risk-row:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
    transform: translateX(2px);
}

.risk-indicator {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    margin-right: 0.75rem;
}

.risk-indicator.high {
    background: #ef4444;
}

.risk-indicator.medium {
    background: #f59e0b;
}

.risk-indicator.low {
    background: #10b981;
}

.risk-label {
    color: #64748b;
    flex: 1;
    font-weight: 500;
}

.risk-count {
    color: #1e293b;
    font-weight: 600;
}

/* Card Footer */
.card-footer {
    border-top: 1px solid #f1f5f9;
    padding: 1rem 1.5rem;
    background: #fafafa;
}

.btn-view {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
}

.btn-view:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* No Data State */
.no-data-state {
    padding: 4rem 2rem;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.no-data-state i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

.no-data-state h3 {
    color: #475569;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.no-data-state p {
    color: #64748b;
    font-size: 1rem;
}

/* Hover Effects */
.hover-lift {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

/* Notification Toast */
.notification-toast {
    top: 20px;
    right: 20px;
    z-index: 1050;
    min-width: 300px;
}

/* Page Loader Overlay */
.page-loader-overlay {
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
}

/* Responsive Design */
@media (max-width: 640px) {
    .dashboard-header {
        padding: 1.5rem 1rem 0;
        margin: 1rem;
    }
    
    .header-content {
        padding: 1.5rem;
    }
    
    .header-title {
        font-size: 1.5rem;
    }
    
    .risk-donut {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .donut-chart {
        width: 6rem;
        height: 6rem;
    }
    
    .kpi-chips {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .assessment-grid {
        padding: 0 1rem;
        margin: 1rem auto;
    }
}
