/* =====================================================================
   AXXÈS — CHARTE GRAPHIQUE COMMUNE
   ===================================================================== */
:root {
    --axx-purple: #7145fd;
    --axx-purple-2: #977dff;
    --axx-pink: #f7aef1;
    --axx-cyan: #22f4ef;
    --axx-dark: #0f0a20;
    --axx-muted: #6b6884;
    --axx-bg: #f7f5fc;
    --axx-hover: #f0ebff;
    --axx-border: #e5e1ef;
    --axx-danger: #dc3545;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    padding: 20px;
    color: var(--axx-dark);
    background:
        radial-gradient(1200px 800px at 110% -10%, rgba(34, 244, 239, 0.35), transparent 60%),
        radial-gradient(1000px 900px at -10% 50%, rgba(247, 174, 241, 0.45), transparent 55%),
        linear-gradient(135deg, #7145fd 0%, #977dff 55%, #f7aef1 100%);
    background-attachment: fixed;
}
body.page-bg { font-size: 15px; }

/* =====================================================================
   1) CONTENEURS LEGACY (inscrits.php, voting.php, records/*.php, stats2/*)
   ===================================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--axx-bg);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15, 10, 32, 0.3);
    overflow: hidden;
}
.header {
    background: #ffffff;
    color: var(--axx-dark);
    padding: 30px;
    text-align: center;
    border-bottom: 2px solid var(--axx-border);
}
.header-logo { display: inline-block; margin-bottom: 16px; }
.header-logo img { display: block; height: 60px; width: auto; }
.header h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    color: var(--axx-purple);
}
.header p {
    margin-top: 6px;
    color: var(--axx-muted);
    font-size: 15px;
}
.content { padding: 30px; }
.filters {
    background: var(--axx-bg);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
}
.filters form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}
.form-group { display: flex; flex-direction: column; }
.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--axx-muted);
    font-size: 14px;
}
.form-group select,
.form-group input[type="date"] {
    padding: 12px 16px;
    border: 2px solid var(--axx-border);
    border-radius: 8px;
    font-size: 15px;
    background: #ffffff;
    color: var(--axx-dark);
    transition: all 0.3s ease;
    cursor: pointer;
}
.form-group select:hover,
.form-group input[type="date"]:hover { border-color: var(--axx-purple); }
.form-group select:focus,
.form-group input[type="date"]:focus {
    outline: none;
    border-color: var(--axx-purple);
    box-shadow: 0 0 0 3px rgba(113, 69, 253, 0.15);
}
.warning {
    background: var(--axx-hover);
    border-left: 4px solid var(--axx-purple);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    color: var(--axx-dark);
}
.warning p { margin: 0; font-size: 14px; line-height: 1.6; }
.winners-section { margin-bottom: 30px; }
.winners-title, .table-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--axx-dark);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--axx-border);
}
.winners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}
.winner-card {
    background: linear-gradient(135deg, var(--axx-purple) 0%, var(--axx-purple-2) 100%);
    color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(113, 69, 253, 0.3);
    transition: transform 0.3s ease;
}
.winner-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(113, 69, 253, 0.4);
}
.winner-card .rank { font-size: 14px; opacity: 0.8; margin-bottom: 5px; }
.winner-card .phone { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.winner-card .coords { font-size: 14px; opacity: 0.9; }
.table-section { overflow-x: auto; }
.table-section table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15, 10, 32, 0.1);
}
.table-section table thead {
    background: linear-gradient(135deg, var(--axx-purple) 0%, var(--axx-purple-2) 100%);
    color: #ffffff;
}
.table-section table thead th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table-section table tbody tr {
    border-bottom: 1px solid var(--axx-border);
    transition: background 0.2s ease;
}
.table-section table tbody tr:hover { background: var(--axx-hover); }
.table-section table tbody tr:last-child { border-bottom: none; }
.table-section table tbody td { padding: 14px 16px; font-size: 15px; color: var(--axx-dark); }
.table-section table tbody tr.total-row {
    background: linear-gradient(135deg, var(--axx-purple) 0%, var(--axx-purple-2) 100%);
    color: #ffffff;
    font-weight: 600;
}
.table-section table tbody tr.total-row td { color: #ffffff; font-size: 16px; }

/* =====================================================================
   2) NOUVEAUX CONTENEURS (stats/index.php, stats/global.php,
      minisite/sgdm/vp26/rapport.php)
   ===================================================================== */
.page-wrap {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--axx-bg);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15, 10, 32, 0.3);
    overflow: hidden;
}

