:root {
    --status-success: #198754;
    --status-danger: #dc3545;
    --status-warning: #ffc107;
    --status-neutral: #6c757d;
    --dept-primary: #0d6efd;
    --dept-accent: #ffc107;
    --dept-background: #f4f6f9;
}

[data-bs-theme="light"] {
    --surface: #ffffff;
    --surface-muted: #f1f3f5;
    --border-color: rgba(33, 37, 41, 0.12);
    --text-color: #212529;
    --muted-color: #6c757d;
    --primary-action-color: var(--brand-link, var(--dept-strong));
}

[data-bs-theme="dark"] {
    --surface: color-mix(in srgb, var(--dept-background) 88%, #ffffff 12%);
    --surface-muted: color-mix(in srgb, var(--dept-background) 78%, #ffffff 22%);
    --border-color: rgba(255, 255, 255, 0.14);
    --text-color: #f1f3f5;
    --muted-color: #b8c0c8;
    --primary-action-color: #f1f3f5;
}

body {
    --dept-strong: var(--brand-strong, color-mix(in srgb, var(--dept-primary) 45%, #000000));
    --dept-on-strong: var(--brand-on-strong, #fff);
    --dept-accent-soft: color-mix(in srgb, var(--dept-accent) 10%, var(--surface-muted));
    --dept-accent-border: color-mix(in srgb, var(--dept-accent) 42%, var(--border-color));
    --bs-body-bg: var(--dept-background);
    --bs-body-color: var(--text-color);
    --bs-secondary-color: var(--muted-color);
    --bs-emphasis-color: var(--text-color);
    --bs-border-color: var(--border-color);
    --bs-primary: var(--dept-strong);
    color: var(--text-color);
    background-color: var(--dept-background);
    -webkit-tap-highlight-color: transparent;
}

.team-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 1rem;
}

.team-overview-card,
.league-game-card {
    border: 1px solid var(--border-color);
    background: var(--surface);
}

.team-player-count {
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.team-overview-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.team-overview-facts > div {
    min-width: 0;
    padding: 0.75rem;
    border-radius: 0.625rem;
    background: var(--surface-muted);
}

.team-overview-facts strong,
.team-overview-facts span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-add-quick > summary {
    list-style: none;
    cursor: pointer;
}

.team-add-quick > summary::-webkit-details-marker {
    display: none;
}

.team-add-quick[open] {
    flex-basis: 100%;
}

.team-detail-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.team-detail-tabs .nav-link {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .team-detail-tabs {
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
        mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
        padding-right: 1.5rem;
    }
}

.roster-number {
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--surface-muted);
    font-weight: 700;
}

.roster-list-item {
    display: flex;
    width: 100%;
    min-height: 4.25rem;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    color: inherit;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.roster-editable {
    cursor: pointer;
}

.roster-table th button {
    padding: 0;
    color: inherit;
    background: none;
    border: 0;
    font-weight: 600;
}

.team-player-choice-list {
    max-height: 320px;
    overflow-y: auto;
}

.team-player-choice + .team-player-choice {
    border-top: 1px solid var(--border-color);
}

.members-filter,
.member-card,
.members-table {
    border-color: var(--border-color);
}

.members-table th a {
    color: inherit;
    text-decoration: none;
}

.members-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface);
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.team-event-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 0;
    color: inherit;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
}

.team-event-date {
    display: inline-flex;
    width: 4rem;
    min-height: 4rem;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    flex-shrink: 0;
    border-radius: 0.625rem;
    background: var(--surface-muted);
    font-weight: 700;
}

.league-data-grid {
    min-width: 0;
}

.league-table-wrap {
    max-height: 620px;
    overflow-y: auto;
}

.league-table {
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.league-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface);
}

.league-table th,
.league-table td {
    border-bottom: 1px solid var(--border-color);
    box-shadow: none;
}

.league-table th:first-child,
.league-table td:first-child {
    width: auto;
}

.league-table th.league-col-rank {
    width: 2.9rem;
}

.league-table th.league-col-value {
    width: 3.9rem;
}

.league-team-name {
    overflow-wrap: break-word;
    hyphens: auto;
    font-weight: 600;
}

.league-table .league-own-row > * {
    background: color-mix(in srgb, var(--dept-accent) 18%, var(--surface));
    font-weight: 700;
}

.league-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
}

.league-legend abbr {
    text-decoration: none;
    font-weight: 700;
}

.league-game-segments {
    position: sticky;
    top: 0.5rem;
    z-index: 2;
}

.league-game-date {
    margin: 1rem 0 0.5rem;
    font-weight: 700;
}

.league-game-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem 0.75rem;
    margin-bottom: 0.625rem;
    padding: 0.875rem;
    border-radius: 0.625rem;
}

.league-own-game {
    border-left: 0.25rem solid var(--dept-primary);
}

.league-game-teams {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.375rem;
    grid-column: 1;
    grid-row: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
}

.league-game-team {
    overflow-wrap: break-word;
    font-weight: 500;
}

.league-game-team.is-own {
    font-weight: 700;
}

