/* ====================================================
   MyPadel Abidjan — Design
   Pro, sobre, unique — v2 pure CSS background
   ==================================================== */

:root {
    /* Surfaces */
    --surface: rgba(14, 22, 34, 0.88);
    --surface-light: rgba(22, 34, 52, 0.82);
    --surface-hover: rgba(28, 42, 62, 0.88);
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.10);

    /* Texte */
    --text: #e2e5e9;
    --text-secondary: rgba(255, 255, 255, 0.45);

    /* Accent — teal padel */
    --accent: #00d4aa;
    --accent-hover: #00b894;
    --accent-subtle: rgba(0, 212, 170, 0.10);

    /* Sémantique */
    --danger: #ff6b6b;
    --danger-hover: #ee5a5a;
    --warning: #feca57;
    --success: #00d4aa;
    --info: #0077cc;

    /* Rayons */
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
}

/* ====================================================
   BASE
   ==================================================== */

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    scroll-padding-top: 70px;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    color: var(--text);
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    letter-spacing: -0.01em;
    -webkit-overflow-scrolling: touch;
    -webkit-font-smoothing: antialiased;
    background: #080c14;
}

/* ── Fond pur CSS : gradient + mesh subtil ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        /* Lueur accent haut-gauche (très subtile) */
        radial-gradient(ellipse 55% 40% at 8% 12%,  rgba(0, 212, 170, 0.045) 0%, transparent 70%),
        /* Lueur bleue bas-droite */
        radial-gradient(ellipse 50% 45% at 92% 85%, rgba(84, 160, 255, 0.03)  0%, transparent 70%),
        /* Gradient principal */
        linear-gradient(168deg, #0b1120 0%, #0d1528 35%, #090e1a 70%, #060a12 100%);
}

/* Micro-grille décorative (très discrète) */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.025;
    background-image:
        linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.07) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* Scrollbar custom */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* Sélection */
::selection {
    background: rgba(0, 212, 170, 0.25);
    color: #fff;
}

/* Focus global */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

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

.container {
    position: relative;
    z-index: 1;
}

body > .container {
    padding-top: 0;
    margin-top: 0;
}

/* ====================================================
   TYPOGRAPHIE
   ==================================================== */

h1, h2, h3, h4, h5, h6 {
    color: #fff;
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
h5 { font-size: 0.95rem; }

.text-muted {
    color: var(--text-secondary) !important;
}

a {
    color: var(--accent);
}
a:hover {
    color: var(--accent-hover);
}

/* ====================================================
   NAVBAR
   ==================================================== */

.navbar {
    min-height: 56px;
    background: rgba(8, 12, 22, 0.96) !important;
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    background-image: none !important;
    position: sticky !important;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.25);
    padding: 0.4rem 0;
    margin: 0;
}

/* Container navbar : même largeur et padding partout (public, admin, organisateur, login) */
.navbar .container {
    position: relative;
    z-index: 1;
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

.navbar-brand {
    font-weight: 700;
    color: #fff !important;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    margin-right: 0;
    margin-left: 8px; /* espace à gauche du logo */
    display: flex;
    align-items: center;
}
.navbar-brand .navbar-logo {
    height: 28px;
    width: auto;
    display: block;
    margin-right: 8px;
    flex-shrink: 0;
    vertical-align: middle;
}
.navbar-logo-text {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}
.navbar-logo-text .logo-my {
    color: #9ca3af;
}
.navbar-logo-text .logo-padel {
    color: var(--accent);
}
.navbar-brand:has(.navbar-logo)::before,
.navbar-brand:has(.navbar-logo-text)::before {
    display: none;
}
.navbar-brand::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 8px;
    vertical-align: middle;
    box-shadow: 0 0 6px rgba(0, 212, 170, 0.4);
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.65) !important;
    font-weight: 450;
    font-size: 0.88rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.06);
}

