/* Global app styles consolidated from inline route/component CSS */
.site-wide-footer {
    padding: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: #64748b;
}

.site-wide-footer a {
    color: #325a96;
    text-decoration: none;
}

/* Manager tab styles (moved from components.py) */
.manager-tab-nav {
    display: flex;
    border-bottom: 2px solid var(--pico-primary);
    margin-bottom: 1.5rem;
    gap: 0.25rem;
    overflow-x: auto;
}

.manager-tab-nav input[type="radio"] {
    display: none;
}

.manager-tab-nav .tab-label {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: 0.375rem 0.375rem 0 0;
    background: var(--pico-card-background-color);
    color: var(--pico-muted-color);
    transition: all 0.2s ease;
    border: 1px solid transparent;
    border-bottom: none;
    margin-bottom: -2px;
    white-space: nowrap;
    font-weight: 500;
}

.manager-tab-nav .tab-label:hover {
    background: var(--pico-secondary-background);
    color: var(--pico-color);
}

.manager-tab-nav input:checked + .tab-label {
    background: var(--pico-background-color);
    color: var(--pico-primary);
    border-color: var(--pico-primary);
    border-bottom: 2px solid var(--pico-background-color);
}

.tab-content {
    min-height: 200px;
}

.tab-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    color: var(--pico-muted-color);
}

.htmx-request .tab-loading-indicator {
    display: block;
}

.htmx-request .tab-content-inner {
    opacity: 0.5;
}

@media (max-width: 768px) {
    .manager-tab-nav .tab-label {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* Programmes page styles (moved from routes/programmes.py) */
.programmes-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    text-align: center;
}
.programmes-header h1 { margin: 0; color: white; }
.programmes-filters {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.programmes-filters select {
    min-width: 200px;
}
.filter-nav {
    display: flex;
    gap: 0.5rem;
}
.filter-nav .button {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}
.programme-meta {
    font-size: 0.85rem;
    color: var(--pico-muted-color);
    margin-bottom: 0.5rem;
}
.programmes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.programme-card {
    background: var(--pico-card-background-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}
.programme-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.programme-image-container {
    position: relative;
    width: 100%;
    padding-top: 140%; /* Aspect ratio for programme covers */
    background: #f0f0f0;
    overflow: hidden;
}
.programme-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.programme-details {
    padding: 1rem;
}
.programme-season {
    font-size: 0.85rem;
    color: var(--pico-muted-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.programme-opposition {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}
.programme-opposition img {
    height: 24px;
    width: auto;
}
.programme-score {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--pico-primary);
    margin-bottom: 0.5rem;
}
.programme-venue {
    font-size: 0.9rem;
    color: var(--pico-muted-color);
    margin-bottom: 0.5rem;
}
.programme-scorers {
    font-size: 0.85rem;
    color: var(--pico-muted-color);
    font-style: italic;
    margin-bottom: 0.5rem;
}
.programme-attendance {
    font-size: 0.85rem;
    color: var(--pico-muted-color);
}
.programme-link {
    display: block;
    margin-top: 0.75rem;
    text-align: center;
}
.outcome-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}
.outcome-W { background: #22c55e; color: white; }
.outcome-D { background: #f59e0b; color: white; }
.outcome-L { background: #ef4444; color: white; }

/* Match page styles (moved from routes/matches.py) */
.match-page {
    --trfc-navy: #004494;
    --trfc-green1: #00874e;
    --trfc-green2: #215433;
    --trfc-maroon: #731d2a;
    --trfc-awayblue2: #4f7cd8;
}

.match-shell-card {
    border: 1px solid #dbe6f4;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.match-tab-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1f2937 !important;
    font-weight: 500;
}

.match-tab-btn:hover {
    border-color: var(--trfc-navy);
    color: var(--trfc-navy) !important;
}

.match-tab-btn.is-active {
    border-color: var(--trfc-awayblue2);
    background: var(--trfc-awayblue2);
    color: #ffffff !important;
    box-shadow: 0 8px 22px rgba(79, 124, 216, 0.28);
}

#match-workspace table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #dbe6f4;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

#match-workspace thead th {
    background: linear-gradient(90deg, #eef4ff, #f5f9ff);
    color: #27426b;
    font-size: 0.82rem;
    font-weight: 300;
    border: 0;
    border-bottom: 1px solid #d4e3f9;
}

#match-workspace tbody td {
    border-bottom: 1px solid #e6eef9;
    font-weight: 300;
    color: #243145;
}

#match-workspace tbody tr:nth-child(even) td {
    background: #fcfdff;
}

#match-workspace tbody tr:hover td {
    background: #f3f8ff;
}

#match-workspace a {
    color: #325a96;
    font-weight: 300;
}

#match-workspace tbody tr.league-line-auto td {
    border-bottom: 2px solid #1f6fdb !important;
}

#match-workspace tbody tr.league-line-playoff td {
    border-bottom: 2px solid #1b9f5c !important;
}

#match-workspace tbody tr.league-line-relegation td {
    border-top: 2px solid #c2410c !important;
}

/* On This Day styles (moved from routes/on_this_day.py) */
.on-this-day-page {
    --trfc-navy: #004494;
    --trfc-green1: #00874e;
    --trfc-green2: #215433;
    --trfc-maroon: #731d2a;
    --trfc-awayblue1: #6e8fe8;
    --trfc-awayblue2: #4f7cd8;
}

.on-this-day-shell-card {
    border: 1px solid #dbe6f4;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.on-this-day-section-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1f2937 !important;
    font-weight: 500;
}

.on-this-day-section-btn:hover {
    border-color: var(--trfc-navy);
    color: var(--trfc-navy) !important;
}

.on-this-day-section-btn.is-active {
    border-color: var(--trfc-awayblue2);
    background: var(--trfc-awayblue2);
    color: #ffffff !important;
    box-shadow: 0 8px 22px rgba(79, 124, 216, 0.28);
}

