/**
 * BKS Formations — affichage mobile du menu
 */

/* Bouton hamburger : masqué sur desktop */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
}

.nav-toggle:hover {
    background: var(--grey-bg);
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
}

/* Mobile : menu en dessous du header */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        height: auto;
        min-height: 56px;
        padding: 10px var(--pad);
    }

    .header-left {
        flex: 1;
        min-width: 0;
    }

    .header-title {
        display: none;
    }

    .header-right {
        order: 2;
    }

    .nav-toggle {
        display: flex;
        order: 3;
    }

    /* Navigation : masquée par défaut, en bloc sous le header quand ouverte */
    .main-nav {
        order: 4;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease;
    }

    .main-header.menu-open .main-nav {
        max-height: 420px;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
        padding: 8px 0;
        border-top: 1px solid var(--grey-border);
        margin-top: 8px;
    }

    .nav-menu li {
        border-bottom: 1px solid var(--grey-bg);
    }

    .nav-menu a {
        display: block;
        padding: 12px 14px;
    }

    /* Contenu : padding réduit */
    .main-content {
        padding: 16px var(--pad);
    }

    .page-title-bar {
        padding: 12px 16px;
    }

    .page-title-wrap h1 {
        font-size: 16px;
    }

    .card {
        padding: 16px;
    }

    .summary-blocks {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar .search-input {
        min-width: 0;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
}

/* Fiche client : responsive */
@media (max-width: 768px) {
    .client-fiche-tabs {
        width: 100%;
    }
    .client-fiche-tab {
        flex: 1;
        justify-content: center;
        min-width: 0;
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    .client-info-grid {
        grid-template-columns: 1fr;
    }
    .client-info-row .client-info-label {
        border-bottom: none;
        padding-bottom: 4px;
    }
    .client-info-row .client-info-value {
        padding-top: 0;
        padding-bottom: 12px;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    :root {
        --pad: 16px;
    }

    .logo-img {
        height: 32px;
    }

    .user-menu-toggle .user-name {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
