/* Custom Styles für Wettkampf-App */

@import 'https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css';
@import 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css';

:root {
    --primary-color: #dc2626;
    --secondary-color: #b91c1c;
    --accent-color: #f87171;
    --status-planned-bg: #fff3cd;
    --status-planned-text: #664d03;
    --status-ongoing-bg: #d1e7dd;
    --status-ongoing-text: #0f5132;
    --status-completed-bg: #f8d7da;
    --status-completed-text: #842029;
    --status-unknown-bg: #e2e3e5;
    --status-unknown-text: #41464b;
}

@media print {
        .no-print, .btn, .navbar, footer { display: none !important; }
        .group-card { page-break-inside: avoid; margin-bottom: 24px; }
        .group-container { margin-bottom: 24px; }
}

@page {
    size: portrait;
}

.print-only {
    display: none;
}

.screen-only {
    display: block;
}

.group-container
{   
    border: 2px solid #dee2e6; 
    border-radius: 8px;
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Login */
body.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
}

.login-logo {
    width: 96px;
    height: auto;
}

/* Navigation (scoped to app theme) */
.mo5k-theme .navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.mo5k-theme .navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

@media (max-width: 991.98px) {
    .mo5k-theme .navbar .dropdown-menu {
        width: 100%;
        margin-top: 0.35rem;
    }

    .mo5k-theme .navbar .dropdown-item {
        padding-top: 0.55rem;
        padding-bottom: 0.55rem;
    }
}

