/* Small, self-contained design system used by every page. One file, one set of tr- component
   classes — improving it here improves every page at once (see design conversation
   2026-09-23). Per-club branding
   (logo/colors) layers on top of this via inline overrides on club.html specifically; this file
   stays the sane default. */

* { box-sizing: border-box; }

:root {
    --primary: #0e8a93;
    --primary-dark: #0b6f77;
    --primary-soft: #e6f5f6;
    --primary-border: #b7e1e4;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --error: #ef4444;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    --success: #10b981;
    --success-dark: #059669;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    /* Small categorical palette for stat chips etc. — used sparingly (one hue per category,
       not decoratively), not the brand color, which stays --primary throughout. */
    --accent-blue: #3b82f6;
    --accent-blue-bg: #eff6ff;
    --accent-purple: #8b5cf6;
    --accent-purple-bg: #f5f3ff;
    --accent-amber: #f59e0b;
    --accent-amber-bg: #fffbeb;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.05);
    --shadow-md: 0 4px 12px rgba(17, 24, 39, 0.08);
    --shadow-lg: 0 12px 32px rgba(17, 24, 39, 0.16);
    --transition: 150ms ease;
}

* { -webkit-font-smoothing: antialiased; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
}

a { color: var(--primary-dark); }

::selection { background: var(--primary-border); }

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.tr-header {
    background: white;
    box-shadow: var(--shadow-sm);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tr-header-brand {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-900);
}

.tr-header-user {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.tr-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
}

/* Data-heavy staff dashboards (tables, charts) get a wider content area than the 960px default.
   The stat-tile row is capped and centered to match so the two stay aligned. */
.tr-page-wide .tr-container,
.tr-page-wide .tr-stats-row {
    max-width: 1360px;
    margin-left: auto;
    margin-right: auto;
}

.tr-container-narrow {
    max-width: 480px;
    margin: 60px auto;
    padding: 0 20px;
}

.tr-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 16px;
    transition: box-shadow var(--transition);
}

.tr-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* A left-aligned label/value list inside an otherwise-centered confirmation card (e.g.
   "Program / Offer type / Team"), paired with .tr-detail-row for each line. */
.tr-detail-list { text-align: left; margin-top: 16px; }
.tr-detail-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--gray-200); }
.tr-detail-row:last-child { border-bottom: none; }

/* A quoted message from a person (a club's note on an offer, etc.) — labelled so it reads as
   "someone said this", not just an unexplained italic paragraph. */
.tr-quote-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-400); font-weight: 700; margin-bottom: 6px; text-align: left; }
.tr-quote-box { margin: 4px 0 16px; padding: 14px 16px; background: var(--gray-50); border-left: 3px solid var(--primary); border-radius: var(--radius-sm); text-align: left; color: var(--gray-700); font-size: 0.95rem; line-height: 1.5; white-space: pre-wrap; }

h1, h2, h3 { margin-top: 0; letter-spacing: -0.015em; }
h1 { font-weight: 800; }
h2 { font-weight: 700; }
h3 { font-weight: 700; }

.tr-form-group {
    margin-bottom: 16px;
}

.tr-form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--gray-800);
}

.tr-form-group input,
.tr-form-group select,
.tr-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: white;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.tr-form-group input:focus,
.tr-form-group select:focus,
.tr-form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 138, 147, 0.15);
}

.tr-btn {
    display: inline-block;
    font-family: inherit; /* buttons don't inherit the page font by default (they'd use the system font) */
    line-height: 1.3;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.tr-btn:active:not(:disabled) { transform: translateY(1px); }

.tr-btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}
.tr-btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); }

.tr-btn-secondary {
    background: var(--gray-100);
    color: var(--gray-800);
}
.tr-btn-secondary:hover { background: var(--gray-200); }

.tr-btn-danger {
    background: var(--error);
    color: white;
}
.tr-btn-danger:hover { background: #dc2626; }

.tr-btn-block { width: 100%; }

.tr-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.tr-alert {
    display: none;
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}
.tr-alert.visible { display: block; }
.tr-alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; }
.tr-alert-success { background: var(--success-bg); border: 1px solid var(--success-border); color: #065f46; }
.tr-alert-error { background: var(--error-bg); border: 1px solid var(--error-border); color: #991b1b; }

.tr-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.tr-nav {
    display: flex;
    gap: 4px;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 8px 24px;
}
.tr-nav a {
    padding: 8px 16px;
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 999px;
    transition: color var(--transition), background var(--transition);
}
.tr-nav a:hover { color: var(--gray-900); background: var(--gray-100); }
.tr-nav a.active {
    color: white;
    background: var(--primary);
}

.tr-section { display: none; }
.tr-section.active { display: block; animation: tr-fade-in 150ms ease; }

@keyframes tr-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tr-toast-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.tr-toast {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 28px;
    max-width: 360px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    animation: tr-toast-in 180ms ease;
}
@keyframes tr-toast-in {
    from { opacity: 0; transform: scale(0.95) translateY(6px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .tr-toast { animation: none; }
}
/* Mirrors .tr-icon-circle (confirmation/error pages) so a "Team saved" toast and a full-page
   "You're registered!" confirmation read as the same design language, not two different ones. */
.tr-toast-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}
.tr-toast-icon svg { width: 24px; height: 24px; }
.tr-toast-icon-success { background: var(--success-bg); color: var(--success-dark); }
.tr-toast-icon-error { background: var(--error-bg); color: var(--error); }
.tr-toast-icon-confirm { background: var(--accent-amber-bg); color: var(--accent-amber); }
.tr-toast-text { margin-bottom: 22px; font-size: 1rem; line-height: 1.5; color: var(--gray-800); }
.tr-toast-actions { display: flex; gap: 10px; justify-content: center; }
/* Confirm dialog: same width/feel as the small form modals, buttons share the row. */
.tr-toast-confirm { box-sizing: border-box; width: calc(100% - 32px); max-width: 440px; padding: 28px 28px 24px; }
.tr-toast-confirm .tr-toast-actions .tr-btn { flex: 1; padding: 12px 18px; white-space: normal; }

/* Notices (success / error): non-blocking cards at the bottom of the screen. */
.tr-notice-stack {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
    z-index: 1100; display: flex; flex-direction: column; gap: 10px; align-items: center;
    width: max-content; max-width: calc(100vw - 32px); pointer-events: none;
}
.tr-notice {
    pointer-events: auto; cursor: pointer; box-sizing: border-box;
    display: flex; align-items: center; gap: 12px;
    min-width: 280px; max-width: 480px; padding: 12px 10px 12px 14px;
    background: white; border: 1px solid var(--brand-line, var(--gray-200)); border-left: 4px solid var(--primary);
    border-radius: 14px; box-shadow: var(--brand-shadow-lg, var(--shadow-lg));
    animation: tr-notice-in 200ms ease;
}
.tr-notice-error { border-left-color: var(--error); }
.tr-notice .tr-toast-icon { width: 32px; height: 32px; margin: 0; flex: none; }
.tr-notice .tr-toast-icon svg { width: 18px; height: 18px; }
.tr-notice-text { flex: 1; font-size: 0.95rem; line-height: 1.4; color: var(--gray-800); font-weight: 500; }
.tr-notice-close { flex: none; background: none; border: none; color: var(--gray-400, #9ca3af); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 8px; font-family: inherit; }
.tr-notice-close:hover { color: var(--gray-700, #374151); background: var(--gray-100); }
.tr-notice.leaving { opacity: 0; transform: translateY(6px); transition: opacity 180ms ease, transform 180ms ease; }
@keyframes tr-notice-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .tr-notice { animation: none; } }
/* Phones: sit above the bottom tab bar. */
@media (max-width: 760px) { .tr-notice-stack { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); } .tr-notice { min-width: 0; width: calc(100vw - 32px); } }

/* ---- Form modal (header / scrolling body / sticky footer) ----
   For real forms; .tr-toast stays for small confirmations and alerts. */
.tr-modal {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 640px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    text-align: left;
}
.tr-modal-sm { max-width: 440px; }
.tr-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--gray-200);
}
.tr-modal-header h3 { margin: 0; font-size: 1.15rem; }
.tr-modal-header p { margin: 4px 0 0; }
.tr-modal-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0 4px;
}
.tr-modal-close:hover { color: var(--gray-800); }
.tr-modal-form { display: flex; flex-direction: column; min-height: 0; }
.tr-modal-body { padding: 20px 24px; overflow-y: auto; }
.tr-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius) var(--radius);
}
.tr-form-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin: 0 0 10px;
}
.tr-form-section + .tr-form-section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--gray-100); }
.tr-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.tr-form-hint { margin: 5px 0 0; font-size: 0.8rem; color: var(--gray-500); }
.tr-form-group input:disabled,
.tr-form-group select:disabled { background-color: var(--gray-100); color: var(--gray-600); cursor: not-allowed; }

