/* ==========================================================================
   AVOLOPAY — DESIGN SYSTEM INTEGRATION
   ========================================================================== */
/* Modifié le 2026-11-12, version 7.1.0, correction des défauts d'affichage :
   - les @import de tokens.css et components.css visaient des fichiers absents de
     src/style : deux requêtes en erreur à chaque chargement ; les pages chargent
     déjà le design system par ds/ ;
   - le second bloc body imposait un fond #f4f4f4 et un texte #333, clairs en thème
     sombre ;
   - les tableaux sans classe avaient un en-tête bleu en dur et, au survol, une ligne
     #f1f1f1 sous un texte clair en thème sombre, illisible ; ces règles passent sur
     les jetons et sous :where(), de spécificité nulle, pour ne pas gêner .table.
   Ancienne version : 'AI works/archives_2026-11-12/affichage/generale.css'. */

/* Base styles and resets */
:root {
    --primary-color: var(--primary);
    --secondary-color: var(--secondary);
    --text-light: var(--text-main);
    --text-dark: var(--text-main);
    --background-dark: var(--bg-base);
    --input-bg: var(--bg-surface);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Global utility classes */
.text-center {
    text-align: center;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Global animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Global transitions */
.transition-all {
    transition: all 0.3s ease;
}

/* Global focus styles */
:focus {
    outline: none;
    box-shadow: var(--shadow-glow);
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Basic responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Reset some default styles */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    /* position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    min-width: 100vw;
    min-height: 100vh;
    max-width: 100vw;
    max-height: 100vh; */
}

/* Main content styling — Full Available Space Layout (Design System) */
#main_content {
    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);
    padding: 24px 28px !important;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl, 16px);
    box-shadow: var(--shadow-md);
    transition: margin var(--transition-normal, 0.3s ease), width var(--transition-normal, 0.3s ease);
}

/* Action navigation — barre flottante fixe en bas à droite */
.action_nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    position: fixed;
    bottom: -12px;
    right: 20px;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 8px 12px;
    z-index: calc(var(--z-dropdown) - 1);
    box-shadow: var(--shadow-xl);
}

.action_nav p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.dt-container {
    position: relative;
}

.justify-content-between:nth-child(1) {
    justify-content: space-between;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: start;
    align-items: center;
    position: fixed;
    left: 0px;
    top: 124px;
    z-index: calc(var(--z-dropdown) - 1);
    width: 100%;
    background-color: var(--bg-surface);
}

#search_bar {
    display: flex;
    min-width: 90%;
    max-width: 90%;
    margin: 10px;
    margin-left: 5%;
    margin-right: 5%;
    max-height: 50px;
}

#search {
    padding: 10px;
    border: 1px solid var(--border-color-hover);
    border-radius: 4px;
    margin-right: 10px;
}

/* ── Boutons d'action icône (.action_nav) ────────────────────────────── */
#btn_add,
#btn_rem,
#btn_auto_rearrange,
#btn_open_assign_multi,
#btn_generate_private_link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.22s, box-shadow 0.22s, transform 0.14s;
    margin: 0;
    padding: 0 !important;
    flex-shrink: 0;
    position: relative;
}

#btn_add,
#btn_auto_rearrange,
#btn_open_assign_multi,
#btn_generate_private_link {
    background: linear-gradient(135deg, var(--primary), var(--color-info)) !important;
    color: var(--text-on-primary) !important;
    box-shadow: var(--shadow-glow) !important;
    border: none !important;
}

#btn_add i,
#btn_auto_rearrange i,
#btn_open_assign_multi i,
#btn_generate_private_link i {
    color: var(--text-main) !important;
    font-size: 1rem;
}

#btn_rem {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1.5px solid var(--color-danger-border);
    box-shadow: none;
}

#btn_add:hover,
#btn_auto_rearrange:hover,
#btn_open_assign_multi:hover,
#btn_generate_private_link:hover {
    background: linear-gradient(135deg, var(--primary), var(--color-info)) !important;
    box-shadow: var(--shadow-glow) !important;
    transform: translateY(-1px);
    color: var(--text-on-primary) !important;
}

#btn_rem:hover {
    background: var(--color-danger-bg);
    border-color: var(--color-danger-border);
    color: var(--color-danger);
    transform: translateY(-1px);
}


/* Client list table styling */
.client_list {
    margin-top: 20px;
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

:where(table) {
    width: 100%;
    border-collapse: collapse;
}

:where(table th, table td) {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

:where(table th) {
    background-color: var(--bg-subtle);
    color: var(--text-main);
}

:where(table td.bigBro) {
    border-style: solid;
}

#free_account p {
    font-size: 1.2rem;
    color: var(--text-on-primary);
}

:where(table tr):hover {
    background-color: var(--bg-subtle);
}

/* Urgence div styling */
#urgence {
    margin-top: 20px;
    padding: 10px;
    background-color: var(--color-warning);
    border-radius: 4px;
    display: none;
    /* Initially hidden, can be shown via JavaScript */
}

