/* ---- GLOBAL ---- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: #eef1f5;
    font-family: "Segoe UI", Arial, sans-serif;
}

/* ---- VIEWPORT & RESPONSIVE BASE ---- */
@viewport {
    width: device-width;
    zoom: 1.0;
}

/* ---- NAVBAR ---- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: 60px;
    background: linear-gradient(90deg, #1b263b 0%, #253654 40%, #3b82f6 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    z-index: 2000;
    padding: 0 20px;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    font-size: 18px;
    font-weight: bold;
    white-space: nowrap;
    z-index: 2001;
}

/* Bouton hamburger (caché sur desktop) */
.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 2001;
}

.navbar-toggle span {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.navbar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Menu de navigation */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: space-between;
    padding-left: 30px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-right {
    display: flex;
    align-items: center;
}

.navbar a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}

.navbar a:hover {
    background: rgba(255,255,255,0.1);
}

/* MOBILE: Menu hamburger */
@media (max-width: 768px) {
    .navbar {
        padding: 0 15px;
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: #1b263b;
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    
    .nav-menu.active {
        max-height: 400px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-left,
    .nav-right {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    
    .navbar a {
        padding: 15px 20px;
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .navbar a:hover {
        background: rgba(255,255,255,0.05);
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 16px;
    }
    
    .navbar a {
        font-size: 14px;
        padding: 12px 15px;
    }
}

/* ---- PAGE ---- */
.page {
    margin-top: 90px;
    padding: 0 50px;
    margin-bottom: 40px;
}
.page-inner {
    max-width: 1400px;
    background: white;
    padding: 40px;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

/* MOBILE & TABLET: Réduire les marges */
@media (max-width: 1024px) {
    .page {
        padding: 0 20px;
        margin-top: 100px;
    }
    
    .page-inner {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .page {
        padding: 0 10px;
        margin-top: 120px;
    }
    
    .page-inner {
        padding: 15px;
        border-radius: 5px;
    }
}

/* ---- TITRES ---- */
h1 {
    margin-top: 0;
    color: #1b263b;
    font-size: 28px;
}
h2 {
    color: #415a77;
    font-size: 22px;
}
h3 {
    font-size: 18px;
}

@media (max-width: 768px) {
    h1 {
        font-size: 24px;
    }
    h2 {
        font-size: 20px;
    }
    h3 {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 20px;
    }
    h2 {
        font-size: 18px;
    }
    h3 {
        font-size: 15px;
    }
}

/* ---- FORMULAIRES ---- */
label {
    font-weight: 600;
    color: #1b263b;
    font-size: 14px;
}
input[type="text"],
input[type="number"],
input[type="password"],
textarea {
    width: 100%;
    max-width: 100%;
    padding: 10px;
    border: 1px solid #c9d0db;
    border-radius: 6px;
    margin-top: 5px;
    font-size: 14px;
}

select {
    width: 100%;
    padding: 10px;
    border: 1px solid #c9d0db;
    border-radius: 6px;
    font-size: 14px;
}

button, .btn {
    background: #1b263b;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
}
button:hover, .btn:hover {
    background: #4a505a;
}
/* Hover transparent uniquement pour le bouton menu */
#navbar-toggle.navbar-toggle:hover {
    background-color: transparent !important;
}

@media (max-width: 480px) {
    input[type="text"],
    input[type="number"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px; /* Éviter le zoom automatique sur iOS */
        padding: 12px;
    }
    
    button, .btn {
        width: 100%;
        padding: 12px;
        margin-bottom: 10px;
    }
}

/* ---- FLASH ---- */
.flash {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}
.flash.success {
    background: #d4ffe0;
    border-left: 5px solid #27ae60;
}
.flash.error {
    background: #ffd6d6;
    border-left: 5px solid #c0392b;
}

/* ---- DASHBOARD ---- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas:
        "a b ."
        "c d e";
    gap: 25px;
}

.dashboard-grid > :nth-child(1) { grid-area: a; }
.dashboard-grid > :nth-child(2) { grid-area: b; }
.dashboard-grid > :nth-child(3) { grid-area: c; }
.dashboard-grid > :nth-child(4) { grid-area: d; }
.dashboard-grid > :nth-child(5) { grid-area: e; }

.dashboard-grid2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.card {
    background: #f8faff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    text-align: center;
}
.card h3 {
    margin-top: 0;
    color: #415a77;
    font-size: 14px;
}
.card p {
    font-size: 32px;
    font-weight: bold;
    color: #1b263b;
    margin: 10px 0;
}

/* TABLET: 2 colonnes */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-areas:
            "a b"
            "c d"
            "e e";
        gap: 15px;
    }
    
    .dashboard-grid2 {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .card {
        padding: 15px;
    }
    
    .card p {
        font-size: 24px;
    }
}

/* MOBILE: 1 colonne */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "a"
            "b"
            "c"
            "d"
            "e";
        gap: 10px;
    }
    
    .dashboard-grid2 {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .card {
        padding: 12px;
    }
    
    .card h3 {
        font-size: 12px;
    }
    
    .card p {
        font-size: 20px;
    }
}
/* ------------------------------------------------------------------
   BAR CHART (Emails par source)
-------------------------------------------------------------------*/
.bar-chart {
    margin-top: 20px;
}

.bar-row {
    display: grid;
    grid-template-columns: 150px 1fr 60px;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.bar-label {
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
}

.bar-container {
    background: #e9edf5;
    border-radius: 6px;
    height: 14px;
    overflow: hidden;
    position: relative;
}

.bar {
    background: #4e73df;
    height: 100%;
    width: 0%;
    border-radius: 6px;
    transition: width 0.6s ease;
}

.bar-value {
    font-weight: 700;
    color: #2c3e50;
    text-align: right;
}
/* ---- BAR CHART Emails par source ---- */
.bar-chart {
    margin-top: 15px;
}

.bar-row {
    display: grid;
    grid-template-columns: 150px 1fr 60px;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.bar-label {
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
}

.bar-container {
    background: #e9edf5;
    border-radius: 6px;
    height: 14px;
    overflow: hidden;
}

.bar {
    background: #4e73df;
    height: 100%;
    width: 0%;
    border-radius: 6px;
    transition: width 0.6s ease;
}

.bar-value {
    font-weight: 700;
    color: #2c3e50;
    text-align: right;
}
/* ---- TABLEAU BASE EMAILS ---- */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 10px 0;
}

#emails-table {
    width: 100%;
    min-width: 800px; /* Force scroll sur mobile */
    border-collapse: collapse;
    margin-top: 10px;
    background: white;
}

#emails-table th,
#emails-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e1e5ee;
    text-align: left;
    font-size: 13px;
}

#emails-table th {
    background: #1b263b;
    color: #fff;
    white-space: nowrap;
}

#emails-table tr:nth-child(even) {
    background: #f8f9fc;
}