.tr-choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tr-choice-card {
    text-align: left;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 14px 16px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color var(--transition), background var(--transition);
}
.tr-choice-card:hover:not(:disabled) { border-color: var(--gray-300); }
.tr-choice-card strong { display: block; color: var(--gray-900); margin-bottom: 4px; }
.tr-choice-card span { font-size: 0.85rem; color: var(--gray-500); line-height: 1.35; display: block; }
.tr-choice-card.selected { border-color: var(--primary); background: var(--primary-soft); }
.tr-choice-card:disabled { cursor: not-allowed; opacity: 0.65; }
.tr-choice-card:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(14, 138, 147, 0.25); }

/* ---- Filter bar, status pills, data tables, pagination ---- */
.tr-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(140px, 1fr));
    gap: 12px 16px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 12px 0 16px;
}
.tr-filter-bar label { display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-500); margin-bottom: 4px; }
.tr-filter-bar input, .tr-filter-bar select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    background: white;
}
.tr-filter-bar input:focus, .tr-filter-bar select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 138, 147, 0.15); }

.tr-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; background: var(--gray-100); color: var(--gray-600); }
.tr-pill-green { background: #dcfce7; color: #166534; }
.tr-pill-blue { background: #dbeafe; color: #1e40af; }
.tr-pill-amber { background: #fef3c7; color: #92400e; }
.tr-pill-red { background: #fee2e2; color: #991b1b; }

.tr-data-card { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.tr-data-card .tr-table th { background: var(--gray-50); padding: 10px 14px; }
.tr-data-card .tr-table td { padding: 12px 14px; vertical-align: middle; }
.tr-data-card .tr-table tbody tr:hover { background: var(--gray-50); }
.tr-data-card .tr-table tbody tr:last-child td { border-bottom: none; }
.tr-cell-sub { font-size: 0.8rem; color: var(--gray-500); margin-top: 2px; }
.tr-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--gray-200); background: var(--gray-50); font-size: 0.9rem; color: var(--gray-600); }
.tr-pagination-buttons { display: flex; gap: 8px; }

/* ---- Metrics page ---- */
.tr-filter-bar-2 { grid-template-columns: repeat(2, minmax(180px, 280px)); }
.tr-kpi-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tr-kpi { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 14px 16px; }
.tr-kpi-label { font-size: 0.8rem; color: var(--gray-500); }
.tr-kpi-value { font-size: 1.9rem; font-weight: 700; color: var(--gray-900); line-height: 1.15; margin-top: 4px; }
.tr-kpi-sub { font-size: 0.78rem; color: var(--gray-500); margin-top: 2px; min-height: 1em; }
.tr-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tr-chart-card { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 16px 18px 18px; min-width: 0; }
.tr-chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.tr-chart-title { font-weight: 700; color: var(--gray-900); }
.tr-chart-sub { font-size: 0.8rem; color: var(--gray-500); margin-top: 2px; }
.tr-chart-wrap { position: relative; width: 100%; }
.tr-chart-empty { display: none; color: var(--gray-500); font-size: 0.9rem; padding: 40px 0; text-align: center; }
.tr-chart-card.is-empty .tr-chart-wrap, .tr-chart-card.is-empty .tr-chart-legend { display: none; }
.tr-chart-card.is-empty .tr-chart-empty { display: block; }
.tr-chart-table { display: none; }
.tr-chart-card.show-table .tr-chart-wrap, .tr-chart-card.show-table .tr-chart-legend { display: none; }
.tr-chart-card.show-table:not(.is-empty) .tr-chart-table { display: block; }
.tr-chart-table table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tr-chart-table th { text-align: left; font-size: 0.75rem; text-transform: uppercase; color: var(--gray-500); padding: 6px 8px; border-bottom: 1px solid var(--gray-200); }
.tr-chart-table td { padding: 6px 8px; border-bottom: 1px solid var(--gray-100); }
.tr-chart-legend { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-size: 0.875rem; color: var(--gray-600); }
.tr-legend-item { display: flex; align-items: center; gap: 8px; }
.tr-legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.tr-legend-value { margin-left: auto; color: var(--gray-900); font-weight: 600; }
.tr-chart-span-2 { grid-column: span 2; }
#metricsBody { transition: opacity 120ms ease; }
#metricsBody.is-loading { opacity: 0.5; }
@media (max-width: 860px) {
    .tr-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tr-chart-grid { grid-template-columns: 1fr; }
    .tr-chart-span-2 { grid-column: auto; }
    .tr-filter-bar-2 { grid-template-columns: 1fr; }
}

/* ---- Messaging (shared by the coach dashboard and the parent portal) ---- */
.tr-nav-badge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: #ef4444; color: white; font-size: 0.7rem; font-weight: 700; line-height: 18px; text-align: center; vertical-align: middle; }
.tr-nav a.active .tr-nav-badge { background: white; color: #ef4444; }
.tr-msg-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.tr-msg-team-name { font-weight: 700; color: var(--gray-800); font-size: 0.95rem; }
.tr-msg-toolbar select { padding: 8px 10px; border: 1px solid var(--brand-line); border-radius: 10px; background-color: white; font-size: 0.95rem; }
.tr-msg-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tr-msg { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.tr-msg-list-pane, .tr-msg-thread-pane { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.tr-msg-list-pane { max-height: 70vh; overflow-y: auto; }
.tr-msg-item { padding: 12px 14px; border-bottom: 1px solid var(--gray-100); cursor: pointer; }
.tr-msg-item:hover { background: var(--gray-50); }
.tr-msg-item.active { background: var(--primary-soft); }
.tr-msg-item-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tr-msg-subject { font-weight: 500; color: var(--gray-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-msg-item.unread .tr-msg-subject { font-weight: 700; }
.tr-msg-item.unread .tr-msg-subject::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-right: 6px; }
.tr-msg-time { font-size: 0.75rem; color: var(--gray-500); white-space: nowrap; }
.tr-msg-who { font-size: 0.82rem; color: var(--gray-600); margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tr-msg-preview { font-size: 0.82rem; color: var(--gray-500); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-msg-empty { padding: 40px 20px; text-align: center; color: var(--gray-500); }
.tr-msg-thread-head { padding: 14px 18px; border-bottom: 1px solid var(--gray-200); }
.tr-msg-thread-head h4 { margin: 0; font-size: 1.05rem; }
.tr-msg-thread-sub { font-size: 0.85rem; color: var(--gray-500); margin-top: 2px; }
.tr-msg-back { display: none; background: none; border: none; color: var(--primary-dark); font-weight: 600; cursor: pointer; padding: 0 0 8px; font-size: 0.9rem; }
.tr-msg-thread-body { padding: 16px 18px; max-height: 52vh; min-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: var(--gray-50); }
.tr-bubble { max-width: 78%; padding: 9px 13px; border-radius: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.tr-bubble-text { white-space: pre-wrap; } /* only the message text keeps its line breaks, not the markup around it */
.tr-bubble.theirs { align-self: flex-start; background: white; border: 1px solid var(--gray-200); border-top-left-radius: 4px; }
.tr-bubble.mine { align-self: flex-end; background: var(--brand-ink, var(--gray-900)); color: white; border-top-right-radius: 4px; }
.tr-bubble.mine a { color: white; text-decoration: underline; }
.tr-bubble-meta { font-size: 0.72rem; margin-top: 4px; opacity: 0.75; }
.tr-msg-more { align-self: center; }
.tr-msg-composer { padding: 12px 18px 16px; border-top: 1px solid var(--gray-200); background: white; }
.tr-msg-composer textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--brand-line); border-radius: 10px; font: inherit; resize: vertical; min-height: 70px; }
.tr-msg-composer textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 138, 147, 0.15); }
.tr-msg-composer-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.tr-msg-note { font-size: 0.82rem; color: var(--gray-500); }
.tr-msg-checklist { max-height: 200px; overflow-y: auto; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 6px 10px; }
.tr-msg-checklist label { display: flex; gap: 8px; align-items: center; padding: 4px 0; font-weight: 400; }
.tr-msg-checklist label.disabled { color: var(--gray-400); }
/* Radios and checkboxes must not inherit the full-width text-input styling of .tr-form-group. */
.tr-form-group input[type="checkbox"], .tr-form-group input[type="radio"], .tr-msg-checklist input { width: auto; padding: 0; margin: 0; flex: none; accent-color: var(--primary); box-shadow: none; }
@media (max-width: 860px) {
    .tr-msg { grid-template-columns: 1fr; }
    .tr-msg-back { display: block; }
    .tr-msg:not(.show-thread) .tr-msg-thread-pane { display: none; }
    .tr-msg.show-thread .tr-msg-list-pane { display: none; }
    .tr-bubble { max-width: 90%; }
}
/* ---- Schedule (shared by the coach dashboard and the parent portal) ---- */
.tr-sch-day { margin: 22px 0 8px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-500); display: flex; align-items: center; gap: 8px; }
.tr-sch-day.today { color: var(--primary-dark); }
.tr-sch-day:first-child { margin-top: 6px; }
.tr-sch-event { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 14px; background: white; border: 1px solid var(--gray-200); border-left: 4px solid var(--gray-300); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 8px; }
.tr-sch-event.practice { border-left-color: var(--primary); }
.tr-sch-event.game { border-left-color: var(--accent-blue); }
.tr-sch-event.tournament { border-left-color: var(--accent-amber); }
.tr-sch-event.cancelled { background: var(--gray-50); border-left-color: #ef4444; }
.tr-sch-event.cancelled .tr-sch-title > span:first-child, .tr-sch-event.cancelled .tr-sch-time { text-decoration: line-through; color: var(--gray-500); } /* title and time only, not the badges */
.tr-sch-time { font-weight: 700; color: var(--gray-900); line-height: 1.3; font-size: 0.95rem; }
.tr-sch-time small { display: block; font-weight: 400; color: var(--gray-500); font-size: 0.78rem; }
.tr-sch-title { font-weight: 600; color: var(--gray-900); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tr-sch-meta { font-size: 0.88rem; color: var(--gray-600); margin-top: 3px; }
.tr-sch-meta a { color: var(--primary-dark); font-weight: 600; }
.tr-sch-notes { font-size: 0.85rem; color: var(--gray-500); margin-top: 4px; white-space: pre-wrap; }
.tr-sch-change { font-size: 0.82rem; margin-top: 6px; padding: 5px 9px; background: #fef3c7; color: #92400e; border-radius: 6px; display: inline-block; }
.tr-sch-cancelled-note { font-size: 0.82rem; margin-top: 6px; color: #991b1b; font-weight: 600; }
.tr-sch-actions { display: flex; flex-direction: row; gap: 6px; align-items: flex-start; white-space: nowrap; }
.tr-sch-venues { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.tr-sch-venue { background: white; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 12px 14px; }
.tr-sch-rsvp { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.tr-sch-rsvp-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tr-sch-rsvp-child { font-size: 0.82rem; color: var(--gray-500); margin-right: 2px; }
/* .tr-pill is normally just a label; these are real buttons, so they need a proper touch target
   (the default pill padding is ~20px tall, well under the ~40px minimum this app's own
   .tr-btn-sm uses) — override font-size/padding/line-height, not just add a border. */
.tr-rsvp-btn { font-size: 0.8rem; padding: 8px 14px; line-height: 1; border: 1px solid var(--gray-200); cursor: pointer; white-space: nowrap; }
.tr-rsvp-btn.tr-rsvp-active { border-color: transparent; }
@media (max-width: 640px) {
    .tr-sch-event { grid-template-columns: 1fr; gap: 6px; }
    .tr-sch-actions { flex-direction: row; align-items: center; }
}
.tr-bib-badge {
    display: inline-block;
    background: var(--primary-soft);
    border: 2px dashed var(--primary);
    border-radius: 12px;
    padding: 14px 28px;
    margin: 16px 0;
}
.tr-bib-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary-dark); font-weight: 700; }
.tr-bib-number { font-size: 2.2rem; font-weight: 800; color: var(--primary-dark); }

.tr-muted { color: var(--gray-500); font-size: 0.9rem; }

/* ============================================
   Icon circle — a colored badge for confirmation/error states (checkmark,
   warning, etc.), instead of a plain heading with no visual cue at all.
   ============================================ */
.tr-icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.tr-icon-circle svg { width: 28px; height: 28px; }
.tr-icon-circle-success { background: var(--success-bg); color: var(--success-dark); }
.tr-icon-circle-error { background: var(--error-bg); color: var(--error); }

/* ============================================
   Skeleton loading states — replaces plain "Loading..." text everywhere.
   ============================================ */
.tr-skeleton-block { padding: 4px 0; }
.tr-skeleton-line {
    height: 14px;
    border-radius: 6px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 37%, var(--gray-100) 63%);
    background-size: 400% 100%;
    animation: tr-shimmer 1.4s ease infinite;
}
.tr-skeleton-line:last-child { margin-bottom: 0; width: 70%; }
@keyframes tr-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) {
    .tr-skeleton-line { animation: none; }
}

/* ============================================
   Empty states — a small consistent icon + message instead of a bare <p>.
   ============================================ */
.tr-empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--gray-500);
}
.tr-empty-state svg { width: 40px; height: 40px; color: var(--gray-300); margin-bottom: 10px; }
.tr-empty-state p { margin: 0; font-size: 0.9rem; }

/* ============================================
   Responsive tables — a table wider than the viewport scrolls horizontally
   instead of breaking the page layout.
   ============================================ */
.tr-table-wrap { overflow-x: auto; }

/* ============================================
   Small-screen pass. The layout is already flex/rem-based so most of this is
   just tightening spacing and letting things wrap, not a rebuild.
   ============================================ */
@media (max-width: 640px) {
    .tr-header { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
    .tr-header-user { font-size: 0.85rem; gap: 10px; }
    .tr-nav { padding: 0 8px; overflow-x: auto; white-space: nowrap; }
    .tr-nav a { padding: 12px 10px; font-size: 0.85rem; }
    .tr-container { padding: 16px; }
    .tr-container-narrow { margin: 24px auto; }
    .tr-card { padding: 16px; }
    .tr-toast { max-width: calc(100vw - 32px); }
    .tr-modal { max-height: 100vh; border-radius: 0; height: 100%; }
    .tr-modal-header, .tr-modal-body, .tr-modal-footer { padding-left: 16px; padding-right: 16px; }
    .tr-form-row, .tr-choice-cards { grid-template-columns: 1fr; }
    .tr-filter-bar { grid-template-columns: 1fr; }
    .tr-card-row { align-items: flex-start; }
    .tr-stats-row { padding: 12px 16px 0; }
}

/* ============================================
   Dashboard stats row — a glanceable summary instead of jumping straight
   into a flat list (the "4-6 KPI cards" pattern every modern dashboard
   design guide converges on).
   ============================================ */
.tr-stats-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 24px 0;
}
.tr-stat-card {
    flex: 1;
    min-width: 140px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.tr-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tr-stat-icon svg { width: 20px; height: 20px; }
.tr-stat-icon-green { background: var(--success-bg); color: var(--success-dark); }
.tr-stat-icon-blue { background: var(--accent-blue-bg); color: var(--accent-blue); }
.tr-stat-icon-purple { background: var(--accent-purple-bg); color: var(--accent-purple); }
.tr-stat-icon-amber { background: var(--accent-amber-bg); color: var(--accent-amber); }
.tr-stat-value { font-size: 1.6rem; font-weight: 800; color: var(--gray-900); line-height: 1.2; }
.tr-stat-label { font-size: 0.75rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

/* A colored left accent on list-item cards ties their border to status at a glance, instead of
   every card looking identical regardless of what's inside it. */
.tr-card-accent { border-left: 4px solid var(--gray-300); }
.tr-card-accent-open { border-left-color: var(--primary); }
.tr-card-accent-closed { border-left-color: var(--gray-300); }

/* ============================================
   Team detail: coaches and roster (club-admin / coach dashboard)
   ============================================ */
.tr-team-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--gray-200); }
.tr-team-section:first-child { margin-top: 8px; }
.tr-team-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.tr-team-section-head h4 { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--gray-900); }
.tr-team-section-head h4 .tr-count { margin-left: 6px; font-weight: 600; color: var(--gray-500); }
.tr-team-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tr-team-tools select { padding: 6px 10px; border-radius: 10px; border: 1px solid var(--brand-line); background-color: white; font-size: 0.85rem; font-family: inherit; }
.tr-btn-sm { padding: 6px 12px; font-size: 0.82rem; border-radius: var(--radius-sm); }

.tr-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--gray-200); border-radius: 999px; background: var(--gray-50); font-size: 0.88rem; font-weight: 600; color: var(--gray-800); }
.tr-chip small { font-weight: 500; color: var(--gray-500); font-size: 0.78rem; }
.tr-chip-x { background: none; border: none; cursor: pointer; color: var(--gray-400); font-size: 1.1rem; line-height: 1; padding: 0 0 0 2px; }
.tr-chip-x:hover { color: #dc2626; }
.tr-assign-row { display: flex; gap: 8px; margin-top: 10px; }
.tr-assign-row select { flex: 0 1 340px; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--brand-line); background-color: white; font-family: inherit; }

.tr-roster { border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; background: white; }
.tr-roster-row { display: grid; grid-template-columns: 40px minmax(0, 1.2fr) minmax(0, 1.4fr) 190px; gap: 14px; align-items: center; padding: 12px 16px; }
.tr-roster-row + .tr-roster-row { border-top: 1px solid var(--gray-100); }
.tr-roster-row:hover { background: var(--gray-50); }
.tr-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--gray-100); color: var(--gray-700); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em; }
.tr-roster-player { min-width: 0; }
.tr-roster-name { font-weight: 700; color: var(--gray-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-roster-sub { font-size: 0.8rem; color: var(--gray-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-roster-parent { min-width: 0; font-size: 0.88rem; }
.tr-roster-parent .tr-roster-name { font-weight: 600; font-size: 0.88rem; }
.tr-roster-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; row-gap: 6px; }
/* A simple two-part row (details + actions) in a .tr-roster list. The plain .tr-roster-row is the
   four-column player roster grid (avatar / player / parent / actions); without this modifier a
   two-part row would land its details in the 40px avatar column and get cut off. */
.tr-roster-row.tr-list-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.tr-list-row .tr-roster-player { flex: 1; min-width: 0; }
.tr-list-row .tr-roster-actions { flex: 0 0 auto; }
.tr-btn-ghost-danger { background: none; border: 1px solid transparent; color: var(--gray-500); cursor: pointer; padding: 6px 10px; border-radius: var(--radius-sm); font-size: 0.82rem; font-weight: 600; font-family: inherit; }
.tr-btn-ghost-danger:hover { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.tr-roster-medical { margin-top: 2px; }
.tr-roster-medical summary { font-size: 0.8rem; color: var(--primary-dark); font-weight: 600; cursor: pointer; padding: 6px 0; }
.tr-roster-medical-body { font-size: 0.85rem; color: var(--gray-700); margin-top: 2px; padding-bottom: 4px; display: flex; flex-direction: column; gap: 3px; }

@media (max-width: 760px) {
    .tr-roster-row { grid-template-columns: 40px minmax(0, 1fr); row-gap: 8px; }
    .tr-roster-parent { grid-column: 2; }
    .tr-roster-actions { grid-column: 2; justify-content: flex-start; }
}

/* Colour pickers: a compact swatch, not a full-width bar. */
.tr-form-group input[type="color"].tr-color-input { width: 64px; height: 40px; padding: 3px; cursor: pointer; border-radius: var(--radius-sm); }

/* A row of action buttons at the end of a card or table row. */
.tr-row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
td .tr-row-actions { justify-content: flex-start; flex-wrap: nowrap; }
@media (max-width: 760px) { .tr-row-actions { justify-content: flex-start; } td .tr-row-actions { flex-wrap: wrap; } }

@media (max-width: 640px) {
    .tr-table.tr-stack thead { display: none; }
    .tr-table.tr-stack, .tr-table.tr-stack tbody { display: block; width: 100%; }
    .tr-table.tr-stack tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--gray-200); }
    .tr-table.tr-stack tbody tr:last-child { border-bottom: none; }
    .tr-table.tr-stack td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0; border: none; text-align: right; }
    .tr-table.tr-stack td:first-child { display: block; text-align: left; font-size: 1rem; padding-bottom: 6px; }
    .tr-table.tr-stack td[data-label]::before { content: attr(data-label); color: var(--gray-500); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; flex-shrink: 0; text-align: left; }
    .tr-table.tr-stack td:not([data-label]):not(:first-child) { display: block; text-align: left; padding-top: 6px; }
    .tr-table.tr-stack td .tr-cell-sub { display: block; }
    .tr-data-card .tr-table.tr-stack td { padding: 3px 0; }
    .tr-stat-label { font-size: 0.68rem; letter-spacing: 0.02em; }
    .tr-stat-card { padding: 12px 14px; }
}
.tr-row-actions .tr-btn { white-space: nowrap; }

@media (max-width: 640px) {
    /* Cells with a second line of detail (parent + email, program + season) read better as label-over-value. */
    .tr-table.tr-stack td[data-label]:has(.tr-cell-sub) { display: block; text-align: left; padding: 6px 0; }
    .tr-table.tr-stack td[data-label]:has(.tr-cell-sub)::before { display: block; margin-bottom: 2px; }
    .tr-table.tr-stack .tr-cell-sub { word-break: break-all; }
}

.tr-chip-link { background: none; border: none; cursor: pointer; color: var(--primary-dark); font-size: 0.75rem; font-weight: 600; padding: 0 2px; font-family: inherit; }
.tr-chip-link:hover { text-decoration: underline; }

/* ============================================
   Dashboard refresh: header, tabs, summary strip, section heads, list rows
   ============================================ */
.tr-header { padding: 12px 24px; box-shadow: none; border-bottom: 1px solid var(--gray-200); }
.tr-header-brand { gap: 12px; font-size: 1.05rem; font-weight: 700; }
#headerBrandLabel { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
#clubNameText { margin-left: 0 !important; font-weight: 700 !important; }
#userName[data-initials]::before { content: attr(data-initials); display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-right: 10px; border-radius: 50%; background: var(--gray-100); color: var(--gray-800); font-size: 0.75rem; font-weight: 700; vertical-align: middle; }
#userName { font-weight: 600; color: var(--gray-800); }

.tr-nav { padding: 0 24px; gap: 2px; box-shadow: none; }
.tr-nav a { padding: 14px 14px 12px; border-radius: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; color: var(--gray-500); }
.tr-nav a:hover { background: none; color: var(--gray-900); border-bottom-color: var(--gray-300); }
.tr-nav a.active { background: none; color: var(--primary-dark); border-bottom-color: var(--primary); }
.tr-nav a.active .tr-nav-badge { background: #ef4444; color: white; }

/* One summary strip instead of four separate tiles. */
.tr-stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; padding: 0; margin: 20px 24px 0; background: white; border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.tr-page-wide .tr-stats-row { margin: 20px auto 0; width: calc(100% - 48px); max-width: 1312px; }
.tr-stats-row .tr-stat-card { min-width: 0; border: none; border-radius: 0; box-shadow: none; padding: 14px 18px; border-right: 1px solid var(--gray-100); background: transparent; }
.tr-stats-row .tr-stat-card:last-child { border-right: none; }
.tr-stats-row .tr-stat-card[role="button"]:hover { background: var(--gray-50); }
.tr-stats-row .tr-stat-icon { width: 36px; height: 36px; }
.tr-stats-row .tr-stat-value { font-size: 1.4rem; }

.tr-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.tr-section-head h2 { margin: 0; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; color: var(--gray-900); }
.tr-section-head p { margin: 4px 0 0; color: var(--gray-500); font-size: 0.9rem; max-width: 70ch; line-height: 1.5; }
.tr-section-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.tr-card-accent { padding: 16px 20px; margin-bottom: 12px; }
.tr-card-accent:hover { box-shadow: var(--shadow-md); }
.tr-item-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.tr-item-main { min-width: 0; flex: 1 1 280px; }
.tr-item-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: 1.02rem; color: var(--gray-900); }
.tr-item-meta { margin-top: 3px; font-size: 0.85rem; color: var(--gray-500); }
.tr-meter { height: 6px; max-width: 280px; margin-top: 10px; background: var(--gray-100); border-radius: 999px; overflow: hidden; }
.tr-meter > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.tr-meter.full > span { background: #f59e0b; }

@media (max-width: 640px) {
    .tr-header { padding: 10px 16px; }
    .tr-nav { padding: 0 8px; }
    .tr-nav a { padding: 12px 10px 10px; font-size: 0.85rem; }
    .tr-stats-row, .tr-page-wide .tr-stats-row { margin: 14px 16px 0; width: auto; grid-template-columns: 1fr 1fr; }
    .tr-stats-row .tr-stat-card { border-bottom: 1px solid var(--gray-100); }
    .tr-section-head h2 { font-size: 1.2rem; }
}

/* ============================================
   Dropdowns: one consistent look, with room for the arrow (the browser default crowds and clips it)
   ============================================ */
select {
    -webkit-appearance: none; appearance: none;
    padding: 9px 36px 9px 12px;
    line-height: 1.3;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background-color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    font-family: inherit; font-size: 0.92rem; color: var(--gray-900);
    cursor: pointer;
    text-overflow: ellipsis;
}
select:hover { border-color: var(--gray-400); }
select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 138, 147, 0.15); }
select:disabled { background-color: var(--gray-50); cursor: not-allowed; }

