/* Custom styles for admin dashboard */

:root {
    --primary-color: #3b82f6;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    --info-color: #6366f1;
    --dark-color: #1f2937;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --background-color: #f1f5f9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

/* Layout principal en colonnes */
.admin-layout {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Colonne sidebar - 280px de largeur fixe (plus large) */
.admin-sidebar-column {
    width: 280px;
    flex-shrink: 0;
    background: white;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Colonne contenu principal - occupe le reste de l'espace */
.admin-content-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--background-color);
}

/* Section header à l'intérieur de la zone de contenu */
.admin-header-section {
    flex-shrink: 0;
}

/* Contenu principal avec scroll */
.admin-main-content {
    flex: 1;
    overflow-y: auto;
    background-color: var(--background-color);
    padding: 1.5rem;
    width: 100%;
}

/* Header styles */
.admin-header {
    background: linear-gradient(135deg, #f59e0b 0%, #10b981 100%);
    color: white;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 70px;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.header-title p {
    font-size: 0.875rem;
    margin: 0;
    opacity: 0.9;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.user-role {
    font-size: 0.75rem;
    opacity: 0.8;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.header-logo {
    display: flex;
    align-items: center;
}

.logo-shield {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 120px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-country {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.9;
    line-height: 1;
}

.logo-federation {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.logo-figure {
    font-size: 1.5rem;
    margin-left: auto;
}

.header-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.header-title p {
    font-size: 0.875rem;
    opacity: 0.9;
    line-height: 1.4;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-date {
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 500;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

.header-btn-rectangular {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    min-width: 100px;
    justify-content: center;
}

.header-btn-rectangular:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.header-btn-rectangular i {
    font-size: 1rem;
}

/* Sidebar styles */
.admin-sidebar {
    background: white;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

/* Logo styles */
.sidebar-logo {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    background: white;
}

.logo-image {
    max-width: 100%;
    height: auto;
    max-height: 60px;
    object-fit: contain;
}

/* Menu styles */
.sidebar-menu {
    flex: 1;
    padding: 0.5rem 0;
}

.menu-section {
    margin-bottom: 1rem;
}

.menu-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 1.5rem 0.25rem;
    margin-bottom: 0.25rem;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 0.875rem;
}

.menu-item:hover {
    background: #f8fafc;
    color: var(--text-primary);
    border-left-color: var(--primary-color);
}

.menu-item.active {
    background: #eff6ff;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.menu-item-icon {
    margin-right: 0.75rem;
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.menu-item-icon i {
    font-size: 1rem;
    line-height: 1;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

/* Force l'affichage des icônes PrimeIcons */
.pi {
    font-family: "PrimeIcons" !important;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    display: inline-block !important;
}

.menu-item-text {
    font-size: 0.875rem;
    font-weight: 500;
    flex: 1;
}

/* Main content area */
.admin-main {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 1.5rem;
    width: 100%;
}

/* Main header adjustments for dashboard */
.main-header {
    padding: 1rem 2rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.main-header .main-title {
    display: flex;
    flex-direction: column;
}

.main-title h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.main-title p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

.main-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Bouton principal */
.btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background: #d97706;
}

/* Cartes de filtres et liste - Design sobre */
.filter-card,
.list-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.filter-title,
.list-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.filter-row {
    display: flex;
    gap: 1.5rem;
    align-items: end;
    flex-wrap: wrap;
    width: auto;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
    flex: 0 0 auto;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.filter-select,
.filter-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.875rem;
    background: white;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-input {
    position: relative;
    display: flex;
    align-items: center;
    width: 300px;
}

.search-input i {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.search-input .filter-input {
    padding-left: 2.5rem;
    width: 100%;
}

/* Boutons d'actions */
.btn-actions {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-actions:hover {
    background: var(--light-color);
    color: var(--text-primary);
}

/* Back button */
.back-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s;
    text-decoration: none;
    margin-bottom: 0;
}

.back-btn:hover {
    background: #d97706;
    color: white;
    text-decoration: none;
}

/* Tabs */
.admin-tabs {
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-list {
    display: flex;
    gap: 0;
    list-style: none;
}

.tab-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-weight: 500;
    color: var(--text-secondary);
}

.tab-item:hover {
    color: var(--text-primary);
}

.tab-item.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Content area */
.admin-content {
    padding: 1.5rem;
    width: 100%;
}

.content-section {
    margin-bottom: 1.5rem;
    width: 100%;
}

.content-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* Action cards grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.action-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

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

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: white;
}

.card-icon.blue {
    background: var(--primary-color);
}
.card-icon.green {
    background: var(--success-color);
}
.card-icon.orange {
    background: var(--accent-color);
}
.card-icon.purple {
    background: var(--info-color);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.card-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
}

.card-button:hover {
    background: #2563eb;
    color: white;
    text-decoration: none;
}

.card-button.green {
    background: var(--success-color);
}
.card-button.green:hover {
    background: #059669;
}
.card-button.orange {
    background: var(--accent-color);
}
.card-button.orange:hover {
    background: #d97706;
}
.card-button.purple {
    background: var(--info-color);
}
.card-button.purple:hover {
    background: #4f46e5;
}

/* Table styles */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    table-layout: fixed;
}

.data-table th {
    background: #fafbfc;
    padding: 0.875rem 1.25rem;
    text-align: left;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f8fafc;
    color: var(--text-primary);
    vertical-align: middle;
    word-wrap: break-word;
}

.data-table tr:hover {
    background: #f9fafb;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Colonnes spécifiques */
.data-table th:nth-child(1), /* Nom */
.data-table td:nth-child(1) {
    width: 22%;
}

.data-table th:nth-child(2), /* Fédération */
.data-table td:nth-child(2) {
    width: 18%;
}

.data-table th:nth-child(3), /* Statut */
.data-table td:nth-child(3) {
    width: 12%;
    text-align: center;
}

.data-table th:nth-child(4), /* Date de création */
.data-table td:nth-child(4) {
    width: 18%;
}

.data-table th:nth-child(5), /* Dernière modification */
.data-table td:nth-child(5) {
    width: 18%;
}

.tests-table th:nth-child(1) {
    width: 24%;
}
.tests-table th:nth-child(2) {
    width: 12%;
}
.tests-table th:nth-child(3) {
    width: 16%;
}
.tests-table th:nth-child(4) {
    width: 14%;
}
.tests-table th:nth-child(5) {
    width: 14%;
}
.tests-table th:nth-child(6) {
    width: 10%;
}
.tests-table th:nth-child(7) {
    width: 5%;
    text-align: center;
}
.tests-table th:nth-child(8) {
    width: 5%;
    text-align: center;
}
.tests-table td:nth-child(7),
.tests-table td:nth-child(8) {
    text-align: center;
}

.data-table th:nth-child(6), /* Actions */
.data-table td:nth-child(6) {
    width: 12%;
    text-align: center;
}

/* Badge styles */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge.admin {
    background: #dbeafe;
    color: #1e40af;
}

.badge.user {
    background: #d1fae5;
    color: #065f46;
}

.badge.active {
    background: #d1fae5;
    color: #065f46;
}

.badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

/* Variante warning pour badges (jaune) */
.badge.warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Button styles */
.btn-small {
    padding: 0.25rem 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 0.5rem;
}

/* Styles temporaires - seront remplacés plus bas */

/* Dark theme support */
body.dark-theme {
    background-color: #1f2937;
    color: #f9fafb;
}

body.dark-theme .admin-sidebar-column {
    background: #374151;
    border-right-color: #4b5563;
}

body.dark-theme .admin-main-content {
    background: #374151;
}

body.dark-theme .main-header {
    border-bottom-color: #4b5563;
}

body.dark-theme .main-title h2 {
    color: #f9fafb;
}

body.dark-theme .main-title p {
    color: #d1d5db;
}

body.dark-theme .user-details h4 {
    color: #d1d5db;
}

body.dark-theme .user-details p {
    color: #f9fafb;
}

body.dark-theme .admin-tabs {
    border-bottom-color: #4b5563;
}

body.dark-theme .tab-item {
    color: #d1d5db;
}

body.dark-theme .tab-item:hover {
    color: #f9fafb;
}

body.dark-theme .content-title {
    color: #f9fafb;
}

body.dark-theme .action-card {
    background: #4b5563;
    border-color: #6b7280;
}

body.dark-theme .card-title {
    color: #f9fafb;
}

body.dark-theme .card-description {
    color: #d1d5db;
}

body.dark-theme .table-container {
    background: #4b5563;
}

body.dark-theme .data-table th {
    background: #374151;
    color: #f9fafb;
    border-bottom-color: #6b7280;
}

body.dark-theme .data-table td {
    border-bottom-color: #6b7280;
    color: #d1d5db;
}

body.dark-theme .data-table tr:hover {
    background: #374151;
}

/* Responsive design */
@media (max-width: 1024px) {
    .admin-sidebar-column {
        width: 250px;
    }

    .action-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .header-title h1 {
        font-size: 1.5rem;
    }

    .logo-shield {
        width: 40px;
        height: 40px;
    }

    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar-column {
        width: 100%;
        height: auto;
        max-height: 300px;
    }

    .admin-content-column {
        flex: 1;
    }

    .admin-main-content {
        padding: 1rem;
    }

    .main-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .main-actions {
        width: 100%;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 0.75rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .header-right {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .header-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .header-btn-rectangular {
        width: 100%;
        justify-content: center;
    }

    .filter-card,
    .list-card {
        padding: 1rem;
    }

    .filter-row {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-group {
        width: 100%;
    }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge.active {
    background: #dcfce7;
    color: #166534;
}

.badge.inactive {
    background: #fef2f2;
    color: #dc2626;
}

/* Button styles - Design sobre et propre */
.btn-primary {
    background: var(--text-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: #374151;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 0.5rem;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-small:last-child {
    margin-right: 0;
}

/* Boutons d'actions sobres et propres */
.btn-edit,
.btn-delete {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    min-width: 32px;
    height: 32px;
}

.btn-edit:hover {
    background: var(--background-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-delete:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.modal-show {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
}

.modal-container {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s ease;
}

.modal-overlay.modal-show .modal-container {
    transform: scale(1) translateY(0);
}

.modal-sm {
    width: 400px;
}

.modal-md {
    width: 500px;
}

.modal-lg {
    width: 600px;
}

.modal-xl {
    width: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.modal-title h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.modal-title p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.modal-body {
    padding: 0 1.5rem 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 120px);
}

/* Form styles for modal */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-form-label.required::after {
    content: "*";
    color: var(--danger-color);
    margin-left: 0.25rem;
}

.modal-form-input,
.modal-form-select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.modal-form-input:focus,
.modal-form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-form-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
    background: #d1d5db;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.toggle-switch.active {
    background: var(--primary-color);
}

.toggle-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch.active::after {
    transform: translateX(26px);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1.5rem;
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid;
}

.modal-btn-secondary {
    background: white;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.modal-btn-secondary:hover {
    background: #f8fafc;
    border-color: var(--text-muted);
}

.modal-btn-primary {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
}

.modal-btn-primary:hover {
    background: #374151;
    border-color: #374151;
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-container {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 2rem);
    }

    .modal-form-row {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-btn {
        width: 100%;
    }
}

/* Styles pour les icônes PrimeIcons plates */
.pi {
    font-family: "PrimeIcons" !important;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    display: inline-block !important;
    color: inherit !important;
    background: none !important;
    border: none !important;
    font-size: 1rem;
    line-height: 1;
}

/* Icônes dans les boutons */
.btn-small .pi {
    font-size: 0.875rem;
}

.btn-primary .pi {
    font-size: 1rem;
}

/* Bouton primary icon-only */
.btn-icon-only {
    padding: 0.75rem !important;
    min-width: 42px;
    width: 42px;
    height: 42px;
    border-radius: 10px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Icônes dans le menu */
.menu-item-icon .pi {
    font-size: 1rem;
    color: var(--text-secondary);
}

.menu-item.active .menu-item-icon .pi {
    color: var(--primary-color);
}

.menu-item:hover .menu-item-icon .pi {
    color: var(--text-primary);
}

/* Icônes dans l'état vide */
.empty-icon .pi {
    font-size: 3rem;
    color: var(--text-muted);
    opacity: 0.5;
}

/* ── Drapeaux : emoji par défaut, image SVG si emojis non supportés ── */
.flag-wrap .flag-img { display: none; }
.flag-wrap .flag-emoji { display: inline; }
html.flags-img .flag-wrap .flag-emoji { display: none; }
html.flags-img .flag-wrap .flag-img { display: inline !important; }

/* ══════════════════════════════════════════════════════
   Classements spéciaux Marathon (par catégorie / commune)
   ══════════════════════════════════════════════════════ */
.marathon-special-section {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    margin-bottom: 2rem;
}

/* Champion cards */
.marathon-champion-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
    transition: box-shadow .2s, transform .2s;
}
.marathon-champion-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    transform: translateY(-2px);
}
.marathon-champion-cat    { border-top: 3px solid #f59e0b; }
.marathon-champion-commune { border-top: 3px solid #3b82f6; }

.marathon-champion-label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6b7280;
    margin-bottom: .6rem;
}
.marathon-champion-cat    .marathon-champion-label { color: #d97706; }
.marathon-champion-commune .marathon-champion-label { color: #2563eb; }

.marathon-champion-body    { display: flex; align-items: center; gap: .75rem; }
.marathon-champion-medal   { font-size: 1.5rem; flex-shrink: 0; }
.marathon-champion-info    { flex: 1; min-width: 0; }
.marathon-champion-name    { font-weight: 700; font-size: .9rem; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marathon-champion-meta    { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.marathon-champion-dossard { font-size: .75rem; color: #9ca3af; font-weight: 600; flex-shrink: 0; }

.marathon-time-badge {
    display: inline-block;
    background: #dcfce7;
    color: #15803d;
    font-size: .7rem;
    font-weight: 700;
    padding: .1rem .4rem;
    border-radius: 4px;
}
.marathon-commune-tag {
    display: inline-block;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: .7rem;
    font-weight: 600;
    padding: .1rem .4rem;
    border-radius: 4px;
}
.marathon-cat-tag {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    font-size: .7rem;
    font-weight: 600;
    padding: .1rem .4rem;
    border-radius: 4px;
}

/* Pill tabs */
.marathon-tab-pills {
    display: flex;
    gap: .5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: .5rem;
}
.marathon-tab-pill {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem 1rem;
    border-radius: 20px;
    border: 1.5px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.marathon-tab-pill:hover  { border-color: #d1d5db; color: #374151; }
.marathon-tab-pill.active { background: #1f2937; color: #fff; border-color: #1f2937; }
.marathon-pill-count {
    background: rgba(255,255,255,.25);
    color: inherit;
    font-size: .7rem;
    font-weight: 700;
    padding: .05rem .35rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}
.marathon-tab-pill:not(.active) .marathon-pill-count { background: #e5e7eb; color: #374151; }

/* Group headers */
.marathon-group-section { margin-bottom: 1.25rem; }
.marathon-group-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem 1rem;
    border-radius: 8px 8px 0 0;
    font-weight: 700;
    font-size: .9rem;
    color: #fff;
}
.marathon-group-header-cat     { background: linear-gradient(90deg, #f59e0b, #d97706); }
.marathon-group-header-commune { background: linear-gradient(90deg, #3b82f6, #1d4ed8); }
.marathon-group-count { margin-left: auto; font-size: .75rem; font-weight: 500; opacity: .85; }

/* Ranking table */
.marathon-ranking-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    font-size: .85rem;
}
.marathon-ranking-table thead th {
    background: #f1f5f9;
    padding: .55rem .75rem;
    font-weight: 700;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.marathon-ranking-table tbody tr { border-bottom: 1px solid #f1f5f9; transition: background .15s; }
.marathon-ranking-table tbody tr:hover { background: #f8fafc; }
.marathon-ranking-table td { padding: .55rem .75rem; color: #374151; vertical-align: middle; }

.marathon-row-gold   { background: #fffbeb !important; }
.marathon-row-silver { background: #f8fafc !important; }
.marathon-row-bronze { background: #fff7ed !important; }

.marathon-rank-cell    { font-size: 1.1rem; text-align: center; }
.marathon-rank-num     { font-weight: 700; color: #6b7280; }
.marathon-dossard-cell { font-weight: 700; color: #9ca3af; font-size: .8rem; }
.marathon-name-cell    { font-weight: 600; color: #111827; }
.marathon-general-rank { font-size: .75rem; font-weight: 700; color: #6b7280; background: #f1f5f9; padding: .1rem .4rem; border-radius: 4px; }