#emails-table tr:hover {
    background: #e9f2ff;
}

@media (max-width: 768px) {
    #emails-table {
        min-width: 600px;
        font-size: 12px;
    }
    
    #emails-table th,
    #emails-table td {
        padding: 6px 8px;
    }
}

/* ---- BADGES STATUT MAUTIC ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-ok {
    background: #e5f9ed;
    color: #1e824c;
}

.badge-pending {
    background: #fff7e0;
    color: #b7791f;
}

.badge-error {
    background: #ffe5e5;
    color: #c0392b;
}

.badge-unknown {
    background: #e2e8f0;
    color: #4a5568;
}

/* ---- MODAL ---- */
.modal.hidden {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    overflow-y: auto;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
}

.modal-content {
    position: relative;
    max-width: 600px;
    margin: 60px auto;
    background: #fff;
    padding: 20px 25px 25px 25px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.modal-body {
    background: #ffffff;
    margin: 40px auto;
    padding: 25px;
    width: 520px;
    max-width: 90%;
    max-height: 85vh;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    position: relative;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    cursor: pointer;
    font-size: 26px;
    color: gray;
    background: none;
    border: none;
    padding: 0;
    width: auto;
}

@media (max-width: 768px) {
    .modal-content {
        margin: 20px;
        max-width: calc(100% - 40px);
        padding: 15px;
    }
    
    .modal-body {
        margin: 20px auto;
        padding: 20px;
        width: auto;
        max-width: calc(100% - 20px);
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 10px;
        max-width: calc(100% - 20px);
        padding: 12px;
        border-radius: 8px;
    }
    
    .modal-body {
        margin: 10px;
        padding: 15px;
        max-width: calc(100% - 20px);
        border-radius: 8px;
    }
}

/* -----------------------
   GRID SOURCES
----------------------- */

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

.source-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    border: 1px solid #e5e5e5;
}