#on-this-day-workspace table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #dbe6f4;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

#on-this-day-workspace thead th {
    background: linear-gradient(90deg, #eef4ff, #f5f9ff);
    color: #27426b;
    text-transform: none;
    letter-spacing: 0.01em;
    font-size: 0.82rem;
    font-weight: 300;
    border: 0;
    border-bottom: 1px solid #d4e3f9;
}

#on-this-day-workspace tbody td {
    border-bottom: 1px solid #e6eef9;
    font-weight: 300;
    color: #243145;
}

#on-this-day-workspace tbody tr:nth-child(even) td {
    background: #fcfdff;
}

#on-this-day-workspace tbody tr:hover td {
    background: #f3f8ff;
}

#on-this-day-workspace a {
    color: #325a96;
    font-weight: 300;
}

/* Opponent page styles (moved from routes/opponents.py) */
.opponent-page {
    --trfc-navy: #004494;
    --trfc-green1: #00874e;
    --trfc-green2: #215433;
    --trfc-maroon: #731d2a;
    --trfc-awayblue1: #6e8fe8;
    --trfc-awayblue2: #4f7cd8;
}

.opponent-tab-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1f2937 !important;
    font-weight: 500;
}

.opponent-tab-btn:hover {
    border-color: var(--trfc-navy);
    color: var(--trfc-navy) !important;
}

.opponent-tab-btn.is-active {
    border-color: var(--trfc-awayblue2);
    background: var(--trfc-awayblue2);
    color: #ffffff !important;
    box-shadow: 0 8px 22px rgba(79, 124, 216, 0.28);
}

.opponent-shell-card {
    border: 1px solid #dbe6f4;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

#opponent-workspace table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #dbe6f4;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

#opponent-workspace thead th {
    background: linear-gradient(90deg, #eef4ff, #f5f9ff);
    color: #27426b;
    text-transform: none;
    letter-spacing: 0.01em;
    font-size: 0.82rem;
    font-weight: 300;
    border: 0;
    border-bottom: 1px solid #d4e3f9;
}

#opponent-workspace tbody td {
    border-bottom: 1px solid #e6eef9;
    font-weight: 300;
    color: #243145;
}

#opponent-workspace tbody tr:nth-child(even) td {
    background: #fcfdff;
}

#opponent-workspace tbody tr:hover td {
    background: #f3f8ff;
}

#opponent-workspace a {
    color: #325a96;
    font-weight: 300;
}

#opponent-workspace .button:not(.expand-toggle-btn),
#opponent-workspace button:not(.expand-toggle-btn),
#opponent-workspace input[type='submit'] {
    border-radius: 10px;
    border: 1px solid var(--trfc-awayblue2);
    background: var(--trfc-awayblue2);
    color: #ffffff;
    font-weight: 400;
}

#opponent-workspace .button:not(.expand-toggle-btn):hover,
#opponent-workspace button:not(.expand-toggle-btn):hover,
#opponent-workspace input[type='submit']:hover {
    background: var(--trfc-awayblue1);
    border-color: var(--trfc-awayblue1);
}

/* Manager page styles (moved from routes/managers.py) */
.manager-page {
    --trfc-navy: #004494;
    --trfc-green1: #00874e;
    --trfc-green2: #215433;
    --trfc-maroon: #731d2a;
    --trfc-awayblue1: #6e8fe8;
    --trfc-awayblue2: #4f7cd8;
}

.manager-tab-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1f2937 !important;
    font-weight: 500;
}

.manager-tab-btn:hover {
    border-color: var(--trfc-navy);
    color: var(--trfc-navy) !important;
}

.manager-tab-btn.is-active {
    border-color: var(--trfc-awayblue2);
    background: var(--trfc-awayblue2);
    color: #ffffff !important;
    box-shadow: 0 8px 22px rgba(79, 124, 216, 0.28);
}

.manager-shell-card {
    border: 1px solid #dbe6f4;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.manager-info-grid {
    border: 1px solid #dbe6f4;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.manager-info-grid table {
    width: 100%;
    margin: 0;
}

.manager-info-grid table td {
    padding: 0.8rem 0.6rem;
    font-weight: 300;
    color: #243145;
}

.manager-info-grid table td:first-child {
    color: var(--trfc-navy);
    font-weight: 500;
    width: 34%;
}

.manager-info-grid table th {
    font-weight: 300;
    color: #27426b;
}

.manager-info-grid strong {
    font-weight: 500;
}

#manager-workspace table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #dbe6f4;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

#manager-workspace thead th {
    background: linear-gradient(90deg, #eef4ff, #f5f9ff);
    color: #27426b;
    text-transform: none;
    letter-spacing: 0.01em;
    font-size: 0.82rem;
    font-weight: 300;
    border: 0;
    border-bottom: 1px solid #d4e3f9;
}

#manager-workspace tbody td {
    border-bottom: 1px solid #e6eef9;
    font-weight: 300;
    color: #243145;
}

#manager-workspace td strong,
#manager-workspace th strong {
    font-weight: 400;
}

#manager-workspace tbody tr:nth-child(even) td {
    background: #fcfdff;
}

#manager-workspace tbody tr:hover td {
    background: #f3f8ff;
}

#manager-workspace a {
    color: #325a96;
    font-weight: 300;
}

#manager-workspace input[type='search'],
#manager-workspace input[type='text'],
#manager-workspace input[type='number'],
#manager-workspace select {
    border: 1px solid #bfd1eb;
    border-radius: 10px;
    background: #ffffff;
    font-weight: 300;
    min-height: 40px;
    padding: 0.45rem 0.7rem;
}

#manager-workspace .button:not(.expand-toggle-btn),
#manager-workspace button:not(.expand-toggle-btn),
#manager-workspace input[type='submit'] {
    border-radius: 10px;
    border: 1px solid var(--trfc-awayblue2);
    background: var(--trfc-awayblue2);
    color: #ffffff;
    font-weight: 400;
}

