/* Club Run theme.
   Deliberately light: server-rendered Bootstrap for management screens, with
   the heavier styling reserved for the race-night timer and claim desk where
   legibility at arm's length matters. */

:root {
    --cr-ink: #12263a;
    --cr-accent: #1f7a5a;
    --cr-accent-dark: #145c43;
    --cr-surface: #f6f8f7;
}

.cr-body {
    background-color: var(--cr-surface);
    color: var(--cr-ink);
}

.cr-navbar {
    background-color: var(--cr-accent);
}

.cr-navbar .navbar-brand,
.cr-navbar .nav-link,
.cr-navbar .navbar-text,
.cr-navbar .navbar-toggler {
    color: #fff;
}

.cr-navbar .navbar-brand .site-mark {
    height: 28px;
    width: 28px;
    margin-right: 0.5rem;
    /* <img> SVGs do not inherit currentColor — force white on the green bar */
    filter: brightness(0) invert(1);
}

.cr-navbar .nav-link:hover,
.cr-navbar .nav-link:focus {
    color: #d9f2e7;
}

.cr-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}

.cr-navbar .dropdown-menu {
    --bs-dropdown-link-active-bg: var(--cr-accent);
}

.cr-hero {
    padding: 2rem 0 1rem;
}

.cr-club-tagline {
    font-size: 1.4rem;
    font-weight: 700;
    font-style: italic;
    color: var(--cr-ink);
    line-height: 1.35;
    margin-bottom: 0;
}

.cr-card {
    border: 1px solid rgba(18, 38, 58, 0.08);
    box-shadow: 0 1px 2px rgba(18, 38, 58, 0.05);
}

.cr-dashboard-card .cr-dashboard-list {
    font-size: 0.875rem;
}

.cr-dashboard-card .cr-dashboard-list .list-group-item {
    border-color: rgba(18, 38, 58, 0.08);
}

.cr-dashboard-run-link {
    color: inherit;
}

.cr-dashboard-run-link:hover,
.cr-dashboard-run-link:focus {
    color: inherit;
}

.cr-club-runs-filters {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cr-club-runs-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.cr-club-runs-check .form-check-input {
    float: none;
    margin: 0;
    position: static;
    flex-shrink: 0;
}

.cr-club-runs-dates {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    min-height: 2.125rem;
}

.cr-club-runs-dates input[type="date"].form-control-sm {
    width: 10.5rem;
    min-width: 10.5rem;
}

.cr-activity-card {
    color: var(--cr-ink);
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.cr-activity-card:hover,
.cr-activity-card:focus-visible {
    color: var(--cr-ink);
    border-color: rgba(31, 122, 90, 0.35);
    box-shadow: 0 4px 14px rgba(18, 38, 58, 0.08);
    transform: translateY(-1px);
}

.cr-activity-card .cr-activity-icon {
    font-size: 2.75rem;
    line-height: 1;
    color: var(--cr-accent);
}

.cr-delete-modal--destructive .modal-content {
    border: 2px solid #b42318;
    overflow: hidden;
}

.cr-delete-modal--destructive .modal-header {
    background-color: #b42318;
    color: #fff;
    border-bottom: 0;
}

.cr-delete-modal--destructive .modal-body {
    background-color: #fff;
    color: var(--cr-ink);
}

.cr-delete-modal--destructive .modal-footer {
    background-color: #b42318;
    border-top: 0;
}

.cr-delete-modal--destructive .cr-delete-modal__lead {
    font-size: 1.05rem;
}

.cr-delete-modal--destructive .cr-delete-modal__confirm {
    color: #b42318;
    font-weight: 600;
}

.cr-runner-table tbody tr:hover {
    background: rgba(31, 122, 90, 0.06);
}

.cr-runners-layout {
    align-items: flex-start;
}

.cr-runner-list-card,
.cr-runner-list-card .card-body {
    /* Bootstrap .card is a column flex container and .card-body is
       flex: 1 1 auto. Default min-height: auto then uses the table's
       full intrinsic height, so the page kept growing with every runner
       even after the list itself was clipped to 70vh. */
    min-height: 0;
}

.cr-runner-list-card .card-body {
    overflow: hidden;
}

.cr-runner-table-wrap {
    max-height: min(70vh, 42rem);
    overflow: auto;
}

.cr-runner-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
    box-shadow: inset 0 -1px 0 rgba(18, 38, 58, 0.08);
}

.cr-runner-row-link {
    display: inline-block;
}

.cr-runner-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    font-size: 1.05rem;
    line-height: 1;
    text-decoration: none;
}

.cr-runner-action--official {
    color: #6c757d;
}

.cr-runner-action--promote {
    color: #0d6efd;
}

.cr-runner-action--promote:hover,
.cr-runner-action--promote:focus-visible {
    color: #0a58ca;
}

.cr-runner-table .btn.btn-link.cr-runner-action--delete,
.cr-runner-table .btn.btn-link.cr-runner-action--delete > i {
    color: #dc3545;
}

.cr-runner-table .btn.btn-link.cr-runner-action--delete:hover,
.cr-runner-table .btn.btn-link.cr-runner-action--delete:focus-visible,
.cr-runner-table .btn.btn-link.cr-runner-action--delete:hover > i,
.cr-runner-table .btn.btn-link.cr-runner-action--delete:focus-visible > i {
    color: #b02a37;
}

.cr-footer {
    background-color: #fff;
    border-top: 1px solid rgba(18, 38, 58, 0.08);
}

.btn-cr-accent {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--cr-accent);
    --bs-btn-border-color: var(--cr-accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--cr-accent-dark);
    --bs-btn-hover-border-color: var(--cr-accent-dark);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--cr-accent-dark);
    --bs-btn-active-border-color: var(--cr-accent-dark);
    --bs-btn-focus-shadow-rgb: 31, 122, 90;
}

.cr-comm-to-btn {
    cursor: pointer;
    background: #fff;
}

.cr-comm-preview-text {
    white-space: pre-wrap;
    font-family: inherit;
    margin: 0;
}

.cr-comm-keyword-picker {
    background: #fff;
    border: 1px solid rgba(18, 38, 58, 0.15);
    border-radius: 0.375rem;
    box-shadow: 0 8px 24px rgba(18, 38, 58, 0.12);
    max-height: min(12rem, 40vh);
    overflow: auto;
    padding: 0.25rem;
    -webkit-overflow-scrolling: touch;
}

.cr-comm-keyword-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.4rem 0.6rem;
    border-radius: 0.25rem;
    font-size: 0.9rem;
}

.cr-comm-keyword-item:hover,
.cr-comm-keyword-item.active {
    background: rgba(31, 122, 90, 0.1);
}

.cr-comm-sent-row {
    cursor: pointer;
}

.cr-comm-sent-row:hover > td {
    background: rgba(31, 122, 90, 0.06);
}

.cr-comm-sent-row.table-danger:hover > td {
    background: rgba(220, 53, 69, 0.12);
}