/* ── Burger animé ── */
.navbar-toggler {
    border: none !important;
    padding: 6px !important;
    width: 38px;
    height: 38px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    cursor: pointer;
}
.navbar-toggler:focus {
    box-shadow: none !important;
}
.burger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
    transition: all 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    transform-origin: center;
}
.navbar-toggler[aria-expanded="true"] .burger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.navbar-toggler[aria-expanded="true"] .burger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.navbar-toggler[aria-expanded="true"] .burger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Menu plein écran mobile ── */
@media (min-width: 992px) {
    .nav-fullscreen {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .nav-fullscreen {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(6, 10, 18, 0.98);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        z-index: 1050;
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 0;
        margin: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        opacity: 0;
        visibility: hidden;
        transform: scale(0.97);
        transition: opacity 0.3s ease, visibility 0.3s, transform 0.3s ease;
    }
    .nav-fullscreen.nav-fs-open {
        opacity: 1;
        visibility: visible;
        transform: scale(1);
    }
    .navbar-toggler {
        z-index: 1060;
        position: relative;
    }
    .nav-fullscreen ~ .navbar-brand,
    body.nav-open .navbar-brand {
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    body.nav-open {
        overflow: hidden !important;
    }
    .nav-fullscreen .navbar-nav {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        width: 100%;
        max-width: 340px;
        margin: 0 auto;
        padding: 0;
        list-style: none;
    }
    .nav-fullscreen .navbar-nav .nav-item {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    .nav-fullscreen .navbar-nav .nav-link {
        font-size: 1.2rem !important;
        padding: 0.9rem 2rem !important;
        border-radius: var(--radius);
        color: rgba(255, 255, 255, 0.7) !important;
        text-align: center;
        width: 100%;
        max-width: 300px;
        display: block;
        font-weight: 500;
    }
    .nav-fullscreen .navbar-nav .nav-link:hover {
        background: rgba(255, 255, 255, 0.06) !important;
        color: #fff !important;
    }
    .nav-fullscreen .navbar-nav .nav-link:active {
        transform: scale(0.98);
        background: rgba(255, 255, 255, 0.1) !important;
    }
}

/* ====================================================
   CARDS
   ==================================================== */

.card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: relative;
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(0, 212, 170, 0);
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    border-color: var(--border-light);
}

/* Supprime l'ancien overlay radial */
.card::before {
    display: none !important;
}

.card > * {
    position: relative;
    z-index: 1;
}

.card-body {
    color: var(--text);
    padding: 1.25rem;
}

.card-title {
    color: #fff;
}

.card-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
    color: #fff;
    font-weight: 600;
    padding: 0.9rem 1.25rem;
}

/* ====================================================
   BOUTONS — hiérarchie claire
   ==================================================== */

.btn {
    font-weight: 500;
    border-radius: var(--radius-sm);
    font-size: 0.87rem;
    padding: 0.45rem 1rem;
    transition: all 0.15s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    line-height: 1.5;
}

.btn:active {
    transform: scale(0.97);
}

.btn i {
    font-size: 0.85em;
}

/* Primary — accent teal */
.btn-primary {
    background: var(--accent);
    color: #0a1520;
    font-weight: 600;
}
.btn-primary:hover {
    background: var(--accent-hover);
    color: #0a1520;
}

/* Success — vert */
.btn-success {
    background: #27ae60;
    color: #fff;
}
.btn-success:hover {
    background: #219a52;
    color: #fff;
}

/* Warning — or subtil */
.btn-warning {
    background: #e8a817;
    color: #fff;
}
.btn-warning:hover {
    background: #d09510;
    color: #fff;
}

/* Info — bleu doux */
.btn-info {
    background: var(--info);
    color: #fff;
}
.btn-info:hover {
    background: #0066aa;
    color: #fff;
}

/* Bouton "Voir le tournoi" organisateur — bleu foncé (priorité sur Bootstrap) */
.btn-voir-tournoi,
a.btn-voir-tournoi {
    background: #005a9e !important;
    border-color: #005a9e !important;
    color: #fff !important;
}
.btn-voir-tournoi:hover,
a.btn-voir-tournoi:hover {
    background: #004d82 !important;
    border-color: #004d82 !important;
    color: #fff !important;
}

/* Meilleurs 3èmes — vrai bronze (cuivre/bronze métallique) */
.btn-meilleurs-3 {
    background: #b87333 !important;
    border-color: #a0652b !important;
    color: #fff !important;
}
.btn-meilleurs-3:hover {
    background: #9a5a28 !important;
    border-color: #9a5a28 !important;
    color: #fff !important;
}

/* Meilleurs 4èmes — sobre (gris ardoise) */
.btn-meilleurs-4 {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: var(--text) !important;
}
.btn-meilleurs-4:hover {
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
    color: #fff !important;
}

/* Danger — rouge */
.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: var(--danger-hover);
    color: #fff;
}

/* Secondary — verre subtil */
.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-light);
    color: var(--text);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Outline primary */
.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}
.btn-outline-primary:hover {
    background: var(--accent);
    color: #0a1520;
}

/* Modifier format — bleu */
.btn-modifier-format {
    background: var(--info) !important;
    color: #fff !important;
    border: none !important;
}
.btn-modifier-format:hover {
    background: #3d8bdb !important;
    color: #fff !important;
}

.bg-primary {
    background: rgba(0, 212, 170, 0.15) !important;
    color: var(--accent) !important;
}

.bg-danger {
    background-color: var(--danger) !important;
}

.card-header.bg-primary {
    background: rgba(0, 212, 170, 0.08) !important;
    color: var(--accent) !important;
    border-bottom: 1px solid rgba(0, 212, 170, 0.15);
}
.card-header.bg-primary .mb-0,
.card-header.bg-primary h5 {
    color: var(--accent) !important;
}
.text-white {
    color: var(--text) !important;
}

/* ====================================================
   BOUTONS D'ACTION — page tournoi
   ==================================================== */

.btn-action-primary {
    background: var(--accent);
    border: none;
    color: #0a1520;
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.87rem;
}
.btn-action-primary.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}
.btn-action-primary:hover {
    background: var(--accent-hover);
    color: #0a1520;
    text-decoration: none;
}

.btn-action-secondary {
    background: #27ae60;
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.87rem;
    cursor: pointer;
}
.btn-action-secondary:hover {
    background: #219a52;
    color: #fff;
    text-decoration: none;
}