#manager-workspace .button:not(.expand-toggle-btn):hover,
#manager-workspace button:not(.expand-toggle-btn):hover,
#manager-workspace input[type='submit']:hover {
    background: var(--trfc-awayblue1);
    border-color: var(--trfc-awayblue1);
}

#manager-workspace [id$='-filters'] {
    margin-bottom: 0.8rem;
}

.manager-filter-shell {
    position: relative;
}

.manager-filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.manager-filter-search {
    flex: 1 1 280px;
}

#manager-workspace .manager-filter-toggle {
    border-radius: 999px;
    border: 1px solid #bcd2f2;
    background: #ffffff;
    color: #2c4f7b;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.42rem 0.9rem;
    min-height: 38px;
}

#manager-workspace .manager-filter-toggle:hover {
    border-color: var(--trfc-awayblue2);
    color: var(--trfc-awayblue2);
}

.manager-filter-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 30;
    background: #ffffff;
    border: 1px solid #d7e4f8;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(21, 42, 73, 0.14);
    padding: 0.75rem;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.manager-filter-panel.is-open {
    display: flex;
}

.manager-filter-group {
    flex: 1 1 220px;
    max-width: 420px;
    background: #f8fbff;
    border: 1px solid #dbe7f8;
    border-radius: 11px;
    padding: 0.55rem;
}

.manager-filter-group-title {
    display: block;
    margin-bottom: 0.35rem !important;
    font-weight: 500 !important;
    color: #2b4b73;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.manager-filter-chip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.33rem;
}

.manager-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.36rem;
    margin: 0 !important;
    padding: 0.22rem 0.5rem;
    border: 1px solid #d2dff2;
    border-radius: 999px;
    background: #ffffff;
    font-weight: 400 !important;
    color: #35547a;
    font-size: 0.84rem;
}

.manager-range-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.manager-range-value {
    font-weight: 500;
    color: #27426b;
    min-width: 2.1rem;
}

#manager-workspace input[type='checkbox'] {
    width: 14px;
    height: 14px;
    margin: 0 !important;
    accent-color: var(--trfc-awayblue2);
}

#manager-workspace input[type='range'] {
    accent-color: var(--trfc-awayblue2);
}

#manager-workspace [id$='-filters'] input[type='search'] {
    width: min(100%, 360px) !important;
    background: #f9fbff;
}

/* Player page styles (moved from routes/players.py) */
.player-page {
    --trfc-navy: #004494;
    --trfc-green1: #00874e;
    --trfc-green2: #215433;
    --trfc-maroon: #731d2a;
    --trfc-awayblue1: #6e8fe8;
    --trfc-awayblue2: #4f7cd8;
}

.players-page {
    --trfc-navy: #004494;
    --trfc-green1: #00874e;
    --trfc-green2: #215433;
    --trfc-maroon: #731d2a;
    --trfc-awayblue1: #6e8fe8;
    --trfc-awayblue2: #4f7cd8;
}

.player-tab-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1f2937 !important;
    font-weight: 500;
}

.player-tab-btn:hover {
    border-color: var(--trfc-navy);
    color: var(--trfc-navy) !important;
}

.player-tab-btn.is-active {
    border-color: var(--trfc-awayblue2);
    background: var(--trfc-awayblue2);
    color: #ffffff !important;
    box-shadow: 0 8px 22px rgba(79, 124, 216, 0.28);
}

.player-shell-card {
    border: 1px solid #dbe6f4;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.player-info-grid {
    border: 1px solid #dbe6f4;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.player-info-grid table {
    width: 100%;
    margin: 0;
}

.player-info-grid table td {
    padding: 0.8rem 0.6rem;
    font-weight: 300;
    color: #243145;
}

.player-info-grid table td:first-child {
    color: var(--trfc-navy);
    font-weight: 500;
    width: 34%;
}

.player-info-grid strong {
    font-weight: 500;
}

#player-workspace table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #dbe6f4;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

#player-workspace thead th {
    background: linear-gradient(90deg, #eef4ff, #f5f9ff);
    color: #27426b;
    text-transform: none;
    letter-spacing: 0.01em;
    font-size: 0.82rem;
    font-weight: 300;
    border: 0;
    border-bottom: 1px solid #d4e3f9;
}

#player-workspace tbody td {
    border-bottom: 1px solid #e6eef9;
    font-weight: 300;
    color: #243145;
}

#player-workspace tbody tr:nth-child(even) td {
    background: #fcfdff;
}

#player-workspace tbody tr:hover td {
    background: #f3f8ff;
}

#player-workspace a {
    color: #325a96;
    font-weight: 300;
}

#player-workspace input[type='search'],
#player-workspace input[type='text'],
#player-workspace input[type='number'],
#player-workspace select {
    border: 1px solid #bfd1eb;
    border-radius: 10px;
    background: #ffffff;
    font-weight: 300;
    min-height: 40px;
    padding: 0.45rem 0.7rem;
}

#player-workspace .button:not(.expand-toggle-btn),
#player-workspace button:not(.expand-toggle-btn),
#player-workspace input[type='submit'] {
    border-radius: 10px;
    border: 1px solid var(--trfc-awayblue2);
    background: var(--trfc-awayblue2);
    color: #ffffff;
    font-weight: 400;
}

#player-workspace .button:not(.expand-toggle-btn):hover,
#player-workspace button:not(.expand-toggle-btn):hover,
#player-workspace input[type='submit']:hover {
    background: var(--trfc-awayblue1);
    border-color: var(--trfc-awayblue1);
}

button.expand-toggle-btn,
.button.expand-toggle-btn {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #000 !important;
    min-height: 0 !important;
    padding: 0 !important;
}

button.expand-toggle-btn:hover,
.button.expand-toggle-btn:hover {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #000 !important;
}

#players-workspace table,
#managers-workspace table,
#seasons-workspace table,
#attendances-workspace table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #dbe6f4;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

