/* ============================================================
   SUPERVISION — Styles (CSP-safe, aucun inline)
   ============================================================ */
:root { --bg-body:#f0f2f5; --card-shadow:0 10px 20px rgba(0,0,0,0.08); --text-main:#2c3e50; --text-light:#7f8c8d; --blue-header:linear-gradient(135deg,#2c3e50,#3498db); }
body { font-family:'Montserrat',sans-serif; background-color:var(--bg-body); margin:0; padding:0; color:var(--text-main); overflow-x:hidden; }

.blue-header-zone { background:var(--blue-header); color:white; padding:60px 20px; text-align:center; border-radius:0 0 20px 20px; margin-bottom:30px; box-shadow:0 4px 15px rgba(0,0,0,0.2); }
.blue-header-zone h1 { margin:0; font-size:2.5em; font-weight:800; text-transform:uppercase; letter-spacing:2px; }
.blue-header-zone p { margin:15px 0 0; font-size:1.2em; opacity:0.9; }

.dashboard-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,380px),1fr)); gap:25px; max-width:1400px; margin:0 auto; padding:0 15px 80px; }

.card { position:relative; background-color:white; border-radius:15px; box-shadow:var(--card-shadow); overflow:hidden; transition:all 0.3s ease; display:flex; flex-direction:column; }
.card:hover { transform:translateY(-5px); box-shadow:0 15px 30px rgba(0,0,0,0.2); }
.card-title-zone { background:var(--blue-header); padding:5px; text-align:center; }
.card-title { font-size:1.8em; font-weight:800; color:white; margin:0; text-transform:uppercase; letter-spacing:2px; position:relative; z-index:2; }
.card-body { padding:25px 20px; flex-grow:1; display:flex; flex-direction:column; justify-content:center; align-items:center; text-align:center; position:relative; }
.watermark-letter { position:absolute; bottom:0; right:-10px; font-size:8em; font-weight:900; color:rgba(0,0,0,0.05); line-height:1; pointer-events:none; z-index:1; }
.card-desc { font-size:1.2em; color:var(--text-main); margin-bottom:20px; font-weight:700; z-index:2; }
.status-badge { padding:8px 16px; border-radius:30px; font-size:0.9em; font-weight:600; color:white; box-shadow:0 4px 6px rgba(0,0,0,0.1); z-index:2; }

