/**
 * mobile.css — CSS responsive mobile complet pour AvoloPay
 * Intégré dans gestion.html via <link rel="stylesheet" href="css/mobile.css">
 * Ce fichier complète generale.css et menu_hub.css avec des améliorations mobiles.
 */

/* ═══════════════════════════════════════════════════════════════
   DESIGN TOKENS & VARIABLES CSS
   ═══════════════════════════════════════════════════════════════ */
:root {
    --avolo-blue: #0056b3;
    --avolo-blue-light: #007bff;
    --avolo-blue-dark: #003d80;
    --avolo-accent: #00b4d8;
    --avolo-success: #28a745;
    --avolo-warning: #ffc107;
    --avolo-danger: #dc3545;
    --avolo-bg: #f0f4f8;
    --avolo-card-bg: #ffffff;
    --avolo-text: #1a2332;
    --avolo-text-muted: #6b7280;
    --avolo-border: #e5e7eb;
    --avolo-shadow: 0 2px 16px rgba(0, 86, 179, 0.10);
    --avolo-shadow-hover: 0 6px 32px rgba(0, 86, 179, 0.18);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --menu-width: 280px;
    --header-height: 120px;
    --header-height-mobile: 56px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--avolo-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--avolo-text);
    overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   MENU PRINCIPAL — VERSION DESKTOP (top-bar horizontale)
   ═══════════════════════════════════════════════════════════════ */
#menu_content {
    background: linear-gradient(135deg, #0a1628 0%, #0d2137 100%);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#menu_content #weblogo {
    filter: brightness(1.2);
}

#menu_content div#app {
    scrollbar-width: none;
}

#menu_content div#app::-webkit-scrollbar {
    display: none;
}

#menu_content div#app .bar_tile p,
#menu_content div#app_management a {
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    border-radius: 6px;
    padding: 8px 12px;
    transition: var(--transition);
}

#menu_content div#app_management a {
    color: rgba(255, 255, 255, 0.85);
}

#menu_content div#app_management a:hover {
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    transform: none;
}

#menu_content .bar_tile.highlighted a,
#menu_content .bar.highlighted a {
    color: #fff;
    background-color: rgba(0, 180, 216, 0.25) !important;
}

/* ═══════════════════════════════════════════════════════════════
   CONTENU PRINCIPAL
   ═══════════════════════════════════════════════════════════════ */
#main_content {
    background: var(--bg-surface, var(--avolo-card-bg));
    border-radius: var(--radius-xl, var(--radius-md));
    box-shadow: var(--shadow-md, var(--avolo-shadow));
    padding: 24px 28px;
    margin-left: 265px !important;
    margin-top: 75px !important;
    margin-right: 20px !important;
    margin-bottom: 40px !important;
    width: calc(100vw - 285px) !important;
    max-width: none !important;
    min-height: calc(100vh - 100px);
    transition: var(--transition);
}

/* ═══════════════════════════════════════════════════════════════
   STYLES DU MODAL
   ═══════════════════════════════════════════════════════════════ */
/* ── OVERLAY ──────────────────────────────────────────────────────────── */
#payment_proof_modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#ppm_overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 25, 0.85);
    backdrop-filter: blur(8px);
    z-index: 0;
}

#ppm_container {
    position: relative;
    z-index: 1;
    background: #0d1f35;
    border: 1.5px solid rgba(0, 180, 216, 0.3);
    border-radius: 20px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 180, 216, 0.1);
    animation: ppmIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

@keyframes ppmIn {
    from {
        opacity: 0;
        transform: scale(0.88) translateY(30px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ── HEADER ───────────────────────────────────────────────────────────── */
#ppm_header {
    padding: 20px 22px 16px;
    background: linear-gradient(135deg, #081520, #0d2137);
    border-bottom: 1px solid rgba(0, 180, 216, 0.15);
    flex-shrink: 0;
}

#ppm_title_row {
    display: flex;
    align-items: center;
    gap: 14px;
}

#ppm_icon_wrap {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #0056b3, #00b4d8);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 180, 216, 0.3);
}

#ppm_title {
    margin: 0;
    color: #f0f8ff;
    font-size: 1rem;
    font-weight: 700;
}

#ppm_subtitle {
    margin: 3px 0 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

