body {
    background: #f3f5f9;
    color: #1f2937;
}

.app-topbar {
    background: linear-gradient(120deg, #8b1023 0%, #b91c1c 45%, #dc2626 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.navbar-brand {
    letter-spacing: 0.2px;
    font-size: 1.04rem;
}

.dashboard-shell {
    max-width: 1500px;
    margin: 0 auto;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

.hero-header {
    background: #ffffff;
    border: 1px solid #e5eaf2;
    border-left: 5px solid #b91c1c;
    border-radius: 0.9rem;
    padding: 1.15rem 1.25rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.hero-kicker {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #2f5da8;
}

.card {
    border-radius: 0.85rem;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06) !important;
}

.metric-card {
    border: 1px solid #e2e8f0;
    background: #fff;
    overflow: hidden;
    position: relative;
}

.metric-card::after {
    display: none;
}

.metric-primary::after {
    background: #2563eb;
}

.metric-success::after {
    background: #16a34a;
}

.metric-warning::after {
    background: #f59e0b;
}

.metric-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-bottom: 0.45rem;
    font-size: 0.85rem;
    color: #fff;
    box-shadow: none;
}

.metric-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    font-weight: 600;
}

.metric-value {
    font-size: 2rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #0f172a;
}

.metric-unit {
    font-size: 1.25rem;
    margin-left: 0.18rem;
    color: #334155;
    font-weight: 700;
}

.metric-sub {
    font-size: 0.78rem;
    color: #64748b;
}

.metric-primary .metric-icon {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.metric-success .metric-icon {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.metric-warning .metric-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stage-pill-card {
    border: 1px solid #e5e7eb;
    background: #fff !important;
}

.stage-title {
    font-weight: 500;
}

.stage-count {
    font-weight: 700;
    color: #1e293b;
}

.stage-progress {
    margin-top: 0.42rem;
    height: 5px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.stage-progress-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #dc2626, #f59e0b);
}

.panel-card {
    border: 1px solid #e2e8f0;
}

.panel-card .table-responsive {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
}

.area-summary-card .card-header {
    padding-left: 1rem;
    padding-right: 1rem;
}

.area-summary-table td,
.area-summary-table th {
    padding-top: 0.58rem !important;
    padding-bottom: 0.58rem !important;
}

.area-summary-table {
    table-layout: fixed;
}

.area-summary-table .col-unit {
    width: 22%;
}

.area-summary-table .col-stations {
    width: 10%;
}

.area-summary-table .col-total,
.area-summary-table .col-turnout {
    width: 21%;
}

.area-summary-table .col-rate {
    width: 26%;
}

.area-summary-table .area-rate-cell {
    white-space: nowrap;
}

.area-summary-table tbody tr:nth-child(odd) {
    background: #fcfdff;
}

.area-rate-badge {
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    min-width: 48px;
}

.area-rate-bar {
    width: 92px;
    height: 7px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.area-rate-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #dc2626 0%, #f59e0b 55%, #16a34a 100%);
}

.dashboard-shell h2.h5 {
    font-weight: 700;
    margin-bottom: 0.9rem !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-shell h2.h5::before {
    content: "";
    width: 8px;
    height: 20px;
    border-radius: 999px;
    background: linear-gradient(180deg, #1d4ed8, #0e7490);
}

.dashboard-shell .table > :not(caption) > * > * {
    padding-top: 0.62rem;
    padding-bottom: 0.62rem;
    vertical-align: middle;
}

.dashboard-shell .table thead th {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #4b5563;
    background-color: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0;
}

.dashboard-shell .table-hover tbody tr:hover {
    background: #f8fafc;
}

.chart-wrap {
    position: relative;
    width: 100%;
}

.chart-wrap-md {
    height: 280px;
}

.chart-wrap-lg {
    height: 320px;
}

.chart-wrap-vote {
    height: 320px;
}

.timeline {
    position: relative;
    margin-left: 0.35rem;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -0.35rem;
    width: 2px;
    background: #d5def7;
}

.timeline-item {
    margin-bottom: 0.85rem;
    border-left: 4px solid #0d6efd;
}

.timeline-inline {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    align-items: center;
}

.timeline-inline .badge {
    font-weight: 500;
    background: #fff !important;
}

.gantt-axis {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    font-size: 0.72rem;
    color: #6c757d;
}

.gantt-axis span {
    text-align: center;
}

.gantt-axis-header {
    margin-top: 0.35rem;
}

.gantt-track-wrap {
    margin-top: 0.1rem;
}

.gantt-track {
    position: relative;
    height: 18px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: visible;
}

.gantt-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 55%, #16a34a 100%);
    box-shadow: none;
}

.gantt-points {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.gantt-percent-label {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem;
    font-weight: 700;
    color: #0b3a8f;
    z-index: 2;
}

.gantt-point {
    position: absolute;
    transform: translateX(-50%);
}

.gantt-point .dot {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #adb5bd;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #ced4da;
}

.gantt-point.done .dot {
    background: #0d6efd;
    box-shadow: 0 0 0 1px #0d6efd;
}

.btn-outline-primary {
    border-color: #b91c1c;
    color: #b91c1c;
}

.btn-outline-primary:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.app-footer {
    margin-top: 1.5rem;
    border-top: 1px solid #dbe4f2;
    background: #f7f9fd;
    padding: 0.9rem 0;
    font-size: 0.86rem;
}

.app-footer a {
    color: #1d4ed8;
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .dashboard-shell {
        padding-left: 0.2rem;
        padding-right: 0.2rem;
    }

    .panel-card .table-responsive {
        padding-left: 0.3rem;
        padding-right: 0.3rem;
    }

    .hero-header {
        padding: 0.9rem;
    }

    .dashboard-shell .table thead th {
        font-size: 0.73rem;
    }
}