.btn-action-back {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-light);
    color: var(--text);
    font-weight: 450;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
}
.btn-action-back:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    text-decoration: none;
}
.btn-action-back.btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
}

.btn-action-danger {
    background: var(--danger);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.87rem;
}
.btn-action-danger:hover {
    background: var(--danger-hover);
    color: #fff;
    text-decoration: none;
}

/* Bouton modifier équipe */
.btn-modifier-equipe {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.75);
    font-weight: 450;
    font-size: 0.73rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.btn-modifier-equipe:hover {
    background: var(--info);
    border-color: var(--info);
    color: #fff;
    text-decoration: none;
}

/* Bouton supprimer équipe */
.btn-supprimer-equipe {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    color: rgba(255, 107, 107, 0.7);
    font-size: 0.68rem;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.btn-supprimer-equipe:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
    text-decoration: none;
}

/* Boutons modification colorés */
a.btn-outline-primary[href*="update"],
a.btn-outline-primary[href*="edit"],
a.btn-outline-primary[href*="modifier"],
a.btn-outline-primary[href*="format_update"],
a.btn-outline-primary[href*="match_update"],
a.btn-outline-primary[href*="inscription_edit"] {
    background: var(--info) !important;
    border-color: var(--info) !important;
    color: #fff !important;
}
a.btn-outline-primary[href*="update"]:hover,
a.btn-outline-primary[href*="edit"]:hover,
a.btn-outline-primary[href*="modifier"]:hover,
a.btn-outline-primary[href*="format_update"]:hover,
a.btn-outline-primary[href*="match_update"]:hover,
a.btn-outline-primary[href*="inscription_edit"]:hover {
    background: #3d8bdb !important;
    border-color: #3d8bdb !important;
    color: #fff !important;
}

/* ====================================================
   EN-TÊTE TOURNOI
   ==================================================== */

.tournoi-header {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.tournoi-title-section h1 {
    margin-bottom: 0.35rem;
    font-size: 1.65rem;
    font-weight: 700;
}

.tournoi-actions {
    margin-top: 0.5rem;
}

/* ====================================================
   FORMULAIRES
   ==================================================== */

.form-control, .form-select,
select.form-control, select.form-select {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid var(--border-light) !important;
    color: #fff !important;
    border-radius: var(--radius-sm);
}

.form-control:focus, .form-select:focus,
select.form-control:focus, select.form-select:focus {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.15);
    color: #fff !important;
}

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

/* Menus déroulants (scores, etc.) : texte et options visibles sur fond sombre */
select.form-control option,
select.form-select option {
    background: #1a2332 !important;
    color: #fff !important;
}

.score-select,
select.score-select {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    font-weight: 600;
}
.score-select option {
    background: #1a2332 !important;
    color: #fff !important;
}

.form-label {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.form-check-input {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--border-light);
}

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

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

.form-text {
    color: var(--text-secondary) !important;
}

.input-group-text {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ====================================================
   TABLES
   ==================================================== */

.table {
    color: var(--text);
}

.table thead {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table thead th {
    border: none;
    font-weight: 600;
    padding: 0.6rem 0.5rem;
}

/* Override Bootstrap table helpers for dark theme */
.table thead.table-light,
.table thead.table-light th {
    background: rgba(255, 255, 255, 0.05) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    border-color: var(--border) !important;
}

.table .table-success,
.table .table-success td {
    background: rgba(0, 212, 170, 0.10) !important;
    color: var(--text) !important;
}

.table .table-success:hover,
.table .table-success:hover td {
    background: rgba(0, 212, 170, 0.15) !important;
}

.table tbody tr {
    border-bottom: 1px solid var(--border);
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.table tbody td {
    border: none;
    padding: 0.55rem 0.5rem;
    vertical-align: middle;
}

/* ====================================================
   BOOTSTRAP OVERRIDES (dark theme)
   ==================================================== */

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

.list-group-item .text-muted {
    color: var(--text-secondary) !important;
}

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

.input-group-text {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border);
    color: var(--text-secondary);
}

.border-success {
    border-color: rgba(0, 212, 170, 0.35) !important;
}

.border-secondary {
    border-color: var(--border) !important;
}

.admin-bar-auth {
    border-bottom-color: var(--border) !important;
}
.admin-bar-username {
    color: var(--text);
    font-size: 0.9rem;
}
.admin-bar-username strong {
    color: #fff;
}

/* ====================================================
   STAT CARDS (admin)
   ==================================================== */

.stat-card {
    text-align: center;
    border: none;
}
.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.stat-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.stat-card.stat-total {
    background: var(--accent-subtle);
    border-left: 3px solid var(--accent);
}
.stat-card.stat-total h3 {
    color: var(--accent);
}
.stat-card.stat-actifs {
    background: rgba(39, 174, 96, 0.12);
    border-left: 3px solid #27ae60;
}
.stat-card.stat-actifs h3 {
    color: #27ae60;
}
.stat-card.stat-inactifs {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--text-secondary);
}
.stat-card.stat-inactifs h3 {
    color: var(--text-secondary);
}

/* ====================================================
   BADGES
   ==================================================== */

.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.3em 0.65em;
    border-radius: 4px;
    letter-spacing: 0.01em;
}