.source-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
}

.source-status.on { color: #28a745; font-weight: bold; }
.source-status.off { color: #d9534f; font-weight: bold; }

.source-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.source-actions button {
    flex: 1;
    min-width: 100px;
}

@media (max-width: 768px) {
    .source-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .source-card {
        padding: 15px;
    }
    
    .source-header {
        flex-direction: column;
    }
    
    .source-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .source-grid {
        gap: 10px;
    }
    
    .source-card {
        padding: 12px;
    }
}

/* -----------------------
   MODALS
----------------------- */

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px);
}

.modal-body {
    background: #ffffff;
    margin: 40px auto;
    padding: 25px;
    width: 520px;
    max-width: 90%;
    max-height: 85vh;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    position: relative;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    cursor: pointer;
    font-size: 26px;
    color:gray
}

/* Items list */
.item-row {
    display: flex;
    margin-bottom: 10px;
}

.item-input {
    flex: 1;
    margin-right: 8px;
}

.btn-delete-small {
    background: #dc3545;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
}

/* Switch modern */
.switch { position: relative; display: inline-block; width: 50px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer;
    inset: 0; background: #ccc; border-radius: 34px;
    transition: .3s;
}
.slider:before {
    position: absolute; content: "";
    height: 18px; width: 18px; left: 3px; bottom: 3px;
    background: white; border-radius: 50%;
    transition: .3s;
}
input:checked + .slider { background: #28a745; }
input:checked + .slider:before { transform: translateX(26px); }

.switch-label { margin-left: 10px; }

/* Buttons full-width */
.btn-accent-full {
    width: 100%;
    margin-top: 15px;
}
/* Panneau de contrôle global */
.global-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px 20px 15px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    border: 1px solid #e5e5e5;
    margin-bottom: 25px;
}

.global-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.global-card-body {
    margin-top: 10px;
}

.global-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