/* ============================================
   Team window: coaches and roster
   ============================================ */
.tr-modal-lg { max-width: 800px; }
.tr-detail-block + .tr-detail-block { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--gray-200); }
.tr-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tr-detail-head h4 { margin: 0; font-size: 1rem; font-weight: 800; color: var(--gray-900); }
.tr-detail-head h4 .tr-count { margin-left: 8px; font-weight: 600; color: var(--gray-500); font-size: 0.9rem; }

.tr-coach-list { border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.tr-coach-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.tr-coach-row + .tr-coach-row { border-top: 1px solid var(--gray-100); }
.tr-coach-info { flex: 1; min-width: 0; }
.tr-select-inline { padding: 7px 34px 7px 12px; font-size: 0.85rem; font-weight: 600; flex: 0 0 auto; }
.tr-dd.tr-select-inline { padding: 0; flex: 0 0 auto; }
.tr-select-inline .tr-dd-btn { padding: 7px 12px; font-size: 0.85rem; font-weight: 600; }

.tr-add-coach { margin-top: 16px; padding: 14px 16px; background: var(--gray-50); border: 1px dashed var(--gray-300); border-radius: var(--radius); }
.tr-add-coach label { display: block; margin-bottom: 8px; font-size: 0.82rem; font-weight: 700; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.04em; }
.tr-add-coach-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tr-add-coach-row select:first-child { flex: 1 1 220px; min-width: 0; }
.tr-add-coach-row select:nth-child(2) { flex: 0 0 auto; }

.tr-team-tools select { padding: 7px 34px 7px 12px; font-size: 0.85rem; }

@media (max-width: 640px) {
    .tr-coach-row { flex-wrap: wrap; }
    .tr-coach-info { flex: 1 1 60%; }
}
select { padding-right: 36px !important; }
.tr-form-group select:disabled { background-color: var(--gray-100); }

/* Some older rules set `background: white` on selects, which wipes the arrow; put it back everywhere. */
select:not([multiple]):not([data-plain]):not([size]) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
}