.league-game-meta {
    display: flex;
    gap: 0.5rem;
    grid-column: 1;
    grid-row: 2;
    color: var(--muted-color);
    font-size: 0.8rem;
    flex-wrap: wrap;
}

.league-result-pill {
    display: inline-flex;
    min-width: 3.5rem;
    align-self: center;
    justify-content: center;
    grid-column: 2;
    grid-row: 1 / span 2;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    color: var(--text-color);
    background: var(--surface-muted);
    font-weight: 700;
    white-space: nowrap;
}

.league-result-win {
    color: #0a4726;
    background: #d1e7dd;
}

.league-result-draw {
    color: #664d03;
    background: #fff3cd;
}

.league-result-loss {
    color: #842029;
    background: #f8d7da;
}

.skeleton-line,
.skeleton-row,
.skeleton-card {
    border-radius: 0.375rem;
    background: linear-gradient(90deg, var(--surface-muted) 25%, var(--border-color) 50%, var(--surface-muted) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
}

.skeleton-line {
    width: 45%;
    height: 1.15rem;
    margin-bottom: 1rem;
}

.skeleton-row {
    height: 2.5rem;
    margin-bottom: 0.25rem;
}

.skeleton-card {
    height: 5rem;
    margin-bottom: 0.75rem;
}

@keyframes skeleton-shimmer {
    to { background-position-x: -200%; }
}

@media (min-width: 1280px) {
    .league-data-grid > .league-standings-pane {
        width: 41.666667%;
    }

    .league-data-grid > .league-games-pane {
        width: 58.333333%;
    }
}

@media (max-width: 767.98px) {
    .league-table {
        width: 100%;
        font-size: 0.84rem;
    }

    .league-table th,
    .league-table td {
        padding: 0.55rem 0.35rem;
    }

    .league-table-wrap {
        max-height: none;
        overflow: visible;
    }

    .league-legend {
        font-size: 0.72rem;
    }

    .league-game-segments .btn {
        min-height: 2.5rem;
    }
}

.min-w-0 {
    min-width: 0;
}

.app-shell {
    min-height: 100vh;
}

.app-content {
    min-width: 0;
}

.mobile-app-bar,
.tablet-nav {
    background: var(--dept-strong);
    border-bottom: 2px solid color-mix(in srgb, var(--dept-accent) 72%, var(--dept-strong));
    color: var(--dept-on-strong);
}

.mobile-app-bar {
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 0.75rem 0;
    align-items: center;
    justify-content: space-between;
}

.tablet-nav {
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: 64px;
    padding: 0.5rem 1rem;
    align-items: center;
    gap: 1.5rem;
}

.tablet-nav nav {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.tablet-nav nav::-webkit-scrollbar {
    display: none;
}

.tablet-nav nav a {
    color: var(--dept-on-strong);
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
}

.tablet-nav nav a:hover,
.tablet-nav nav a:focus-visible {
    background: rgb(255 255 255 / 14%);
}

.tablet-account {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.app-brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.625rem;
    color: var(--dept-on-strong);
    font-weight: 700;
    text-decoration: none;
}

.app-brand:hover,
.app-brand:focus-visible {
    color: var(--dept-on-strong);
}

.app-brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 0.5rem;
    background: #fff;
    object-fit: contain;
    padding: 0.2rem;
}

.app-brand-mark {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.app-bar-button {
    min-width: 44px;
    min-height: 44px;
    color: var(--dept-on-strong);
}

.mobile-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1035;
    min-height: calc(64px + env(safe-area-inset-bottom));
    padding: 0.25rem 0.5rem env(safe-area-inset-bottom);
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    align-items: stretch;
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -0.25rem 1rem rgb(0 0 0 / 8%);
}

.mobile-bottom-nav > a,
.bottom-nav-more {
    display: flex;
    min-width: 0;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.15rem;
    color: var(--muted-color);
    background: transparent;
    border: 0;
    border-radius: 0.5rem;
    font-size: 0.72rem;
    text-decoration: none;
}

.mobile-bottom-nav > a.active,
.mobile-bottom-nav > a:hover,
.bottom-nav-more.active,
.bottom-nav-more:hover,
.bottom-nav-more:focus-visible {
    color: var(--primary-action-color);
    background: var(--surface-muted);
}

.mobile-bottom-nav svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.mobile-bottom-nav .bottom-nav-more {
    width: 100%;
}

.fab-new-event {
    position: fixed;
    right: 1rem;
    bottom: calc(64px + env(safe-area-inset-bottom) + 1rem);
    z-index: 1036;
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1.1rem;
    color: var(--dept-on-strong);
    background: var(--dept-strong);
    border: 2px solid color-mix(in srgb, var(--dept-accent) 72%, var(--dept-strong));
    border-radius: 999px;
    box-shadow: 0 0.35rem 1rem rgb(0 0 0 / 25%);
    font-weight: 700;
    text-decoration: none;
}

.fab-new-event:hover,
.fab-new-event:focus-visible {
    color: var(--dept-on-strong);
    filter: brightness(1.12);
}

.offcanvas.app-sheet {
    height: auto;
    max-height: 80vh;
    max-height: 80dvh;
    color: var(--text-color);
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    border-radius: 1rem 1rem 0 0;
}

.app-sheet .offcanvas-body {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}

.announcement-popup-list {
    display: grid;
    gap: 1rem;
}

.announcement-popup-item + .announcement-popup-item {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.announcement-body {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.announcement-list {
    display: grid;
    gap: 1rem;
}

.announcement-card {
    border-left: 4px solid transparent;
}

.announcement-card.announcement-unread {
    border-left-color: var(--dept-primary);
}

.announcement-team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.25rem 1rem;
}

@media (max-width: 767.98px) {
    .announcement-modal .modal-dialog {
        max-width: none;
        align-items: flex-end;
        min-height: 100%;
        margin: 0;
    }

    .announcement-modal .modal-content {
        max-height: 88dvh;
        border-radius: 1rem 1rem 0 0;
    }

    .announcement-team-grid {
        grid-template-columns: 1fr;
    }
}

.sheet-link {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    color: var(--text-color);
    background: transparent;
    border: 0;
    border-radius: 0.5rem;
    text-align: left;
    text-decoration: none;
}

.sheet-link:hover,
.sheet-link:focus-visible,
.sheet-link.active {
    color: var(--primary-action-color);
    background: var(--surface-muted);
}

.sheet-link.text-danger {
    color: var(--status-danger) !important;
}

.sheet-label {
    display: block;
    padding: 0.5rem 0.75rem 0.25rem;
    color: var(--muted-color);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sheet-divider {
    margin: 0.5rem 0;
    border-top: 1px solid var(--border-color);
}

.desktop-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1030;
    width: 264px;
    flex-direction: column;
    color: var(--dept-on-strong);
    background: var(--dept-strong);
}

.sidebar-brand {
    padding: 1.25rem;
}

.sidebar-nav {
    display: flex;
    padding: 0 0.75rem;
    flex-direction: column;
    gap: 0.125rem;
}

.sidebar-nav a {
    min-height: 44px;
    padding: 0.65rem 0.75rem;
    color: var(--dept-on-strong);
    border-radius: 0.5rem;
    text-decoration: none;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus-visible,
.sidebar-nav a.active {
    background: rgb(255 255 255 / 14%);
}

.sidebar-nav a.active {
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--dept-accent);
}

.sidebar-section-label {
    padding: 1rem 0.75rem 0.25rem;
    color: color-mix(in srgb, var(--dept-on-strong) 75%, transparent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-account {
    padding: 1rem;
    border-top: 1px solid color-mix(in srgb, var(--dept-on-strong) 18%, transparent);
}

.sidebar-profile {
    display: block;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    color: var(--dept-on-strong);
    text-decoration: none;
}

.sidebar-profile small {
    color: color-mix(in srgb, var(--dept-on-strong) 78%, transparent);
}

.page-header-icon,
.empty-state-icon {
    color: var(--primary-action-color);
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.page-header-actions {
    align-items: center;
}

.help-button {
    display: inline-flex;
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--primary-action-color);
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--dept-strong) 45%, var(--border-color));
    border-radius: 50%;
    box-shadow: 0 1px 2px rgb(0 0 0 / 8%);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.help-button:hover,
.help-button[aria-expanded="true"] {
    color: var(--dept-on-strong);
    background: var(--dept-strong);
    border-color: var(--dept-strong);
}

.app-help-popover {
    --bs-popover-max-width: min(24rem, calc(100vw - 1.5rem));
    --bs-popover-bg: var(--surface);
    --bs-popover-border-color: var(--border-color);
    --bs-popover-header-bg: var(--surface-muted);
    --bs-popover-header-color: var(--text-color);
    --bs-popover-body-color: var(--text-color);
    z-index: 1090;
    box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 18%);
}

.app-help-popover .popover-header {
    padding-right: 2.5rem;
    border-bottom-color: var(--border-color);
    font-size: 1rem;
    font-weight: 700;
}

.app-help-popover .popover-body {
    padding: 0.9rem;
    line-height: 1.45;
}

.app-help-content {
    position: relative;
}

.app-help-content p {
    margin-bottom: 0.65rem;
}

.app-help-content li + li {
    margin-top: 0.3rem;
}

.app-help-close {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    float: right;
    margin: -0.25rem -0.35rem 0.25rem 0.5rem;
    padding: 0;
    color: var(--muted-color);
    background: transparent;
    border: 0;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
}

.app-help-close:hover {
    color: var(--text-color);
    background: var(--surface-muted);
}

.page-header-icon svg {
    width: 1.75rem;
    height: 1.75rem;
}

@media (max-width: 575.98px) {
    .help-button {
        width: 2.75rem;
        min-width: 2.75rem;
        height: 2.75rem;
    }

    .app-help-popover {
        --bs-popover-max-width: calc(100vw - 1.5rem);
    }
}

.status-pill {
    display: inline-flex;
    min-height: 1.75rem;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.status-pill-success {
    color: var(--status-success);
    border-color: color-mix(in srgb, var(--status-success) 55%, transparent);
    background: color-mix(in srgb, var(--status-success) 12%, var(--surface));
}

.status-pill-danger {
    color: var(--status-danger);
    border-color: color-mix(in srgb, var(--status-danger) 55%, transparent);
    background: color-mix(in srgb, var(--status-danger) 12%, var(--surface));
}

.status-pill-warning {
    color: color-mix(in srgb, var(--status-warning) 65%, var(--text-color));
    border-color: color-mix(in srgb, var(--status-warning) 72%, var(--border-color));
    background: color-mix(in srgb, var(--status-warning) 18%, var(--surface));
}

.status-pill-neutral {
    color: var(--muted-color);
    border-color: var(--border-color);
    background: var(--surface-muted);
}

.empty-state {
    border: 1px dashed var(--border-color);
    border-radius: 0.75rem;
    background: var(--surface);
}

.empty-state > p {
    max-width: 42rem;
}

.app-toast-container {
    z-index: 1090;
}

@media (max-width: 767.98px) {
    .app-content {
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }

    .app-content > main {
        padding-top: 1rem;
    }

    .mobile-app-bar {
        display: flex !important;
    }

    .mobile-bottom-nav {
        display: grid !important;
    }

    .app-toast-container {
        right: 0;
        bottom: calc(64px + env(safe-area-inset-bottom));
        left: 0;
        width: auto;
    }
}

@media (min-width: 1200px) {
    .is-authenticated .app-content {
        margin-left: 264px;
        padding-top: 1.5rem;
    }
}

.card {
    background-color: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    color: var(--text-color);
}

.card-header {
    background-color: var(--dept-accent-soft);
    border-bottom-color: var(--dept-accent-border);
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--dept-accent) 65%, var(--dept-strong));
    color: var(--text-color);
}

.modal-content {
    background-color: var(--surface);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.modal-header,
.modal-footer {
    border-color: var(--border-color);
}

.bg-light {
    background-color: var(--surface-muted) !important;
    color: var(--text-color) !important;
}

.alert-light {
    background-color: var(--surface-muted);
    border-color: var(--border-color);
    color: var(--text-color);
}

.dropdown-menu {
    background-color: var(--surface);
    border-color: var(--border-color);
}

.dropdown-item {
    color: var(--text-color);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--surface-muted);
    color: var(--text-color);
}

.input-group-text {
    background-color: var(--surface-muted);
    border-color: var(--border-color);
    color: var(--muted-color);
}

.list-group-item {
    background-color: var(--surface);
    border-color: var(--border-color);
    color: var(--text-color);
}

hr {
    color: var(--border-color);
    opacity: 1;
}

code {
    color: inherit;
}

.table {
    --bs-table-color: var(--text-color);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-color);
    --bs-table-hover-color: var(--text-color);
    --bs-table-hover-bg: color-mix(in srgb, var(--surface-muted) 70%, transparent);
    --bs-table-striped-bg: color-mix(in srgb, var(--surface-muted) 55%, transparent);
}