/* ── CLIENT BANNER ───────────────────────────────────────────────────── */
#ppm_client_banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px;
    background: rgba(0, 180, 216, 0.07);
    border-bottom: 1px solid rgba(0, 180, 216, 0.12);
    flex-shrink: 0;
}

#ppm_client_icon {
    font-size: 2rem;
    color: #00B4D8;
    opacity: 0.8;
}

#ppm_client_name {
    font-weight: 700;
    color: #7FDBFF;
    font-size: 0.95rem;
}

#ppm_client_phone {
    font-size: 0.8rem;
    color: rgba(127, 219, 255, 0.6);
    margin-top: 2px;
}

#ppm_action_badge {
    margin-left: auto;
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

#ppm_action_badge.renew {
    background: linear-gradient(135deg, #0056b3, #00b4d8);
}

/* ── BODY ─────────────────────────────────────────────────────────────── */
#ppm_body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 180, 216, 0.3) transparent;
}

.ppm_section {
    margin-bottom: 18px;
}

.ppm_label {
    display: block;
    font-size: 0.83rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ppm_label i {
    color: #00B4D8;
    margin-right: 5px;
}

.ppm_required {
    color: #f87171;
    margin-left: 3px;
}

.ppm_optional_tag {
    color: #64748b;
    font-weight: normal;
    font-size: 0.78rem;
    margin-left: 4px;
    text-transform: none;
}

.ppm_recommended_tag {
    color: #f59e0b;
    font-size: 0.78rem;
    margin-left: 4px;
    text-transform: none;
    font-weight: 600;
}

.ppm_input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 11px 14px;
    color: #e2e8f0;
    font-size: 0.88rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    resize: vertical;
}

.ppm_input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

.ppm_input:focus {
    outline: none;
    border-color: #00B4D8;
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
    background: rgba(0, 180, 216, 0.05);
    color: #00B4D8;
}

.ppm_input.ppm_error {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

/* ── OPERATOR GRID ────────────────────────────────────────────────────── */
#ppm_operator_grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.ppm_op_card {
    cursor: pointer;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 6px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    user-select: none;
}

.ppm_op_card input {
    display: none;
}

.ppm_op_inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.ppm_op_card span {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 600;
}

.ppm_op_logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.9rem;
    color: white;
}

.ppm_op_logo.moov {
    background: linear-gradient(135deg, #003399, #0052cc);
}

.ppm_op_logo.airtel {
    background: linear-gradient(135deg, #cc0000, #ff3333);
}

.ppm_op_logo.cash {
    background: linear-gradient(135deg, #059669, #10b981);
    font-size: 0.75rem;
}

.ppm_op_logo.vir {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    font-size: 0.75rem;
}

.ppm_op_card:hover {
    background: rgba(0, 180, 216, 0.08);
    transform: translateY(-2px);
}

.ppm_op_card.selected {
    border-color: #00B4D8;
    background: rgba(0, 180, 216, 0.12);
    box-shadow: 0 0 0 2px rgba(0, 180, 216, 0.25);
}

.ppm_op_card.selected span {
    color: #7FDBFF;
}

/* ── DROP ZONE ────────────────────────────────────────────────────────── */
#ppm_drop_zone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    overflow: hidden;
    position: relative;
}

#ppm_drop_zone:hover,
#ppm_drop_zone.drag_over {
    border-color: #00B4D8;
    background: rgba(0, 180, 216, 0.06);
}

#ppm_drop_inner {
    text-align: center;
    padding: 16px;
}

#ppm_drop_icon {
    font-size: 2rem;
    color: rgba(0, 180, 216, 0.5);
    display: block;
    margin-bottom: 8px;
}

#ppm_drop_text {
    color: #94a3b8;
    font-size: 0.85rem;
    margin: 0;
}

#ppm_preview_wrap {
    width: 100%;
    height: 100%;
    position: relative;
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

#ppm_preview_img {
    max-height: 160px;
    max-width: 100%;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

#ppm_preview_pdf {
    color: #f87171;
    font-size: 1rem;
    font-weight: 700;
    display: none;
}

#ppm_remove_file {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(248, 113, 113, 0.9);
    border: none;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#ppm_remove_file:hover {
    background: #ef4444;
}