#players-workspace thead th,
#managers-workspace thead th,
#seasons-workspace thead th,
#attendances-workspace thead th {
    background: linear-gradient(90deg, #eef4ff, #f5f9ff);
    color: #27426b;
    text-transform: none;
    letter-spacing: 0.01em;
    font-size: 0.82rem;
    font-weight: 300;
    border: 0;
    border-bottom: 1px solid #d4e3f9;
}

#players-workspace tbody td,
#managers-workspace tbody td,
#seasons-workspace tbody td,
#attendances-workspace tbody td {
    border-bottom: 1px solid #e6eef9;
    font-weight: 300;
    color: #243145;
}

#players-workspace tbody tr:nth-child(even) td,
#managers-workspace tbody tr:nth-child(even) td,
#seasons-workspace tbody tr:nth-child(even) td,
#attendances-workspace tbody tr:nth-child(even) td {
    background: #fcfdff;
}

#players-workspace tbody tr:hover td,
#managers-workspace tbody tr:hover td,
#seasons-workspace tbody tr:hover td,
#attendances-workspace tbody tr:hover td {
    background: #f3f8ff;
}

#players-workspace a,
#managers-workspace a,
#seasons-workspace a,
#attendances-workspace a {
    color: #325a96;
    font-weight: 300;
}

#players-workspace input[type='search'],
#managers-workspace input[type='search'],
#seasons-workspace input[type='search'],
#attendances-workspace input[type='search'],
#players-workspace input[type='text'],
#managers-workspace input[type='text'],
#seasons-workspace input[type='text'],
#attendances-workspace input[type='text'],
#players-workspace input[type='number'],
#managers-workspace input[type='number'],
#seasons-workspace input[type='number'],
#attendances-workspace input[type='number'],
#players-workspace select,
#managers-workspace select,
#seasons-workspace select,
#attendances-workspace select {
    border: 1px solid #bfd1eb;
    border-radius: 10px;
    background: #ffffff;
    font-weight: 300;
    min-height: 40px;
    padding: 0.45rem 0.7rem;
}

#players-workspace input[type='checkbox'],
#managers-workspace input[type='checkbox'],
#seasons-workspace input[type='checkbox'],
#attendances-workspace input[type='checkbox'] {
    width: 14px;
    height: 14px;
    margin: 0 !important;
    accent-color: var(--trfc-awayblue2);
}

#players-workspace input[type='range'],
#managers-workspace input[type='range'],
#seasons-workspace input[type='range'],
#attendances-workspace input[type='range'] {
    accent-color: var(--trfc-awayblue2);
}

#players-workspace [id$='-filters'] input[type='search'],
#managers-workspace [id$='-filters'] input[type='search'],
#seasons-workspace [id$='-filters'] input[type='search'],
#attendances-workspace [id$='-filters'] input[type='search'] {
    width: min(100%, 360px) !important;
    background: #f9fbff;
}

#players-workspace .players-filter-panel,
#managers-workspace .players-filter-panel,
#seasons-workspace .players-filter-panel,
#attendances-workspace .players-filter-panel {
    display: block;
    width: 100%;
}

#players-workspace .players-filter-sep,
#managers-workspace .players-filter-sep,
#seasons-workspace .players-filter-sep,
#attendances-workspace .players-filter-sep {
    margin: 0.55rem 0;
    border-color: #d7e4f8;
}

#players-workspace .players-filter-row,
#managers-workspace .players-filter-row,
#seasons-workspace .players-filter-row,
#attendances-workspace .players-filter-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
}

#players-workspace .players-filter-row .manager-filter-group-title,
#managers-workspace .players-filter-row .manager-filter-group-title,
#seasons-workspace .players-filter-row .manager-filter-group-title,
#attendances-workspace .players-filter-row .manager-filter-group-title {
    flex: 0 0 180px;
    margin: 0.25rem 0 0 !important;
}

#players-workspace .players-filter-controls,
#managers-workspace .players-filter-controls,
#seasons-workspace .players-filter-controls,
#attendances-workspace .players-filter-controls {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

#players-workspace .players-filter-controls-stack,
#managers-workspace .players-filter-controls-stack,
#seasons-workspace .players-filter-controls-stack,
#attendances-workspace .players-filter-controls-stack {
    gap: 0.65rem;
}

#players-workspace .players-filter-actions,
#managers-workspace .players-filter-actions,
#seasons-workspace .players-filter-actions,
#attendances-workspace .players-filter-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.1rem;
}

#players-workspace .players-season-value,
#managers-workspace .players-season-value,
#seasons-workspace .players-season-value,
#attendances-workspace .players-season-value {
    white-space: nowrap;
}

#players-workspace .players-section-card,
#managers-workspace .players-section-card,
#seasons-workspace .players-section-card,
#attendances-workspace .players-section-card {
    border: 1px solid #dbe6f4;
    border-radius: 16px;
    background: #ffffff;
    padding: 0.9rem;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}

#players-workspace .players-section-card h3,
#managers-workspace .players-section-card h3,
#seasons-workspace .players-section-card h3,
#attendances-workspace .players-section-card h3 {
    margin: 0 0 0.6rem 0;
}

@media (max-width: 900px) {
    #players-workspace .players-filter-row,
    #managers-workspace .players-filter-row,
    #seasons-workspace .players-filter-row,
    #attendances-workspace .players-filter-row {
        flex-direction: column;
        gap: 0.4rem;
    }

    #players-workspace .players-filter-row .manager-filter-group-title,
    #managers-workspace .players-filter-row .manager-filter-group-title,
    #seasons-workspace .players-filter-row .manager-filter-group-title,
    #attendances-workspace .players-filter-row .manager-filter-group-title {
        flex-basis: auto;
    }
}

/* Season page styles (moved from routes/seasons.py) */
.season-page {
    --trfc-navy: #004494;
    --trfc-green1: #00874e;
    --trfc-green2: #215433;
    --trfc-maroon: #731d2a;
    --trfc-awayblue1: #6e8fe8;
    --trfc-awayblue2: #4f7cd8;
}

