.table-sm td, .table-sm th { vertical-align: middle; }
.text-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.card-header { border-bottom-color: var(--bs-border-color-translucent); }
tr.row-disabled td { opacity: .55; text-decoration: line-through; }
tr.row-disabled td:last-child { text-decoration: none; opacity: 1; }

/* Table header that follows the theme (table-light stays light in dark mode) */
.table > thead.table-head > tr > th {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-emphasis-color);
    border-bottom-color: var(--bs-border-color);
}

/* Dark mode details */
[data-bs-theme="dark"] body.bg-body-tertiary { background-color: #15181c !important; }
[data-bs-theme="dark"] .card { background-color: #1e2227; }
[data-bs-theme="dark"] .card-header.bg-body,
[data-bs-theme="dark"] .card-footer.bg-body { background-color: #23282e !important; }
[data-bs-theme="dark"] .navbar.bg-body { background-color: #1e2227 !important; }
[data-bs-theme="dark"] .form-select.border-warning { border-color: #b98900 !important; }
[data-bs-theme="dark"] .badge.text-bg-light { background-color: #2b3036 !important; color: #dee2e6 !important; }
[data-bs-theme="dark"] .heat-cell { color: #dee2e6; }

/* ---- Compact sizing: everything scales from the root font size (Bootstrap uses rem) ---- */
html { font-size: 13px; }
@media (min-width: 1600px) { html { font-size: 14px; } }
body { line-height: 1.4; }
h1.h4, .h4 { font-size: 1.15rem; }
.h5, h1.h5 { font-size: 1.05rem; }
.fs-4 { font-size: 1.25rem !important; }
.navbar { --bs-navbar-padding-y: .25rem; }
.navbar-brand { font-size: 1rem; padding-top: .2rem; padding-bottom: .2rem; }
.navbar .nav-link { padding-top: .35rem; padding-bottom: .35rem; }
.navbar-expand-lg .navbar-nav .nav-link { padding-left: .55rem; padding-right: .55rem; }
.card-header { padding: .4rem .75rem; }
.card-body { padding: .75rem; }
.card-body.py-2 { padding-top: .45rem !important; padding-bottom: .45rem !important; }
.table-sm > :not(caption) > * > * { padding: .2rem .4rem; }
.form-control-sm, .form-select-sm, .btn-sm { font-size: .85rem; }
.form-label { margin-bottom: .2rem; }
.alert { padding: .45rem .75rem; }
.badge { font-weight: 500; }
main.container-fluid { padding-top: .75rem !important; }

/* Year calendar (dashboard): 53 week columns that stretch to the card width */
.rd-cal, .rd-cal-months { display: flex; gap: 2px; }
.rd-cal-months span { flex: 1 1 0; min-width: 0; font-size: 9px; white-space: nowrap; overflow: visible; color: var(--bs-secondary-color); }
.rd-cal-week { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rd-cal-week .rd-cal-day { width: 100%; height: auto; aspect-ratio: 1; }
.rd-cal-day { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.rd-cal-empty { background: transparent; }
.rd-cal-l0 { background: var(--bs-secondary-bg); }
.rd-cal-l1 { background: #9be9a8; }
.rd-cal-l2 { background: #40c463; }
.rd-cal-l3 { background: #30a14e; }
.rd-cal-l4 { background: #216e39; }
[data-bs-theme="dark"] .rd-cal-l1 { background: #0e4429; }
[data-bs-theme="dark"] .rd-cal-l2 { background: #006d32; }
[data-bs-theme="dark"] .rd-cal-l3 { background: #26a641; }
[data-bs-theme="dark"] .rd-cal-l4 { background: #39d353; }
a.rd-cal-day:hover { outline: 1px solid var(--bs-body-color); }

/* Clickable heatmap cells (dashboard) */
a .rd-heat { cursor: pointer; transition: transform .1s; }
a:hover .rd-heat { outline: 2px solid var(--bs-primary); outline-offset: -1px; }