/* ---- HEADER ---- */
.charte-header {
    background: #fff;
    padding: 28px 30px;
    text-align: center;
    border-bottom: 2px solid var(--axx-border);
}
.charte-header .header-logo { display: inline-block; margin-bottom: 14px; }
.charte-header .header-logo img { display: block; height: 56px; width: auto; }
.charte-header h1 {
    font-size: 26px;
    font-weight: 600;
    margin: 0;
    color: var(--axx-purple);
    line-height: 1.25;
}
.charte-header p,
.charte-header .subtitle {
    margin: 6px 0 0;
    color: var(--axx-muted);
    font-size: 14px;
}

/* ---- CONTENT ---- */
.charte-content { padding: 28px 30px; }
.charte-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--axx-purple);
    margin: 28px 0 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--axx-border);
}
.charte-content hr { display: none; }
.charte-content p { margin: 10px 0; color: var(--axx-dark); line-height: 1.5; }
.charte-content i { color: var(--axx-muted); font-size: 14px; }

/* ---- FILTRES (dates, selects) ---- */
.charte-filters {
    background: #fff;
    padding: 18px 20px;
    border-radius: 12px;
    margin-bottom: 22px;
    box-shadow: 0 1px 4px rgba(15, 10, 32, .05);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: end;
    justify-content: center;
}
.charte-filters .form-group { display: flex; flex-direction: column; min-width: 180px; }
.charte-filters label {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--axx-muted);
    font-size: 13px;
}
.charte-filters input[type="date"],
.charte-filters select {
    padding: 10px 14px;
    border: 2px solid var(--axx-border);
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
    color: var(--axx-dark);
    transition: all .2s ease;
    cursor: pointer;
}
.charte-filters input[type="date"]:hover,
.charte-filters select:hover { border-color: var(--axx-purple); }
.charte-filters input[type="date"]:focus,
.charte-filters select:focus {
    outline: none;
    border-color: var(--axx-purple);
    box-shadow: 0 0 0 3px rgba(113, 69, 253, .15);
}

/* ---- ACTIONS (boutons d'export, etc.) ---- */
.charte-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
}
.charte-actions .btn {
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-radius: 8px;
    border: none;
    transition: all .2s ease;
    cursor: pointer;
}
.charte-actions .btn-success,
.charte-actions .btn-primary {
    background: linear-gradient(135deg, var(--axx-purple) 0%, var(--axx-purple-2) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(113, 69, 253, .35);
}
.charte-actions .btn-success:hover,
.charte-actions .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(113, 69, 253, .45);
    color: #fff;
}
.charte-actions .btn-secondary,
.charte-actions .btn-info {
    background: #fff;
    color: var(--axx-purple);
    border: 2px solid var(--axx-purple);
}
.charte-actions .btn-secondary:hover,
.charte-actions .btn-info:hover {
    background: var(--axx-hover);
    color: var(--axx-purple);
}
.charte-actions .hint {
    display: block;
    width: 100%;
    text-align: center;
    color: var(--axx-muted);
    font-size: 13px;
    margin-top: 4px;
}

/* ---- INDICATION / ALERTE ---- */
#indication {
    color: var(--axx-danger);
    font-weight: 600;
    min-height: 1.2em;
    display: block;
    text-align: center;
    margin-bottom: 8px;
}
.alerte { color: var(--axx-danger); font-weight: 600; }

