/* ─── Base ─────────────────────────────────────────────────────────────────── */
body {
    background-color: #1a1a2e;
    font-size: 0.95rem;
    color: #e0e0e0;
}

/* ─── Navbar ────────────────────────────────────────────────────────────────── */
.navbar {
    padding: 0.5rem 1rem;
    background-color: #16213e !important;
    border-bottom: 2px solid #0f3460;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #e0e0e0 !important;
}

/* ─── General Cards ─────────────────────────────────────────────────────────── */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    background-color: #16213e;
    color: #e0e0e0;
}

.card-header {
    background-color: #0f3460;
    border-bottom: 1px solid #1a4a7a;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    color: #ffffff !important;
    font-weight: 600;
    letter-spacing: 0.03em;
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

.card-body {
    padding: 0.75rem 1rem;
}

/* ─── Stat Columns ──────────────────────────────────────────────────────────── */
.stat-column {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.stat-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    user-select: none;
}

.stat-col-header:hover {
    filter: brightness(1.1);
}

.stat-cell {
    padding: 0.75rem 1rem;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.25rem;
    opacity: 0.75;
}

.stat-number {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.1;
}

/* Weight - Blue theme */
.weight-column .stat-col-header { background-color: #1a5276; }
.weight-current { background-color: #1a3a5c; color: #5dade2; }
.weight-current .stat-number { color: #5dade2; }
.weight-target { background-color: #16324f; color: #85c1e9; }
.weight-target .stat-number { color: #85c1e9; }

/* Fat - Green theme */
.fat-column .stat-col-header { background-color: #1e8449; }
.fat-current { background-color: #1a5c35; color: #58d68d; }
.fat-current .stat-number { color: #58d68d; }
.fat-target { background-color: #174d2c; color: #82e0aa; }
.fat-target .stat-number { color: #82e0aa; }

/* Muscle - Orange theme */
.muscle-column .stat-col-header { background-color: #a04000; }
.muscle-current { background-color: #7d3400; color: #f0a500; }
.muscle-current .stat-number { color: #f0a500; }
.muscle-target { background-color: #6b2d00; color: #f5b942; }
.muscle-target .stat-number { color: #f5b942; }

/* Delta row - dark for all columns */
.delta-cell {
    background-color: #1a1a2e;
    color: #e74c3c;
}
.delta-cell .stat-number { color: #e74c3c; }
.delta-cell .stat-label { color: #aaa; }

/* ─── Averages Card ─────────────────────────────────────────────────────────── */
.averages-card {
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    border: 1px solid #1a4a7a;
}
.text-muted {
    color: #ffffff !important;
}
.averages-card .avg-item {
    text-align: center;
    padding: 0.5rem;
}

.averages-card .avg-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #ffffff !important;
    margin-bottom: 0.2rem;
}

.averages-card .avg-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e0e0e0;
}

.goal-date-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #58d68d !important;
}

/* ─── Controls Row ──────────────────────────────────────────────────────────── */
.form-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #7fb3d3 !important;
    margin-bottom: 0.25rem;
}

.form-select {
    background-color: #16213e;
    border: 1px solid #0f3460;
    color: #e0e0e0;
    font-size: 0.85rem;
}

.form-select:focus {
    background-color: #16213e;
    border-color: #5dade2;
    color: #e0e0e0;
    box-shadow: 0 0 0 0.2rem rgba(93,173,226,0.25);
}

/* ─── Charts ────────────────────────────────────────────────────────────────── */
#progressChart {
    max-width: 220px;
    max-height: 220px;
}

/* ─── Tables ────────────────────────────────────────────────────────────────── */
.table {
    color: #e0e0e0;
    margin-bottom: 0;
}

.table th {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #7fb3d3;
    border-bottom: 2px solid #0f3460;
    background-color: #16213e;
}

.table td {
    font-size: 0.85rem;
    vertical-align: middle;
    border-color: #0f3460;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(15,52,96,0.3);
    color: #e0e0e0;
}

.table-hover tbody tr:hover > * {
    background-color: rgba(93,173,226,0.15);
    color: #fff;
}

/* ─── Collapse toggle button ────────────────────────────────────────────────── */
.btn-outline-secondary {
    border-color: #0f3460;
    color: #7fb3d3;
}

.btn-outline-secondary:hover {
    background-color: #0f3460;
    color: #e0e0e0;
}

.collapse-icon {
    transition: transform 0.2s ease;
    font-size: 0.8rem;
}

/* ─── Alerts ────────────────────────────────────────────────────────────────── */
.alert {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

/* ─── Entry page ────────────────────────────────────────────────────────────── */
.form-control {
    background-color: #16213e;
    border: 1px solid #0f3460;
    color: #e0e0e0;
}

.form-control:focus {
    background-color: #16213e;
    border-color: #5dade2;
    color: #e0e0e0;
    box-shadow: 0 0 0 0.2rem rgba(93,173,226,0.25);
}

.form-control::placeholder {
    color: #4a6fa5;
}

/* ─── Mobile ────────────────────────────────────────────────────────────────── */
@media (max-width: 576px) {
    main.container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    #progressChart {
        max-width: 160px;
        max-height: 160px;
    }
}