ul.pagination {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: start;

}

ul.pagination>li {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    min-width: 30px;
    max-width: 30px;
    max-height: 30px;
    min-height: 30px;
    border-radius: 6px;
    margin: 0.3rem;
    background-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

ul.pagination>li>a {
    height: auto;
    width: auto;
    margin: auto;
    color: aliceblue;
}

/* Mobile styles */
@media (max-width: 768px) {
    .justify-content-between:nth-child(1) {

        top: 60px;
    }

    #main_content {
        width: calc(100vw - 20px) !important;
        margin: 70px 10px 30px 10px !important;
        min-height: calc(100vh - 100px);
        padding: 14px 12px !important;
        background: var(--bg-surface);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg, 12px);
        box-shadow: var(--shadow-sm);
    }
}

/* ── Modern Floating Stats Widget ── */
#avolo_stats_widget {
    position: fixed;
    bottom: 82px;
    /* Sur PC : Positionné AU-DESSUS de .action_nav */
    right: 20px;
    z-index: calc(var(--z-fixed) + 2);
    background: var(--bg-overlay);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px 18px;
    box-shadow: var(--shadow-inner);
    color: var(--text-main);
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
    min-width: 220px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (max-width: 768px) {
    .action_nav {
        bottom: 16px !important;
        left: 16px !important;
        right: auto !important;
    }

    #avolo_stats_widget {
        bottom: 16px !important;
        right: 16px !important;
        left: auto !important;
    }
}

#avolo_stats_widget.collapsed {
    min-width: 48px;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    overflow: hidden;
    justify-content: center;
    align-items: center;
}

#avolo_stats_widget.collapsed .widget-content {
    display: none;
}

#avolo_stats_widget.collapsed .collapsed-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    font-size: 1.25rem;
    color: var(--color-explainer);
    transition: transform 0.2s;
}

#avolo_stats_widget.collapsed:hover .collapsed-icon {
    transform: scale(1.15);
}

#avolo_stats_widget:not(.collapsed) .collapsed-icon {
    display: none;
}

#avolo_stats_widget .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    width: 100%;
}

#avolo_stats_widget .widget-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-subtle);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

#avolo_stats_widget .widget-collapse-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 0.8rem;
    transition: color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#avolo_stats_widget .widget-collapse-btn:hover {
    color: var(--text-main);
    transform: translateY(1px);
}

#avolo_stats_widget .stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

#avolo_stats_widget .stat-label {
    color: var(--text-subtle);
}

#avolo_stats_widget .stat-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-main);
}

#avolo_stats_widget .stat-value.highlight {
    color: var(--color-explainer);
    /* vibrant cyan */
}

#avolo_stats_widget .stat-value.danger {
    color: var(--color-danger);
    /* soft red */
}
/* ── Écran de changement de plateforme, construit par src/js/variables.js ──
   Ajouté le 2026-11-13, phase E : remplace les styles en ligne et le bloc <style> du gabarit. */
.app-change-loader {
    position: fixed;
    inset: 0;
    z-index: var(--z-tooltip);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--space-6);
    background: var(--bg-base);
    backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity 0.4s ease 0.1s;
}
.app-change-loader.is-visible { opacity: 1; }
.app-change-loader-spinner { position: relative; width: 100px; height: 100px; margin-bottom: var(--space-8); }
.app-change-loader-ring,
.app-change-loader-arc {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-full);
    border: 4px solid var(--border-color);
}
.app-change-loader-arc {
    border-color: transparent;
    border-top-color: var(--primary);
    border-right-color: var(--secondary);
    animation: app-change-spin 1s linear infinite;
}
.app-change-loader-title {
    margin: 0;
    color: var(--text-main);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    letter-spacing: 1px;
    text-align: center;
}
.app-change-loader-text {
    max-width: 300px;
    margin-top: var(--space-3);
    color: var(--text-muted);
    font-size: var(--text-sm);
    text-align: center;
}
@keyframes app-change-spin { to { transform: rotate(360deg); } }

/* Message « Accès Refusé » affiché par src/js/linkpage.js, 2026-11-13 : remplace ses styles en ligne */
.access-denied { padding: 50px; text-align: center; color: var(--color-danger); }
.access-denied h2 { margin-top: var(--space-5); }
.access-denied p { color: var(--text-muted); }