/* ============================================
   Team page (replaces the small window): roster gets the room, coaches sit alongside
   ============================================ */
.tr-back-link { display: inline-block; margin-bottom: 10px; font-size: 0.88rem; font-weight: 600; color: var(--gray-500); text-decoration: none; }
.tr-back-link:hover { color: var(--primary-dark); }
.tr-team-page { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.tr-team-side { position: sticky; top: 16px; }
.tr-team-card { padding: 20px; margin-bottom: 0; }
.tr-team-card .tr-roster { border: none; border-radius: 0; margin: 0 -20px -20px; border-top: 1px solid var(--gray-100); }
.tr-team-card .tr-roster-row { padding-left: 20px; padding-right: 20px; }
.tr-team-card .tr-empty-state { padding: 28px 8px; }
.tr-search { width: 220px; max-width: 100%; padding: 7px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); font: inherit; font-size: 0.85rem; background: white; }
.tr-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 138, 147, 0.15); }
.tr-team-side .tr-coach-list { border: none; border-radius: 0; margin: 0 -20px; }
.tr-team-side .tr-coach-row { flex-wrap: wrap; padding: 12px 20px; }
.tr-team-side .tr-coach-row + .tr-coach-row { border-top: 1px solid var(--gray-100); }
.tr-coach-controls { flex: 1 1 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-left: 54px; }
.tr-team-side .tr-add-coach { margin: 16px 0 0; }
.tr-team-side .tr-add-coach > select { width: 100%; margin-bottom: 8px; }
.tr-team-side .tr-add-coach-row { display: flex; gap: 8px; }
.tr-team-side .tr-add-coach-row select { flex: 1 1 auto; min-width: 0; }