.table thead th {
    background-color: var(--surface-muted);
    color: var(--text-color);
    font-weight: 600;
    white-space: nowrap;
}

.table > :not(caption) > * > * {
    padding: 0.8rem 0.65rem;
}

.form-control,
.form-select {
    background-color: var(--surface);
    border-color: var(--border-color);
    color: var(--text-color);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--surface);
    color: var(--text-color);
    border-color: var(--dept-strong);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--dept-primary) 20%, transparent);
}

.form-control::placeholder {
    color: var(--muted-color);
}

.form-control[type="file"] {
    background-color: var(--surface);
    color: var(--text-color);
}

.form-control[type="file"]::file-selector-button {
    background-color: var(--surface-muted);
    border: 0;
    border-right: 1px solid var(--border-color);
    color: var(--text-color);
    margin: -0.375rem 0.75rem -0.375rem -0.75rem;
    padding: 0.375rem 0.75rem;
}

.form-control[type="file"]::file-selector-button:hover {
    background-color: color-mix(in srgb, var(--dept-primary) 15%, var(--surface-muted));
}

.form-check-input {
    background-color: var(--surface);
    border-color: color-mix(in srgb, var(--text-color) 35%, transparent);
}

.form-check-input:checked {
    background-color: var(--dept-strong);
    border-color: var(--dept-strong);
}