@media (max-width: 768px) {
    .global-card {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .global-actions {
        flex-direction: column;
    }
    
    .global-actions button {
        width: 100%;
    }
    
    .global-actions > div {
        width: 100%;
    }
    
    .global-actions label {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .global-actions input {
        width: 100% !important;
        margin-top: 5px;
    }
}

@media (max-width: 480px) {
    .global-card {
        padding: 12px;
        border-radius: 8px;
    }
}
.scan-box {
    margin-top: 15px;
    padding: 15px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.scan-row {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    height: 14px;
    background: #333;
    border-radius: 7px;
    overflow: hidden;
    flex: 1;
}

.progress-inner {
    height: 100%;
    width: 0%;
    background: #4caf50;
    transition: width 0.3s ease;
}

.progress-text {
    min-width: 45px;
    text-align: right;
    font-size: 12px;
}

.source-progress-block {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.source-progress {
    flex: 1;
}

.source-small-status {
    font-size: 12px;
    opacity: 0.8;
}

/* couleurs par source (tu peux adapter) */
.progress-inner.source-annuaire { background: #ff9800; }
.progress-inner.source-sites { background: #2196f3; }
.progress-inner.source-linkedin { background: #9c27b0; }
.progress-inner.source-opendata { background: #00bcd4; }


.linkedin-conn-block {
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    gap:4px;
    margin-left:10px;
}
.linkedin-conn-status {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}
.linkedin-conn-status.ok {
    background:#e0ffe5;
    color:#2e7d32;
}
.linkedin-conn-status.ko {
    background:#ffe0e0;
    color:#c62828;
}

.div.select {
    height: 34px;
}


.autocomplete-box {
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.autocomplete-item:hover {
    background: #eee;
}

/* Boutons désactivés : style gris + curseur bloqué */

button:disabled,
button[disabled] {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

/* Si tu veux que le texte soit grisé aussi */
button:disabled span,
button[disabled] span {
    color: #aaa !important;
}

/* ===============================================
   MEDIA QUERIES SUPPLÉMENTAIRES POUR RESPONSIVE
=============================================== */

/* LOGS BOX */
@media (max-width: 768px) {
    #logs-box {
        max-height: 400px;
        font-size: 12px;
    }
    
    #logs-container {
        font-size: 11px;
    }
}

/* BAR CHART - Graphiques */
@media (max-width: 768px) {
    .bar-row {
        grid-template-columns: 100px 1fr 50px;
        gap: 8px;
        font-size: 12px;
    }
    
    .bar-label {
        font-size: 12px;
    }
    
    .bar-container {
        height: 12px;
    }
}

@media (max-width: 480px) {
    .bar-row {
        grid-template-columns: 80px 1fr 40px;
        gap: 5px;
        font-size: 11px;
    }
    
    .bar-label {
        font-size: 11px;
    }
}

/* SCAN BOX - Progression */
@media (max-width: 768px) {
    .scan-box {
        padding: 12px;
        font-size: 13px;
    }
    
    .scan-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .progress-bar {
        width: 100%;
        margin-top: 5px;
    }
}

/* BADGES - Statuts */
@media (max-width: 480px) {
    .badge {
        font-size: 11px;
        padding: 2px 6px;
    }
}

/* BOUTONS DÉSACTIVÉS */
@media (max-width: 768px) {
    button:disabled,
    button[disabled] {
        opacity: 0.5 !important;
    }
}

/* GRILLES À DEUX COLONNES (dashboard, settings) */
@media (max-width: 768px) {
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* FLEX GAP FALLBACK */
@media (max-width: 768px) {
    [style*="display:flex"],
    [style*="display: flex"] {
        gap: 8px;
    }
}

/* AUTO-REFRESH BANNER */
@media (max-width: 768px) {
    #auto-refresh-banner {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
        padding: 12px !important;
    }
    
    #auto-refresh-banner > div {
        width: 100%;
    }
    
    #toggle-refresh {
        width: 100%;
    }
}

/* SWITCH TOGGLE */
@media (max-width: 480px) {
    .switch {
        width: 44px;
        height: 22px;
    }
    
    .slider:before {
        height: 16px;
        width: 16px;
    }
    
    input:checked + .slider:before {
        transform: translateX(22px);
    }
}

/* LINKEDIN CONNECTION BLOCK */
@media (max-width: 768px) {
    .linkedin-conn-block {
        align-items: flex-start;
        margin-left: 0;
        width: 100%;
        margin-top: 10px;
    }
    
    .linkedin-conn-status {
        font-size: 11px;
    }
}

/* AUTOCOMPLETE */
@media (max-width: 480px) {
    .autocomplete-box {
        font-size: 13px;
    }
}

/* TABLE RESPONSIVE HELPER */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    table th,
    table td {
        font-size: 12px;
        padding: 6px 8px;
    }
}

/* FORMULAIRES INLINE */
@media (max-width: 768px) {
    form[style*="display:flex"] {
        flex-direction: column !important;
    }
    
    form[style*="display:flex"] input,
    form[style*="display:flex"] select,
    form[style*="display:flex"] button {
        width: 100% !important;
        margin-bottom: 10px;
    }
}

/* SMALL SCREENS - TEXT SIZE */
@media (max-width: 320px) {
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 18px;
    }
    
    h2 {
        font-size: 16px;
    }
    
    h3 {
        font-size: 14px;
    }
}

/* PREVENT HORIZONTAL SCROLL */
body, html {
    overflow-x: hidden;
    max-width: 100%;
}

* {
    max-width: 100%;
}

/* TOUCH TARGETS (44x44px minimum) */
@media (max-width: 768px) {
    button, .btn, a.btn, input[type="checkbox"], input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    .row-checkbox {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
    }
}

/* ===============================================
   CORRECTIONS SPÉCIFIQUES BASE EMAILS (DATABASE)
=============================================== */

/* Container de la page database */
@media (max-width: 768px) {
    /* Bannière auto-refresh plus compacte */
    #auto-refresh-banner {
        padding: 8px 12px !important;
        font-size: 13px;
    }
    
    #auto-refresh-banner span {
        font-size: 12px;
    }
    
    #toggle-refresh {
        padding: 6px 10px !important;
        font-size: 12px;
    }
}

/* Stats en haut de la page database */
.dashboard-grid2 {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)) !important;
    gap: 8px !important;
}

