/* ============================================================
   ZKDIGITAL — FEUILLE DE STYLES PRINCIPALE
   Design sombre avec accent orange, layout flexbox full-screen
   ============================================================ */


/* ============================================================
   VARIABLES CSS GLOBALES
   Toutes les valeurs réutilisables sont centralisées ici
   pour faciliter la maintenance et la cohérence visuelle
   ============================================================ */
:root {
    /* Les blocs sombres (Sidebar, Header, Cartes internes) */
    --bg-dark-theme: #172333;

    /* Le fond du site à droite */
    --bg-site-white: #F3F3F3;

    /* Textes */
    --text-light: #F3F3F3;   /* Texte clair sur fond sombre */
    --text-muted: #575759;   /* Texte discret, infos secondaires */

    /* Identité visuelle */
    --color-orange-accent: #F58220;  /* Couleur principale de la marque */
    --border-color-soft: #575759;    /* Bordure discrète entre éléments */

    --radius-boxes: 14px;    /* Arrondi des cartes et conteneurs */
    --radius-buttons: 8px;   /* Arrondi des boutons et champs */
}


/* ============================================================
   RESET GLOBAL
   Supprime les marges/paddings par défaut du navigateur
   et impose le modèle de boîte border-box sur tous les éléments
   ============================================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/* ============================================================
   BODY
   Police Roboto, hauteur plein écran, scroll global désactivé
   (chaque zone scrollable gère son propre overflow)
   ============================================================ */
body {
    font-family: 'Roboto', sans-serif;
    height: 100vh;
    overflow: hidden;
}


/* ============================================================
   CONTENEUR PRINCIPAL DE L'APPLICATION
   Flex row : sidebar à gauche + zone principale à droite,
   occupe toute la largeur et hauteur disponibles
   ============================================================ */
.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}


/* ============================================================
   SIDEBAR (BARRE LATÉRALE)
   Panneau de navigation gauche à largeur fixe (15%),
   fond sombre, organisé en colonne avec espacement vertical
   entre le menu et le footer
   ============================================================ */
.sidebar {
    width: 15%;
    background-color: var(--bg-dark-theme);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    justify-content: space-between; /* Logo en haut, footer en bas */
    flex-shrink: 0; /* Empêche la sidebar de rétrécir */
}

/* Logo : légèrement réduit par rapport à son conteneur */
.mock-logo img{
    width: 85%;
    height: 85%;
}

/* Zone de navigation principale dans la sidebar */
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 40px;
    flex-grow: 1; /* Prend tout l'espace vertical disponible */
}

/* Zone inférieure de la sidebar (bouton de déconnexion, etc.) */
.sidebar-footer {
    display: flex;
    flex-direction: column;
}

/* Titre de section dans le menu (ex : "Navigation") */
.sidebar-menu h3 {
    color: var(--color-orange-accent);
}

/* Boutons de navigation et bouton de déconnexion
   Style identique : outline orange, fond transparent */
.menu-btn, .logout-btn {
    text-decoration: none;
    color: var(--color-orange-accent);
    padding: 12px;
    border: 1px solid var(--color-orange-accent);
    border-radius: var(--radius-buttons);
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
}


/* ============================================================
   ZONE PRINCIPALE (MAIN STAGE)
   Colonne flexible qui occupe tout l'espace restant
   à droite de la sidebar : header en haut, contenu en dessous
   ============================================================ */
.main-stage {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}


/* ============================================================
   HEADER DE L'APPLICATION
   Bandeau sombre en haut de la zone principale,
   hauteur fixe, titre centré
   ============================================================ */
.app-header {
    background-color: var(--bg-dark-theme);
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Ne se compresse pas si le contenu est grand */
}

/* Titre principal de la page dans le header */
.app-header h1 {
    color: var(--color-orange-accent);
    font-size: 2.2rem;
    letter-spacing: 1px;
}


/* ============================================================
   ZONE DE CONTENU BLANCHE
   Zone scrollable à fond clair qui contient les cartes
   de stats et la liste des tickets
   ============================================================ */