.form-switch .form-check-input {
    cursor: pointer;
    opacity: 1;
}

.form-switch .form-check-input:not(:checked) {
    background-color: #8a9299;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    border: 1px solid #6c757d;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.form-check-label {
    color: var(--text-color);
}

.form-select option {
    background-color: var(--surface);
    color: var(--text-color);
}

.border-top,
.border-bottom,
.border {
    border-color: var(--border-color) !important;
}

.navbar-dept {
    background-color: var(--dept-strong) !important;
    border-bottom: 2px solid color-mix(in srgb, var(--dept-accent) 72%, var(--dept-strong)) !important;
}

.navbar-dept .nav-link:hover,
.navbar-dept .nav-link:focus-visible {
    background-color: color-mix(in srgb, var(--dept-accent) 16%, transparent);
    border-radius: 0.375rem;
}

.btn-primary {
    background-color: var(--dept-strong) !important;
    border-color: var(--dept-strong) !important;
    color: var(--dept-on-strong) !important;
}

.mobile-app-bar .btn-outline-light,
.tablet-nav .btn-outline-light,
.desktop-sidebar .btn-outline-light {
    --bs-btn-color: var(--dept-on-strong);
    --bs-btn-border-color: var(--dept-on-strong);
    --bs-btn-hover-color: var(--dept-strong);
    --bs-btn-hover-bg: var(--dept-on-strong);
    --bs-btn-hover-border-color: var(--dept-on-strong);
}