.season-tab-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1f2937 !important;
    font-weight: 500;
}

.season-tab-btn:hover {
    border-color: var(--trfc-navy);
    color: var(--trfc-navy) !important;
}

.season-tab-btn.is-active {
    border-color: var(--trfc-awayblue2);
    background: var(--trfc-awayblue2);
    color: #ffffff !important;
    box-shadow: 0 8px 22px rgba(79, 124, 216, 0.28);
}

#season-workspace table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #dbe6f4;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

#season-workspace thead th {
    background: linear-gradient(90deg, #eef4ff, #f5f9ff);
    color: #27426b;
    text-transform: none;
    letter-spacing: 0.01em;
    font-size: 0.82rem;
    font-weight: 300;
    border: 0;
    border-bottom: 1px solid #d4e3f9;
}

#season-workspace tbody td {
    border-bottom: 1px solid #e6eef9;
    font-weight: 300;
    color: #243145;
}

#season-workspace tbody tr:nth-child(even) td {
    background: #fcfdff;
}

#season-workspace tbody tr:hover td {
    background: #f3f8ff;
}

#season-league-table-wrapper tbody tr:not(.tranmere-row):nth-child(even) td {
    background: #ffffff;
}

#season-workspace a {
    color: #325a96;
    font-weight: 300;
}

#season-workspace tbody tr.tranmere-row td {
    background: #eef4ff;
    font-weight: 500;
}

.season-shell-card {
    border: 1px solid #dbe6f4;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

#season-workspace [id$='-filters'] {
    margin-bottom: 0.8rem;
}

#season-workspace input[type='search'],
#season-workspace input[type='text'],
#season-workspace input[type='number'],
#season-workspace select {
    border: 1px solid #bfd1eb;
    border-radius: 10px;
    background: #ffffff;
    font-weight: 300;
    min-height: 40px;
    padding: 0.45rem 0.7rem;
}

#season-workspace input[type='checkbox'] {
    width: 14px;
    height: 14px;
    margin: 0 !important;
    accent-color: var(--trfc-awayblue2);
}

#season-workspace input[type='range'] {
    accent-color: var(--trfc-awayblue2);
}

#season-workspace [id$='-filters'] input[type='search'] {
    width: min(100%, 360px) !important;
    background: #f9fbff;
}

.manager-filter-shell {
    position: relative;
}

.manager-filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.manager-filter-search {
    flex: 1 1 280px;
}

.season-filter-details {
    margin-top: 0.5rem;
}

.season-filter-details > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid #bcd2f2;
    background: #ffffff;
    color: #2c4f7b;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.42rem 0.9rem;
    min-height: 38px;
    transition: border-color 0.15s, color 0.15s;
}

.season-filter-details > summary:hover {
    border-color: var(--trfc-awayblue2);
    color: var(--trfc-awayblue2);
}

.season-filter-details > summary::-webkit-details-marker {
    display: none;
}

.season-filter-details > summary::marker {
    content: '';
}

.season-filter-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    background: #ffffff;
    border: 1px solid #d7e4f8;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(21, 42, 73, 0.14);
    padding: 0.75rem;
    margin-top: 0.5rem;
}

.manager-filter-group {
    flex: 1 1 220px;
    max-width: 420px;
    background: #f8fbff;
    border: 1px solid #dbe7f8;
    border-radius: 11px;
    padding: 0.55rem;
}

.manager-filter-group-title {
    display: block;
    margin-bottom: 0.35rem !important;
    font-weight: 500 !important;
    color: #2b4b73;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.manager-filter-chip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.33rem;
}

.manager-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.36rem;
    margin: 0 !important;
    padding: 0.22rem 0.5rem;
    border: 1px solid #d2dff2;
    border-radius: 999px;
    background: #ffffff;
    font-weight: 400 !important;
    color: #35547a;
    font-size: 0.84rem;
    cursor: pointer;
}

.manager-range-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.manager-range-value {
    font-weight: 500;
    color: #27426b;
    min-width: 2.1rem;
}

#season-workspace tbody tr.league-line-auto td {
    border-bottom: 2px solid #1f6fdb !important;
}

#season-workspace tbody tr.league-line-playoff td {
    border-bottom: 2px solid #1b9f5c !important;
}

#season-workspace tbody tr.league-line-relegation td {
    border-top: 2px solid #c2410c !important;
}

.season-attendance-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.season-attendance-kpi {
    border: 1px solid #d7e4f8;
    border-radius: 12px;
    background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
    padding: 0.65rem 0.8rem;
}

.season-attendance-kpi-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4a6387;
    margin-bottom: 0.2rem;
}

.season-attendance-kpi-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #16345f;
    line-height: 1.1;
}

.season-attendance-chart-shell {
    border: 1px solid #d7e4f8;
    border-radius: 12px;
    background: #fff;
    padding: 0.45rem;
    margin-bottom: 1rem;
}

.season-attendance-competition-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    width: 100%;
}

.season-attendance-filter-group {
    flex: 1 1 100%;
    max-width: none;
}

.season-attendance-bar-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.season-attendance-bar-track {
    flex: 1 1 auto;
    min-width: 120px;
    height: 12px;
    border-radius: 999px;
    background: #e4edfb;
    overflow: hidden;
}

.season-attendance-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #4f7cd8, #2563eb);
}

.season-attendance-progress {
    width: 100%;
    min-width: 120px;
    height: 12px;
    border: 0;
    border-radius: 999px;
    overflow: hidden;
    background: #e4edfb;
}

.season-attendance-progress::-webkit-progress-bar {
    background: #e4edfb;
    border-radius: 999px;
}