.white-content-area {
    background-color: var(--bg-site-white);
    flex-grow: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    overflow-y: auto; /* Seule zone avec scroll vertical */
}

.login-content-area {
    background-color: var(--bg-dark-theme);
    flex-grow: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    overflow-y: auto; /* Seule zone avec scroll vertical */
}


/* ============================================================
   GRILLES DE STATISTIQUES
   Deux variantes : 4 colonnes (vue standard) et 6 colonnes (vue admin)
   ============================================================ */

/* Grille standard : 4 cartes de stats côte à côte */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* Grille admin : 6 cartes de stats côte à côte */
.stats-grid-admin {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 25px;
}

/* Carte de statistique individuelle : fond sombre, centrage vertical et horizontal */
.stat-card {
    background-color: var(--bg-dark-theme);
    border-radius: var(--radius-boxes);
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Valeur numérique principale de la carte (ex : "42") */
.stat-value {
    font-size: 4rem;
    font-weight: bold;
    color: var(--text-light);
    line-height: 1;
    margin-bottom: 10px;
}

/* Libellé de la statistique sous la valeur (ex : "Tickets ouverts") */
.stat-name {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 600;
    letter-spacing: 0.5px;
}


/* ============================================================
   CONTENEUR
   Bloc sombre arrondi qui occupe l'espace vertical restant,
   contient le header de section + la liste des lignes
   ============================================================ */
.wrapper {
    background-color: var(--bg-dark-theme);
    border-radius: var(--radius-boxes);
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Sous bloc du wrapper en blanc pour afficher notamment des formulaires */
.sub-wrapper {
    background-color: var(--bg-site-white);
    border-radius: var(--radius-boxes);
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* En-tête de la section tickets : titre à gauche, filtres à droite */
.tickets-header {
    color: var(--color-orange-accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Groupe de boutons de filtre alignés horizontalement */
.filters-group {
    display: flex;
    gap: 8px;
}

/* Boutons de filtre et bouton de recherche
   Style outline orange par défaut, fond transparent */
.filter-tag, .action-search-btn {
    background: transparent;
    border: 1px solid var(--color-orange-accent);
    color: var(--color-orange-accent);
    padding: 6px 14px;
    border-radius: var(--radius-buttons);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Filtre actif : orange plein, texte sombre (inversé) */
.filter-tag.active {
    background-color: var(--color-orange-accent);
    color: var(--bg-dark-theme);
}


/* ============================================================
   LISTE DES TICKETS
   Colonne de lignes séparées par des bordures discrètes
   ============================================================ */
.tickets-list {
    display: flex;
    flex-direction: column;
}

/* Ligne individuelle d'un ticket : icône + titre à gauche, shortcut + flèche à droite */
.ticket-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 8px;
    border-bottom: 1px solid var(--border-color-soft); /* Séparateur entre lignes */
}

/* Supprime le séparateur sur la dernière ligne */
.ticket-row:last-child {
    border-bottom: none;
}

/* Groupe gauche (icône + titre) et groupe droit (raccourci + flèche) */
.row-left, .row-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.row-right {
    padding-right: 15px;
}

/* Icône et titre du ticket en texte clair */
.row-icon, .row-title {
    color: var(--text-light);
}

/* Image de l'icône : taille fixe et rendu propre */
.row-icon img {
    width: 25px;
    height: 25px;
    object-fit: contain;
    display: block; /* Supprime l'espace résiduel sous les images inline */
}

/* Raccourci clavier et flèche de navigation : texte discret */
.row-shortcut, .row-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
}


/* ============================================================
   BARRE DE RECHERCHE
   Conteneur flex qui aligne le champ et le bouton de recherche
   ============================================================ */
.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Champ de saisie de recherche
   Fond transparent, bordure orange, texte clair,
   animation douce à la prise de focus */
.search-input {
    background: transparent;
    border: 1px solid var(--color-orange-accent);
    color: var(--text-light);
    padding: 6px 12px;
    border-radius: var(--radius-buttons);
    outline: none;
    font-size: 0.85rem;
    width: 150px;
    transition: all 0.3s ease; /* Transition fluide (ex : agrandissement au focus) */
}

/* En-tête des boites wrapper : titre */
.box-subtitle {
    color: var(--color-orange-accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ============================================================
   FORMULAIRES & INPUT BOXES
   Styles pour les champs de saisie dans les zones de contenu
   ============================================================ */

/* Style du label pour encadrer le champ */
.sub-wrapper:not(.toggle) label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--bg-dark-theme); /* Texte sombre sur le fond clair */
    font-size: 0.9rem;
    font-weight: 600;
    width: 100%;
}

/* Style de l'input box par défaut */
.sub-wrapper input:not([type="checkbox"]):not([type="submit"]),
.sub-wrapper select,
.sub-wrapper textarea {
    border: 1px solid #D1D1D1; /* Bordure grise discrète au repos */
    color: var(--bg-dark-theme);
    padding: 12px 16px;
    border-radius: var(--radius-buttons);
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.25s ease-in-out;
    width: 100%;
}

/* Effet au survol (Hover) */
.sub-wrapper:not(.submit-label) input:not([type="checkbox"]):hover:not([type="submit"]),
.sub-wrapper:not(.submit-label) select:hover,
.sub-wrapper:not(.submit-label) textarea:hover {
    border-color: #A0A0A0;
}


/* Effet de focus */
.sub-wrapper:not(.submit-label) input:not([type="checkbox"]):focus:not([type="submit"]),
.sub-wrapper:not(.submit-label) select:focus,
.sub-wrapper:not(.submit-label) textarea:focus {
    border-color: var(--color-orange-accent);
    box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.15);
    background-color: #FFFFFF;
}

/* Style optionnel pour le placeholder si vous en ajoutez un */
.sub-wrapper input::placeholder, select::placeholder, textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* Style pour les boutons d'envoi/annulation d'un formulaire */
.submit-label input,
.submit-label a {
    text-decoration: none;
    background-color: var(--bg-dark-theme);
    color: var(--bg-site-white);
    padding: 12px;
    border: 1px solid var(--bg-dark-theme);
    border-radius: var(--radius-buttons);
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.wrapper textarea {
    resize: none;
}

/* Style pour les checkbox en mode levier */
.toggle {

    /* On définit la hauteur de notre élément */
    --toggle-height: 1.5rem;


    /* On désactive le style par défaut du système d'exploitation */
    appearance: none;


    /* On définit les dimensions de la "piste" (le fond) */
    width: 3rem;
    height: var(--toggle-height);
    border-radius: 99px; /* Un grand border-radius pour l'effet pilule */
    background: var(--bg-dark-theme); /* Couleur quand c'est inactif (gris bleuté) */
    position: relative;
    cursor: pointer;
    transition: 0.3s;


    /* On crée la "pastille" (le bouton qui glisse) avec un pseudo-élément
    * Le pseudo-élément est intéressant car le rond qui indique l'état n'a pas de sens sémantique,
    * ajouter un élément juste graphique est de la responsabilité de CSS.
    */
    &::after {
        /* On définit la hauteur et le placement de notre pastille */
        --element-top-left: 2px;
        --element-size: calc(var(--toggle-height) - var(--element-top-left) * 2);


        content: '';
        position: absolute;
        left: var(--element-top-left);
        top: var(--element-top-left);
        width: var(--element-size);
        height: var(--element-size);
        background: white;
        border-radius: 50%;
        transition: 0.3s;
    }


    /* On gère l'état "Activé" grâce à la pseudo-classe :checked natif aux checkbox */
    &:checked {
        background: var(--color-orange-accent); /* Couleur quand c'est actif */


        /* On déplace la pastille vers la droite */
        &::after {
            transform: translateX(var(--toggle-height));
        }
    }
}

.toggle-label {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 16px;
}

.toggle-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toggle-text small {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 400;
}

/* ============================================================
   DÉTAIL TICKET
   ============================================================ */

    /* Grille 2 colonnes : 65% gauche / 35% droite */
.ticket-detail-grid {
    display: grid;
    grid-template-columns: 65% 1fr;
    gap: 2%;
}

.ticket-col-left,
.ticket-col-right {
    display: flex;
    flex-direction: column;
    gap: 2%;
}

.ticket-comments-wrapper,
.ticket-history-wrapper {
}

/* Texte dans le bloc description */
.ticket-libelle {
    color: var(--bg-dark-theme);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.ticket-desc-text {
    color: var(--bg-dark-theme);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Fil de commentaires */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.comment-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.comment-author {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-orange-accent);
}

.comment-author--admin {
    color: var(--text-muted);
}

.comment-body {
    font-size: 0.82rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* Zone de saisie commentaire */
.comment-input {
    background-color: var(--bg-site-white);
    border: none;
    border-radius: var(--radius-buttons);
    padding: 12px 16px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.85rem;
    color: var(--bg-dark-theme);
    resize: none;
    height: 80px;
    outline: none;
    width: 100%;
    margin-top: 10px;
}

.comment-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Bloc informations */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-row {
    font-size: 0.70rem;
    color: var(--text-light);
    line-height: 1;
}

.info-row span {
    color: var(--text-muted);
}

.info-accent {
    color: var(--color-orange-accent) !important;
    font-weight: 700;
}

/* Timeline historique */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.timeline-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-orange-accent);
    flex-shrink: 0;
    margin-top: 3px;
}

.timeline-dot--muted {
    background-color: var(--text-muted);
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.timeline-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
}

.timeline-desc,
.timeline-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Boutons d'action en bas */
.ticket-actions {
    display: flex;
    gap: 1%;
}

.ticket-action-btn {
    flex: 1;
    padding: 14px 0;
    border-radius: var(--radius-buttons);
    font-family: 'Roboto', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: 1px solid var(--color-orange-accent);
    background: transparent;
    color: var(--color-orange-accent);
    transition: all 0.2s ease;
    text-align: center;
}

.ticket-action-btn:hover {
    background-color: var(--color-orange-accent);
    color: var(--bg-dark-theme);
}

.ticket-action-btn--muted {
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.ticket-action-btn--muted:hover {
    background-color: var(--text-muted);
    color: var(--bg-dark-theme);
}

/* ============================================================
   TICKET — CHANGEMENT D'ÉTAT
   ============================================================ */

/* Bloc select + bouton sous l'historique */
.status-update {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-top: 16px;
}

/* Label + select empilés */
.status-update-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-light);
    font-size: 0.82rem;
    font-weight: 600;
}

/* Select stylé comme les inputs du sub-wrapper */
.status-select {
    background-color: var(--bg-site-white);
    border: 1px solid #D1D1D1;
    color: var(--bg-dark-theme);
    padding: 10px 12px;
    border-radius: var(--radius-buttons);
    font-family: 'Roboto', sans-serif;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    width: 100%;
    transition: all 0.25s ease-in-out;
}

.status-select:focus {
    border-color: var(--color-orange-accent);
    box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.15);
}

/* Bouton sauvegarder aligné avec le select */
.status-save-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 10px 16px;
}

/* Textes dans le sub-wrapper commentaires — sur fond blanc */
.sub-wrapper .comment-author {
    color: var(--color-orange-accent);
}

.sub-wrapper .comment-author--admin {
    color: var(--text-muted);
}

.sub-wrapper .comment-body {
    color: var(--bg-dark-theme);
}

/* Textes dans le sub-wrapper historique — sur fond blanc */
.sub-wrapper .timeline-label {
    color: var(--bg-dark-theme);
}

.sub-wrapper .timeline-desc,
.sub-wrapper .timeline-date {
    color: var(--text-muted);
}

/* Textes dans le sub-wrapper informations — alignés à gauche */
.sub-wrapper .info-list {
    align-items: flex-start;
}

.sub-wrapper .info-row {
    color: var(--bg-dark-theme);
}

.sub-wrapper .info-row span {
    color: var(--text-muted);
}

.ticket-col-right .sub-wrapper {
    flex-grow: 0;
}

.ticket-col-right .wrapper {
    flex-grow: 0;
}


/* Indicateur coloré de statut sur les lignes de ticket */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.row-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
}