.badge.bg-primary {
    background: var(--accent-subtle) !important;
    color: var(--accent) !important;
}

.badge.bg-info {
    background: rgba(84, 160, 255, 0.15) !important;
    color: var(--info) !important;
}

.badge.bg-success {
    background: rgba(0, 212, 170, 0.15) !important;
    color: var(--accent) !important;
}

.badge.bg-danger {
    background: rgba(255, 107, 107, 0.15) !important;
    color: var(--danger) !important;
}

.badge.bg-warning {
    background: rgba(254, 202, 87, 0.15) !important;
    color: var(--warning) !important;
}

.badge.bg-secondary {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-secondary) !important;
}

/* Contrer Bootstrap .text-dark sur les badges du thème sombre */
.badge.text-dark {
    color: inherit !important;
}

/* Statuts */
.badge.statut-badge {
    font-weight: 500;
    padding: 0.35em 0.7em;
}

.badge.statut-inscription {
    background: rgba(255, 140, 66, 0.15) !important;
    color: #ff9f43 !important;
}

.badge.statut-complet {
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.6) !important;
}

.badge.statut-tirage {
    background: rgba(0, 212, 170, 0.12) !important;
    color: var(--accent) !important;
}

.badge.statut-en_cours {
    background: rgba(254, 202, 87, 0.15) !important;
    color: var(--warning) !important;
}