/* ---- ONGLETS (stats/index.php) ---- */
#stats_tabs {
    border: none;
    gap: 4px;
    background: transparent;
    padding: 0;
    margin-bottom: 18px;
}
#stats_tabs .nav-item { flex: 1 1 0; }
#stats_tabs .nav-link {
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    font-weight: 600;
    color: var(--axx-muted);
    background: #fff;
    transition: all .2s ease;
    width: 100%;
    box-shadow: 0 1px 3px rgba(15, 10, 32, .05);
}
#stats_tabs .nav-link:hover {
    color: var(--axx-purple);
    background: var(--axx-hover);
}
#stats_tabs .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, var(--axx-purple) 0%, var(--axx-purple-2) 100%);
    box-shadow: 0 4px 14px rgba(113, 69, 253, .35);
}
.tab-content { min-height: 200px; }
.tab-toolbar {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.tab-toolbar label {
    font-weight: 600;
    color: var(--axx-muted);
    font-size: 13px;
    margin: 0;
}
.tab-toolbar .form-select {
    width: auto; min-width: 200px;
    border: 2px solid var(--axx-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    text-align: left;
    text-align-last: left;
}
.tab-toolbar .form-select:focus {
    border-color: var(--axx-purple);
    box-shadow: 0 0 0 3px rgba(113, 69, 253, .15);
    outline: none;
}
.tab-empty {
    padding: 2.5rem;
    text-align: center;
    color: var(--axx-muted);
    font-style: italic;
    background: #fff;
    border-radius: 12px;
    border: 2px dashed var(--axx-border);
}

/* ---- TABLES (.charte-content) ---- */
.charte-content table,
.charte-content table.table {
    background: #fff;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15, 10, 32, .08);
    width: 100%;
    margin: 0 0 22px;
    color: var(--axx-dark);
}
.charte-content table thead {
    background: linear-gradient(135deg, var(--axx-purple) 0%, var(--axx-purple-2) 100%);
}
.charte-content table thead th,
.charte-content table thead td {
    background: transparent;
    color: #fff !important;
    border: none;
    padding: 14px 12px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .5px;
    text-align: center;
    vertical-align: middle;
}
.charte-content table tbody tr {
    transition: background .2s ease;
    border-bottom: 1px solid var(--axx-border);
}
.charte-content table tbody tr:hover { background: var(--axx-hover); }
.charte-content table tbody tr:last-child { border-bottom: none; }
.charte-content table tbody td {
    padding: 12px;
    font-size: 14px;
    color: var(--axx-dark);
    border: none;
    text-align: center;
    vertical-align: middle;
}
.charte-content table tfoot th,
.charte-content table tr.total-row td {
    background: linear-gradient(135deg, var(--axx-purple) 0%, var(--axx-purple-2) 100%);
    color: #fff !important;
    padding: 14px 12px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .5px;
    border: none;
    text-align: center;
}
/* Table sans <thead> : première ligne stylée en gradient (rapport.php) */
.charte-content table.table-no-thead tbody tr:first-child {
    background: linear-gradient(135deg, var(--axx-purple) 0%, var(--axx-purple-2) 100%);
}
.charte-content table.table-no-thead tbody tr:first-child td {
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 14px 12px;
}
.charte-content table.table-no-thead tbody tr:first-child:hover {
    background: linear-gradient(135deg, var(--axx-purple) 0%, var(--axx-purple-2) 100%);
}

/* ---- CARTES MÉTRIQUES (minisite.php, push.php) ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 2px 10px rgba(15, 10, 32, .08);
    transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(113, 69, 253, .15); }
.stat-card .stat-label {
    color: var(--axx-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
    word-break: break-word;
}
.stat-card .stat-label a { color: var(--axx-purple); text-decoration: none; }
.stat-card .stat-label a:hover { color: var(--axx-dark); text-decoration: underline; }
.stat-card .stat-value {
    color: var(--axx-purple);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
}
.stat-card-cta {
    background: linear-gradient(135deg, var(--axx-purple) 0%, var(--axx-purple-2) 100%);
    color: #fff;
    grid-column: 1 / -1;
    text-align: center;
}
.stat-card-cta:hover { transform: none; }
.stat-card-cta .stat-cta-label {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- DATATABLES (stats/index.php) ---- */
div.dt-container { color: var(--axx-dark); }
div.dt-container .dt-search input,
div.dt-container .dt-length select {
    border: 2px solid var(--axx-border);
    border-radius: 8px;
    padding: 6px 10px;
    text-align: left;
    text-align-last: left;
    background: #fff;
}
div.dt-container .dt-search input:focus,
div.dt-container .dt-length select:focus {
    border-color: var(--axx-purple);
    box-shadow: 0 0 0 3px rgba(113, 69, 253, .15);
    outline: none;
}
div.dt-container .dt-paging .dt-paging-button { border-radius: 6px; }
div.dt-container .dt-paging .dt-paging-button.current,
div.dt-container .dt-paging .dt-paging-button.current:hover {
    background: var(--axx-purple) !important;
    color: #fff !important;
    border-color: var(--axx-purple) !important;
}
div.dt-container .dt-paging .dt-paging-button:hover {
    background: var(--axx-hover) !important;
    color: var(--axx-purple) !important;
    border-color: var(--axx-purple) !important;
}

/* =====================================================================
   3) RESPONSIVE
   ===================================================================== */
@media (max-width: 768px) {
    body { padding: 10px; }
    .filters form { grid-template-columns: 1fr; }
    .winners-grid { grid-template-columns: 1fr; }
    .header h1 { font-size: 22px; }
    .header-logo img { height: 56px; }
    .content { padding: 20px; }
    .table-section table { font-size: 14px; }
    .table-section table thead th,
    .table-section table tbody td { padding: 10px 12px; }
    .charte-header { padding: 20px; }
    .charte-header h1 { font-size: 20px; }
    .charte-header .header-logo img { height: 48px; }
    .charte-content { padding: 18px; }
    #stats_tabs { flex-wrap: wrap; }
    .charte-content table { font-size: 14px; }
    .charte-content table thead th,
    .charte-content table thead td,
    .charte-content table tbody td { padding: 10px 12px; }
    /* Tables responsive : scroll horizontal sur mobile.
       Exclut DataTables qui gère sa propre responsivité via le plugin Responsive. */
    .charte-content table:not(.dataTable),
    .table-section table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    .charte-content table:not(.dataTable) td,
    .charte-content table:not(.dataTable) th,
    .table-section table td,
    .table-section table th { white-space: nowrap; }
}
