.tts-module--tournament-overview {
    --tov-accent: var(--tts-accent, #4527a0);
}

.tournament-overview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.75rem 0.5rem 1.25rem;
}

.tov-top-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}

.tov-header__badge {
    display: inline-block;
    margin: 0;
    padding: 0.15rem 0.5rem;
    border-radius: 0.35rem;
    background: #fce8e6;
    color: #c5221f;
    font-size: 0.85rem;
    font-weight: 600;
}

.tov-updated {
    margin: 0;
    font-size: 0.8rem;
    color: var(--tts-text-muted, #5f6368);
}

.tov-kpi-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tov-kpi-row__cards {
    flex: 1 1 auto;
    min-width: 0;
}

.tov-kpi-row__ring {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
}

.tov-ring {
    position: relative;
    width: 8.5rem;
    height: 8.5rem;
    flex-shrink: 0;
}

.tov-ring__svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.tov-ring__track {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 10;
}

.tov-ring__value {
    fill: none;
    stroke: var(--tov-accent);
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.35s ease;
}

.tov-ring__center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
}

.tov-ring__percent {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
}

.tov-ring__sub {
    font-size: 0.75rem;
    color: var(--tts-text-muted, #5f6368);
    margin-top: 0.15rem;
}

.tov-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}

@media (max-width: 768px) {
    .tov-kpi-row {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .tov-kpi-row__ring {
        width: 100%;
        justify-content: flex-end;
    }

    .tov-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.tov-kpi {
    background: #fff;
    border: 1px solid var(--tts-panel-border, #cfd3d8);
    border-radius: 0.65rem;
    padding: 0.75rem 0.85rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tov-kpi__value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.tov-kpi__label {
    margin-top: 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.tov-kpi__hint {
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: var(--tts-text-muted, #5f6368);
}

.tov-kpi--finished .tov-kpi__value { color: #1e8e3e; }
.tov-kpi--ongoing .tov-kpi__value { color: #e37400; }
.tov-kpi--remaining .tov-kpi__value { color: #1967d2; }
.tov-kpi--classes .tov-kpi__value { color: var(--tov-accent); }

.tov-section {
    background: #fff;
    border: 1px solid var(--tts-panel-border, #cfd3d8);
    border-radius: 0.65rem;
    padding: 0.85rem 1rem;
}

.tov-section__title {
    margin: 0 0 0.65rem;
    font-size: 1rem;
    font-weight: 600;
}

.tov-section__summary {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: var(--tts-text-muted, #5f6368);
}

.tov-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.tov-charts-grid--overview-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    align-items: stretch;
}

.tov-charts-grid--overview-row .tov-section {
    padding: 0.55rem 0.6rem;
    min-width: 0;
}

.tov-charts-grid--overview-row .tov-section__title {
    font-size: 0.88rem;
    margin-bottom: 0.4rem;
}

.tov-charts-grid--overview-row .tov-section__summary {
    font-size: 0.72rem;
    line-height: 1.25;
    margin-top: 0.35rem;
}

.tov-charts-grid--overview-row .tov-stacked {
    height: 0.7rem;
}

.tov-charts-grid--overview-row .tov-section--alerts .tov-alerts {
    padding-left: 0.95rem;
    margin: 0;
}

.tov-charts-grid--overview-row .tov-alerts__item {
    font-size: 0.75rem;
    line-height: 1.25;
    margin: 0.12rem 0;
}

.tov-charts-grid--overview-row .tov-empty {
    font-size: 0.72rem;
}

@media (max-width: 992px) {
    .tov-charts-grid--overview-row {
        grid-template-columns: 1fr;
    }
}

.tov-stacked {
    display: flex;
    width: 100%;
    height: 0.85rem;
    border-radius: 0.45rem;
    overflow: hidden;
    background: #eceff1;
}

.tov-stacked--empty {
    min-height: 0.85rem;
}

.tov-stacked__segment {
    height: 100%;
    min-width: 0;
}

.tov-segment--finished { background: #34a853; }
.tov-segment--started { background: #f9ab00; }
.tov-segment--ready { background: #aecbfa; }
.tov-segment--notstarted { background: #9aa0a6; }
.tov-segment--notready { background: #dadce0; }
.tov-segment--paid { background: #34a853; }
.tov-segment--unpaid { background: #ea4335; }
.tov-segment--table-open { background: #34a853; }
.tov-segment--table-started { background: #f9ab00; }
.tov-segment--table-closed { background: #9aa0a6; }

.tov-legend {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
}

.tov-legend__item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
}

.tov-legend__swatch {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 0.15rem;
    flex-shrink: 0;
}

.tov-bar {
    width: 100%;
    height: 0.5rem;
    border-radius: 0.35rem;
    background: #eceff1;
    overflow: hidden;
}

.tov-bar__fill {
    height: 100%;
    background: var(--tov-accent);
    border-radius: inherit;
    transition: width 0.3s ease;
}

.tov-class-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
    gap: 0.65rem;
    align-items: stretch;
}

@media (min-width: 900px) {
    .tov-class-list {
        grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    }
}

@media (min-width: 1200px) {
    .tov-class-list {
        grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    }
}

.tov-class-card {
    box-sizing: border-box;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.65rem 0.75rem;
    background: #fff;
    border: 1px solid var(--tts-panel-border, #cfd3d8);
    border-radius: 0.55rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.tov-class-row__head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    margin-bottom: 0;
}

.tov-class-row__name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.25;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tov-class-row__chip {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 0.35rem;
}

.tov-class-row__chip--finished { background: #e6f4ea; color: #137333; }
.tov-class-row__chip--progress { background: #fef7e0; color: #b06000; }
.tov-class-row__chip--notstarted { background: #e8f0fe; color: #1967d2; }
.tov-class-row__chip--nodraw { background: #f1f3f4; color: #5f6368; }

.tov-class-row__meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.75rem;
    color: var(--tts-text-muted, #5f6368);
    margin-bottom: 0.15rem;
    flex: 1 1 auto;
}

.tov-class-row .tov-bar {
    margin-top: auto;
}

.tov-class-row__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.65rem;
    margin-top: 0.35rem;
    padding-top: 0.25rem;
    border-top: 1px solid #eceff1;
}

.tov-class-row__actions .tov-link {
    font-size: 0.78rem;
}

.tov-link {
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.tov-link:hover {
    text-decoration: underline;
}

.tov-section--alerts .tov-alerts {
    margin: 0;
    padding-left: 1.1rem;
}

.tov-alerts__item {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.tov-empty {
    margin: 0;
    color: var(--tts-text-muted, #5f6368);
}

.tov-section--admin-status {
    border-top: 1px solid var(--tts-panel-border, #cfd3d8);
    padding-top: 0.5rem;
}

.tov-admin-status__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tov-admin-status__head .tov-section__title {
    margin: 0;
}

.tov-admin-status__grid {
    width: 100%;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 0.5rem;
}

.tov-admin-status__grid .tov-kpi {
    padding: 0.45rem 0.5rem;
}

.tov-admin-status__grid .tov-kpi__label {
    font-size: 0.78rem;
    line-height: 1.2;
}

.tov-admin-status__grid .tov-kpi__hint {
    font-size: 0.68rem;
    line-height: 1.2;
}

.tov-admin-status__grid .tov-admin-status__value {
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

@media (max-width: 1200px) {
    .tov-admin-status__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .tov-admin-status__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.tov-admin-status__value {
    font-size: 1.1rem;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.tov-admin-status--ok {
    border-color: #81c995;
    background: #e6f4ea;
}

.tov-admin-status--ok .tov-admin-status__value {
    color: #137333;
}

.tov-admin-status--pending {
    border-color: #fdd663;
    background: #fef7e0;
}

.tov-admin-status--pending .tov-admin-status__value {
    color: #b06000;
}

.tov-admin-status--error {
    border-color: #f28b82;
    background: #fce8e6;
}

.tov-admin-status--error .tov-admin-status__value {
    color: #c5221f;
}

.tov-admin-status--muted {
    opacity: 0.92;
}

.tov-admin-status--count {
    border-color: #c5cae9;
    background: #f8f9fe;
}

.tov-admin-status--count .tov-admin-status__value {
    color: #1a237e;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.tov-admin-status__hint {
    word-break: break-word;
}