/* ── ERRORS ───────────────────────────────────────────────────────────── */
#ppm_errors {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.4);
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: -6px;
    margin-bottom: 12px;
}

#ppm_errors ul {
    margin: 0;
    padding-left: 18px;
    color: #fca5a5;
    font-size: 0.83rem;
}

/* ── PROGRESS ─────────────────────────────────────────────────────────── */
#ppm_progress_wrap {
    text-align: center;
    padding: 12px 0;
}

#ppm_progress_bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

#ppm_progress_fill {
    height: 100%;
    background: linear-gradient(90deg, #0056b3, #00b4d8);
    border-radius: 6px;
    transition: width 0.3s ease;
    width: 0%;
    animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

#ppm_progress_label {
    font-size: 0.82rem;
    color: #94a3b8;
}

/* ── SUCCESS ──────────────────────────────────────────────────────────── */
#ppm_success {
    text-align: center;
    padding: 20px;
    animation: ppmIn 0.4s ease;
}

#ppm_success_icon {
    font-size: 3.5rem;
    color: #10b981;
    margin-bottom: 12px;
    animation: popBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    70% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#ppm_success h3 {
    color: #6ee7b7;
    margin: 0 0 8px;
    font-size: 1.1rem;
}

#ppm_success p {
    color: #94a3b8;
    margin: 4px 0;
    font-size: 0.85rem;
}

#ppm_abn_display {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 8px 14px;
    color: #6ee7b7;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-block;
    margin: 8px auto;
}

/* ── FOOTER ───────────────────────────────────────────────────────────── */
#ppm_footer {
    padding: 14px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(5, 10, 20, 0.5);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
}

#ppm_cancel_btn {
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

#ppm_cancel_btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

#ppm_submit_btn {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.87rem;
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

#ppm_submit_btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

#ppm_submit_btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 500px) {
    #ppm_operator_grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #ppm_container {
        border-radius: 16px;
        max-height: 95vh;
    }

    #payment_proof_modal {
        padding: 8px;
        align-items: flex-end;
    }

    #ppm_container {
        border-radius: 16px 16px 0 0;
    }
}

/* ═══════════════════════════════════════════════════════════════
   BOUTON TOGGLE MENU — DESKTOP : CACHÉ
   ═══════════════════════════════════════════════════════════════ */
#menu-toggle {
    display: none;
    position: fixed;
    top: 10px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: var(--avolo-blue);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1100;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0, 86, 179, 0.4);
    transition: var(--transition);
}

#menu-toggle:hover {
    background: var(--avolo-blue-dark);
    transform: scale(1.05);
}

/* ═══════════════════════════════════════════════════════════════
   CARTES & CONTENEURS GÉNÉRIQUES
   ═══════════════════════════════════════════════════════════════ */
.card,
.avolo-card {
    background: var(--avolo-card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--avolo-shadow);
    padding: 20px;
    border: 1px solid var(--avolo-border);
    transition: var(--transition);
}

.card:hover,
.avolo-card:hover {
    box-shadow: var(--avolo-shadow-hover);
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════════
   BOUTONS GLOBAUX
   ═══════════════════════════════════════════════════════════════ */
button,
.btn,
input[type="submit"],
input[type="button"] {
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

#btn_add {
    background: linear-gradient(135deg, var(--avolo-blue), var(--avolo-accent));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.3);
    transition: var(--transition);
}

#btn_add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 86, 179, 0.4);
}

.action_nav {
    background: linear-gradient(135deg, var(--avolo-blue), var(--avolo-blue-dark));
    box-shadow: 0 4px 20px rgba(0, 86, 179, 0.4);
    padding: 8px 12px;
}

/* ═══════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════ */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

table thead tr {
    background: linear-gradient(135deg, var(--avolo-blue), #0a3d6e);
}

table th {
    background: transparent;
    color: white;
    padding: 14px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

table th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

table th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--avolo-border);
    font-size: 0.88rem;
    vertical-align: middle;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover td {
    background-color: rgba(0, 86, 179, 0.04);
}

/* ═══════════════════════════════════════════════════════════════
   INPUTS & FORMULAIRES
   ═══════════════════════════════════════════════════════════════ */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--avolo-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--avolo-text);
    background: #fafbfc;
    transition: var(--transition);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--avolo-blue-light);
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.12);
}