.season-attendance-progress::-webkit-progress-value {
    background: linear-gradient(90deg, #4f7cd8, #2563eb);
    border-radius: 999px;
}

.season-attendance-progress::-moz-progress-bar {
    background: linear-gradient(90deg, #4f7cd8, #2563eb);
    border-radius: 999px;
}

.season-attendance-value {
    min-width: 72px;
    text-align: right;
    color: #16345f;
    font-weight: 600;
}

/* Attendance page styles (moved from routes/attendances.py) */
#attendances-layout {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

#attendances-sidebar {
    width: 280px;
    flex: 0 0 280px;
}

#attendances-main {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 1024px) {
    #attendances-layout {
        flex-direction: column;
    }
    #attendances-sidebar {
        width: 100%;
        flex: 0 0 auto;
    }
    #attendances-main {
        width: 100%;
    }
}

.filter-section {
    margin-bottom: 1.5rem;
}

.filter-section h4 {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.season-range-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.season-range-container select {
    width: 100%;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f77b4;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #666;
}

.attendance-table-section {
    margin-top: 2rem;
}

.attendance-table-section h3 {
    margin-bottom: 1rem;
}

.table-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.table-controls input[type="search"] {
    min-width: 250px;
}

.attendance-table {
    width: 100%;
}

.attendance-table th {
    white-space: nowrap;
}

.attendance-table td {
    vertical-align: middle;
}

.opponent-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.opponent-crest {
    height: 25px;
    width: auto;
}

.pagination-controls {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--pico-card-background-color);
    border-radius: 8px;
    text-align: center;
}

.pagination-controls a {
    padding: 5px 10px;
    cursor: pointer;
}

.pagination-controls span.disabled {
    padding: 5px 10px;
    color: #ccc;
}

.checkbox-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.checkbox-buttons button {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.range-filter {
    margin-bottom: 1rem;
}

.range-filter label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.range-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.range-container input[type="range"] {
    flex: 1;
}

.range-value {
    font-size: 1rem;
    font-weight: 600;
    min-width: 60px;
    text-align: right;
    white-space: nowrap;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-switch input[type="checkbox"] {
    width: 40px;
    height: 22px;
    appearance: none;
    background-color: #ccc;
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}

.toggle-switch input[type="checkbox"]:checked {
    background-color: #1f77b4;
}

.toggle-switch input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.toggle-switch input[type="checkbox"]:checked::before {
    transform: translateX(18px);
}

.toggle-switch label {
    font-size: 0.9rem;
    cursor: pointer;
}

/* Attendances-by-season styles (moved from routes/attendances_by_season.py) */
#att-season-layout {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

#att-season-sidebar {
    width: 250px;
    flex: 0 0 250px;
}

#att-season-main {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 1024px) {
    #att-season-layout {
        flex-direction: column;
    }
    #att-season-sidebar {
        width: 100%;
        flex: 0 0 auto;
    }
    #att-season-main {
        width: 100%;
    }
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.season-chart-card {
    background: var(--pico-card-background-color);
    border-radius: 8px;
    padding: 1rem;
}

.season-chart-card h4 {
    margin-bottom: 0.5rem;
    text-align: center;
}

.table-view-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.table-view-controls button {
    padding: 0.5rem 1rem;
}

.table-view-controls button.active {
    background-color: var(--pico-primary);
    color: white;
}

.season-table-section {
    margin-top: 2rem;
}

.season-table-section h3 {
    margin-bottom: 1rem;
}

.attendance-table {
    width: 100%;
}

.attendance-table th {
    white-space: nowrap;
}

.attendance-table td {
    vertical-align: middle;
}

.opponent-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.opponent-crest {
    height: 25px;
    width: auto;
}

.pagination-controls {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--pico-card-background-color);
    border-radius: 8px;
    text-align: center;
}

.pagination-controls a {
    padding: 5px 10px;
    cursor: pointer;
}

.pagination-controls span.disabled {
    padding: 5px 10px;
    color: #ccc;
}

.stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.stats-row span {
    background: #f5f5f5;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.filter-section {
    margin-bottom: 1rem;
}

.filter-section h5 {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    margin: 0;
    width: 14px;
    height: 14px;
}

.checkbox-buttons {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.checkbox-buttons button {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
}

.table-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 1rem;
    background: var(--pico-card-background-color);
    border-radius: 8px;
}

.table-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.table-filters .filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
}

.table-filters input[type="search"] {
    min-width: 200px;
}

.range-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-group input[type="range"] {
    width: 120px;
}

