/* ========== KPI Row ========== */

.kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: box-shadow 0.15s ease;
}

.kpi-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.kpi-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    font-size: 20px;
    flex-shrink: 0;
}

.kpi-icon-inprogress { background: #fef3c7; color: #d97706; }
.kpi-icon-scheduled  { background: #dbeafe; color: #2563eb; }
.kpi-icon-overdue    { background: #fee2e2; color: #dc2626; }
.kpi-icon-critical   { background: #fee2e2; color: #b91c1c; }
.kpi-icon-comingdue  { background: #e0e7ff; color: #4f46e5; }

.kpi-value {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.kpi-label {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

/* ========== Dashboard Grid ========== */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.dashboard-panel-full {
    grid-column: 1 / -1;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.panel-title {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.panel-title i {
    margin-right: 8px;
    color: #059669;
}

.panel-body {
    padding: 20px;
}

/* ========== Charts ========== */

.chart-wrapper-dashboard {
    position: relative;
    height: 280px;
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 280px;
    color: #94a3b8;
    font-style: italic;
    font-size: 13px;
}

/* ========== Status Badges ========== */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.status-badge.status-pending     { background: #f1f5f9; color: #475569; }
.status-badge.status-scheduled   { background: #dbeafe; color: #1e40af; }
.status-badge.status-inprogress  { background: #fef3c7; color: #92400e; }
.status-badge.status-onhold      { background: #ffedd5; color: #9a3412; }
.status-badge.status-completed   { background: #d1fae5; color: #065f46; }
.status-badge.status-cancelled   { background: #e2e8f0; color: #334155; }

/* ========== Stalled Table ========== */

.entity-primary {
    color: #1e293b;
    font-weight: 500;
}

.entity-secondary {
    color: #64748b;
    font-size: 12px;
    margin-top: 2px;
}

.inspection-link {
    color: #1e40af;
    font-weight: 600;
    text-decoration: none;
}

.inspection-link:hover {
    text-decoration: underline;
}

.past-due {
    color: #dc2626;
    font-weight: 600;
}

.coverage-bar-track {
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
    min-width: 120px;
}

.coverage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b 0%, #10b981 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.coverage-bar-label {
    font-size: 11px;
    color: #64748b;
}

.text-right {
    text-align: right;
}

/* ========== Coming Due Pills ========== */

.days-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.days-pill.days-urgent  { background: #fee2e2; color: #b91c1c; }
.days-pill.days-warning { background: #fef3c7; color: #92400e; }
.days-pill.days-normal  { background: #dbeafe; color: #1e40af; }

/* ========== Responsive ========== */

@media (max-width: 1200px) {
    .kpi-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .kpi-row {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .kpi-row {
        grid-template-columns: 1fr;
    }
}