/* ═══════════════════════════════════════════════════════════════
   BADGES & STATUTS
   ═══════════════════════════════════════════════════════════════ */
.badge-active {
    background: #d1fae5;
    color: #065f46;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-expired {
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   SEARCH BAR
   ═══════════════════════════════════════════════════════════════ */
#search_input,
.search input,
input[id="search_input"] {
    background: #f3f6fb;
    border: 1.5px solid #dee3ec;
    border-radius: 50px;
    padding: 10px 18px;
}

#search_input:focus {
    border-color: var(--avolo-blue-light);
    background: white;
}

/* ═══════════════════════════════════════════════════════════════
   MODALES
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay,
.registration-overlay,
#registration_modal_overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal, 10010);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition-normal, 0.25s ease), visibility var(--transition-normal, 0.25s ease);
}

.modal-overlay.active,
.modal-overlay.open,
.registration-overlay.active,
.registration-overlay.open,
#registration_modal_overlay.active,
#registration_modal_overlay.open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.modal-container,
.wizard-container {
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 18px 24px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-body {
    padding: 24px;
    background: var(--bg-surface);
    color: var(--text-main);
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    background: var(--bg-subtle);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ═══════════════════════════════════════════════════════════════
   SYSTÈME DE SUGGESTIONS (clients existants)
   ═══════════════════════════════════════════════════════════════ */
.client-suggest-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1.5px solid var(--avolo-border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 220px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.client-suggest-item {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s ease;
}

.client-suggest-item:hover {
    background: #f0f6ff;
}

.client-suggest-item:last-child {
    border-bottom: none;
}

.suggest-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--avolo-blue), var(--avolo-accent));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.suggest-info {
    flex: 1;
}

.suggest-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--avolo-text);
}

.suggest-detail {
    font-size: 0.75rem;
    color: var(--avolo-text-muted);
}

.suggest-platform-badge {
    font-size: 0.7rem;
    background: var(--avolo-bg);
    padding: 2px 8px;
    border-radius: 100px;
    color: var(--avolo-blue);
    font-weight: 600;
}

.suggest-inactive {
    opacity: 0.7;
}

.suggest-inactive .suggest-name {
    text-decoration: line-through;
    color: var(--avolo-text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   NOTIFICATION TOASTS (Only .system-toast)
   ═══════════════════════════════════════════════════════════════ */
.system-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--avolo-text);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    max-width: 90vw;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    overflow-x: auto;
}

.system-toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════════════
   ████████████████████ MEDIA QUERIES MOBILE █████████████████████
   ═══════════════════════════════════════════════════════════════ */

/* ── Tablette (< 1024px) ─────────────────────────────────────── */
@media (max-width: 1024px) {
    #main_content {
        margin-top: 130px;
        padding: 20px;
    }
}