.range-value {
    font-weight: 600;
    min-width: 50px;
    text-align: right;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Heatmap styles (moved from routes/heatmap.py) */
.heatmap-container {
    overflow-x: auto;
    margin-top: 1rem;
}

.heatmap-table {
    border-collapse: collapse;
    font-size: 12px;
    white-space: nowrap;
}

.heatmap-table th,
.heatmap-table td {
    border: 1px solid #ddd;
    padding: 4px 6px;
    text-align: center;
    min-width: 32px;
}

.heatmap-table th {
    background-color: #f5f5f5;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.heatmap-table th.player-header {
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 11;
    background-color: #f5f5f5;
}

.heatmap-table td.player-name {
    text-align: left;
    font-weight: 500;
    position: sticky;
    left: 0;
    background-color: white;
    z-index: 5;
    min-width: 150px;
    max-width: 150px;
}

.heatmap-table td.player-name a {
    color: inherit;
    text-decoration: none;
}

.heatmap-table td.player-name a:hover {
    text-decoration: underline;
}

.heatmap-table .game-header {
    font-size: 11px;
    padding: 6px 4px;
    cursor: help;
}

/* Custom tooltip styling - uses fixed positioning to escape overflow */
.game-tooltip {
    position: relative;
    display: inline-block;
}

.game-tooltip .tooltip-text {
    display: none;
    position: fixed;
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: normal;
    white-space: nowrap;
    z-index: 99999;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.heatmap-cell {
    font-size: 11px;
    font-weight: 300;
}

/* Green heatmap colors based on minutes proportion */
.heat-0 { background-color: white; color: #999; }
.heat-10 { background-color: #f0fff0; color: #333; }
.heat-20 { background-color: #dcfce7; color: #333; }
.heat-30 { background-color: #bbf7d0; color: #333; }
.heat-40 { background-color: #86efac; color: #333; }
.heat-50 { background-color: #4ade80; color: #333; }
.heat-60 { background-color: #22c55e; color: white; }
.heat-70 { background-color: #16a34a; color: white; }
.heat-80 { background-color: #15803d; color: white; }
.heat-90 { background-color: #166534; color: white; }
.heat-100 { background-color: #14532d; color: white; }

/* Controls section (outside accordion) */
.controls-section {
    margin-bottom: 1rem;
}

.controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.control-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.control-group input[type="search"] {
    min-width: 200px;
}

/* Accordion styles */
.filters-accordion {
    margin-bottom: 1rem;
}

.filters-accordion details {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.filters-accordion summary {
    padding: 0.75rem 1rem;
    background-color: #f5f5f5;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filters-accordion summary::-webkit-details-marker {
    display: none;
}

.filters-accordion summary::before {
    content: "▶";
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.filters-accordion details[open] summary::before {
    transform: rotate(90deg);
}

.filters-accordion .accordion-content {
    padding: 1rem;
    background-color: #fff;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group > label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.range-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.range-container input[type="range"] {
    flex: 1;
}

.range-value {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    min-width: 30px;
    text-align: center;
    white-space: nowrap;
}

.season-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.no-results {
    padding: 2rem;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Summary statistics columns */
.stats-header {
    background-color: #e5e7eb !important;
    font-size: 11px;
    min-width: 45px;
    border-left: 2px solid #9ca3af !important;
}

.stats-header:first-of-type {
    border-left: 2px solid #6b7280 !important;
}

.stats-cell {
    background-color: #f9fafb;
    font-size: 11px;
    font-weight: 500;
    border-left: 2px solid #9ca3af !important;
}

.stats-cell:first-of-type {
    border-left: 2px solid #6b7280 !important;
}

.stats-divider {
    border-left: 2px solid #6b7280 !important;
}

/* Sortable headers */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.sortable:hover {
    background-color: #e5e7eb !important;
}

.sort-indicator {
    display: none;
}

/* Charts layout styles (moved from routes/charts.py Style blocks) */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 900px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

#season-progress-layout {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

#season-progress-sidebar {
    width: 250px;
    flex: 0 0 250px;
}

#season-progress-main {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 1024px) {
    #season-progress-layout {
        flex-direction: column;
    }

    #season-progress-sidebar {
        width: 100%;
        flex: 0 0 auto;
    }

    #season-progress-main {
        width: 100%;
    }
}

/* Shared HTMX loading state (moved from route Style fragments) */
.htmx-request {
    opacity: 0.5;
    transition: opacity 0.2s;
}

/* Utility classes replacing former inline style attributes */
.s-mt20-tright { margin-top: 20px; text-align: right; }
.s-pointer-underline { cursor: pointer; text-decoration: underline; }
.s-sort-link { cursor: pointer; text-decoration: none; color: inherit; }
.s-mr5 { margin-right: 5px; }
.s-wauto-inline { width: auto; display: inline-block; }
.s-inline-mr20 { display: inline-block; margin-right: 20px; }
.s-page-disabled { padding: 5px 10px; color: #ccc; }
.s-page-disabled-default { padding: 5px 10px; color: #ccc; cursor: default; }
.s-page-link { padding: 5px 10px; cursor: pointer; }
.s-page-link-no-decoration { padding: 5px 10px; cursor: pointer; text-decoration: none; }
.s-ml20-mr5 { margin-left: 20px; margin-right: 5px; }
.s-inline { display: inline-block; }
.s-pad-5-10 { padding: 5px 10px; }
.s-ml10-muted { margin-left: 10px; color: #666; }
.s-ml15-muted { margin-left: 15px; color: #666; }
.s-pagination-shell { margin-bottom: 10px; text-align: center; padding: 1rem; background: var(--pico-card-background-color); border-radius: 8px; }
.s-pagination-mb10 { margin-bottom: 10px; }
.s-pagination-mt10 { margin-top: 10px; }
.s-pagination-mt10-mb10 { margin-top: 10px; margin-bottom: 10px; }
.s-crest-wrap-40 { display: inline-block; vertical-align: middle; width: 40px; }
.s-crest-wrap-21 { display: inline-block; vertical-align: middle; width: 21px; }
.s-crest-wrap-55 { display: inline-block; vertical-align: middle; width: 55px; }
.s-h30 { height: 30px; }
.s-h35 { height: 35px; }
.s-h20 { height: 20px; }
.s-h50 { height: 50px; }
.s-h50-round { height: 50px; border-radius: 50%; }
.s-h50-round-border-mr5 { height: 50px; border-radius: 50%; border: 1px solid darkgray; margin-right: 5px; }
.s-h25-mr8 { height: 25px; margin-right: 8px; }
.s-h40-mr8 { height: 40px; margin-right: 8px; }
.s-flex-center { display: flex; justify-content: center; align-items: center; }
.s-flex-align-center { display: flex; align-items: center; }
.s-flex-align-center-gap065 { display: flex; align-items: center; gap: 0.65rem; }
.s-flex-align-center-gap1 { display: flex; align-items: center; gap: 1rem; }
.s-flex-align-center-wrap-mt10 { margin-top: 10px; display: flex; align-items: center; flex-wrap: wrap; }
.s-flex-between-wrap-gap1-mb1 { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.s-flex-gap1-wrap-align-center-mb1 { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.s-pr10 { padding-right: 10px; }
.s-bg-f8 { background-color: #f8f9fa; }
.s-pad0-bg-f8 { padding: 0; background-color: #f8f9fa; }
.s-hidden-bg-f8 { display: none; background-color: #f8f9fa; }
.s-display-none { display: none; }
.s-muted-italic { color: #666; font-style: italic; }
.s-muted { color: #666; }
.s-bold-mb10 { font-weight: bold; margin-bottom: 10px; }
.s-font-small { font-size: small; }
.s-overflow-x-auto { overflow-x: auto; }
.s-w180 { width: 180px; }
.s-w200-mr20 { width: 200px; margin-right: 20px; }
.s-w250 { width: 250px; }
.s-mb10 { margin-bottom: 10px; }
.s-mb1 { margin-bottom: 1rem; }
.s-mb0-w100 { margin-bottom: 0; width: 100%; }
.s-w100 { width: 100%; }
.s-w100-h310 { width: 100%; height: 310px; }
.s-w100-h500 { width: 100%; height: 500px; }
.s-w100-h600 { width: 100%; height: 600px; }
.s-w100-h350 { width: 100%; height: 350px; }
.s-w100-h300 { width: 100%; height: 300px; }
.s-maxw100 { max-width: 100%; }
.s-maxw100-hauto { max-width: 100%; height: auto; }
.s-text-right { text-align: right; }
.s-disabled-link { opacity: 0.5; pointer-events: none; }
.s-sort-asc,
.s-sort-desc {
    position: relative;
}

/* Direction indicator for active sorted column (robust against table-specific border styles) */
th.s-sort-asc {
    box-shadow: inset 0 4px 0 #004494 !important;
}

th.s-sort-desc {
    box-shadow: inset 0 -4px 0 #004494 !important;
}

.s-status-pill-active { padding: 5px 10px; font-weight: bold; background: #e9ecef; border-radius: 4px; }

/* Seasons list filter utility classes */
.s-label-block-bold-mb5 { font-weight: bold; display: block; margin-bottom: 5px; }
.s-mr20 { margin-right: 20px; }
.s-flex-wrap { display: flex; flex-wrap: wrap; }
.s-flex-wrap-center { display: flex; flex-wrap: wrap; align-items: center; }
.s-mb15 { margin-bottom: 15px; }
.s-w50-mr5 { width: 50px; margin-right: 5px; }
.s-w150-mid-pt10 { width: 150px; vertical-align: middle; padding-top: 10px; }
.s-ml10-bold-min40 { margin-left: 10px; font-weight: bold; min-width: 40px; }
.s-flex-align-center-mr30 { display: flex; align-items: center; margin-right: 30px; }
.s-flex-align-center { display: flex; align-items: center; }
.s-mr15 { margin-right: 15px; }
.s-mr5-inline { margin-right: 5px; }
.s-w150-mid { width: 150px; vertical-align: middle; }
.s-ml10-bold-min25 { margin-left: 10px; font-weight: bold; min-width: 25px; }
.s-summary-filter { cursor: pointer; font-weight: bold; padding: 10px; background: #e9ecef; border-radius: 4px; margin-bottom: 10px; }
.s-filter-panel-box { padding: 10px; border: 1px solid #ddd; border-radius: 4px; }

/* Streaks filter utility classes */
.s-w120 { width: 120px; }
.s-ml15 { margin-left: 15px; }
.s-flex-align-center-gap8-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.s-mr15-nowrap { margin-right: 15px; white-space: nowrap; }
.s-flex-wrap-gap5 { display: flex; flex-wrap: wrap; gap: 5px; }
.s-flex-gap10 { display: flex; gap: 10px; }
.s-summary-filters { cursor: pointer; font-weight: 600; padding: 10px; background: #f8f9fa; border-radius: 4px; }
.s-flex1-min250 { flex: 1; min-width: 250px; }
.s-flex1-min150 { flex: 1; min-width: 150px; }
.s-flex-wrap-gap20-mb15 { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 15px; }
.s-flex1-min200 { flex: 1; min-width: 200px; }
.s-flex2-min300 { flex: 2; min-width: 300px; }
.s-mr10 { margin-right: 10px; }
.s-filter-form-shell { padding: 15px; background: #fff; border: 1px solid #ddd; border-radius: 4px; margin-top: 10px; }
.s-mb20 { margin-bottom: 20px; }
.s-tab-link-base { margin-right: 10px; padding: 8px 16px; text-decoration: none; cursor: pointer; }
.s-tab-link-active { background-color: #007bff; color: white; border-radius: 4px; }
.s-tab-link-inactive { background-color: #e9ecef; color: #333; border-radius: 4px; }
.s-empty-state { padding: 20px; text-align: center; }

/* Misc helpers */
.s-mt1 { margin-top: 1rem; }
.s-wauto { width: auto; }
.s-inline-flex-column-start-gap035 { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; }
.s-flex-end { display: flex; justify-content: flex-end; }
.s-flex-end-bottom { display: flex; justify-content: flex-end; align-items: end; }
.s-wauto-min360 { width: auto; min-width: 360px; }
.s-wauto-min280 { width: auto; min-width: 280px; }
.s-ml05 { margin-left: 0.5rem; }
.s-mr05 { margin-right: 0.5rem; }
.s-range-input-200 { width: 200px; display: inline-block; vertical-align: middle; }
.s-fw600 { font-weight: 600; }
.s-fw600-ml1 { font-weight: 600; margin-left: 1rem; }
.s-empty-muted { text-align: center; padding: 2rem; color: var(--pico-muted-color); }
.s-page-current { padding: 5px 10px; font-weight: bold; background: #e9ecef; border-radius: 4px; }
.s-mb10-flex-align-center { margin-bottom: 10px; display: flex; align-items: center; }
.s-flex-gap1-wrap-align-center { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.s-pos-green { color: green; }
.s-pos-red { color: red; }
.s-pos-orange { color: orange; }
.s-pos-gray { color: gray; }

/* Home/dashboard helpers */
.season-nav { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.season-nav-label { margin-right: 5px; }
.season-nav-disabled { opacity: 0.5; pointer-events: none; }

/* Sort indicator on table headers */
th.s-sort-asc,
th.s-sort-desc {
    transition: border-color 0.2s ease;
}
