:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --border: #e5e7eb;
    --text: #1f2937;
    --muted: #6b7280;

    --green: #16a34a;
    --red: #dc2626;
    --blue: #2563eb;
    --orange: #ea580c;

    --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

body.dark {
    --bg: #111827;
    --card: #1f2937;
    --border: #374151;
    --text: #f3f4f6;
    --muted: #9ca3af;

    background: var(--bg);
    color: var(--text);
}

body {
    background: var(--bg);
    color: var(--text);

    transition:
        background 0.35s ease,
        color 0.35s ease;
}

.card {
    background: var(--card);
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.summary-card {
    min-height: 210px;
}

.metric-title {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
}

.metric-delta {
    margin-top: 8px;
    font-size: 15px;
    font-weight: 600;
}

.metric-small {
    margin-top: 12px;
    color: var(--muted);
}

.progress {
    height: 8px;
    border-radius: 999px;
    background: #e5e7eb;
}

.progress-bar {
    transition: 1s;
}

.table {
    background: var(--card);
    color: var(--text);
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 2;

    background: #aeb0af;
    color: white;

    white-space: nowrap;
}

.table tbody tr {
    transition: 0.2s;
}

.table tbody tr:hover {
    background: rgba(37, 99, 235, 0.06);
}

.badge-up {
    background: #dcfce7;
    color: #166534;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.badge-down {
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.badge-neutral {
    background: #f3f4f6;
    color: #6b7280;
    padding: 4px 10px;
    border-radius: 999px;
}

.covered {
    font-weight: 600;
}

.total {
    color: var(--muted);
}

#coverageChart {
    max-height: 450px;
}

input {
    background: var(--card) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
}

input::placeholder {
    color: var(--muted);
}

.btn {
    border-radius: 10px;
}

.card h5 {
    color: var(--muted);
}

#latestReport,
#bestImprovement,
#coveredAdded {
    font-size: 28px;
    font-weight: bold;
}

.up {
    color: var(--green);
}

.down {
    color: var(--red);
}

.good {
    color: var(--green);
    font-weight: bold;
}

.medium {
    color: var(--orange);
    font-weight: bold;
}

.bad {
    color: var(--red);
    font-weight: bold;
}

.table-responsive {
    border-radius: 16px;
    overflow: auto;
}

::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 999px;
}

.dark .table {
    --bs-table-bg: var(--card);
    --bs-table-color: var(--text);
    --bs-table-striped-bg: #243244;
    --bs-table-hover-bg: #314154;
}

.dark .progress {
    background: #374151;
}

.dark input {
    background: #111827 !important;
}

.dark .badge-neutral {
    background: #374151;
    color: #f3f4f6;
}

@media (max-width: 992px) {
    .metric-value {
        font-size: 28px;
    }

    #latestReport,
    #bestImprovement,
    #coveredAdded {
        font-size: 20px;
    }
}

.fade-in {
    animation: fade 0.4s ease;
}

@keyframes fade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.coverage-cell {
    min-width: 180px;
}

.coverage-percent {
    font-size: 22px;
    font-weight: 700;
}

.coverage-delta {
    margin-top: 4px;
    margin-bottom: 6px;
    font-size: 14px;
}

.coverage-total {
    color: #6b7280;
    font-size: 13px;
}

.dark .coverage-total {
    color: #9ca3af;
}

.table td {
    vertical-align: top;
}
.dark .table {
    --bs-table-bg: var(--card);
    --bs-table-color: var(--text);

    --bs-table-striped-bg: #243244;
    --bs-table-striped-color: var(--text);

    --bs-table-hover-bg: #314154;
    --bs-table-hover-color: #fff;

    --bs-table-border-color: #374151;
}

.dark .card {
    background: var(--card);
    color: var(--text);
}

.dark .card * {
    color: inherit;
}

.dark .metric-value {
    color: #fff;
}

.dark .metric-title {
    color: #cbd5e1;
}

.dark .metric-small {
    color: #94a3b8;
}

.dark h2,
.dark h3,
.dark h4,
.dark h5,
.dark h6 {
    color: #fff;
}

.dark .text-muted {
    color: #94a3b8 !important;
}

.dark .table thead th {
    background: #273343;
}