.bg-inscription { background-color:#3498db; } .bg-blocage { background-color:#e74c3c; } .bg-generation { background-color:#9b59b6; }
.bg-poule { background-color:#34495e; } .bg-resultats { background-color:#e67e22; } .bg-termine { background-color:#27ae60; }
.bg-finales { background-color:#e67e22; } .bg-default { background-color:#95a5a6; }

.btn-detail { margin-top:15px; padding:8px 20px; background-color:rgba(255,255,255,0.9); border:2px solid #27ae60; color:#27ae60; border-radius:20px; font-weight:700; cursor:pointer; font-family:'Montserrat',sans-serif; font-size:0.85em; transition:all 0.2s; z-index:2; }
.btn-detail:hover { background-color:#27ae60; color:white; }

.detail-container { display:none; margin-top:15px; padding:0; width:100%; box-sizing:border-box; font-size:0.85em; text-align:left; color:var(--text-main); z-index:2; max-height:400px; overflow-y:auto; overflow-x:hidden; }

.pool-block-friendly { background-color:#f0faf4; border-left:5px solid #27ae60; padding:12px; border-radius:10px; margin-bottom:15px; box-shadow:0 2px 8px rgba(39,174,96,0.1); }
.pool-block-friendly:last-child { margin-bottom:0; }
.pool-header-friendly { font-weight:800; color:#27ae60; margin-bottom:10px; font-size:0.95em; display:flex; align-items:center; gap:6px; }
.pool-header-egalite { color:#d68910; border-left-color:#f39c12; background-color:#fef9e7; }

.match-table { width:100%; border-collapse:collapse; margin-bottom:12px; background:white; border-radius:6px; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,0.05); table-layout:fixed; }
.match-table td { padding:8px 4px; border-bottom:1px solid #f4f4f4; vertical-align:middle; }
.match-table tr:last-child td { border-bottom:none; }
.match-table tr:hover { background-color:#f9f9f9; }
.p-left { text-align:right; font-weight:700; color:#2c3e50; padding-right:6px; white-space:normal; word-wrap:break-word; overflow-wrap:break-word; font-size:0.85em; }
.p-vs { text-align:center; color:#bdc3c7; font-weight:600; width:25px; font-size:0.75em; }
.p-right { text-align:left; color:#95a5a6; padding-left:6px; white-space:normal; word-wrap:break-word; overflow-wrap:break-word; font-size:0.85em; }
.badge-v { background-color:#27ae60; color:white; padding:2px 5px; border-radius:4px; font-weight:800; font-size:0.7em; margin-left:3px; white-space:nowrap; }
.badge-d { background-color:#e0e0e0; color:#7f8c8d; padding:2px 5px; border-radius:4px; font-weight:800; font-size:0.7em; margin-left:3px; white-space:nowrap; }

.mini-ranking-table { width:100%; border-collapse:collapse; font-size:0.85em; }
.mini-ranking-table th { text-align:left; padding:6px; background-color:#dcdde1; color:#2f3640; font-weight:700; font-size:0.8em; }
.mini-ranking-table th:first-child { border-radius:6px 0 0 6px; }
.mini-ranking-table th:last-child { border-radius:0 6px 6px 0; }
.mini-ranking-table td { padding:6px; border-bottom:1px solid #eee; white-space:normal; word-wrap:break-word; }
.mini-ranking-table tr:last-child td { border-bottom:none; }
.row-qualified { background-color:#d5f5e3; color:#1e8449; font-weight:600; }
.row-eliminated { background-color:#fadbd8; color:#c0392b; font-weight:400; }
.row-egalite { background-color:#fdebd0; color:#d68910; font-weight:600; }
.no-pool-msg { text-align:center; color:#95a5a6; font-style:italic; padding:20px 0; font-size:0.9em; }

/* Remplace style="text-align:center" */
.text-center { text-align: center; }

.btn-retour-container { position:fixed; bottom:30px; right:30px; z-index:100; }
.btn-retour { display:inline-flex; align-items:center; background-color:#2c3e50; color:white; padding:15px 25px; border-radius:50px; text-decoration:none; font-weight:600; box-shadow:0 5px 15px rgba(0,0,0,0.2); border:none; cursor:pointer; font-family:'Montserrat',sans-serif; font-size:1em; }
.btn-retour:hover { background-color:#34495e; transform:scale(1.05); }
.btn-retour::before { content:"\2190"; margin-right:10px; font-size:1.2em; }

/* BOUTON VOIR EDITION */
.btn-edition {
    margin-top:15px; padding:10px 22px;
    background:linear-gradient(135deg,#34495e,#2c3e50);
    border:none; color:white; border-radius:20px;
    font-weight:700; cursor:pointer;
    font-family:'Montserrat',sans-serif; font-size:0.85em;
    transition:all 0.3s; z-index:2;
    box-shadow:0 4px 12px rgba(44,62,80,0.3);
    display:inline-flex; align-items:center; gap:8px;
}
.btn-edition:hover {
    background:linear-gradient(135deg,#2c3e50,#1a252f);
    transform:translateY(-2px);
    box-shadow:0 6px 18px rgba(44,62,80,0.4);
}
.btn-edition i { font-size:1em; }

/* MODAL EDITION POULES */
.edition-overlay {
    display:none; position:fixed; top:0; left:0; right:0; bottom:0;
    background:rgba(15,23,42,0.8); backdrop-filter:blur(8px);
    z-index:10000; justify-content:center; align-items:flex-start;
    padding:20px; overflow-y:auto;
}
.edition-overlay.active { display:flex; }

.edition-modal {
    background:white; border-radius:18px;
    max-width:880px; width:100%;
    box-shadow:0 30px 90px rgba(0,0,0,0.4);
    margin:30px auto; overflow:hidden;
    animation:editionSlideUp 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes editionSlideUp {
    from { transform:translateY(50px); opacity:0; }
    to { transform:translateY(0); opacity:1; }
}

.edition-modal-header {
    background:linear-gradient(135deg,#2c3e50,#34495e);
    padding:20px 25px; display:flex; align-items:center; justify-content:space-between;
    position:relative; overflow:hidden;
}
.edition-modal-header::before {
    content:'\1F3D3'; position:absolute; top:-20px; right:-15px;
    font-size:8em; opacity:0.06; transform:rotate(-12deg);
}
.edition-modal-header-left { display:flex; align-items:center; gap:15px; z-index:1; }
.edition-modal-header-icon {
    width:48px; height:48px; background:rgba(255,255,255,0.12);
    border-radius:12px; display:flex; align-items:center; justify-content:center;
    font-size:1.5em; flex-shrink:0;
}
.edition-modal-header h2 { color:white; font-size:1.15em; font-weight:700; margin:0; z-index:1; }
.edition-modal-header h2 small { display:block; font-weight:400; font-size:0.78em; opacity:0.7; margin-top:3px; }
.edition-modal-close {
    background:rgba(255,255,255,0.1); border:none; color:white;
    width:38px; height:38px; border-radius:10px; font-size:1.2em;
    cursor:pointer; display:flex; align-items:center; justify-content:center;
    transition:all 0.2s; z-index:1;
}
.edition-modal-close:hover { background:rgba(255,255,255,0.25); }

.edition-modal-body { padding:25px; max-height:75vh; overflow-y:auto; }

.edition-loader { text-align:center; padding:50px 20px; }
.edition-loader-text { color:#64748b; }
.edition-spinner {
    width:40px; height:40px; border:4px solid #e2e8f0;
    border-top-color:#34495e; border-radius:50%;
    animation:edSpin 0.7s linear infinite; margin:0 auto 15px;
}
@keyframes edSpin { to { transform:rotate(360deg); } }

.edition-empty { text-align:center; padding:50px 20px; color:#95a5a6; }
.edition-empty i { font-size:3em; margin-bottom:15px; display:block; }

/* Classes remplacement des styles inline dans le JS */
.error-icon-red { color:#ef4444; }
.error-text-main { color:#b91c1c; font-size:0.9em; }
.error-detail-small { color:#666; word-break:break-all; }

/* Bloc poule (STYLE FPDF STRICT) */
.ed-poule-block {
    margin-bottom: 25px; overflow: hidden; page-break-inside: avoid;
}
.ed-poule-block:last-child { margin-bottom: 0; }

.ed-poule-header {
    background: none; padding: 5px 0; display: flex; align-items: center; gap: 8px;
}
.ed-poule-header img { width: 14px; height: 14px; flex-shrink: 0; }
.ed-poule-header-text {
    font-family: 'Times New Roman', Times, serif;
    font-weight: 700; font-size: 1em; color: #000000;
}
.ed-poule-subtitle {
    text-align: center; font-family: Arial, sans-serif;
    font-style: italic; font-size: 0.85em; color: #646464;
    padding: 2px 0 8px;
}

.ed-poule-content { padding: 0; }

/* Tableau joueurs */
.ed-joueurs-table {
    width: 100%; border-collapse: collapse; font-family: Arial, sans-serif;
    margin-bottom: 6px; border: 1px solid #000000;
}
.ed-joueurs-table th {
    background-color: #606060; color: #FFFFFF; padding: 5px 0;
    text-align: center; font-weight: 700; font-size: 0.82em;
    border: 1px solid #000000;
}
.ed-joueurs-table td {
    padding: 5px 0; text-align: center; font-weight: 700; font-size: 0.82em;
    border: 1px solid #000000; color: #000000;
}
.ed-joueurs-table tr.ed-row-blue td { background-color: #D4E5ED; }
.ed-joueurs-table tr.ed-row-white td { background-color: #FFFFFF; }

/* Grille matchs */
.ed-match-grid {
    width: 100%; border-collapse: collapse; font-family: Arial, sans-serif;
    border: 1px solid #000000;
}
.ed-match-grid th {
    background-color: #606060; color: #FFFFFF; padding: 5px 0;
    text-align: center; font-weight: 700; font-size: 0.78em;
    border: 1px solid #000000;
}
.ed-match-grid td {
    padding: 6px 0; text-align: center; font-weight: 700; font-size: 0.82em;
    border: 1px solid #000000; color: #000000;
}
.ed-match-grid tr.ed-row-white td { background-color: #FFFFFF; }
.ed-match-grid tr.ed-row-gray td { background-color: #CFDBDC; }

.ed-match-grid td.ed-cell-gray {
    background-color: #606060 !important; color: transparent;
    border: 1px solid #000000 !important;
}
.ed-match-grid td.ed-cell-white {
    background-color: #FFFFFF !important; color: transparent;
    border: 1px solid #000000 !important;
}
.ed-match-grid td.ed-cell-total {
    background-color: #FFFFFF !important; font-weight: 700; text-align: center;
}

/* Tableau Forfait / Joueur / Rang */
.ed-fjr-table {
    width: 100%; border-collapse: collapse; font-family: Arial, sans-serif;
    border: 1px solid #000000;
}
.ed-fjr-table th {
    background-color: #FFFFFF; color: #000000; padding: 4px 0;
    text-align: center; font-weight: 700; font-size: 0.82em;
    border: 1px solid #000000;
}
.ed-fjr-table td {
    padding: 4px 0; text-align: center; border: 1px solid #000000;
    height: 16px; background-color: #FFFFFF;
}

.ed-example-text {
    text-align: center; font-family: Arial, sans-serif;
    font-style: italic; font-size: 0.82em; color: #000000;
    margin: 8px 0 4px;
}
.ed-example-row {
    width: 100%; border-collapse: collapse; font-family: Arial, sans-serif;
    border: 1px solid #000000;
}
.ed-example-row td {
    padding: 5px 0; text-align: center; border: 1px solid #000000;
    background-color: #F0F0F0; font-weight: 700; font-size: 0.72em; color: #000000;
}
.ed-example-row td.ed-cell-gray {
    background-color: #606060 !important; color: transparent;
    border: 1px solid #000000 !important;
}

@media (max-width:768px) {
    .edition-modal { margin:10px; border-radius:14px; }
    .edition-modal-header { padding:16px 18px; flex-wrap:wrap; gap:10px; }
    .edition-modal-header h2 { font-size:1em; }
    .edition-modal-close { margin-top:-45px; align-self:flex-end; }
    .edition-modal-body { padding:15px; max-height:70vh; }
    .ed-joueurs-table { font-size:0.72em; }
    .ed-match-grid { font-size:0.68em; }
    .ed-match-grid td { min-width:22px; padding:4px 2px; }
    .ed-fjr-table { font-size:0.68em; }
}
@media (max-width:480px) {
    .blue-header-zone { padding:30px 15px; border-radius:0 0 15px 15px; }
    .blue-header-zone h1 { font-size:1.5em; letter-spacing:1px; }
    .blue-header-zone p { font-size:1em; margin-top:10px; }
    .card-body { padding:15px; }
    .watermark-letter { font-size:5em; right:-5px; }
    .card-desc { font-size:1em; margin-bottom:15px; }
    .btn-retour-container { bottom:15px; right:15px; left:15px; }
    .btn-retour { width:100%; justify-content:center; padding:12px 15px; }
    .ed-match-grid td { font-size:0.62em; min-width:20px; padding:3px 1px; }
    .ed-joueurs-table td { font-size:0.65em; padding:3px 2px; }
}