.badge.statut-termine {
    background: rgba(255, 255, 255, 0.06) !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

/* ====================================================
   ALERTES
   ==================================================== */

.alert {
    border-radius: var(--radius);
    font-size: 0.88rem;
    border: none;
}

.alert-success {
    background: rgba(0, 212, 170, 0.1);
    border-left: 3px solid var(--accent);
    color: #a3f0d8;
}

.alert-danger {
    background: rgba(255, 107, 107, 0.1);
    border-left: 3px solid var(--danger);
    color: #ffb3b3;
}

.alert-info {
    background: rgba(84, 160, 255, 0.1);
    border-left: 3px solid var(--info);
    color: #a8ccff;
}

.alert-warning {
    background: rgba(254, 202, 87, 0.1);
    border-left: 3px solid var(--warning);
    color: #ffe49a;
}

.btn-close {
    filter: invert(1);
}

/* ====================================================
   MATCHS
   ==================================================== */

/* Label temps réel */
.realtime-label {
    font-size: 0.6em;
}

.match-card {
    border-left: 3px solid var(--accent);
}

.match-termine {
    border-left-color: var(--success);
}

.match-en-cours {
    border-left-color: var(--warning);
}

.tableau-bracket {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.round-column {
    min-width: 250px;
}

/* ====================================================
   EQUIPES — cartes
   ==================================================== */

.equipe-card-uniforme {
    min-height: 140px;
    background: var(--surface-light) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
}

.equipe-card-uniforme::before {
    display: none !important;
}

.equipe-card-body-uniforme {
    min-height: 140px;
    padding: 1.25rem 1rem 3rem 1rem !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.equipe-content-centered {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.equipe-content-centered > div {
    text-align: center;
    width: 100%;
    font-size: 0.92rem;
}

.equipe-card-body-uniforme .position-absolute {
    bottom: 0.5rem;
    right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.equipe-btn-modifier {
    padding: 2px 6px !important;
    font-size: 0.73rem !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
    height: 22px;
}

/* Carte des équipes inscrites */
.card-equipes-inscrites {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.card-equipes-inscrites::before {
    display: none !important;
}

/* Nom joueur dans carte équipe */
.equipe-joueur-name {
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
}

/* Texte doré têtes de série */
.tete-de-serie-dore {
    color: var(--warning) !important;
    font-weight: 600;
}

/* ====================================================
   POULES — cartes
   ==================================================== */

.card-poule-phase {
    background: var(--surface) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.card-poule-phase::before {
    display: none !important;
}

.card-poule {
    background: var(--surface-light) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: none;
}

.card-poule::before {
    display: none !important;
}

.card-header-poule {
    background: rgba(255, 255, 255, 0.03) !important;
    border-bottom: 1px solid var(--border) !important;
}

.card-poule .card-body,
.card-poule-phase .card-body {
    background: transparent !important;
    color: var(--text);
}

.card-poule table {
    color: var(--text);
    background: transparent !important;
}

.card-poule table thead {
    background: rgba(255, 255, 255, 0.04) !important;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid var(--border-light);
}

.card-poule table thead th {
    background: transparent !important;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.card-poule table tbody {
    background: transparent !important;
}

.card-poule table tbody tr {
    background: transparent !important;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.card-poule table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

.card-poule table tbody td {
    background: transparent !important;
    border: none;
    color: var(--text);
}

/* Même design que visiteurs : rangs 1–3 or / argent / bronze, aucune ligne en fond vert/clair */
.card-poule table tbody td:first-child {
    text-align: center;
    font-weight: 700;
}
.card-poule table tbody tr:first-child td:first-child {
    color: #d4af37 !important;
    font-weight: 800;
}
.card-poule table tbody tr:first-child td {
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}
.card-poule table tbody tr:nth-child(2) td:first-child {
    color: #c0c0c0 !important;
    font-weight: 700;
}
.card-poule table tbody tr:nth-child(2) td {
    border-bottom: 1px solid rgba(192, 192, 192, 0.15);
}
.card-poule table tbody tr:nth-child(3) td:first-child {
    color: #cd7f32 !important;
    font-weight: 700;
}
.card-poule table tbody tr:nth-child(3) td {
    border-bottom: 1px solid rgba(205, 127, 50, 0.2);
}

/* Meilleurs 3èmes : style par valeur de rang (pas par position) pour égalités */
.card-poule.meilleurs-troisiemes table tbody tr:first-child td:first-child,
.card-poule.meilleurs-troisiemes table tbody tr:nth-child(2) td:first-child,
.card-poule.meilleurs-troisiemes table tbody tr:nth-child(3) td:first-child {
    color: var(--text) !important;
    font-weight: 700;
}
.card-poule.meilleurs-troisiemes table tbody tr:first-child td,
.card-poule.meilleurs-troisiemes table tbody tr:nth-child(2) td,
.card-poule.meilleurs-troisiemes table tbody tr:nth-child(3) td {
    border-bottom: 1px solid var(--border);
}
.card-poule.meilleurs-troisiemes table tbody tr.rang-1 td:first-child {
    color: #d4af37 !important;
    font-weight: 800;
}
.card-poule.meilleurs-troisiemes table tbody tr.rang-1 td {
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}
.card-poule.meilleurs-troisiemes table tbody tr.rang-2 td:first-child {
    color: #c0c0c0 !important;
    font-weight: 700;
}
.card-poule.meilleurs-troisiemes table tbody tr.rang-2 td {
    border-bottom: 1px solid rgba(192, 192, 192, 0.15);
}
.card-poule.meilleurs-troisiemes table tbody tr.rang-3 td:first-child {
    color: #cd7f32 !important;
    font-weight: 700;
}
.card-poule.meilleurs-troisiemes table tbody tr.rang-3 td {
    border-bottom: 1px solid rgba(205, 127, 50, 0.2);
}

/* Table meilleurs 3èmes : éviter que les titres s’empiettent */
.card-poule.meilleurs-troisiemes .table-meilleurs-troisiemes {
    table-layout: fixed;
    width: 100%;
}
.card-poule.meilleurs-troisiemes .table-meilleurs-troisiemes thead th {
    white-space: nowrap;
    padding: 0.5rem 0.4rem;
    text-align: center;
    border-right: 1px solid var(--border);
}
.card-poule.meilleurs-troisiemes .table-meilleurs-troisiemes thead th:last-child {
    border-right: none;
}
.card-poule.meilleurs-troisiemes .table-meilleurs-troisiemes thead th.th-equipe {
    text-align: left;
}
.card-poule.meilleurs-troisiemes .table-meilleurs-troisiemes tbody td {
    padding: 0.5rem 0.4rem;
    border-right: 1px solid var(--border);
}
.card-poule.meilleurs-troisiemes .table-meilleurs-troisiemes tbody td:last-child {
    border-right: none;
}
.card-poule.meilleurs-troisiemes .table-meilleurs-troisiemes .th-num,
.card-poule.meilleurs-troisiemes .table-meilleurs-troisiemes .td-num {
    width: 2.5rem;
    min-width: 2.5rem;
    text-align: center;
}
.card-poule.meilleurs-troisiemes .table-meilleurs-troisiemes .th-equipe,
.card-poule.meilleurs-troisiemes .table-meilleurs-troisiemes .td-equipe {
    text-align: left;
    min-width: 8rem;
}
.card-poule.meilleurs-troisiemes .table-meilleurs-troisiemes .th-poules,
.card-poule.meilleurs-troisiemes .table-meilleurs-troisiemes .td-poules,
.card-poule.meilleurs-troisiemes .table-meilleurs-troisiemes .th-pts,
.card-poule.meilleurs-troisiemes .table-meilleurs-troisiemes .td-pts,
.card-poule.meilleurs-troisiemes .table-meilleurs-troisiemes .th-v,
.card-poule.meilleurs-troisiemes .table-meilleurs-troisiemes .td-v,
.card-poule.meilleurs-troisiemes .table-meilleurs-troisiemes .th-diff,
.card-poule.meilleurs-troisiemes .table-meilleurs-troisiemes .td-diff {
    width: 4rem;
    min-width: 4rem;
    text-align: center;
}

/* Table liste joueurs : colonnes bien disposées, titres sur une ligne */
.card-poule.card-joueurs-list .table-joueurs-list {
    table-layout: fixed;
    width: 100%;
}
.card-poule.card-joueurs-list .table-joueurs-list thead th {
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
    border-right: 1px solid var(--border);
}
.card-poule.card-joueurs-list .table-joueurs-list thead th:last-child {
    border-right: none;
}
.card-poule.card-joueurs-list .table-joueurs-list tbody td {
    padding: 0.5rem 0.75rem;
    border-right: 1px solid var(--border);
}
.card-poule.card-joueurs-list .table-joueurs-list tbody td:last-child {
    border-right: none;
}
.card-poule.card-joueurs-list .table-joueurs-list .th-nom,
.card-poule.card-joueurs-list .table-joueurs-list .td-nom {
    width: 30%;
    min-width: 6rem;
    text-align: left;
}
.card-poule.card-joueurs-list .table-joueurs-list .th-prenom,
.card-poule.card-joueurs-list .table-joueurs-list .td-prenom {
    width: 45%;
    min-width: 6rem;
    text-align: left;
}
.card-poule.card-joueurs-list .table-joueurs-list .th-niveau,
.card-poule.card-joueurs-list .table-joueurs-list .td-niveau {
    width: 25%;
    min-width: 7rem;
    text-align: center;
}

/* Pas de fond vert/teal clair au survol ou sur des lignes (forcer comme visiteurs) */
.card-poule table tbody tr,
.card-poule table tbody tr.table-success,
.card-poule table tbody tr:hover,
.card-poule table tbody tr.table-success:hover {
    background: transparent !important;
}
.card-poule table tbody tr:hover td,
.card-poule table tbody tr.table-success td,
.card-poule table tbody tr.table-success:hover td {
    background: rgba(255, 255, 255, 0.03) !important;
}

/* Pas de fond blanc dans les tableaux des poules (organisateur = même rendu que visiteurs) */
.card-poule .table,
.card-poule-phase .table,
.card-poule .table thead,
.card-poule .table tbody,
.card-poule .table th,
.card-poule .table td,
.card-poule-phase .table thead,
.card-poule-phase .table tbody,
.card-poule-phase .table th,
.card-poule-phase .table td {
    background: transparent !important;
    background-color: transparent !important;
}

/* ====================================================
   RESPONSIVE
   ==================================================== */

/* ── Tablettes (≤ 992px) ── */
@media (max-width: 992px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    .navbar .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .tournoi-header {
        padding: 1rem;
    }

    .tournoi-header > .d-flex {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .tournoi-title-section h1 {
        font-size: 1.4rem;
    }

    .tournoi-actions {
        width: 100%;
    }

    .tournoi-actions .d-flex {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .tournoi-actions .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .btn-action-primary,
    .btn-action-secondary,
    .btn-action-back,
    .btn-action-danger {
        font-size: 0.85rem;
    }

    .round-column {
        min-width: 200px;
    }

    .admin-form-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem;
    }
    .admin-form-header > a,
    .admin-form-header > div:last-child {
        width: 100%;
    }
    .admin-form-header > a.btn,
    .admin-form-header > div:last-child .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .card-header.d-flex {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem;
    }
    .card-header.d-flex > .d-flex {
        flex-wrap: wrap;
        gap: 0.4rem;
        width: 100%;
    }

    .row.justify-content-center > .col-md-6,
    .row.justify-content-center > .col-md-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ── Mobiles (≤ 768px) ── */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    .navbar .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .navbar {
        padding: 0.3rem 0;
    }

    .navbar-brand {
        font-size: 1rem;
    }
    .navbar-brand .navbar-logo {
        height: 26px;
    }

    h1 { font-size: 1.3rem; }
    h2 { font-size: 1.15rem; }
    h3 { font-size: 1.05rem; }
    h4 { font-size: 0.95rem; }

    .card {
        margin-bottom: 12px;
        border-radius: var(--radius);
    }

    .card-body {
        padding: 0.85rem;
    }

    .card-header {
        padding: 0.6rem 0.85rem;
    }

    .tournoi-header {
        padding: 0.85rem;
        border-radius: var(--radius);
    }

    .tournoi-title-section h1 {
        font-size: 1.2rem;
    }

    .tournoi-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .tournoi-actions .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .btn-action-primary,
    .btn-action-secondary,
    .btn-action-back,
    .btn-action-danger {
        width: 100%;
        justify-content: center;
        padding: 0.55rem 1rem;
        font-size: 0.85rem;
    }

    .badge {
        font-size: 0.72rem;
        padding: 0.25em 0.55em;
    }

    .table-responsive-wrapper,
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.85rem;
    }

    table th, table td {
        padding: 0.5rem 0.4rem;
    }

    .tableau-bracket {
        flex-direction: column;
        gap: 12px;
    }

    .round-column {
        min-width: 100%;
    }

    .equipe-card-uniforme {
        min-height: 115px;
    }

    .equipe-card-body-uniforme {
        min-height: 115px;
        padding: 1rem 0.75rem 2.8rem 0.75rem !important;
    }

    .col-md-4,
    .col-md-6,
    .col-md-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .form-label {
        font-size: 0.84rem;
    }

    .input-group-text {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    .d-flex.justify-content-between:not(.tournoi-card-info):not(.dashboard-stat *) {
        gap: 0.5rem;
    }

    .form-control, .form-select {
        font-size: 0.88rem;
    }

    .card-header .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* ── Petits mobiles (≤ 480px) ── */
@media (max-width: 480px) {
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }
    .navbar .container {
        padding-left: 8px;
        padding-right: 8px;
    }

    h1 { font-size: 1.15rem; }
    h2 { font-size: 1rem; }

    .navbar-brand {
        font-size: 0.9rem;
    }
    .navbar-brand .navbar-logo {
        height: 24px;
    }

    .card-body {
        padding: 0.7rem;
    }

    .badge {
        font-size: 0.68rem;
        padding: 0.2em 0.45em;
    }

    table {
        font-size: 0.78rem;
    }

    table th, table td {
        padding: 0.35rem 0.3rem;
    }

    .d-flex.gap-2:not(.tournoi-card-info):not(.equipe-card-body-uniforme .d-flex) {
        flex-direction: column;
    }
    .d-flex.gap-2:not(.tournoi-card-info):not(.equipe-card-body-uniforme .d-flex) > .btn,
    .d-flex.gap-2:not(.tournoi-card-info):not(.equipe-card-body-uniforme .d-flex) > a.btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ====================================================
   ADMIN SUPERUSER — Responsive
   ==================================================== */

@media (max-width: 992px) {
    .admin-bar-auth {
        font-size: 0.85rem;
    }
    .admin-bar-username {
        word-break: break-word;
    }
    #admin-organisateurs-page .admin-card-wrap,
    #contact-messages-card.admin-card,
    .admin-form-card,
    .admin-delete-card {
        padding: 1.25rem;
    }
    #admin-organisateurs-page .d-flex.flex-wrap.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    #admin-organisateurs-page .d-flex.flex-wrap .d-flex.gap-2 {
        flex-wrap: wrap;
        justify-content: center;
    }
    #admin-organisateurs-page .d-flex.flex-wrap .d-flex.gap-2 .btn {
        flex: 1 1 auto;
        min-width: 140px;
    }
    #contact-messages-card .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    #contact-messages-card .d-flex.justify-content-between .btn {
        width: 100%;
        text-align: center;
    }
    .admin-card .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .admin-card .d-flex.justify-content-between .btn {
        width: 100%;
        text-align: center;
    }
    .admin-card .mt-4 {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    .admin-card .mt-4 .btn {
        width: 100%;
        text-align: center;
        margin-left: 0 !important;
    }
}

@media (max-width: 768px) {
    .admin-bar-auth {
        font-size: 0.8rem;
        padding-bottom: 0.75rem;
    }
    #admin-organisateurs-page .admin-card-wrap,
    #contact-messages-card.admin-card {
        padding: 1rem;
    }
    #admin-organisateurs-page h2 {
        font-size: 1.25rem;
    }
    #admin-organisateurs-page .admin-stat-row {
        gap: 0.75rem;
    }
    #admin-organisateurs-page .admin-stat-card {
        padding: 1rem;
    }
    #admin-organisateurs-page .admin-stat-card h3 {
        font-size: 1.5rem;
    }
    /* Organisateurs : vue cartes sur mobile */
    #admin-organisateurs-page .admin-table-organisateurs thead {
        display: none;
    }
    #admin-organisateurs-page .admin-table-organisateurs tbody tr {
        display: block;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    #admin-organisateurs-page .admin-table-organisateurs tbody tr:hover {
        background: rgba(255, 255, 255, 0.05);
    }
    #admin-organisateurs-page .admin-table-organisateurs tbody td {
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.4rem 0;
        font-size: 0.9rem;
        white-space: normal;
        border: none;
    }
    #admin-organisateurs-page .admin-table-organisateurs tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: rgba(255, 255, 255, 0.6);
        min-width: 7rem;
        flex-shrink: 0;
    }
    #admin-organisateurs-page .admin-table-organisateurs tbody td[data-label="Actions"] {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding-top: 0.75rem;
        margin-top: 0.25rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
    #admin-organisateurs-page .admin-table-organisateurs tbody td[data-label="Actions"]::before {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    #admin-organisateurs-page .admin-btn-edit,
    #admin-organisateurs-page .admin-btn-delete {
        font-size: 0.8rem;
        padding: 0.4rem 0.65rem;
    }
    /* Messages : vue cartes sur mobile */
    #contact-messages-card .admin-table-messages thead {
        display: none;
    }
    #contact-messages-card .admin-table-messages tbody tr {
        display: block;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    #contact-messages-card .admin-table-messages tbody tr:hover {
        background: rgba(255, 255, 255, 0.05);
    }
    #contact-messages-card .admin-table-messages tbody td {
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.4rem 0;
        font-size: 0.9rem;
        white-space: normal;
        border: none;
        text-align: left;
    }
    #contact-messages-card .admin-table-messages tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: rgba(255, 255, 255, 0.6);
        min-width: 6rem;
        flex-shrink: 0;
    }
    #contact-messages-card .admin-table-messages tbody td[data-label="Action"] {
        padding-top: 0.75rem;
        margin-top: 0.25rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
    #contact-messages-card .admin-table-messages tbody td[data-label="Action"]::before {
        display: none;
    }
    #contact-messages-card h2 {
        font-size: 1.25rem;
    }
    .admin-form-card,
    .admin-delete-card {
        padding: 1rem;
    }
    .admin-form-card h2,
    .admin-delete-card h2 {
        font-size: 1.25rem;
    }
    .admin-card {
        padding: 1rem !important;
    }
    .admin-card h2 {
        font-size: 1.2rem;
    }
    .contact-meta {
        font-size: 0.85rem;
    }
    .contact-message-body {
        padding: 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    #admin-organisateurs-page .admin-card-wrap,
    #contact-messages-card.admin-card {
        padding: 0.75rem;
    }
    #admin-organisateurs-page h2 {
        font-size: 1.1rem;
    }
    #admin-organisateurs-page .d-flex.flex-wrap .d-flex.gap-2 {
        flex-direction: column;
    }
    #admin-organisateurs-page .d-flex.flex-wrap .d-flex.gap-2 .btn {
        width: 100%;
        min-width: 0;
    }
    #admin-organisateurs-page .admin-stat-card h3 {
        font-size: 1.35rem;
    }
    #admin-organisateurs-page .admin-table-organisateurs tbody tr {
        padding: 0.85rem;
    }
    #admin-organisateurs-page .admin-table-organisateurs tbody td {
        font-size: 0.85rem;
    }
    #admin-organisateurs-page .admin-table-organisateurs tbody td::before {
        min-width: 6rem;
    }
    #admin-organisateurs-page .admin-btn-edit.me-1 {
        margin-right: 0.25rem !important;
    }
    #contact-messages-card h2 {
        font-size: 1.1rem;
    }
    #contact-messages-card .admin-table-messages tbody tr {
        padding: 0.85rem;
    }
    #contact-messages-card .admin-table-messages tbody td {
        font-size: 0.85rem;
    }
    #contact-messages-card .admin-table-messages tbody td::before {
        min-width: 5rem;
    }
    .admin-form-card .row .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .admin-delete-card {
        padding: 0.85rem;
    }
    .admin-card {
        padding: 0.75rem !important;
    }
    .admin-card h2 {
        font-size: 1.05rem;
    }
}