.btn-primary:hover {
    filter: brightness(1.12);
}

.btn-outline-primary {
    color: var(--primary-action-color) !important;
    border-color: var(--primary-action-color) !important;
}

.status-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    height: 24px;
    font-size: 0.78rem;
    line-height: 1;
    font-weight: 600;
    background-color: var(--surface);
}

.maps-action-primary,
.maps-action-secondary {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    font-weight: 600;
}

.location-card-layout {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.location-card-actions {
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

.location-card-actions .btn,
.location-card-actions form {
    min-height: 40px;
    flex: 1 1 0;
}

.location-card-actions form .btn {
    width: 100%;
}

@media (min-width: 576px) {
    .location-card-layout {
        flex-direction: row;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .location-card-actions {
        flex: 0 0 auto;
        align-self: flex-start;
        border-top: 0;
        padding-top: 0;
    }

    .location-card-actions .btn,
    .location-card-actions form {
        flex: 0 0 auto;
        min-height: 0;
    }

    .location-card-actions form .btn {
        width: auto;
    }
}

.btn-outline-primary:hover {
    background-color: var(--dept-strong) !important;
    color: var(--dept-on-strong) !important;
}

.text-primary {
    color: var(--primary-action-color) !important;
}

.btn-dept-secondary {
    background-color: var(--dept-accent-soft) !important;
    border-color: var(--dept-accent-border) !important;
    color: var(--text-color) !important;
}

.btn-dept-secondary:hover {
    background-color: color-mix(in srgb, var(--dept-accent) 18%, var(--surface)) !important;
    border-color: color-mix(in srgb, var(--dept-accent) 60%, var(--dept-strong)) !important;
}

.bg-dept-secondary {
    background-color: var(--surface-muted) !important;
    border: 1px solid var(--border-color);
    color: var(--text-color) !important;
}

.badge-role-admin,
.badge-role-mandantenadmin,
.badge-role-trainer,
.badge-role-spieler,
.badge-role-default {
    background-color: var(--surface-muted) !important;
    border: 1px solid var(--border-color);
    color: var(--text-color) !important;
    text-shadow: none !important;
}

a,
button {
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--dept-strong) 55%, transparent);
    outline-offset: 2px;
}

@media (max-width: 767.98px) {
    .btn-mobile-full {
        width: 100%;
        margin-bottom: 0.4rem;
    }

    .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn-close,
    .navbar-toggler {
        min-width: 44px;
        min-height: 44px;
    }

    .navbar-nav .nav-link {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 0.65rem 0.5rem;
        font-size: 1.05rem;
    }

    .dropdown-item {
        display: flex;
        align-items: center;
        min-height: 44px;
    }

    .card-body {
        padding: 1rem;
    }

    .card-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .card-header > .d-flex {
        flex-wrap: wrap;
    }

    .form-control,
    .form-control-sm,
    .form-select,
    .form-select-sm,
    .input-group-sm > .form-control,
    .input-group-sm > .form-select {
        min-height: 44px;
        font-size: 1rem;
    }

    .form-check {
        min-height: 44px;
        padding-left: 1.75em;
    }

    .form-check-input {
        position: relative;
        top: 0.75rem;
        width: 1.25em;
        height: 1.25em;
        margin-top: 0;
        margin-left: -1.75em;
    }

    .form-check.form-switch {
        padding-left: 3em;
    }

    .form-check.form-switch .form-check-input {
        width: 2em;
        height: 1em;
        margin-left: -2.5em;
    }

    .form-check-label {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0.25rem 0;
    }

    .modal-content {
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }

    .modal-body {
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .modal-footer {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .modal-footer > .btn {
        flex: 1 1 100%;
        margin: 0;
    }
}

/* ===== AP2b: Terminübersicht, Termin-Detail, Quick-Response ===== */
:root {
    --sticky-top: calc(56px + env(safe-area-inset-top));
}

@media (min-width: 768px) {
    :root { --sticky-top: 64px; }
}

@media (min-width: 1200px) {
    :root { --sticky-top: 0px; }
}

.event-type-spiel { --type-color: #d9480f; }
.event-type-training { --type-color: #1c7ed6; }
.event-type-turnier { --type-color: #7048e8; }
.event-type-verein { --type-color: #2f9e44; }
.event-type-other { --type-color: var(--muted-color); }

/* Filter-Chips */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin: 0 -0.75rem 0.75rem;
    padding: 0.25rem 0.75rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    display: inline-flex;
    min-height: 44px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 1rem;
    color: var(--text-color);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 0.92rem;
    text-decoration: none;
    white-space: nowrap;
}

.filter-chip:hover,
.filter-chip:focus-visible {
    color: var(--text-color);
    background: var(--surface-muted);
}

.filter-chip-primary {
    border-color: var(--dept-strong);
    font-weight: 700;
}

.filter-chip-icon {
    padding-inline: 0.75rem;
}

.filter-chip.active,
.filter-chip.active:hover {
    color: var(--dept-on-strong);
    background: var(--dept-strong);
    border-color: var(--dept-strong);
}

.event-filter-card {
    width: 100%;
}

.event-filter-form {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
}

.event-filter-actions {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.event-filter-actions .btn {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
}

.status-filter {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    scrollbar-width: none;
}

/* Zweispaltiges Desktop-Layout der Terminliste */
.events-layout {
    display: block;
}

.events-aside-inner {
    position: sticky;
    top: 1rem;
    display: grid;
    gap: 1rem;
}

.info-panel {
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
}

.info-panel h4 {
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted-color);
}

.info-panel-link {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    color: var(--text-color);
    border-top: 1px solid var(--border-color);
    font-size: 0.92rem;
    text-decoration: none;
}

.info-panel-link:first-of-type {
    border-top: 0;
}

.info-panel-link:hover strong {
    text-decoration: underline;
}

.open-item:not([data-status="pending"]) {
    display: none;
}

@media (min-width: 1280px) {
    .events-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 1.5rem;
        align-items: start;
    }
}

/* Datumsköpfe und Terminkarten */
.bulk-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
}

.event-day-header {
    position: sticky;
    top: var(--sticky-top);
    z-index: 1020;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0;
    padding: 0.55rem 0 0.4rem;
    background: var(--dept-background);
    font-size: 1rem;
    font-weight: 700;
}

.event-day-date {
    color: var(--muted-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.event-card {
    position: relative;
    margin-bottom: 0.6rem;
    padding: 0.75rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--dept-accent);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgb(0 0 0 / 6%);
}

.event-card-top {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.event-card .event-select {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    margin: 0.2rem 0 0;
    top: 0;
}

.bulk-toolbar .form-check-input {
    position: static;
    width: 1.35rem;
    height: 1.35rem;
    margin: 0;
}

.event-time {
    min-width: 3rem;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.event-time small {
    display: block;
    color: var(--muted-color);
    font-size: 0.68rem;
    font-weight: 500;
}

.event-title {
    color: var(--text-color);
    font-weight: 700;
    text-decoration: none;
}

.event-title:hover {
    color: var(--text-color);
    text-decoration: underline;
}

.event-team-link {
    position: relative;
    z-index: 2;
    text-decoration: none;
}

.event-team-link:hover {
    text-decoration: underline;
}

.event-meta,
.hero-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-top: 0.15rem;
    color: var(--muted-color);
    font-size: 0.85rem;
}

.event-type-label {
    color: var(--type-color, var(--muted-color));
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.event-deadline {
    margin-top: 0.4rem;
    color: var(--muted-color);
    font-size: 0.82rem;
}

.event-deadline.is-expired {
    color: var(--status-danger);
    font-weight: 600;
}

.event-description {
    display: -webkit-box;
    margin: 0.4rem 0 0;
    overflow: hidden;
    font-size: 0.88rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.event-progress {
    margin-top: 0.6rem;
}

.event-progress-bar {
    display: flex;
    height: 8px;
    overflow: hidden;
    background: var(--surface-muted);
    border-radius: 999px;
}

.event-progress-bar .seg {
    flex-basis: 0;
    min-width: 0;
}

.seg-accepted { background: var(--status-success); }
.seg-maybe { background: var(--status-warning); }
.seg-declined { background: var(--status-danger); }
.seg-pending { background: color-mix(in srgb, var(--status-neutral) 55%, var(--surface)); }

.event-progress-legend {
    display: flex;
    gap: 0.9rem;
    margin-top: 0.3rem;
    font-size: 0.82rem;
}

.event-progress-legend b {
    margin-left: 0.15rem;
}

.stat-accepted { color: var(--status-success); }
.stat-declined { color: var(--status-danger); }
.stat-maybe { color: color-mix(in srgb, var(--status-warning) 70%, var(--text-color)); }
.stat-pending { color: var(--muted-color); }

/* Quick-Response-Widget */
.event-responses {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 0.75rem;
    margin-top: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--border-color);
}

.resp-widget {
    display: grid;
    gap: 0.4rem;
}

.resp-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
    font-size: 0.88rem;
}

.resp-name {
    font-weight: 700;
}

.resp-state {
    display: none;
    font-weight: 600;
}

.resp-widget[data-status="accepted"] .resp-state-accepted,
.resp-widget[data-status="maybe"] .resp-state-maybe,
.resp-widget[data-status="declined"] .resp-state-declined,
.resp-widget[data-status="pending"] .resp-state-pending {
    display: inline;
}

.resp-state-accepted { color: var(--status-success); }
.resp-state-declined { color: var(--status-danger); }
.resp-state-pending { color: var(--muted-color); }

.resp-expired {
    padding: 0.05rem 0.55rem;
    color: var(--status-danger);
    border: 1px solid color-mix(in srgb, var(--status-danger) 55%, transparent);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.resp-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
}

.resp-btn {
    min-height: 48px;
    padding: 0.35rem 0.5rem;
    color: var(--text-color);
    background: var(--surface);
    border: 1.5px solid var(--border-color);
    border-radius: 0.6rem;
    font-weight: 600;
}

.resp-btn-accepted { color: var(--status-success); border-color: color-mix(in srgb, var(--status-success) 60%, transparent); }
.resp-btn-declined { color: var(--status-danger); border-color: color-mix(in srgb, var(--status-danger) 60%, transparent); }
.resp-btn-maybe { border-color: color-mix(in srgb, var(--status-warning) 80%, transparent); }

.resp-btn:disabled {
    opacity: 0.5;
}

.resp-widget[data-status="accepted"] .resp-btn-accepted {
    color: #fff;
    background: var(--status-success);
    border-color: var(--status-success);
}

.resp-widget[data-status="maybe"] .resp-btn-maybe {
    color: #212529;
    background: var(--status-warning);
    border-color: var(--status-warning);
}

.resp-widget[data-status="declined"] .resp-btn-declined {
    color: #fff;
    background: var(--status-danger);
    border-color: var(--status-danger);
}

.resp-widget[aria-busy="true"] {
    opacity: 0.85;
}

.resp-comment {
    color: var(--muted-color);
    font-size: 0.82rem;
}

.resp-card .resp-buttons {
    max-width: 440px;
}

/* Abgesagt-/Kader-Sheets */
.app-sheet-centered {
    left: 0;
    right: 0;
}

@media (min-width: 768px) {
    .app-sheet-centered {
        max-width: 560px;
        margin-inline: auto;
    }
}

.reason-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.reason-chip {
    min-height: 44px;
    padding: 0.35rem 1rem;
    color: var(--text-color);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 999px;
}

.reason-chip[aria-pressed="true"] {
    color: var(--dept-on-strong);
    background: var(--dept-strong);
    border-color: var(--dept-strong);
}

.sheet-link.active {
    font-weight: 700;
}

/* Toast */
.quick-toast-container {
    position: fixed;
    top: calc(var(--sticky-top) + 0.5rem);
    right: 0;
    left: 0;
    z-index: 1095;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 0.75rem;
    pointer-events: none;
}

.quick-toast-container .toast {
    pointer-events: auto;
}

@media (min-width: 768px) {
    .quick-toast-container {
        top: auto;
        bottom: 1rem;
        left: auto;
        align-items: flex-end;
    }
}

/* Termin-Detail */
.detail-header {
    position: sticky;
    top: var(--sticky-top);
    z-index: 1025;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 -0.75rem 0.75rem;
    padding: 0.4rem 0.75rem;
    background: var(--dept-background);
    border-bottom: 1px solid var(--border-color);
}

.detail-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.detail-back,
.detail-menu-btn {
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    background: transparent;
    border: 0;
    border-radius: 50%;
}

.detail-back:hover,
.detail-menu-btn:hover {
    background: var(--surface-muted);
}

.segment-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    padding: 0.25rem;
    overflow-x: auto;
    background: var(--surface-muted);
    border-radius: 0.75rem;
    scrollbar-width: none;
}

.segment-tabs button {
    min-height: 44px;
    flex: 1 0 auto;
    padding: 0.35rem 0.9rem;
    color: var(--text-color);
    background: transparent;
    border: 0;
    border-radius: 0.55rem;
    font-weight: 600;
    white-space: nowrap;
}

.segment-tabs button.active {
    color: var(--dept-on-strong);
    background: var(--dept-strong);
}

.event-hero {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--type-color, var(--muted-color));
    border-radius: 0.75rem;
}

.hero-date {
    margin-top: 0.4rem;
    color: var(--muted-color);
}

.hero-relative {
    margin-right: 0.4rem;
    padding: 0.05rem 0.5rem;
    color: var(--dept-on-strong);
    background: var(--dept-strong);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.hero-time {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
}

.hero-where {
    margin-top: 0.75rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.hero-actions .btn {
    flex: 1 1 10rem;
}

.hero-privacy {
    display: block;
    margin-top: 0.4rem;
    color: var(--muted-color);
    font-size: 0.75rem;
}

.hero-description {
    margin: 0.75rem 0 0;
}

.nom-group-title {
    margin: 0;
    padding: 0.5rem 1rem;
    background: var(--surface-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.nom-group-accepted { color: var(--status-success); }
.nom-group-declined { color: var(--status-danger); }
.nom-group-maybe { color: color-mix(in srgb, var(--status-warning) 70%, var(--text-color)); }
.nom-group-pending { color: var(--muted-color); }

.nom-group.is-empty {
    display: none;
}

.nom-row {
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.nom-name {
    font-weight: 600;
}

.nom-reason {
    color: var(--muted-color);
    font-size: 0.82rem;
}

.nom-menu-btn {
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    color: var(--muted-color);
    background: transparent;
    border: 0;
    border-radius: 50%;
}

.nom-menu-btn:hover {
    background: var(--surface-muted);
}

.response-bar {
    position: fixed;
    right: 0;
    bottom: calc(64px + env(safe-area-inset-bottom));
    left: 0;
    z-index: 1034;
    display: grid;
    gap: 0.5rem;
    max-height: 45vh;
    padding: 0.5rem 0.75rem;
    overflow-y: auto;
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -0.25rem 1rem rgb(0 0 0 / 10%);
}

.response-bar-title {
    color: var(--muted-color);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.event-layout.with-response-bar {
    padding-bottom: 8rem;
}

@media (min-width: 768px) {
    .response-bar {
        bottom: 0;
    }
}

@media (min-width: 1200px) {
    .response-bar {
        left: 264px;
    }
}

@media (max-width: 1279.98px) {
    .event-main,
    .event-aside {
        display: contents;
    }

    .event-layout[data-active-tab="overview"] .detail-pane:not([data-pane="overview"]),
    .event-layout[data-active-tab="roster"] .detail-pane:not([data-pane="roster"]),
    .event-layout[data-active-tab="helpers"] .detail-pane:not([data-pane="helpers"]),
    .event-layout[data-active-tab="manage"] .detail-pane:not([data-pane="manage"]) {
        display: none;
    }
}

@media (min-width: 1280px) {
    .segment-tabs {
        display: none;
    }

    .event-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 380px;
        gap: 1.5rem;
        align-items: start;
    }

    .event-layout.with-response-bar {
        padding-bottom: 0;
    }

    .event-aside {
        position: sticky;
        top: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}

.resp-bar .resp-btn {
    min-height: 44px;
}


/* --- Verwaltung (AP4) --- */
.admin-subnav {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
    scrollbar-width: none;
}

.admin-subnav-link {
    flex: 0 0 auto;
    padding: 0.55rem 0.85rem;
    color: var(--muted-color);
    border-bottom: 3px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.admin-subnav-link:hover,
.admin-subnav-link:focus-visible {
    color: var(--text-color);
}

.admin-subnav-link.active {
    color: var(--primary-action-color);
    border-bottom-color: var(--dept-accent);
    font-weight: 700;
}

.admin-subnav-secondary {
    margin-top: -0.75rem;
    padding-left: 0.5rem;
    background: var(--surface-muted);
    border-radius: 0.5rem 0.5rem 0 0;
}

.admin-subnav-tertiary {
    margin-top: -0.75rem;
}

.admin-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 1rem;
}

.admin-hub-card {
    color: var(--text-color);
    background: var(--surface);
    border: 1px solid var(--border-color);
    transition: border-color 0.15s ease;
}

.admin-hub-card:hover,
.admin-hub-card:focus-visible {
    color: var(--text-color);
    border-color: var(--dept-strong);
}

.admin-hub-card-danger {
    border-color: color-mix(in srgb, var(--status-danger) 55%, var(--border-color));
}

.admin-user-list {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border-color);
}

.admin-user-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem 0.75rem;
    align-items: center;
    padding: 0.75rem 1rem;
}

.admin-user-row + .admin-user-row {
    border-top: 1px solid var(--border-color);
}

.admin-user-row.is-locked {
    background: color-mix(in srgb, var(--status-danger) 7%, var(--surface));
}

.admin-user-name {
    color: var(--text-color);
    font-weight: 700;
    text-decoration: none;
}

.admin-user-name:hover {
    text-decoration: underline;
}

.admin-user-chips {
    grid-column: 1 / -1;
    grid-row: 2;
}

.admin-user-edit {
    grid-column: 2;
    grid-row: 1;
}

@media (min-width: 768px) {
    .admin-user-row {
        grid-template-columns: minmax(220px, 1.2fr) minmax(0, 2fr) auto;
    }

    .admin-user-chips {
        grid-column: 2;
        grid-row: 1;
    }

    .admin-user-edit {
        grid-column: 3;
    }
}

.danger-zone {
    padding: 1rem;
    border: 1px solid color-mix(in srgb, var(--status-danger) 55%, var(--border-color));
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--status-danger) 6%, var(--surface));
}

.security-kill-switch {
    margin-top: 2rem;
    border-width: 2px;
}

.brand-preview {
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
}

.brand-preview-bar {
    padding: 0.6rem 0.9rem;
    font-weight: 700;
}

.brand-preview-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.9rem;
}

.brand-logo-preview {
    max-width: 64px;
    max-height: 64px;
    object-fit: contain;
}

.brand-logo-preview-wide {
    max-width: 200px;
    max-height: 56px;
}

.app-brand-logo-wide {
    height: 34px;
    max-width: 160px;
    border-radius: 0.375rem;
    background: #fff;
    object-fit: contain;
    padding: 0.2rem 0.4rem;
}

.skip-link:focus-visible {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2000;
    padding: 0.5rem 0.9rem;
    border: 2px solid var(--brand-strong);
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--text-color);
    box-shadow: 0 0.25rem 1rem rgb(0 0 0 / 0.25);
    text-decoration: none;
}

#main-content:focus-visible {
    outline: none;
}

.app-footer {
    color: var(--muted-color);
}

.app-footer .list-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
}

.app-footer .list-inline-item:not(:last-child) {
    margin-right: 0;
}

.app-footer a {
    color: inherit;
}

.app-footer a:hover,
.app-footer a:focus-visible {
    color: var(--brand-link);
}