@media (max-width: 960px) {
    .tr-team-page { grid-template-columns: 1fr; }
    .tr-team-side { position: static; order: -1; }
}
@media (max-width: 640px) {
    .tr-team-card { padding: 16px; }
    .tr-team-card .tr-roster { margin: 0 -16px -16px; }
    .tr-team-card .tr-roster-row { padding-left: 16px; padding-right: 16px; }
    .tr-team-side .tr-coach-list { margin: 0 -16px; }
    .tr-team-side .tr-coach-row { padding: 12px 16px; }
    .tr-search { width: 100%; }
}

/* ============================================
   Brand alignment with the public website (styles/site.css): Inter text, Manrope headings, warm
   light page background and the near-black header, so the site and the app feel like one product.
   ============================================ */
:root {
    --brand-ink: #10191b;
    --brand-cream: #f5f8f8;
    --brand-heading: 'Manrope', 'Inter', system-ui, sans-serif;
    --brand-line: #e0e8e9;
    --brand-shadow: 0 1px 2px rgba(16, 25, 27, 0.06), 0 10px 28px rgba(16, 25, 27, 0.14);
    --brand-shadow-lg: 0 2px 4px rgba(16, 25, 27, 0.08), 0 24px 56px rgba(16, 25, 27, 0.22);
}
body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--brand-cream); }
h1, h2, h3, .tr-section-head h2, .tr-modal-header h3, .tr-home-card h3, .tr-home-next-title { font-family: var(--brand-heading); letter-spacing: -0.025em; }