/* ====================================================
   LOGO PREVIEW
   ==================================================== */

.logo-preview {
    max-width: 100px;
    max-height: 100px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

/* ====================================================
   TIRAGE — noms d'équipe
   ==================================================== */

.tirage-equipe-names {
    line-height: 1.4;
}

/* ====================================================
   FINANCES — gain net
   ==================================================== */

.gain-net-value {
    font-size: 1.2em;
}

/* ====================================================
   DEPARTAGE — drag and drop
   ==================================================== */

.departage-group {
    background-color: rgba(255, 255, 255, 0.04);
}

.drag-handle {
    cursor: move;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.drag-rank {
    min-width: 30px;
    text-align: center;
}

/* ====================================================
   TRANSITIONS
   ==================================================== */

.nav-link {
    transition: color 0.15s ease, background 0.15s ease !important;
}

/* ====================================================
   TABLES POULES — layout fixe
   ==================================================== */

.card-poule .table,
.card-poule table {
    table-layout: fixed;
    width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
}
.card-poule .table th:first-child,
.card-poule .table td:first-child {
    width: 32px;
}
.card-poule .table th:last-child,
.card-poule .table td:last-child {
    width: 50px;
}

@media (max-width: 768px) {
    .card-poule .table-responsive {
        overflow-x: visible !important;
    }
    .card-poule .table th,
    .card-poule .table td {
        padding: 0.4rem 0.25rem;
        font-size: 0.8rem;
    }
}

/* Tables publiques */
.classement-table {
    table-layout: fixed;
    width: 100%;
}
.classement-table th:first-child,
.classement-table td:first-child {
    width: 30px;
    text-align: center;
}
.classement-table th:nth-child(3),
.classement-table td:nth-child(3) {
    width: 52px;
}
.classement-table th:nth-child(4),
.classement-table td:nth-child(4) {
    width: 32px;
}
.classement-table th:nth-child(5),
.classement-table td:nth-child(5) {
    width: 62px;
}
.classement-table td {
    word-break: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 480px) {
    .classement-table th,
    .classement-table td {
        padding: 0.4rem 0.2rem;
        font-size: 0.75rem;
    }
    .classement-table th:nth-child(4),
    .classement-table td:nth-child(4) {
        width: 26px;
    }
    .classement-table th:nth-child(5),
    .classement-table td:nth-child(5) {
        width: 50px;
    }
}

/* ====================================================
   ADMIN TABLES POULE DETAIL
   ==================================================== */
.poule-table-fit {
    table-layout: fixed;
    width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
}
.poule-table-fit th:first-child,
.poule-table-fit td:first-child {
    width: 36px;
}
.poule-table-fit th:nth-child(3),
.poule-table-fit td:nth-child(3),
.poule-table-fit th:nth-child(4),
.poule-table-fit td:nth-child(4) {
    width: 42px;
}
.poule-table-fit th:nth-child(5),
.poule-table-fit td:nth-child(5) {
    width: 60px;
}

@media (max-width: 768px) {
    .poule-table-fit th,
    .poule-table-fit td {
        padding: 0.4rem 0.25rem;
        font-size: 0.82rem;
    }
}

/* ====================================================
   TOGGLE MATCHS (PUBLIC)
   ==================================================== */
.matchs-toggle .toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}
.matchs-toggle.active .toggle-icon {
    transform: rotate(180deg);
}