/* Mobile Fencing */

        .sticky-topbar { position: sticky; top: 0; z-index: 20; background:var(--secondary-color);; color: #fff; padding: 10px 12px; }
        .entry-card { border: 0; border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
        .fight-card { border: 0; border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.08); border-left: 4px solid var(--primary-color); }
        .combo-btn { border-radius: 12px; padding: 14px 12px; font-size: 1rem; font-weight: 600; text-align: left; }
        .combo-btn .sub { font-size: .78rem; font-weight: 400; opacity: .85; display: block; margin-top: 2px; }
        .lbl { font-size: .72rem; text-transform: uppercase; font-weight: 700; color: #6c757d; margin-bottom: .2rem; }
        .big-input { min-height: 52px; font-size: 1.15rem; font-weight: 600; text-align: center; }
        .save-btn { width: 100%; min-height: 52px; font-weight: 700; font-size: 1.1rem; }
        .status-ok { color: #166534; }
        .status-err { color: #991b1b; }
        .debug-box { background: #f5f5f5; border: 1px solid #ddd; border-radius: 4px; padding: 10px; margin-top: 20px; font-size: 0.8rem; font-family: monospace; }
        .debug-ok { color: green; }

/* Mobile Dashboard */
        .topbar {
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
            color: #fff;
            padding: 12px 16px;
            position: sticky;
            top: 0;
            z-index: 10;
        }
        .info-card {
            border: 0;
            border-radius: 14px;
            box-shadow: 0 2px 10px rgba(0,0,0,.08);
        }
        .discipline-btn {
            border-radius: 14px;
            padding: 18px 14px;
            font-size: 1.05rem;
            font-weight: 600;
        }
        .discipline-subtext {
            display: block;
            font-size: 0.78rem;
            opacity: 0.95;
            margin-top: 4px;
            font-weight: 500;
        }
        .stack-gap > * + * { margin-top: 12px; }


 /* Mobile Timekeeping */       
        .time-input {
            font-size: 1.1rem;
            font-weight: 600;
            text-align: center;
        }
        .save-btn {
            min-width: 110px;
        }
    
/* Cards (scoped to app theme) */
.mo5k-theme .card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.mo5k-theme .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mo5k-theme .card-header {
    border-radius: 8px 8px 0 0;
    font-weight: 600;
}

.card-discipline {
    border-left: 4px solid var(--accent-color);
    cursor: pointer;
    transition: all 0.2s;
}
.card-discipline:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.stat-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin: 2px;
}
.stat-badge.primary { background-color: #e7f3ff; color: #0066cc; }
.stat-badge.success { background-color: #e8f5e9; color: #2e7d32; }
.stat-badge.warning { background-color: #fff3e0; color: #e65100; }
.status-badge {
    font-size: 14px;
    padding: 6px 12px;
}

.competition-status-badge {
    font-size: 0.8rem;
    padding: 0.38rem 0.62rem;
    border-radius: 999px;
    font-weight: 600;
}

.competition-status-planned {
    background-color: var(--status-planned-bg);
    color: var(--status-planned-text);
}

.competition-status-ongoing {
    background-color: var(--status-ongoing-bg);
    color: var(--status-ongoing-text);
}

.competition-status-completed {
    background-color: var(--status-completed-bg);
    color: var(--status-completed-text);
}

.competition-status-unknown {
    background-color: var(--status-unknown-bg);
    color: var(--status-unknown-text);
}

/* Buttons */
.btn-red  { 
    background: var(--primary-color); 
    border-color: var(--secondary-color); 
    color: #fff; 
}

.btn-red:hover 
{ 
    background: var(--secondary-color); 
    border-color: var(--primary-color); 
    color: #fff; 
}

.btn-red-outline 
{ 
    border: 1px solid var(--primary-color); 
    color: var(--primary-color); 
    background: transparent; 
}

.btn-red-outline:hover 
{ 
    background: var(--primary-color); 
    color: #fff; 
}

.mo5k-theme .btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s;
}

.mo5k-theme .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff; 
}

.mo5k-theme .btn-outline-primary {
    background-color: #fff;
    border-color: var(--primary-color);
    color: var(--primary-color); 
}

.mo5k-theme .btn-outline-primary:hover,
.mo5k-theme .btn-outline-primary:active {
    background-color: #fff;
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.mo5k-theme .btn-primary:hover,
.mo5k-theme .btn-primary:active {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff; 
}

@media (max-width: 767.98px) {
    div.competition-action-buttons {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }

    div.competition-action-buttons > .btn {
        width: 100% !important;
        flex: 0 0 auto !important;
        justify-content: flex-start !important;
        display: flex !important;
    }
}

.discipline-controls {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.discipline-toggle {
    border-radius: 0.5rem 0.5rem 0 0;
    border-bottom-width: 2px;
    background: #f8f9fa;
    color: var(--primary-color);
}

.discipline-toggle.active {
    background: var(--secondary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.discipline-toggle .chevron {
    display: inline-block;
    transition: transform 0.2s ease;
}

.discipline-toggle:not(.active) .chevron {
    transform: rotate(-90deg);
}

.discipline-hidden {
    display: none;
}
/* Tables (scoped to app theme) */
.mo5k-theme .table {
    background-color: white;
}

.mo5k-theme .table thead {
    background-color: #f8f9fa;
}

.mo5k-theme .table td {
    vertical-align: middle;
}

.mo5k-theme .table td {
    padding:8px; border:1px solid #ddd;
}

/* Forms (scoped to app theme) */
.mo5k-theme .form-control,
.mo5k-theme .form-select {
    border-radius: 6px;
    border: 1px solid #ddd;
}

.mo5k-theme .form-control:focus,
.mo5k-theme .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Alerts (scoped + variant-safe) */
.mo5k-theme .alert {
    border-radius: 6px;
    border: none;
}

.mo5k-theme .alert-danger {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: var(--secondary-color);
    border-radius: 10px;
    padding: .5rem .75rem;
    font-size: .88rem;
}

.mo5k-theme .alert-success {
    background: #d1e7dd;
    border: 1px solid #a3cfbb;
    color: #0f5132;
}

.mo5k-theme .alert-warning {
    background: #fff3cd;
    border: 1px solid #ffecb5;
    color: #664d03;
}

.mo5k-theme .alert-info {
    background: #cff4fc;
    border: 1px solid #9eeaf9;
    color: #055160;
}

/* Badges */
.mo5k-theme .badge {
    padding: 0.5rem 0.75rem;
    font-weight: 500;
}

/* Main content */
main {
    min-height: calc(100vh - 200px);
    padding: 20px 0;
}

footer {
    border-top: 1px solid #ddd;
    margin-top: 40px;
}

.precision-round-head {
    border-left: 2px solid #dee2e6;
    background: #f8f9fa;
}

.precision-round-cell {
    border-left: 2px solid #e9ecef;
    min-width: 100px;
}


/* Responsive adjustments */
@media (max-width: 767.98px) {
    .mo5k-theme .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }

    .login-logo {
        width: 80px;
    }
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

/* Icons */
i {
    margin-right: 0.25rem;
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-buttons .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Utility classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.border-start-4 {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

/* Utility: width (px) */
.u-w-10 { width: 10px; }
.u-w-40 { width: 40px; }
.u-w-45 { width: 45px; }
.u-w-50 { width: 50px; }
.u-w-55 { width: 55px; }
.u-w-60 { width: 60px; }
.u-w-70 { width: 70px; }
.u-w-80 { width: 80px; }
.u-w-90 { width: 90px; }
.u-w-100 { width: 100px; }
.u-w-110 { width: 110px; }
.u-w-120 { width: 120px; }
.u-w-130 { width: 130px; }
.u-w-140 { width: 140px; }
.u-w-170 { width: 170px; }
.u-w-200 { width: 200px; }

/* Utility: width (%) */
.u-w-5p { width: 5%; }
.u-w-12p { width: 12%; }
.u-w-15p { width: 15%; }
.u-w-18p { width: 18%; }
.u-w-25p { width: 25%; }
.u-w-30p { width: 30%; }
.u-w-33p { width: 33%; }
.u-w-35p { width: 35%; }
.u-w-43p { width: 43%; }

/* Utility: min/max width */
.u-min-w-40 { min-width: 40px; }
.u-min-w-50 { min-width: 50px; }
.u-min-w-80 { min-width: 80px; }
.u-min-w-100 { min-width: 100px; }
.u-min-w-110 { min-width: 110px; }
.u-min-w-140 { min-width: 140px; }
.u-min-w-150 { min-width: 150px; }
.u-min-w-180 { min-width: 180px; }
.u-min-w-190 { min-width: 190px; }
.u-min-w-220 { min-width: 220px; }

.u-max-w-72 { max-width: 72px; }
.u-max-w-90 { max-width: 90px; }
.u-max-w-110 { max-width: 110px; }
.u-max-w-140 { max-width: 140px; }
.u-max-w-150 { max-width: 150px; }
.u-max-w-180 { max-width: 180px; }

/* Utility: spacing/display */
.u-d-none { display: none; }
.u-d-inline { display: inline; }

.u-mt-2px { margin-top: 2px; }
.u-mt-4px { margin-top: 4px; }
.u-mt-40 { margin-top: 40px; }
.u-mt-10-c-666 { margin-top: 10px; color: #666; }

.u-p-12 { padding: 12px; }
.u-p-15 { padding: 15px; }

/* Utility: typography/colors */
.u-fs-08em { font-size: 0.8em; }
.u-fs-09em { font-size: 0.9em; }
.u-fs-1rem { font-size: 1rem; }
.u-fs-105em { font-size: 1.05em; }
.u-fs-25rem { font-size: 2.5rem; }

.u-c-bronze { color: #cd7f32; }
.u-bg-343a40 { background-color: #343a40; }
.u-bg-white { background: #fff; }

/* Utility: interaction */
.u-cursor-pointer { cursor: pointer; }
.u-pe-none-op-75 { pointer-events: none; opacity: .75; }

/* Utility: borders/background helpers */
.u-border-left-primary-4 { border-left: 4px solid #007bff; }
.u-border-info-soft { border-color: #0dcaf0; background-color: rgba(13, 202, 240, 0.05); }

.u-chip-gray { background: #f0f0f0; padding: 2px 6px; border-radius: 3px; font-size: 12px; }
.u-badge-laserrun-points { background-color: #fd7e14 !important; color: #fff; }

/* Utility: component/layout helpers */
.u-h-6 { height: 6px; }
.u-h-2rem { height: 2rem; }

.u-max-h-400-scroll {
    max-height: 400px;
    overflow-y: auto;
}

.u-embed-85vh { width: 100%; height: 85vh; border: none; }
.u-embed-85vh-alt { display: block; width: 100%; height: 85vh; border: 1; background: #fff; }

.u-td-base {
    padding: 8px;
    border: 1px solid #ddd;
}

.u-p12-va-mid {
    padding: 12px;
    vertical-align: middle;
}

.u-p12-mid-center-bold {
    padding: 12px;
    vertical-align: middle;
    text-align: center;
    font-weight: bold;
}

.u-row-played-muted {
    background-color: #f8f9fa;
    opacity: 0.75;
}

.u-input-shot-compact { width: 37px; padding: 1px 1px; }

.u-code-sample {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
}

/* Utility: page-specific helper classes */
.reset-password-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.discipline-top-info { border-top: 4px solid var(--bs-info); }
.discipline-top-danger { border-top: 4px solid var(--bs-danger); }
.discipline-top-warning { border-top: 4px solid var(--bs-warning); }
.discipline-top-primary { border-top: 4px solid var(--bs-primary); }
.discipline-top-success { border-top: 4px solid var(--bs-success); }
.discipline-top-secondary { border-top: 4px solid var(--bs-secondary); }
.discipline-top-purple { border-top: 4px solid var(--secondary-color); }

/* Draggable items for fencing startlist */
.draggable-item {
    cursor: move;
}

.draggable-item.dragging {
    opacity: 0.5;
    background: var(--accent-color);
}

/* Page: Age Classes */
@media print {
    .discipline-hidden {
        display: table-cell !important;
    }
}

/* Page: Clubs */
.filter-section {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.club-section {
    margin-bottom: 30px;
    page-break-inside: avoid;
}

.club-header {
    background-color: #007bff;
    color: #fff;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-weight: bold;
}

.badge-pill-custom {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 5px;
    margin-bottom: 5px;
}

@media print {
    .filter-section {
        display: none;
    }
}

/* Page: Public Startlists */
.collapse-icon::before {
    content: '▶';
    display: inline-block;
    transition: transform 0.3s ease;
    margin-right: 8px;
}

.card-header[data-bs-toggle="collapse"][aria-expanded="true"] .collapse-icon::before {
    transform: rotate(90deg);
}

/* Cookie notice */
.cookie-notice {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1085;
    background: rgba(23, 27, 34, 0.97);
    color: #f8f9fa;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 -0.5rem 1rem rgba(0, 0, 0, 0.18);
}

.cookie-notice__content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.85rem 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.cookie-notice__text {
    font-size: 0.92rem;
}

.cookie-notice__actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Help pages */
.help-hero {
    background: linear-gradient(135deg, #e9f4ff 0%, #f8fbff 55%, #ffffff 100%);
    border: 1px solid #d8e9fb;
    border-radius: 14px;
    padding: 1.5rem;
}

.help-card {
    border: 0;
    border-left: 4px solid #0d6efd;
    border-radius: 12px;
    box-shadow: 0 0.5rem 1.25rem rgba(13, 110, 253, 0.08);
}

.help-card h3,
.help-card h4 {
    color: #0b3b74;
}

.help-checklist li {
    margin-bottom: 0.35rem;
}

.help-sticky-actions {
    position: sticky;
    top: 1rem;
}

.admin-help-hero {
    background: linear-gradient(135deg, #eef8f0 0%, #f8fcf9 60%, #ffffff 100%);
    border: 1px solid #d7eadc;
    border-radius: 14px;
    padding: 1.5rem;
}

.admin-help-card {
    border: 0;
    border-left: 4px solid #198754;
    border-radius: 12px;
    box-shadow: 0 0.5rem 1.25rem rgba(25, 135, 84, 0.08);
}

.admin-help-card h2,
.admin-help-card h3 {
    color: #145c38;
}

.admin-help-steps li {
    margin-bottom: 0.35rem;
}

/* Cup drag and drop */
.cup-dnd-list {
    min-height: 220px;
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    padding: .5rem;
    background: var(--bs-light-bg-subtle);
}

.cup-dnd-list[data-role="selected"] {
    background: #eaf4ff;
    border-color: #6ea8fe;
}

.cup-dnd-item {
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    padding: .5rem .65rem;
    margin-bottom: .4rem;
    cursor: grab;
}

.cup-dnd-list[data-role="selected"] .cup-dnd-item {
    border-color: #6ea8fe;
    background: linear-gradient(180deg, #ffffff 0%, #f3f9ff 100%);
    box-shadow: inset 0 0 0 1px rgba(13, 110, 253, 0.08);
}

.cup-dnd-item:active {
    cursor: grabbing;
}

.cup-dnd-list.is-drop-target {
    outline: 2px dashed var(--bs-primary);
    outline-offset: 2px;
}

.js-cup-dnd[data-picker="age-classes"] .cup-dnd-list {
    max-height: none;
    overflow: visible;
}

/* Helper print page */
.helper-referee-print-page {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: #1f2937;
    background: #ffffff;
}

.helper-referee-print-page .wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px;
}

.helper-referee-print-page h1 {
    margin: 0 0 10px 0;
    color: #0b3b74;
    font-size: 28px;
}

.helper-referee-print-page h2 {
    margin-top: 28px;
    margin-bottom: 10px;
    color: #0f4b8a;
    font-size: 20px;
    border-bottom: 1px solid #d7e4f2;
    padding-bottom: 6px;
}

.helper-referee-print-page p,
.helper-referee-print-page li {
    font-size: 15px;
    line-height: 1.45;
}

.helper-referee-print-page ul,
.helper-referee-print-page ol {
    margin-top: 8px;
}

.helper-referee-print-page .note {
    background: #eef6ff;
    border-left: 4px solid #0d6efd;
    padding: 12px 14px;
    margin: 14px 0;
}

.helper-referee-print-page .actions {
    margin-bottom: 16px;
}

.helper-referee-print-page .btn {
    display: inline-block;
    text-decoration: none;
    border: 1px solid #b8c8dc;
    border-radius: 6px;
    padding: 8px 12px;
    color: #1f2937;
    margin-right: 8px;
    margin-bottom: 8px;
}

.helper-referee-print-page .btn-primary {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
}

@media (max-width: 767.98px) {
    .cookie-notice__content {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-notice__actions {
        width: 100%;
    }

    .cookie-notice__actions .btn {
        flex: 1;
    }

    .entry-meta {
        font-size: 0.78rem;
        line-height: 1.2;
    }
}

/* Page: Fencing Startlist */
.team-card {
    background: #fff;
}

.round-group-start td {
    border-top: 2px solid #9ec5fe !important;
}

.round-label-cell {
    background: #eef4ff;
    font-weight: 700;
    vertical-align: middle !important;
}

@media print {
    .helper-referee-print-page .actions {
        display: none;
    }

    .helper-referee-print-page .wrap {
        max-width: none;
        padding: 0;
    }

    .helper-referee-print-page h1 {
        font-size: 24px;
    }

    .helper-referee-print-page h2 {
        font-size: 18px;
    }

    .print-card {
        page-break-inside: avoid;
        margin-bottom: 14px;
        border: 1px solid #d5d5d5;
        border-radius: 6px;
        padding: 10px;
    }

    .print-slot-title {
        font-weight: 700;
        margin: 6px 0;
    }

    .print-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 10px;
        font-size: 12px;
    }

    .print-table th,
    .print-table td {
        border: 1px solid #cfcfcf;
        padding: 4px 6px;
        vertical-align: top;
    }

    .print-round-title {
        font-size: 15px;
        font-weight: 700;
        margin-bottom: 8px;
    }

    .lane-print-page {
        page-break-after: always;
    }

    .lane-print-page:last-child {
        page-break-after: auto;
    }
}

/* Page: Overall Results */
@media print {
    .group-card {
        page-break-inside: avoid;
        margin-bottom: 24px;
    }
}

@media (max-width: 767.98px) {
    .overall-mobile-card {
        border: 1px solid #e9ecef;
        border-radius: 10px;
        padding: 10px;
        margin-bottom: 10px;
        background: #fff;
    }

    .overall-mobile-athlete-toggle {
        cursor: pointer;
    }

    .overall-mobile-ultra-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .overall-mobile-ultra-name {
        font-weight: 600;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 70vw;
    }

    .overall-mobile-ultra-club {
        color: #6c757d;
        font-size: 0.82rem;
        line-height: 1.2;
        max-width: 70vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .overall-mobile-ultra-hidden {
        display: none;
    }

    .overall-mobile-total {
        font-weight: 700;
        font-size: 1rem;
    }

    .overall-mobile-details {
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
        transition: max-height 220ms ease, opacity 180ms ease, margin-top 220ms ease, padding-top 220ms ease;
    }

    .overall-mobile-details.is-open {
        opacity: 1;
        margin-top: 10px;
        padding-top: 8px;
        border-top: 1px solid #edf0f2;
    }

    .overall-mobile-detail-row {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 10px;
        padding: 5px 0;
        font-size: 0.88rem;
    }

    .overall-mobile-detail-label {
        color: #6c757d;
    }

    .overall-mobile-detail-value {
        text-align: right;
        font-weight: 600;
    }

    .overall-mobile-detail-sub {
        display: block;
        font-size: 0.76rem;
        color: #6c757d;
        font-weight: 400;
    }
}

/* Page: Fencing Results (scoped to avoid class collisions) */
@page fencing-results {
    size: landscape;
}

@media print {
    body.fencing-results-page {
        page: fencing-results;
    }

    body.fencing-results-page .matrix-card {
        page-break-inside: avoid;
        margin-bottom: 2px;
    }

    body.fencing-results-page .matrix-wrap {
        overflow: visible !important;
    }
}

body.fencing-results-page .matrix-wrap {
    overflow: auto;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    background: #fff;
}

body.fencing-results-page .fencing-matrix {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
}

body.fencing-results-page .fencing-matrix th,
body.fencing-results-page .fencing-matrix td {
    border-right: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
    vertical-align: middle;
    padding: .35rem .5rem;
    font-size: .86rem;
}

body.fencing-results-page .fencing-matrix thead th {
    background: #f8f9fa;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 2;
}

body.fencing-results-page .sticky-left {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #fff;
    height: 50px;
}

body.fencing-results-page .sticky-left.header {
    background: #f8f9fa;
    z-index: 4;
}

body.fencing-results-page .col-head {
    min-width: 50px;
    width: 50px;
    max-width: 50px;
    height: 180px;
    padding: .25rem;
}

body.fencing-results-page .col-number-head {
    min-width: 50px;
    width: 50px;
    height: 34px;
    padding: .2rem .25rem;
}

body.fencing-results-page .col-head .col-number {
    display: block;
    font-size: .95rem;
    font-weight: 800;
}

body.fencing-results-page .col-head .rotated-name {
    transform: rotate(-90deg);
    transform-origin: center;
    font-size: 0.8rem;
    color: #495057;
    max-height: 1rem;
}

body.fencing-results-page .rotated-name {
    display: inline-block;
    min-width: 300px;
}

body.fencing-results-page .self-cell {
    background-color: #666666;
    color: #666666;
    font-weight: 700;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

body.fencing-results-page .result-cell {
    font-weight: 700;
}

body.fencing-results-page .result-dd {
    display: block;
    font-size: .68rem;
    color: #6c757d;
    font-weight: 500;
    margin-top: 2px;
}

body.fencing-results-page .row-athlete {
    text-align: left !important;
    min-width: 210px;
}

body.fencing-results-page .row-athlete .n {
    font-weight: 800;
    color: #0d6efd;
}

body.fencing-results-page .row-athlete .nm {
    font-weight: 600;
}

body.fencing-results-page .summary-col {
    min-width: 48px;
    width: 48px;
    padding-left: .25rem !important;
    padding-right: .25rem !important;
    font-weight: 700;
    background: #fafafa;
}

body.fencing-results-page .result-cell,
body.fencing-results-page .self-cell {
    min-width: 50px;
    width: 50px;
}

body.fencing-results-page .summary-total {
    background: #fff3cd;
}

/* Page: Fencing Bout Entry (scoped mobile styles) */
@media (max-width: 767.98px) {
    body.tk-fencing-bout-page,
    body.ref-fencing-bout-page {
        background: #f6f7fb;
    }

    body.tk-fencing-bout-page .sticky-topbar,
    body.ref-fencing-bout-page .sticky-topbar {
        position: sticky;
        top: 0;
        z-index: 20;
        background: #198754;
        color: #fff;
        padding: 10px 12px;
        margin: -0.5rem -0.75rem 1rem;
    }

    body.tk-fencing-bout-page .entry-card,
    body.ref-fencing-bout-page .entry-card {
        border: 0;
        border-radius: 14px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    }

    body.tk-fencing-bout-page .fight-mobile-card,
    body.ref-fencing-bout-page .fight-mobile-card {
        background: #fff;
        border: 0;
        border-radius: 14px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    }

    body.tk-fencing-bout-page .fight-mobile-card .form-label-sm,
    body.ref-fencing-bout-page .fight-mobile-card .form-label-sm {
        font-size: 0.75rem;
        text-transform: uppercase;
        font-weight: 600;
        color: #6c757d;
        margin-bottom: 0.25rem;
    }

    body.tk-fencing-bout-page .fight-mobile-card .form-control,
    body.ref-fencing-bout-page .fight-mobile-card .form-control {
        min-height: 45px;
        font-size: 1rem;
        padding: 0.5rem;
    }

    body.tk-fencing-bout-page .mobile-context-alert,
    body.ref-fencing-bout-page .mobile-context-alert {
        background: #e8f5ee;
        border: 1px solid #b7e0c7;
        color: #0f5132;
    }

    body.tk-fencing-bout-page .mobile-save-wrap,
    body.ref-fencing-bout-page .mobile-save-wrap {
        margin-bottom: 1.25rem;
    }

    body.tk-fencing-bout-page .mobile-save-btn,
    body.ref-fencing-bout-page .mobile-save-btn {
        width: 100%;
        min-height: 52px;
        background: #198754;
        border-color: #198754;
        font-weight: 600;
    }

    body.tk-fencing-bout-page .mobile-save-btn:hover,
    body.ref-fencing-bout-page .mobile-save-btn:hover {
        background: #157347;
        border-color: #157347;
    }
}

/* Page: Mobile Fencing Entry v2 */
body.mobile-fencing-v2-page {
    background: #fff5f5;
}

body.mobile-fencing-v2-page .sticky-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #b91c1c;
    color: #fff;
    padding: 10px 12px;
}

body.mobile-fencing-v2-page .entry-card {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}

body.mobile-fencing-v2-page .fight-card {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    border-left: 4px solid #dc2626;
}

body.mobile-fencing-v2-page .lbl {
    font-size: .72rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #6c757d;
    margin-bottom: .2rem;
}

body.mobile-fencing-v2-page .big-input {
    min-height: 52px;
    font-size: 1.15rem;
    font-weight: 600;
    text-align: center;
}

body.mobile-fencing-v2-page .ctx-bar {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #7f1d1d;
    border-radius: 10px;
    padding: .5rem .75rem;
    font-size: .88rem;
}

body.mobile-fencing-v2-page .combo-btn {
    border-radius: 12px;
    padding: 14px 12px;
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
}

body.mobile-fencing-v2-page .combo-btn .sub {
    font-size: .78rem;
    font-weight: 400;
    opacity: .85;
    display: block;
    margin-top: 2px;
}

body.mobile-fencing-v2-page .save-btn {
    width: 100%;
    min-height: 52px;
    font-weight: 700;
    font-size: 1.1rem;
}

body.mobile-fencing-v2-page .debug-box {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-top: 20px;
    font-size: 0.8rem;
    font-family: monospace;
    max-height: 300px;
    overflow-y: auto;
}

body.mobile-fencing-v2-page .debug-ok {
    color: green;
}

body.mobile-fencing-v2-page .debug-err {
    color: red;
}