@media (max-width: 480px) {
    .dashboard-grid2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Filtres de recherche */
@media (max-width: 768px) {
    form[method="GET"] {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    form[method="GET"] > div {
        width: 100% !important;
    }
    
    form[method="GET"] input,
    form[method="GET"] select {
        width: 100% !important;
    }
    
    form[method="GET"] button,
    form[method="GET"] a.btn {
        width: 100%;
        margin: 5px 0;
    }
}

/* Pagination */
@media (max-width: 768px) {
    div[style*="justify-content:space-between"] {
        flex-direction: column !important;
        gap: 10px;
        align-items: stretch !important;
    }
    
    div[style*="justify-content:space-between"] > div {
        width: 100%;
        justify-content: center;
    }
}

/* Tableau emails - Wrapper avec scroll */
div[style*="overflow-x:auto"] {
    -webkit-overflow-scrolling: touch;
    margin: 15px -20px; /* Déborde des marges sur mobile */
    padding: 0 20px;
}

@media (max-width: 768px) {
    div[style*="overflow-x:auto"] {
        margin: 10px -15px;
        padding: 0 15px;
    }
}

/* Tableau emails responsive */
#emails-table {
    min-width: 900px; /* Force le scroll sur mobile */
}

@media (max-width: 768px) {
    #emails-table {
        min-width: 700px;
        font-size: 12px;
    }
    
    #emails-table th,
    #emails-table td {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    #emails-table th {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    #emails-table {
        min-width: 600px;
        font-size: 11px;
    }
    
    #emails-table th,
    #emails-table td {
        padding: 5px 6px;
        font-size: 10px;
    }
}

/* Compteur de sélection */
#selected-count {
    font-size: 14px;
    margin: 10px 0;
}

@media (max-width: 480px) {
    #selected-count {
        font-size: 12px;
    }
}

/* Bloc actions bulk */
#bulk-form {
    margin-top: 20px;
}

@media (max-width: 768px) {
    #bulk-form > div[style*="display:flex"] {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    #bulk-form > div[style*="display:flex"] > div {
        width: 100% !important;
        min-width: 100% !important;
    }
    
    #bulk-form h4 {
        font-size: 16px;
        margin-top: 0;
    }
    
    #bulk-form button {
        width: 100%;
        margin: 5px 0;
        padding: 12px;
    }
    
    #bulk-form div[style*="display:flex"][style*="gap"] {
        flex-direction: column;
        width: 100%;
    }
    
    #bulk-form select,
    #bulk-form input {
        width: 100% !important;
    }
}

/* Modal email détails */
@media (max-width: 768px) {
    .modal-content {
        margin: 20px 10px;
        padding: 15px;
    }
    
    .modal-content h2 {
        font-size: 18px;
    }
    
    .modal-content p {
        font-size: 13px;
    }
    
    .modal-content div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    
    .modal-content div[style*="display:flex"] {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .modal-content button {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .modal-content button {
        width: 100%;
        min-width: auto;
    }
}

/* Info-bulles et textes d'aide */
@media (max-width: 768px) {
    p[style*="font-size:12px"],
    p[style*="font-size:13px"] {
        font-size: 11px !important;
    }
    
    small {
        font-size: 10px;
    }
}



.navbar .nav-link {
    position: relative;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

/* Soulignement / highlight au hover */
.navbar .nav-link::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 4px;
    height: 2px;
    border-radius: 999px;
    background: transparent;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
    opacity: 0;
}

.navbar .nav-link:hover {
    background: rgba(15, 23, 42, 0.55);
}

.navbar .nav-link:hover::after {
    background: rgba(255, 255, 255, 0.7);
    opacity: 1;
    transform: scaleX(1);
}

/* Onglet actif (page courante) */
.navbar .nav-link.active {
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.navbar .nav-link.active::after {
    background: #fbbf24; /* petit accent jaune/orange */
    opacity: 1;
    transform: scaleX(1);
}
.navbar a.logout {
    background: rgba(239, 68, 68, 0.9);
    border-radius: 999px;
    padding: 8px 16px;
    font-weight: 600;
}

.navbar a.logout:hover {
    background: rgba(220, 38, 38, 1);
}

/* Liens de la barre du haut */
.navbar .nav-left a {
    position: relative;
    border-radius: 999px;
    padding: 8px 16px;
}

/* Onglet actif (page courante) */
.navbar .nav-left a.active {
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

/* Petit trait sous l'onglet actif */
.navbar .nav-left a.active::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 4px;
    height: 2px;
    border-radius: 999px;
    background: #fbbf24; /* accent */
}

.bulk-column {
    flex: 1;
    min-width: 320px;
    background: #f8faff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    padding: 25px;
    
    /* centrage du contenu */
    display: flex;
    flex-direction: column;
    align-items: center;   /* centre horizontalement tout l'intérieur */
    text-align: center;    /* texte centré */
    gap: 10px;
}
