* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f4f6f8;
    color: #17202a;
    font-family: Arial, Helvetica, sans-serif;
}

.topbar {
    background: #111827;
    color: white;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.brand {
    color: white;
    text-decoration: none;
    font-size: 22px;
    font-weight: bold;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 7px;
}

nav a:hover {
    background: #374151;
}

.container {
    width: min(1200px, 94%);
    margin: 28px auto;
}

h1 {
    margin-bottom: 20px;
}

h2 {
    margin-top: 0;
}

.muted {
    color: #6b7280;
}

.welcome {
    margin-bottom: 25px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

.stat {
    background: white;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat span {
    font-size: 25px;
}

.stat strong {
    font-size: 28px;
}

.stat small {
    color: #6b7280;
}

.cards,
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.card {
    display: block;
    background: white;
    padding: 22px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    margin-bottom: 18px;
}

.link-card {
    color: inherit;
    text-decoration: none;
}

.link-card:hover {
    transform: translateY(-2px);
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.button,
button {
    display: inline-block;
    border: 0;
    background: #2563eb;
    color: white;
    padding: 11px 16px;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    font-weight: bold;
}

button:hover,
.button:hover {
    opacity: .9;
}

button.small {
    padding: 7px 10px;
    font-size: 12px;
}

.form-card {
    background: white;
    padding: 25px;
    border-radius: 14px;
    max-width: 650px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.form-card label {
    display: block;
    margin-top: 14px;
    margin-bottom: 6px;
    font-weight: bold;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font: inherit;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.form-card button {
    margin-top: 20px;
}

.table-wrap {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

th {
    background: #f9fafb;
}

.badge {
    display: inline-block;
    background: #e5e7eb;
    color: #111827;
    border-radius: 20px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: bold;
}

.ok {
    color: #15803d;
    font-weight: bold;
}

.danger-text {
    color: #b91c1c;
    font-weight: bold;
}

.flash {
    padding: 13px;
    border-radius: 8px;
    margin-bottom: 15px;
    background: #e5e7eb;
}

.flash.success {
    background: #dcfce7;
    color: #166534;
}

.flash.error {
    background: #fee2e2;
    color: #991b1b;
}

.login-card {
    max-width: 450px;
    margin: 70px auto;
    background: white;
    padding: 35px;
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(0,0,0,.08);
}

.login-card label {
    display: block;
    margin-top: 15px;
    margin-bottom: 6px;
    font-weight: bold;
}

.login-card button {
    width: 100%;
    margin-top: 20px;
}

.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.filters select {
    max-width: 250px;
}

.scores {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.scores span {
    background: #f3f4f6;
    padding: 12px;
    border-radius: 8px;
}

.scores strong {
    display: block;
    font-size: 20px;
    margin-top: 5px;
}

footer {
    text-align: center;
    color: #6b7280;
    padding: 35px 15px;
}

@media (max-width: 900px) {
    .stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .scores {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .topbar {
        align-items: flex-start;
    }

    nav {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    nav a {
        background: #1f2937;
        text-align: center;
    }

    .stats,
    .cards,
    .grid {
        grid-template-columns: 1fr;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .filters {
        flex-direction: column;
    }

    .filters select {
        max-width: none;
    }

    .login-card {
        margin: 30px auto;
        padding: 25px;
    }
}

/* =========================================
   BASKET COACH - GESTION COACHS
   ========================================= */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.page-header h1 {
    margin-bottom: 5px;
}

.page-header p {
    margin-top: 0;
    opacity: .75;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 4px 18px rgba(0,0,0,.08);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
}

.card-header h2 {
    margin: 0 0 8px 0;
}

.card-body p {
    margin: 10px 0;
}

.badge,
.team-tag,
.status {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
}

.badge {
    background: #eef2ff;
}

.team-tag {
    background: #f1f5f9;
    margin: 2px;
}

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

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

.card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.form-card {
    max-width: 900px;
    background: #fff;
    border-radius: 14px;
    padding: 25px;
    box-shadow: 0 4px 18px rgba(0,0,0,.08);
}

.form-card h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.form-card h2:not(:first-child) {
    margin-top: 35px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-full {
    grid-column: 1 / -1;
}

.form-group input,
.form-group textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
}

.form-group small {
    opacity: .7;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    padding: 10px 15px;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-secondary {
    background: #e5e7eb;
    color: #111827;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-success {
    background: #16a34a;
    color: white;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 14px;
}

.empty-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

@media (max-width: 700px) {

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

    .form-full {
        grid-column: auto;
    }

    .page-header {
        align-items: stretch;
    }

    .page-header .btn {
        width: 100%;
    }

    .card-actions .btn,
    .card-actions form {
        width: 100%;
    }

    .card-actions form .btn {
        width: 100%;
    }
}

/* =========================================================
   BASKET COACH - LISTE DES COACHS
   ========================================================= */

.coach-list-section {
    margin-top: 30px;
}

.coach-list-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.coach-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 14px;
}

.coach-table {
    width: 100%;
    border-collapse: collapse;
}

.coach-table th,
.coach-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}

.coach-table th {
    font-weight: 700;
}

.team-badge {
    display: inline-block;
    padding: 5px 9px;
    margin: 2px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status {
    font-weight: 600;
    white-space: nowrap;
}

.status.active {
    color: #16a34a;
}

.status.inactive {
    color: #dc2626;
}

.muted {
    opacity: 0.6;
}

.btn-small {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    border-radius: 14px;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

@media (max-width: 800px) {

    .coach-list-section .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .coach-table th:nth-child(3),
    .coach-table td:nth-child(3) {
        display: none;
    }
}