.status-dot--en-cours   { background-color: var(--color-orange-accent); }
.status-dot--en-attente { background-color: #ede20c; }
.status-dot--termine    { background-color: #4CAF50; }
.status-dot--ouvert    { background-color: #eb0017; }



/* ============================================================
   FILTRE CLIENT — SELECT DASHBOARD ADMIN
   ============================================================ */

.filter-group {
    display: flex;
    align-items: center;
}

.client-select {
    background-color: transparent;
    border: 1px solid var(--color-orange-accent);
    color: var(--color-orange-accent);
    padding: 6px 14px;
    border-radius: var(--radius-buttons);
    font-family: 'Roboto', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;

    /* Flèche native du select invisible sur fond sombre */
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23F58220'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.client-select:hover {
    background-color: var(--color-orange-accent);
    color: var(--bg-dark-theme);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23172333'/%3E%3C/svg%3E");
}

/* Les options héritent du fond sombre du navigateur */
.client-select option {
    background-color: var(--bg-dark-theme);
    color: var(--text-light);
}

/* ============================================================
   RESPONSIVE — POINTS DE RUPTURE
   Ajouts uniquement. Le cœur du design n'est pas modifié.
   Stratégie mobile-last : le desktop est la base,
   on adapte par breakpoints décroissants.
   ============================================================ */


/* ============================================================
   UTILITAIRES FLUIDES (clamp)
   Remplace les tailles fixes par des valeurs qui s'adaptent
   à la largeur de la fenêtre sans media query
   ============================================================ */

/* Titre du header : entre 1.2rem (mobile) et 2.2rem (desktop) */
.app-header h1 {
    font-size: clamp(1.2rem, 2.5vw, 2.2rem);
}

/* Valeur numérique des stat-cards : entre 1.8rem et 4rem */
.stat-value {
    font-size: clamp(1.8rem, 3.5vw, 4rem);
}


/* ============================================================
   BREAKPOINT — TABLETTE LARGE (≤ 1200px)
   La sidebar grossit un peu, les grilles se resserrent
   ============================================================ */
@media (max-width: 1200px) {

    /* Sidebar légèrement plus large pour rester lisible */
    .sidebar {
        width: 200px;
    }

    /* Stats admin (6 colonnes) → 3 colonnes */
    .stats-grid-admin {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Stats standard (4 colonnes) → 2 colonnes */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* ============================================================
   BREAKPOINT — TABLETTE PORTRAIT (≤ 900px)
   Layout principal reste en row mais sidebar compressée,
   grille de détail ticket passe en colonne unique
   ============================================================ */
@media (max-width: 900px) {

    /* Sidebar réduite à une bande d'icônes */
    .sidebar {
        width: 70px;
        padding: 20px 10px;
        align-items: center;
    }

    /* Logo caché car trop large pour 70px */
    .mock-logo {
        display: none;
    }

    /* Menu centré */
    .sidebar-menu {
        margin-top: 20px;
        align-items: center;
        gap: 10px;
    }

    /* Texte des boutons de navigation masqué, bouton réduit à un carré */
    .menu-btn, .logout-btn {
        font-size: 0;           /* Cache le texte */
        padding: 10px;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Titre de section "Navigation" masqué */
    .sidebar-menu h3 {
        display: none;
    }

    /* Grille ticket-detail : 1 colonne pleine largeur */
    .ticket-detail-grid {
        grid-template-columns: 1fr;
    }

    /* Stats admin → 2 colonnes */
    .stats-grid-admin {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Padding de la zone de contenu réduit */
    .white-content-area,
    .login-content-area {
        padding: 20px;
        gap: 16px;
    }

    /* Wrapper intérieur moins espacé */
    .wrapper, .sub-wrapper {
        padding: 20px;
        gap: 16px;
    }
}


/* ============================================================
   BURGER MENU + RESPONSIVE MOBILE (≤ 600px)
   Remplace le bloc ≤ 600px précédent
   ============================================================ */

@media (max-width: 600px) {

    /* --------------------------------------------------
       BODY — scroll vertical autorisé, horizontal bloqué
       -------------------------------------------------- */
    body {
        overflow-x: hidden;
        overflow-y: auto;
        height: auto;
    }

    /* --------------------------------------------------
       LAYOUT — colonne, hauteur auto
       -------------------------------------------------- */
    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    /* --------------------------------------------------
       SIDEBAR — drawer caché hors écran par défaut
       Glisse depuis la gauche via translateX
       -------------------------------------------------- */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 75vw;
        max-width: 280px;
        height: 100vh;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding: 30px 20px;
        overflow-y: auto;
        /* Réinitialise les styles de la barre horizontale */
        flex-direction: column;
        justify-content: space-between;
        align-items: flex-start;
    }

    /* Sidebar ouverte */
    .sidebar--open {
        transform: translateX(0);
    }

    /* Logo toujours visible dans le drawer */
    .mock-logo {
        display: block;
    }

    .mock-logo img {
        width: 120px;
        height: auto;
    }

    /* Menu vertical avec gap normal */
    .sidebar-menu {
        flex-direction: column;
        margin-top: 30px;
        gap: 15px;
        align-items: stretch;
        flex-grow: 1;
    }

    /* Boutons de nav — taille normale, texte visible */
    .menu-btn, .logout-btn {
        font-size: 0.85rem;
        padding: 12px;
        width: 100%;
        height: auto;
        display: block;
    }

    .sidebar-menu h3 {
        display: block;
    }

    /* --------------------------------------------------
       OVERLAY — fond sombre derrière le drawer
       -------------------------------------------------- */
    .burger-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 199;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .burger-overlay--visible {
        opacity: 1;
        pointer-events: all;
    }

    /* --------------------------------------------------
       BURGER BUTTON
       Trois barres qui se transforment en croix
       -------------------------------------------------- */
    .burger-btn {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        position: fixed;
        top: 18px;
        left: 16px;
        z-index: 201; /* Au-dessus du drawer et de l'overlay */
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 6px;
        width: 36px;
        height: 36px;
    }

    /* Chaque barre */
    .burger-btn span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: var(--color-orange-accent);
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.3s ease;
        transform-origin: center;
    }

    /* Animation croix quand ouvert */
    .burger-btn--open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .burger-btn--open span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    .burger-btn--open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* --------------------------------------------------
       MAIN STAGE — pleine largeur, hauteur auto
       -------------------------------------------------- */
    .main-stage {
        width: 100%;
        height: auto;
        flex-grow: 1;
    }

    /* Header : espace à gauche pour le burger */
    .app-header {
        height: 65px;
        padding-left: 60px; /* Évite que le titre chevauche le burger */
    }

    /* --------------------------------------------------
       CONTENU
       -------------------------------------------------- */
    .white-content-area,
    .login-content-area {
        padding: 16px;
        gap: 14px;
        overflow-y: visible;
        height: auto;
    }

    /* Stats → 2 colonnes */
    .stats-grid,
    .stats-grid-admin {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .wrapper, .sub-wrapper {
        padding: 16px;
        gap: 12px;
    }

    .tickets-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .filters-group {
        flex-wrap: wrap;
        gap: 6px;
    }

    .search-container {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        width: 100%;
    }

    .ticket-actions {
        flex-direction: column;
        gap: 8px;
    }

    /* Détail ticket : 1 colonne, hauteurs auto pour scroller */
    .ticket-detail-grid {
        grid-template-columns: 1fr;
    }

    .ticket-col-left,
    .ticket-col-right {
        height: auto !important;
        gap: 12px;
        padding-bottom: 25px;
    }

    /* Tous les wrappers du détail ticket : hauteur auto */
    .ticket-col-left .wrapper,
    .ticket-col-right .wrapper {
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        gap: 8px;
    }

    .ticket-row {
        padding: 12px 6px;
    }

    .row-title {
        font-size: 0.82rem;
    }

    .row-shortcut {
        display: none;
    }
}

/* ============================================================
   BREAKPOINT — TRÈS PETIT MOBILE (≤ 380px)
   ============================================================ */
@media (max-width: 380px) {

    .stats-grid,
    .stats-grid-admin {
        grid-template-columns: 1fr;
    }

    .sidebar {
        width: 85vw;
    }
}

/* ============================================================
   BURGER — masqué sur desktop (> 600px)
   ============================================================ */
@media (min-width: 601px) {
    .burger-btn,
    .burger-overlay {
        display: none;
    }
}




/* ============================================================
   SCROLLBAR CUSTOM — Thème ZkDigital
   ============================================================ */

* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-orange-accent) var(--bg-dark-theme);
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark-theme);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--color-orange-accent);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--color-orange-accent) 80%, white);
}

