/* Style commun de l'application créneaux TOS */
* { box-sizing: border-box; }
body {
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    margin: 0;
    color: #222;
}
header {
    background: #0b3d91;
    color: white;
    padding: 25px;
    text-align: center;
}
header h1 { margin: 0 0 8px; }
main { max-width: 1150px; margin: 30px auto; padding: 0 20px; }
footer { text-align: center; color: #777; font-size: 13px; margin: 40px 0 20px; }
a { color: #0b3d91; }
.intro, .panel {
    background: white;
    padding: 24px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.card {
    background: white;
    padding: 24px;
    border-radius: 10px;
    text-decoration: none;
    color: #222;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 6px solid #0b3d91;
    transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 4px 14px rgba(0,0,0,0.12); }
.card h2 { margin-top: 0; color: #0b3d91; }
.card.warning { border-left-color: #d98200; }
.card.warning h2 { color: #d98200; }
.card.danger { border-left-color: #b00020; }
.card.danger h2 { color: #b00020; }
.nav { margin-bottom: 20px; }
.nav a { display: inline-block; margin: 0 8px 8px 0; padding: 9px 12px; background: white; border-radius: 8px; text-decoration: none; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
table { width: 100%; border-collapse: collapse; background: white; box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-radius: 10px; overflow: hidden; }
th, td { padding: 12px; border-bottom: 1px solid #eee; text-align: left; vertical-align: top; }
th { background: #0b3d91; color: white; }
tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: bold; }
.badge-ok { background: #e6f4ea; color: #137333; }
.badge-full { background: #fdecea; color: #b00020; }
.badge-warn { background: #fff4e5; color: #9a5b00; }
button, .button {
    display: inline-block;
    padding: 10px 14px;
    border: 0;
    border-radius: 8px;
    background: #0b3d91;
    color: white;
    text-decoration: none;
    cursor: pointer;
}
input[type="number"], input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
}
.notice { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; background: #e6f4ea; color: #137333; }
.error { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; background: #fdecea; color: #b00020; }
.small { color: #666; font-size: 13px; }
.row-full { background: #fff8f8; }
.public-note { margin-top: 14px; }
.admin-link { text-align: right; margin-top: 20px; }
.login-main { max-width: 520px; }
.login-panel label { display: block; margin-bottom: 8px; font-weight: bold; }
.login-panel input[type="password"] { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 6px; }

/* V6 - page publique plus visuelle, organisée par catégorie */
.public-hero h2 { margin-top: 0; }
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.summary-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 6px solid #0b3d91;
}
.summary-card strong {
    display: block;
    font-size: 30px;
    line-height: 1;
    margin-bottom: 6px;
}
.summary-card span { color: #555; }
.summary-ok { border-left-color: #137333; }
.summary-low { border-left-color: #d98200; }
.summary-full { border-left-color: #b00020; }
.public-table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.public-availability-table {
    min-width: 980px;
    box-shadow: none;
    border-radius: 0;
}
.public-availability-table th,
.public-availability-table td {
    border: 1px solid #e7e7e7;
}
.public-availability-table thead th {
    text-align: center;
    vertical-align: middle;
}
.category-cell {
    background: #eef3fb;
    color: #0b3d91;
    font-size: 16px;
    min-width: 130px;
}
.slot-card {
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    border-left: 6px solid #137333;
    background: #f7fbf8;
}
.slot-card:last-child { margin-bottom: 0; }
.slot-title {
    font-weight: bold;
    margin-bottom: 7px;
}
.slot-meta {
    font-size: 14px;
    margin-bottom: 4px;
}
.slot-quota {
    font-size: 12px;
    color: #666;
}
.slot-ok {
    border-left-color: #137333;
    background: #f1f8f3;
}
.slot-low {
    border-left-color: #d98200;
    background: #fff8ed;
}
.slot-full {
    border-left-color: #b00020;
    background: #fff1f1;
}
.slot-empty {
    display: inline-block;
    color: #888;
    font-size: 13px;
    padding: 8px 0;
}
.legend h2 { margin-top: 0; }
.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 6px 0 18px;
    vertical-align: middle;
}
.legend-dot:first-child { margin-left: 0; }
.legend-ok { background: #137333; }
.legend-low { background: #d98200; }
.legend-full { background: #b00020; }

@media (max-width: 700px) {
    header { padding: 18px; }
    main { margin: 18px auto; padding: 0 12px; }
    .intro, .panel { padding: 18px; }
    .summary-card strong { font-size: 25px; }
}

/* V8 - feuilles d'appel imprimables */
.call-sheets-main { max-width: 1200px; }
.call-sheet {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.call-sheet-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 18px;
}
.call-sheet-header h2 { margin: 0 0 6px; color: #0b3d91; }
.call-sheet-header h3 { margin: 0; font-size: 20px; }
.call-sheet-meta { min-width: 260px; font-size: 14px; }
.call-sheet-meta p { margin: 0 0 7px; }
.call-sheet-table th,
.call-sheet-table td { font-size: 13px; padding: 9px; }
.call-sheet-table .col-num { width: 45px; text-align: center; }
.call-sheet-table .col-present { width: 80px; text-align: center; font-size: 18px; }
.call-sheet-table .col-remarks { width: 180px; }
.empty-row { text-align: center; color: #777; font-style: italic; }
.call-sheet-footer { margin-top: 18px; }
.call-sheet-footer p { margin: 0 0 8px; font-weight: bold; }
.notes-lines {
    min-height: 55px;
    border: 1px solid #ddd;
    background: repeating-linear-gradient(
        to bottom,
        #fff,
        #fff 26px,
        #eee 27px
    );
}

@media print {
    body { background: white; color: #000; }
    .no-print, header.no-print, footer.no-print, .nav.no-print { display: none !important; }
    main { max-width: none; margin: 0; padding: 0; }
    .call-sheet {
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        margin: 0;
        page-break-after: always;
        break-after: page;
    }
    .call-sheet:last-child { page-break-after: auto; break-after: auto; }
    .call-sheet-header { margin-bottom: 12px; }
    .call-sheet-header h2 { color: #000; font-size: 22px; }
    .call-sheet-header h3 { font-size: 18px; }
    table { box-shadow: none; border-radius: 0; }
    th { background: #eee !important; color: #000 !important; }
    th, td { border: 1px solid #999 !important; padding: 6px !important; }
    .call-sheet-table th,
    .call-sheet-table td { font-size: 11px; }
    .call-sheet-table .col-present { font-size: 16px; }
    .notes-lines { min-height: 45px; }
}

/* V10 - corrections feuilles d'appel */
.nav a.button,
.nav a.print-all-button {
    background: #0b3d91;
    color: #fff;
    font-weight: bold;
}

.call-sheet-actions {
    text-align: right;
    margin-bottom: 14px;
}

.sheet-print-button {
    background: #137333;
    color: #fff;
    font-weight: bold;
}

.sheet-page-info {
    margin: 8px 0 0;
    color: #555;
    font-size: 14px;
}

.call-sheet-table .manual-empty-row td {
    height: 30px;
}

@media print {
    body.print-single-mode .call-sheet {
        display: none !important;
    }

    body.print-single-mode .call-sheet.print-target {
        display: block !important;
    }

    .call-sheet-actions {
        display: none !important;
    }

    .call-sheet-table .manual-empty-row td {
        height: 24px;
    }
}


/* V11 - encart public vers le formulaire MachForm */
.reservation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: linear-gradient(135deg, #0b3d91, #1f6feb);
    color: #fff;
    padding: 28px;
    border-radius: 14px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.16);
}
.reservation-banner h2 {
    margin: 0 0 10px;
    font-size: 26px;
}
.reservation-banner p {
    margin: 0;
    line-height: 1.5;
}
.reservation-kicker {
    display: inline-block;
    margin: 0 0 8px !important;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.reservation-button {
    display: inline-block;
    flex: 0 0 auto;
    background: #fff;
    color: #0b3d91;
    padding: 14px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.reservation-button:hover {
    background: #eef3fb;
}
.public-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 24px;
}
.public-menu a {
    display: inline-block;
    background: #fff;
    color: #0b3d91;
    padding: 10px 13px;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 1px 5px rgba(0,0,0,0.10);
    font-weight: bold;
}
.public-menu a:hover {
    background: #eef3fb;
}
.public-final-cta {
    text-align: center;
}
.public-final-cta h2 {
    margin-top: 0;
    color: #0b3d91;
}
.public-final-cta .button {
    margin-top: 8px;
}

@media (max-width: 760px) {
    .reservation-banner {
        display: block;
        padding: 22px;
    }
    .reservation-button {
        margin-top: 18px;
        width: 100%;
        text-align: center;
    }
    .reservation-banner h2 {
        font-size: 22px;
    }
}

/* V12 - page alertes / anomalies */
.anomaly-panel h2 {
    margin-top: 0;
    color: #0b3d91;
}
.anomaly-table td:first-child {
    width: 140px;
}
.anomaly-table td:nth-child(2) {
    width: 220px;
    font-weight: bold;
}
.row-anomaly-danger {
    background: #fff6f6;
}
.row-anomaly-warning {
    background: #fffaf0;
}

/* V14 - formulaire de configuration licences */
.warning-box { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; background: #fff4e5; color: #9a5b00; }
.admin-form .form-row { margin-bottom: 18px; }
.admin-form label { display: block; font-weight: bold; margin-bottom: 6px; }
.admin-form select { width: min(520px, 100%); padding: 10px; border: 1px solid #ccc; border-radius: 8px; background: white; }

/* V18 - correction d'inscriptions et gestion des logs */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}
.form-grid label,
.choice-row label,
.danger-zone label {
    display: block;
    font-weight: bold;
}
.form-grid input,
.form-grid select,
.danger-zone input {
    width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
}
.choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 10px 0 24px;
}
.button-primary,
.button-secondary,
.button-danger,
.button-small {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
}
.button-primary { background: #0b3d91; color: #fff; }
.button-secondary { background: #e2e8f0; color: #1e293b; }
.button-danger { background: #b00020; color: #fff; }
.button-small { background: #0b3d91; color: #fff; padding: 7px 10px; font-size: 13px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.danger-zone { border-left: 6px solid #b00020; }
.danger-zone h2 { color: #b00020; }
.log-actions table pre { max-width: 360px; max-height: 120px; overflow: auto; white-space: pre-wrap; }


/* V19 - amélioration page de correction d'inscription */
.correction-form .correction-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    margin: -4px 0 22px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.field-important input {
    border: 2px solid #0b3d91;
    background: #f8fbff;
}
.field-help {
    display: block;
    margin-top: 6px;
    color: #475569;
    font-weight: normal;
    font-size: 13px;
    line-height: 1.35;
}
.form-actions-bottom {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}
footer p {
    margin: 4px 0;
}
@media (max-width: 720px) {
    .correction-form .correction-toolbar {
        align-items: stretch;
        flex-direction: column;
    }
    .correction-form .correction-toolbar .button-row {
        margin-bottom: 0;
    }
}

/* V20 - refonte visible de la page de correction d'inscription */
.correction-header-v20 {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding: 18px;
    margin-bottom: 22px;
    background: #eef6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
}
.correction-header-v20 h2 {
    margin-top: 0;
    color: #0b3d91;
}
.correction-header-v20 p {
    margin-bottom: 0;
}
.licence-correction-box {
    padding: 20px;
    margin: 0 0 26px;
    background: #fff7ed;
    border: 2px solid #fb923c;
    border-radius: 12px;
}
.licence-correction-box h2 {
    margin-top: 0;
    color: #9a3412;
}
.licence-correction-box input[type="text"] {
    width: min(420px, 100%);
    box-sizing: border-box;
    display: block;
    margin-top: 8px;
    padding: 14px;
    border: 2px solid #ea580c;
    border-radius: 10px;
    font-size: 20px;
    font-weight: bold;
    background: #fff;
}
.button-large {
    font-size: 16px;
    padding: 13px 18px;
}
@media (max-width: 760px) {
    .correction-header-v20 {
        flex-direction: column;
    }
}

/* V28 - Formulaire de choix de date pour les feuilles d'appel */
.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
}

.inline-form input[type="date"] {
    padding: 10px 12px;
    border: 1px solid #cfd6df;
    border-radius: 8px;
    font-size: 15px;
}

/* V29 - page publique simplifiée + logo TOS dans l'en-tête */
.site-header {
    padding: 18px 24px;
}
.site-header-inner {
    max-width: 1150px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
}
.site-logo {
    width: 92px;
    height: auto;
    display: block;
    background: #fff;
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.site-header-text {
    text-align: left;
}
.site-header-text h1 {
    margin: 0 0 8px;
}
.site-header-text p {
    margin: 0;
}
.reservation-banner {
    align-items: flex-start;
}
#bloc-reservation {
    scroll-margin-top: 24px;
}
footer a {
    color: #0b3d91;
    text-decoration: none;
    font-weight: bold;
}
footer a:hover {
    text-decoration: underline;
}
@media (max-width: 700px) {
    .site-header-inner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    .site-header-text {
        text-align: center;
    }
    .site-logo {
        width: 78px;
    }
}

/* V30 - bannière publique avec nouveau logo blanc TOS */
.site-header {
    background: #0a0f2f;
    padding: 18px 24px;
}
.site-header-inner {
    justify-content: center;
    gap: 24px;
}
.site-logo-white {
    width: auto;
    height: 96px;
    max-height: 96px;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}
.site-header-text h1 {
    font-size: clamp(26px, 4vw, 40px);
    line-height: 1.05;
    margin: 0 0 8px;
}
.site-header-text p {
    font-size: 16px;
    opacity: .96;
}
.site-header-update {
    margin-top: 8px !important;
    font-size: 13px !important;
    opacity: .82 !important;
}
@media (max-width: 700px) {
    .site-logo-white {
        height: 78px;
        width: auto;
    }
}


/* V31 - affichage mobile sans défilement horizontal pour la page publique */
@media (max-width: 768px) {
    .public-table-wrapper {
        overflow-x: visible;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
    }

    .public-availability-table {
        min-width: 0;
        width: 100%;
        background: transparent;
        border-collapse: separate;
        border-spacing: 0 14px;
    }

    .public-availability-table thead {
        display: none;
    }

    .public-availability-table,
    .public-availability-table tbody,
    .public-availability-table tr,
    .public-availability-table th,
    .public-availability-table td {
        display: block;
    }

    .public-availability-table tr {
        background: #fff;
        border-radius: 14px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        overflow: hidden;
        border: 1px solid #e5e7eb;
    }

    .public-availability-table th,
    .public-availability-table td {
        border: 0;
        border-bottom: 1px solid #edf0f5;
        padding: 13px 14px;
        width: 100%;
    }

    .public-availability-table td:last-child {
        border-bottom: 0;
    }

    .public-availability-table .category-cell {
        min-width: 0;
        background: #0b3d91;
        color: #fff;
        font-size: 18px;
        font-weight: bold;
    }

    .public-availability-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 8px;
        color: #0b3d91;
        font-size: 13px;
        font-weight: bold;
        text-transform: uppercase;
        letter-spacing: .03em;
    }

    .slot-card {
        margin-bottom: 10px;
        padding: 12px;
    }

    .slot-title {
        font-size: 15px;
    }

    .slot-meta {
        font-size: 14px;
    }

    .slot-empty {
        padding: 4px 0;
    }

    .public-final-cta .button {
        width: 100%;
        text-align: center;
        padding: 13px 16px;
    }
}

/* V32 - ordre d'âge + années de naissance sur la page publique */
.category-name {
    display: block;
    font-weight: bold;
}
.category-years {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.35;
    color: #42526e;
    font-weight: normal;
}
@media (max-width: 768px) {
    .public-availability-table .category-cell .category-years {
        color: rgba(255,255,255,0.86);
        font-size: 13px;
    }
}