/* ── Mobile (< 768px) ────────────────────────────────────────── */
@media (max-width: 768px) {

    /* Menu : drawer latéral */
    #menu_content {
        position: fixed;
        top: 0;
        right: -100vw;
        width: min(85vw, 320px);
        height: 100vh;
        max-height: 100vh !important;
        flex-direction: column !important;
        z-index: 1050;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        box-shadow: -4px 0 30px rgba(0, 0, 0, 0.4);
        padding-top: 0px;
        padding-bottom: calc(90px + env(safe-area-inset-bottom, 20px)) !important;
        overscroll-behavior: contain;
    }

    #menu_content.opennav {
        right: 0 !important;
    }

    /* Overlay derrière le menu */
    #menu_content.opennav::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        left: -100vw;
        width: 200vw;
    }

    /* Boutons du menu : colonnes */
    #menu_content>div {
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        height: auto !important;
        max-height: none !important;
        max-width: 100% !important;
        min-width: 100% !important;
        margin: 0 !important;
        padding: 8px 0 !important;
        overflow-x: visible !important;
    }

    #menu_content>div#app {
        background: rgba(255, 255, 255, 0.06);
        padding: 8px 0 !important;
    }

    #user_profile_display {
        padding-left: 4.5em;
    }

    #menu_content>div#app_management {
        flex: 1;
        padding: 8px 0 !important;
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 20px)) !important;
    }

    #menu_content .bar,
    #menu_content .bar_group,
    #menu_content .bar_tile {
        min-width: 100%;
        flex-direction: row !important;
        margin: 0 !important;
        padding: 4px 8px !important;
    }

    #menu_content .bar_list {
        flex-direction: column;
        overflow-x: visible;
    }

    #menu_content a,
    #menu_content .bar_tile p {
        white-space: normal !important;
        width: 100%;
        padding: 12px 20px !important;
        border-radius: 0 !important;
        margin: 0 !important;
        font-size: 0.92rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    #menu_content a:last-child {
        margin-bottom: calc(30px + env(safe-area-inset-bottom, 15px)) !important;
    }

    #menu_content #weblogo {
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        max-height: 45px !important;
        min-height: 45px !important;
    }

    /* Bouton toggle visible */
    #menu-toggle {
        display: flex !important;
    }

    /* Masquer le hamburger bouton intégré si présent */
    .menu-drawer-close-btn {
        position: absolute;
        top: 14px;
        right: 14px;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: white;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        font-size: 1rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Contenu principal */
    #main_content {
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 56px 0 80px 0 !important;
        padding: 16px 14px !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        min-height: calc(100vh - 56px);
    }

    /* Tables : scroll horizontal sauf client-table */
    .table-responsive-wrap,
    .newtable_container,
    #LIST_MOD {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    .client_list,
    #client_table_wrapper {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    table:not(.client-table) {
        min-width: 600px;
    }

    table.client-table {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        table-layout: fixed !important;
    }


    table th,
    table td {
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    /* Action nav — adaptation mobile : déplacé vers la gauche */
    .action_nav {
        bottom: 16px !important;
        left: 16px !important;
        right: auto !important;
        padding: 6px 10px !important;
        gap: 6px !important;
        border-radius: 14px !important;
    }

    #avolo_stats_widget {
        bottom: 16px !important;
        right: 16px !important;
        left: auto !important;
    }

    body:not(.has-avolo-topbar) #app_nav {
        min-width: 50px;
        max-width: 50px;
        min-height: 50px;
        max-height: 50px;
        bottom: auto;
        left: auto;
        top: 12px;
        right: 20px;
    }

    /* Modales plein écran sur mobile */
    .modal-container,
    .wizard-container {
        max-width: 100%;
        max-height: 95vh;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
        align-self: flex-end;
        margin-top: auto;
    }

    .modal-overlay,
    #registration_modal_overlay {
        align-items: flex-end;
        padding: 0;
    }

    /* Formulaires */
    .wizard-step-content form {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Stats cards */
    .stat-card,
    .stats-grid>div {
        padding: 14px !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .stats-grid>div:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    /* Barre de recherche */
    .search,
    #OPTION_LIST .search {
        flex-wrap: wrap;
        gap: 8px;
    }

    #search_input {
        flex: 1;
        min-width: 0;
    }

    /* Managers page */
    .mgr-stats {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .mgr-topbar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .mgr-toolbar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px !important;
    }

    /* Dashboard */
    .simulator-section {
        padding: 14px !important;
    }

    .notif-panel {
        margin: 0 -14px 16px !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }
}

/* ── Très petit mobile (< 480px) ─────────────────────────────── */
@media (max-width: 480px) {
    #main_content {
        padding: 12px 10px !important;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .modal-header h2,
    .modal-header h3 {
        font-size: 0.95rem;
    }

    table th,
    table td {
        padding: 8px 10px;
        font-size: 0.76rem;
    }

    #btn_add {
        padding: 8px 14px;
        font-size: 0.82rem;
    }

    /* Formulaires wizard */
    .wizard-nav button {
        padding: 10px !important;
        font-size: 0.8rem;
    }


    #LIST_MOD,
    .client_list {
        overflow: visible;
        overflow-y: visible;
        overflow-x: visible;
    }
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS GLOBALES
   ═══════════════════════════════════════════════════════════════ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

.animate-in {
    animation: fadeInUp 0.3s ease both;
}

/* ═══════════════════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════════════════ */
@media print {

    #menu_content,
    #menu-toggle,
    .action_nav,
    #response_message {
        display: none !important;
    }

    #main_content {
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none;
        width: 100% !important;
    }
}