.tr-header { background: var(--brand-ink); border-bottom-color: rgba(255, 255, 255, 0.08); color: #fff; }
.tr-header-brand, #clubNameText, #portalBrand { color: #fff; }
.tr-header-brand { font-family: var(--brand-heading); }
#headerBrandLabel { background: rgba(14, 138, 147, 0.28); color: #a5e3e7; }
#userName { color: #e8e8ee; }
#userName[data-initials]::before { background: rgba(255, 255, 255, 0.12); color: #fff; }
.tr-header .tr-btn-secondary { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.28); }
.tr-header .tr-btn-secondary:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.5); }
.tr-header select { background-color: #fff; }
.tr-club-crest { border-color: rgba(255, 255, 255, 0.15); }

/* Sign-in / account pages (login, forgot-password, request-account, etc.): a split layout,
   brand imagery/copy on the left (same visual language as the marketing home page, reusing its
   .brand/.eyebrow/.laptop classes from styles/site.css), the form on the right. Below 900px the
   visual panel drops out entirely so the form is the whole screen — these pages are short, so
   there's no scrolling either way. */
.tr-auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.tr-auth-visual { background: var(--brand-ink); color: #fff; padding: 48px; display: flex; flex-direction: column; }
.tr-auth-visual .brand { margin-bottom: auto; }
.tr-auth-visual-copy { max-width: 420px; margin: 40px 0 32px; }
.tr-auth-visual-copy .eyebrow { color: #7fd3d9; }
.tr-auth-visual-copy h1 { font-family: var(--brand-heading); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -0.02em; margin: 14px 0 12px; }
.tr-auth-visual-copy p { color: #a9a9b6; font-size: 1.02rem; line-height: 1.55; margin: 0; }
.tr-auth-visual .laptop { max-width: 440px; }
.tr-auth-form-side { background: var(--brand-cream); display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.tr-auth-form-side .tr-container-narrow { margin: 0; max-width: 400px; width: 100%; }
.tr-auth-form-side .tr-card { padding: 28px; border-radius: 14px; border-color: var(--line, #e7e7ec); box-shadow: 0 1px 2px rgba(16, 25, 27, 0.06), 0 8px 24px rgba(16, 25, 27, 0.06); }
.tr-auth-form-side .tr-card h2 { font-family: var(--brand-heading); text-align: center; font-size: 1.45rem; margin-bottom: 20px; }
.tr-auth-form-side .tr-btn-primary { padding: 12px 18px; border-radius: 10px; }
@media (max-width: 900px) {
    .tr-auth-shell { grid-template-columns: 1fr; }
    .tr-auth-visual { display: none; }
}

/* ============================================
   Brand alignment, part 2: popup modals and dropdowns were still the original (pre-rebrand)
   ScoutLocal look — flat white sheets and a bare browser select — while everything above here
   (header, auth pages) had already moved to the warmer, rounder Clubzilla look. These overrides
   bring modals/toasts and every <select>/form field in line with that same language: warmer
   off-white borders (--brand-line) instead of cool grays, a softer/deeper shadow (--brand-shadow),
   a bit more corner radius, and a select arrow that picks up the brand green on hover/focus
   instead of staying inert gray.
   ============================================ */
.tr-toast-overlay { background: rgba(16, 25, 27, 0.55); }

.tr-toast, .tr-modal {
    border-radius: 18px;
    border: 1px solid var(--brand-line);
    box-shadow: var(--brand-shadow-lg);
}
.tr-modal-header { padding: 22px 26px 18px; border-bottom-color: var(--brand-line); }
.tr-modal-close { border-radius: 8px; transition: color var(--transition), background var(--transition); }
.tr-modal-close:hover { color: var(--primary-dark); background: var(--primary-soft); }
.tr-modal-body { padding: 22px 26px; }
.tr-modal-footer {
    padding: 16px 26px;
    border-top-color: var(--brand-line);
    background: var(--brand-cream);
    border-radius: 0 0 18px 18px;
}
@media (max-width: 640px) {
    .tr-modal { border-radius: 0; border: none; }
    .tr-modal-footer { border-radius: 0; }
}

/* Dropdowns: warmer border, a touch more room, and an arrow that turns brand-green on hover/focus
   instead of sitting there inert — the detail that made every <select> read as "just a browser
   default" rather than a designed control. */
select {
    padding: 10px 38px 10px 13px;
    border-color: var(--brand-line);
    border-radius: 10px;
    font-weight: 500;
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}
/* Specificity note: an earlier rule, select:not([multiple]):not([data-plain]):not([size]), sets
   the default arrow and outranks a plain `select:hover`/`select:focus` — so the hover/focus arrow
   has to repeat the same :not() chain to actually win and show the green arrow. */
select:not([multiple]):not([data-plain]):not([size]):hover:not(:disabled),
select:not([multiple]):not([data-plain]):not([size]):focus {
    border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
select:focus { box-shadow: 0 0 0 3px rgba(14, 138, 147, 0.18); }
select:disabled { border-color: var(--gray-200); }

.tr-form-group input,
.tr-form-group select,
.tr-form-group textarea {
    padding: 11px 14px;
    border-color: var(--brand-line);
    border-radius: 10px;
}
.tr-form-group input:focus,
.tr-form-group textarea:focus {
    box-shadow: 0 0 0 3px rgba(14, 138, 147, 0.18);
}
.tr-filter-bar input, .tr-filter-bar select {
    border-color: var(--brand-line);
    border-radius: 10px;
}
.tr-filter-bar { border-color: var(--brand-line); box-shadow: var(--brand-shadow); }
.tr-search { border-color: var(--brand-line); border-radius: 10px; }

/* ============================================
   Custom dropdown (public/js/custom-select.js): a native <select>'s open list is OS-drawn and
   can't be styled at all, which is the real reason dropdowns kept looking "basic" no matter how
   much the closed box was polished. This is the fully brand-styled replacement UI; the <select>
   itself stays in the DOM (display:none) as the real source of truth.
   ============================================ */
.tr-dd { display: inline-block; max-width: 100%; }
/* A few existing call sites set `select.style.display` directly as part of their own show/hide
   logic (e.g. the header's club picker, toggled between a single club's plain text and this
   select). That inline style would otherwise peek back out from behind the custom button whenever
   that code runs after enhancement — !important here is deliberate and narrow: it only ever
   targets a <select> already living inside a .tr-dd wrapper, which by construction (see
   custom-select.js) is never meant to be visible. */
.tr-dd > select { display: none !important; }
.tr-dd-btn {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; min-width: 0;
    padding: 10px 13px;
    border: 1px solid var(--brand-line);
    border-radius: 10px;
    background: white;
    font: 500 0.92rem/1.3 inherit;
    color: var(--gray-900);
    text-align: left;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.tr-dd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-dd-btn.tr-dd-placeholder .tr-dd-label { color: var(--gray-500); }
.tr-dd-arrow { flex: none; color: var(--gray-500); transition: transform var(--transition), color var(--transition); }
.tr-dd-btn:hover:not(:disabled) { border-color: var(--primary); }
.tr-dd-btn:hover:not(:disabled) .tr-dd-arrow { color: var(--primary-dark); }
.tr-dd-btn:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 138, 147, 0.18); }
.tr-dd-btn[aria-expanded="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 138, 147, 0.18); }
.tr-dd-btn[aria-expanded="true"] .tr-dd-arrow { color: var(--primary-dark); transform: rotate(180deg); }
.tr-dd-btn:disabled { background: var(--gray-50); color: var(--gray-400); cursor: not-allowed; border-color: var(--gray-200); }
.tr-dd-btn:disabled .tr-dd-arrow { color: var(--gray-300); }

/* Portalled straight onto <body> (position: fixed, viewport coordinates from getBoundingClientRect)
   so it always escapes a modal's overflow:auto clipping and sits above the modal's own z-index. */
.tr-dd-panel {
    position: fixed;
    z-index: 2000;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: white;
    border: 1px solid var(--brand-line);
    border-radius: 12px;
    box-shadow: var(--brand-shadow-lg);
    overflow-y: auto;
    animation: tr-dd-in 120ms ease;
}
@keyframes tr-dd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tr-dd-panel { animation: none; } }
.tr-dd-option {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 0.92rem;
    color: var(--gray-800);
    cursor: pointer;
}
.tr-dd-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-dd-option.tr-dd-highlighted { background: var(--primary-soft); color: var(--primary-dark); }
.tr-dd-option.tr-dd-selected { font-weight: 700; }
.tr-dd-check { flex: none; color: var(--primary-dark); }
.tr-dd-option.tr-dd-disabled { color: var(--gray-400); cursor: not-allowed; }

/* The finite set of places a <select>'s own width/flex sizing mattered for layout — now that the
   select itself is display:none, its wrapper (.tr-dd) needs that same sizing instead. Everything
   else about these dropdowns (border/padding/color) comes from .tr-dd-btn above, so only the
   layout-affecting declarations need to be repeated here. */
.tr-form-group .tr-dd { width: 100%; }
.tr-filter-bar .tr-dd { width: 100%; }
.tr-add-coach-row .tr-dd:first-child { flex: 1 1 220px; min-width: 0; }
.tr-add-coach-row .tr-dd:nth-child(2) { flex: 0 0 auto; }
.tr-team-side .tr-add-coach > .tr-dd { width: 100%; margin-bottom: 8px; }
.tr-team-side .tr-add-coach-row .tr-dd { flex: 1 1 auto; min-width: 0; }
.tr-assign-row .tr-dd { flex: 0 1 340px; min-width: 0; }

/* ---- Coach drill library (dashboard "My Drills" tab + public shared-plan.html) ---- */
.tr-drill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tr-drill-card { margin-bottom: 0; display: flex; flex-direction: column; gap: 10px; }
.tr-drill-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tr-drill-title { font-weight: 700; color: var(--gray-900); display: flex; align-items: center; gap: 6px; }
.tr-drill-play { display: inline-flex; color: var(--primary-dark); }
.tr-drill-video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--gray-100); border-radius: var(--radius-sm); overflow: hidden; }
.tr-drill-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tr-drill-fallback { margin: 0; font-size: 0.85rem; }
.tr-drill-text { white-space: pre-wrap; word-wrap: break-word; color: var(--gray-800); background: var(--gray-50); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 0.92rem; }
.tr-drill-notes { margin: 0; color: var(--gray-600); font-size: 0.88rem; white-space: pre-wrap; }
.tr-drill-actions { display: flex; gap: 8px; margin-top: auto; }
.tr-danger-zone { border-color: var(--error-border); }
.tr-danger-zone h3 { color: #991b1b; }
.tr-shared-drill { margin-bottom: 16px; }
.tr-shared-drill-num { color: var(--gray-400); font-weight: 700; margin-right: 6px; }
.tr-shared-drill-note { margin: 0; font-size: 0.88rem; color: var(--accent-blue); font-weight: 600; }
@media (max-width: 640px) {
    .tr-drill-grid { grid-template-columns: 1fr; }
}

/* ---- Coach library: tags, sharing with coaches ---- */
.tr-tag-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tr-tag-chip { border: 1px solid var(--gray-300); background: white; color: var(--gray-700); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.tr-tag-chip:hover { border-color: var(--gray-400); background: var(--gray-50); }
.tr-tag-chip.on { background: var(--primary); border-color: var(--primary); color: white; }
.tr-tag-chip.static { cursor: default; background: var(--gray-100); border-color: transparent; color: var(--gray-600); padding: 2px 10px; font-size: 0.75rem; }
.tr-drill-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tr-drill-shared { margin: 0; font-size: 0.8rem; }
.tr-people-list { display: grid; gap: 2px; max-height: 50vh; overflow-y: auto; }
.tr-people-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 4px; border-radius: var(--radius-sm); font-weight: 400; cursor: pointer; }
.tr-people-row:hover { background: var(--gray-50); }
.tr-people-row input { margin-top: 3px; }
.tr-share-section { padding-bottom: 16px; margin-bottom: 4px; border-bottom: 1px solid var(--gray-200); }

/* ---- Training plan editor: the session on the left, the library panel on the right ---- */
.tr-modal.tr-plan-editor { max-width: 1040px; height: 88vh; }
.tr-plan-editor-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 0; padding: 0; overflow: hidden; flex: 1; min-height: 0; }
.tr-plan-editor-main { padding: 22px 26px; overflow-y: auto; }
.tr-plan-editor-library { padding: 22px 22px; overflow-y: auto; background: var(--brand-cream, var(--gray-50)); border-left: 1px solid var(--brand-line, var(--gray-200)); display: flex; flex-direction: column; gap: 12px; }
.tr-plan-editor-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 6px 0 10px; }
.tr-plan-editor-heading h4 { margin: 0; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gray-500); }
.tr-plan-editor-heading .tr-muted { font-size: 0.82rem; }
.tr-plan-editor-library .tr-plan-editor-heading { margin-top: 0; margin-bottom: 0; }

.tr-plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tr-plan-card { display: flex; align-items: flex-start; gap: 12px; padding: 12px; background: white; border: 1px solid var(--brand-line, var(--gray-200)); border-radius: 14px; box-shadow: var(--shadow-sm); transition: border-color var(--transition), box-shadow var(--transition); }
.tr-plan-card:hover { border-color: var(--gray-300); box-shadow: var(--shadow-md); }
.tr-plan-card.flash { animation: tr-plan-flash 1.4s ease-out; }
@keyframes tr-plan-flash { 0%, 30% { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); } 100% { border-color: var(--brand-line, var(--gray-200)); box-shadow: var(--shadow-sm); } }
.tr-plan-num { flex: 0 0 26px; height: 26px; margin-top: 15px; border-radius: 50%; background: var(--primary); color: white; font-weight: 700; font-size: 0.8rem; display: inline-flex; align-items: center; justify-content: center; }

.tr-plan-thumb { position: relative; flex: 0 0 auto; width: 84px; height: 56px; border-radius: 9px; overflow: hidden; background: var(--gray-800); color: white; display: inline-flex; align-items: center; justify-content: center; }
.tr-plan-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tr-plan-thumb i { position: absolute; inset: auto 6px 6px auto; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, 0.6); display: inline-flex; align-items: center; justify-content: center; font-style: normal; }
.tr-plan-thumb i svg { width: 12px; height: 12px; }
.tr-plan-thumb.video { background: linear-gradient(135deg, #1e3a8a, #3b82f6); }
.tr-plan-thumb.written { background: var(--primary-soft); color: var(--primary-dark); }

.tr-plan-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tr-plan-card-title { font-weight: 700; color: var(--gray-900); line-height: 1.3; overflow-wrap: anywhere; }
.tr-plan-card-type { font-size: 0.8rem; color: var(--gray-500); }
.tr-plan-in { color: var(--primary-dark); font-weight: 600; }
.tr-plan-note { margin-top: 8px; width: 100%; padding: 7px 10px; font-size: 0.88rem; border: 1px dashed var(--gray-300); border-radius: 8px; background: var(--gray-50); }
.tr-plan-note:focus { border-style: solid; background: white; }
.tr-plan-card-actions { display: flex; flex-direction: column; gap: 2px; flex: 0 0 auto; }

.tr-icon-btn { width: 32px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--gray-500); border-radius: 8px; cursor: pointer; transition: background var(--transition), color var(--transition); }
.tr-icon-btn:hover:not(:disabled) { background: var(--gray-100); color: var(--gray-900); }
.tr-icon-btn.danger:hover:not(:disabled) { background: var(--error-bg); color: var(--error); }
.tr-icon-btn:disabled { opacity: 0.3; cursor: default; }

.tr-plan-empty { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; padding: 32px 20px; border: 2px dashed var(--gray-300); border-radius: 14px; color: var(--gray-500); background: var(--gray-50); }
.tr-plan-empty strong { color: var(--gray-800); }

.tr-plan-lib-search { width: 100%; }
.tr-plan-lib-tags { margin-bottom: 0; }
.tr-plan-lib-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tr-plan-lib-item { display: flex; align-items: center; gap: 10px; padding: 8px; background: white; border: 1px solid var(--brand-line, var(--gray-200)); border-radius: 12px; }
.tr-plan-lib-item .tr-plan-thumb { width: 64px; height: 44px; border-radius: 7px; }
.tr-plan-add { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.tr-plan-lib-empty { margin: 8px 0; text-align: center; }

@media (max-width: 860px) {
    .tr-modal.tr-plan-editor { height: 100%; }
    .tr-plan-editor-body { display: block; overflow-y: auto; }
    .tr-plan-editor-main { overflow: visible; padding: 16px; }
    .tr-plan-editor-library { overflow: visible; border-left: none; border-top: 1px solid var(--brand-line, var(--gray-200)); padding: 16px; }
}
@media (max-width: 480px) {
    .tr-plan-card .tr-plan-thumb { display: none; }
    .tr-plan-num { margin-top: 2px; }
}

@media (max-width: 640px) {
    .tr-roster-row.tr-list-row { flex-wrap: wrap; }
    .tr-list-row .tr-roster-actions { width: 100%; justify-content: flex-start; }
}

/* A required styled dropdown left empty (custom-select.js 'invalid' handler). */
.tr-dd-invalid .tr-dd-btn { border-color: var(--error) !important; box-shadow: 0 0 0 3px var(--error-bg) !important; }
.tr-dd-error { margin: 6px 0 0; font-size: 0.82rem; color: var(--error); font-weight: 500; }

/* Club invite waiting for the signed-in coach / admin (js/club-invites.js) */
.tr-invite-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; margin-bottom: 16px;
    background: var(--primary-soft); border: 1px solid var(--primary-border); border-radius: var(--radius, 12px); }
.tr-invite-banner .tr-btn { flex-shrink: 0; }
@media (max-width: 600px) { .tr-invite-banner { flex-direction: column; align-items: stretch; } }