::-webkit-scrollbar-corner {
    background: var(--bg-dark-theme);
}





/* =====================================================
   KANBAN — LAYOUT
   ===================================================== */

/* Grille 4 colonnes égales, pleine hauteur disponible */
.kanban-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    height: 100%;
}

/* Colonne Kanban : fond sombre, bordure arrondie */
.kanban-col {
    background-color: var(--bg-dark-theme);
    border-radius: var(--radius-boxes);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

/* En-tête de colonne */
.kanban-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color-soft);
    flex-shrink: 0;
}

.kanban-col-title {
    color: var(--color-orange-accent);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Badge compteur de cartes */
.kanban-col-count {
    background-color: var(--border-color-soft);
    color: var(--text-light);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
}

/* Zone de défilement des cartes */
.kanban-col-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden; !important;
    flex-grow: 1;
}

/* =====================================================
   CARTE KANBAN
   ===================================================== */
.kanban-card {
    background-color: var(--bg-site-white);
    border-radius: var(--radius-buttons);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
    text-decoration: none;
}

.kanban-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

/* Bande de couleur à gauche selon le type */
.kanban-card--ticket {
    border-left: 3px solid var(--color-orange-accent);
}

.kanban-card--tache {
    border-left: 3px solid #575759;
}

/* Libellé principal de la carte */
.kanban-card-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--bg-dark-theme);
    line-height: 1.3;
}

/* Sous-titre (client / créateur) */
.kanban-card-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Pied de carte : badge type + date d'échéance */
.kanban-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

/* Badge "Ticket" ou "Tâche" */
.kanban-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.kanban-badge--ticket {
    background-color: rgba(245, 130, 32, 0.15);
    color: var(--color-orange-accent);
}

.kanban-badge--tache {
    background-color: rgba(87, 87, 89, 0.15);
    color: var(--text-muted);
}

/* Date d'échéance */
.kanban-card-date {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* Date d'échéance dépassée → rouge */
.kanban-card-date--echue {
    color: #eb0017;
    font-weight: 600;
}


/* =====================================================
   DRAG & DROP — États visuels
   ===================================================== */

/* Carte en cours de drag */
.kanban-card.dragging {
    opacity: 0.5;
    cursor: grabbing !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transform: rotate(1.5deg) scale(1.03);
    pointer-events: none;
    z-index: 999;
}

/* Colonne survolée pendant un drag */
.kanban-col.drag-over {
    outline: 2px dashed var(--color-orange-accent);
    outline-offset: -4px;
    background-color: rgba(245, 130, 32, 0.06);
}

/* Carte non draggable (curseur normal) */
.kanban-card {
    cursor: grab;
}


html, body {
    overflow-x: hidden !important;
}

.kanban-card.dragging {
    position: relative;
    z-index: 9999 !important;
    pointer-events: none;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}


.kanban-grid-dragging-active,
.kanban-grid-dragging-active .kanban-col-body {
    overflow: visible !important;
}

.kanban-col.drag-over {
    background: rgba(0, 0, 0, 0.02);
}