/* ── Portail équipe (front-end, [prodige_equipe]) ────────────────────────────
   Réutilise les variables --pb-primary / --pb-secondary déjà utilisées par le
   widget de réservation public, pour une identité visuelle cohérente avec le
   reste du site plutôt qu'un nouveau système de design. */

.pb-team-wrap, .pb-team-login {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 1000px;
    margin: 2rem auto;
    color: #222;
}

/* Le portail est un "espace de travail" distinct du reste du site — un fond légèrement teinté
   (couleur secondaire) fait ressortir les cartes blanches par contraste, plutôt que de les
   laisser flotter directement sur le fond du site (rendu plat signalé par Barbara). */
.pb-team-wrap {
    background: color-mix(in srgb, var(--pb-secondary, #f0f7ff) 30%, #fafafa);
    border-radius: 18px;
    padding: 26px 28px 34px;
}

/* ── Connexion ─────────────────────────────────────────────────────────── */
.pb-team-login {
    max-width: 380px;
    background: #fff;
    border: 1.5px solid color-mix(in srgb, var(--pb-primary, #1a1a2e) 30%, transparent);
    border-radius: 14px;
    padding: 28px 30px;
    box-shadow: 0 2px 6px rgba(20,20,30,.05), 0 12px 32px rgba(20,20,30,.09);
}
.pb-team-login label { font-size: 13px; font-weight: 600; color: #444; }
.pb-team-login input[type="text"],
.pb-team-login input[type="password"],
.pb-team-login input[type="email"] {
    width: 100%; padding: 9px 12px; border: 1px solid #ccc; border-radius: 8px;
    font-size: 14px; margin-top: 4px; box-sizing: border-box;
}
.pb-team-login-notice { color: #1e6b38; font-size: 13px; }
.pb-team-login-error  { color: #b91c1c; font-size: 13px; }
.pb-team-lost-password { margin-top: 6px; font-size: 13px; color: #666; }
.pb-team-lost-password summary { cursor: pointer; }

/* ── Boutons partagés ──────────────────────────────────────────────────── */
.pb-team-btn {
    display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid #ccc;
    background: #f5f5f5; color: #333; font-size: 13.5px; font-weight: 600; cursor: pointer;
    box-shadow: 0 1px 2px rgba(20,20,30,.05);
    transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.pb-team-btn:hover  { opacity: 1; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(20,20,30,.10); }
.pb-team-btn:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(20,20,30,.06); }
.pb-team-btn--primary {
    background: var(--pb-primary, #1a1a2e); color: #fff; border-color: var(--pb-primary, #1a1a2e);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--pb-primary, #1a1a2e) 40%, transparent);
}
.pb-team-btn--danger  { background: #fff; color: #c0392b; border-color: #e0b4ae; }

/* ── En-tête + nav ─────────────────────────────────────────────────────── */
.pb-team-header {
    display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px;
    margin-bottom: 16px;
}
.pb-team-header-user { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: #555; }
.pb-team-header-user a { color: var(--pb-primary, #1a1a2e); text-decoration: underline; }

.pb-team-nav {
    display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px;
    border-bottom: 1.5px solid color-mix(in srgb, var(--pb-primary, #1a1a2e) 18%, transparent);
    padding-bottom: 10px;
}
.pb-team-nav-item {
    padding: 8px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
    color: #555; text-decoration: none; background: #fff;
    border: 1px solid color-mix(in srgb, var(--pb-primary, #1a1a2e) 10%, transparent);
    box-shadow: 0 1px 2px rgba(20,20,30,.04);
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease;
}
.pb-team-nav-item:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(20,20,30,.08); }
.pb-team-nav-item.is-active {
    background: var(--pb-primary, #1a1a2e); color: #fff; border-color: var(--pb-primary, #1a1a2e);
    box-shadow: 0 3px 10px color-mix(in srgb, var(--pb-primary, #1a1a2e) 45%, transparent);
}

/* ── Contenu de section ────────────────────────────────────────────────── */
.pb-team-section h2 { margin: 0 0 6px; font-size: 20px; }
.pb-team-section-intro { color: #666; font-size: 13.5px; margin: 0 0 18px; }
.pb-team-placeholder { padding: 40px 20px; text-align: center; color: #888; font-size: 14px; }
.pb-team-empty { color: #888; font-size: 13.5px; }

.pb-team-card {
    background: #fff; border: 1px solid color-mix(in srgb, var(--pb-primary, #1a1a2e) 14%, #e4e4e4);
    border-left: 4px solid var(--pb-primary, #1a1a2e);
    border-radius: 14px; padding: 18px 20px; margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(20,20,30,.03), 0 8px 22px rgba(20,20,30,.06);
}
.pb-team-card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }

.pb-team-inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pb-team-inline-form input, .pb-team-inline-form select { padding: 8px 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 13.5px; }
.pb-team-msg { margin-top: 10px; font-size: 13px; }

/* ── Barre d'outils : onglets + recherche (RDV, Clients...) ───────────────── */
.pb-team-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.pb-team-tabs { display: flex; gap: 6px; }
.pb-team-tab {
    padding: 7px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 600; text-decoration: none;
    color: #555; background: #fff; border: 1px solid color-mix(in srgb, var(--pb-primary, #1a1a2e) 10%, transparent);
    box-shadow: 0 1px 2px rgba(20,20,30,.04);
}
.pb-team-tab.is-active {
    background: var(--pb-primary, #1a1a2e); color: #fff; border-color: var(--pb-primary, #1a1a2e);
    box-shadow: 0 3px 10px color-mix(in srgb, var(--pb-primary, #1a1a2e) 40%, transparent);
}
.pb-team-search-form { display: flex; gap: 8px; }
.pb-team-search-form input {
    padding: 7px 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 13.5px;
    background: #fff; box-shadow: inset 0 1px 2px rgba(20,20,30,.04);
}

/* ── Tableaux de données ───────────────────────────────────────────────── */
/* Chaque <table class="pb-team-table"> est enveloppée dans un <div class="pb-team-table-scroll">
   (voir chaque vue public/views/team/*.php) : sur un écran étroit, c'est ce conteneur qui défile
   horizontalement plutôt que le tableau qui tasse ses colonnes jusqu'à devenir illisible. Le
   overflow-x reste actif à toutes les tailles (inoffensif sur desktop où la table tient déjà). */
.pb-team-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pb-team-table {
    width: 100%; border-collapse: collapse; margin-bottom: 14px; background: #fff; border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--pb-primary, #1a1a2e) 12%, #e4e4e4);
    overflow: hidden; box-shadow: 0 1px 2px rgba(20,20,30,.03), 0 6px 18px rgba(20,20,30,.05);
}
.pb-team-table th { text-align: left; font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; background: color-mix(in srgb, var(--pb-secondary, #f0f7ff) 45%, #fff); }
.pb-team-table td { padding: 10px 12px; border-top: 1px solid #f2f2f2; font-size: 13.5px; vertical-align: top; }
.pb-team-table tbody tr { transition: background .1s ease; }
.pb-team-table tbody tr:hover { background: color-mix(in srgb, var(--pb-secondary, #f0f7ff) 28%, #fff); }
.pb-team-table a { color: var(--pb-primary, #1a1a2e); font-weight: 600; text-decoration: none; }
.pb-team-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.pb-team-badge {
    display: inline-block; padding: 3px 11px; border: 1.5px solid; border-radius: 20px;
    font-size: 12px; font-weight: 700; background: color-mix(in srgb, currentColor 10%, #fff);
}

.pb-team-pagination { display: flex; gap: 4px; margin-bottom: 20px; }
.pb-team-page-link { padding: 5px 10px; border-radius: 6px; font-size: 13px; text-decoration: none; color: #555; background: #fff; box-shadow: 0 1px 2px rgba(20,20,30,.05); }
.pb-team-page-link.is-active { background: var(--pb-primary, #1a1a2e); color: #fff; box-shadow: 0 2px 6px color-mix(in srgb, var(--pb-primary, #1a1a2e) 40%, transparent); }

/* ── Cartes statistiques (Caisse) ──────────────────────────────────────── */
.pb-team-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 20px; }
.pb-team-stat {
    background: #fff; border: 1px solid color-mix(in srgb, var(--pb-primary, #1a1a2e) 6%, #e4e4e4);
    border-top: 3px solid var(--pb-primary, #1a1a2e); border-radius: 10px; padding: 12px 14px;
    box-shadow: 0 1px 2px rgba(20,20,30,.03), 0 4px 12px rgba(20,20,30,.05);
}
.pb-team-stat-label { font-size: 11px; color: #888; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pb-team-stat-value { font-size: 18px; font-weight: 700; margin-top: 4px; }

.pb-team-client-contact { color: #666; font-size: 13.5px; }
#pb-team-client-notes { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 13.5px; font-family: inherit; margin-bottom: 8px; }

/* ── Notes (dictée vocale / message vocal) ─────────────────────────────── */
.pb-team-note-content { font-size: 13.5px; line-height: 1.7; color: #333; margin-top: 8px; }
.pb-team-note-content a { color: var(--pb-primary, #1a1a2e); }
.pb-team-btn.is-recording { background: #fdeaea; border-color: #e0b4ae; color: #b91c1c; }

.pb-team-member-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.pb-team-member-email { color: #888; font-size: 12.5px; margin-left: 8px; }

.pb-team-perm-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.pb-team-perm-table th { text-align: left; font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: .04em; padding: 4px 8px; }
.pb-team-perm-table td { padding: 6px 8px; border-top: 1px solid #f0f0f0; font-size: 13.5px; }
.pb-team-perm-table th:not(:first-child), .pb-team-perm-table td:not(:first-child) { text-align: center; width: 90px; }
/* Cases à cocher un peu plus grandes qu'au défaut du navigateur — cible tactile trop petite
   sinon sur un écran de téléphone (permissions, audience des notes...). */
.pb-team-perm-table input[type="checkbox"],
.pb-team-radio-inline input { width: 18px; height: 18px; vertical-align: middle; }

.pb-team-save-msg { margin-left: 10px; font-size: 13px; color: #1e6b38; }

/* ── Formulaire empilé (Notes...) — labels au-dessus des champs, pensé mobile d'emblée
   plutôt qu'un tableau à 2 colonnes (illisible sur un petit écran). ─────────────────── */
.pb-team-field { margin-bottom: 14px; }
.pb-team-field label { display: block; font-size: 13px; font-weight: 600; color: #444; margin-bottom: 4px; }
.pb-team-field input[type="text"], .pb-team-field input[type="email"], .pb-team-field input[type="tel"],
.pb-team-field input[type="date"], .pb-team-field input[type="number"],
.pb-team-field textarea, .pb-team-field select {
    width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid #ccc;
    border-radius: 8px; font-size: 13.5px; font-family: inherit;
}
.pb-team-radio-inline { display: inline-block; margin: 2px 14px 6px 0; font-weight: 400; font-size: 13.5px; }
.pb-team-hint { margin: 4px 0 0; font-size: 11.5px; color: #777; }

/* ── Bloc d'aide repliable ("ℹ️ Aide") — même contenu explicatif que le back-office,
   porté ici puisque toute la gestion se fait désormais depuis ce portail. ────────────── */
.pb-help {
    background: color-mix(in srgb, var(--pb-secondary, #f0f7ff) 35%, #fff);
    border: 1px solid color-mix(in srgb, var(--pb-primary, #1a1a2e) 16%, #e4e4e4);
    border-radius: 12px; margin-bottom: 18px; overflow: hidden;
    box-shadow: 0 1px 2px rgba(20,20,30,.03), 0 6px 16px rgba(20,20,30,.05);
}
.pb-help summary {
    padding: 12px 18px; cursor: pointer; font-weight: 700; font-size: 13.5px;
    list-style: none; display: flex; align-items: center; gap: 8px; user-select: none;
    color: var(--pb-primary, #1a1a2e);
}
.pb-help summary::-webkit-details-marker { display: none; }
.pb-help summary::before { content: '▶'; font-size: 10px; transition: transform .18s; flex-shrink: 0; }
.pb-help[open] summary::before { transform: rotate(90deg); }
.pb-help summary .pb-help-hint { margin-left: auto; font-size: 11.5px; font-weight: 400; color: #888; }
.pb-help-body { padding: 4px 20px 18px; border-top: 1px solid color-mix(in srgb, var(--pb-primary, #1a1a2e) 10%, transparent); font-size: 13px; line-height: 1.75; color: #333; }
.pb-help-body h4 { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #555; }
.pb-help-body ul, .pb-help-body ol { margin: 0; padding-left: 1.2rem; }
.pb-help-body p { margin: 8px 0 0; }
.pb-help-body .pb-help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 10px; }
.pb-help-body .pb-help-tip { margin-top: 12px; background: #fff8e6; border-radius: 8px; padding: 10px 14px; font-size: 12.5px; }

/* ══ Mobile — usage principal attendu de l'espace équipe, chaque bloc ci-dessous a été
   pensé pour rester utilisable sur un téléphone, pas seulement "ne pas casser". ══════════ */
@media (max-width: 640px) {
    .pb-team-wrap, .pb-team-login { margin: 1rem; }
    .pb-team-login { padding: 22px 20px; max-width: none; }

    /* En-tête : bascule en colonne, déconnexion toujours facile d'accès sous le nom */
    .pb-team-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .pb-team-header-user { width: 100%; justify-content: space-between; }

    /* Nav : rangée qui défile horizontalement plutôt que de s'empiler sur plusieurs lignes
       tassées — plus rapide à parcourir du pouce qu'une grille de pastilles. */
    .pb-team-nav {
        flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
        margin-left: -1rem; margin-right: -1rem; padding-left: 1rem; padding-right: 1rem;
    }
    .pb-team-nav-item { flex-shrink: 0; }

    /* Barre d'outils (onglets + recherche) : empilée, recherche pleine largeur */
    .pb-team-toolbar { flex-direction: column; align-items: stretch; }
    .pb-team-search-form { width: 100%; }
    .pb-team-search-form input { flex: 1 1 auto; min-width: 0; }

    /* Formulaires en ligne (ajouter un membre, une recette...) : un champ par ligne,
       plus simple à remplir avec un clavier tactile qu'une rangée compressée. */
    .pb-team-inline-form { flex-direction: column; align-items: stretch; }
    .pb-team-inline-form input, .pb-team-inline-form select, .pb-team-inline-form button { width: 100%; }

    /* Tableaux larges : le conteneur (.pb-team-table-scroll, voir chaque vue) défile
       horizontalement plutôt que de tasser les colonnes jusqu'à les rendre illisibles — le
       tableau lui-même garde une largeur minimale confortable, on le parcourt du doigt comme
       un tableur plutôt que de le voir se déformer. */
    .pb-team-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1rem 14px; padding: 0 1rem; }
    .pb-team-table-scroll .pb-team-table,
    .pb-team-table-scroll .pb-team-perm-table { margin-bottom: 0; }
    .pb-team-table { min-width: 480px; }
    .pb-team-perm-table { min-width: 380px; }

    .pb-team-member-head { flex-direction: column; align-items: flex-start; }
    .pb-team-toolbar, .pb-team-tabs { flex-wrap: wrap; }

    /* Cibles tactiles un peu plus généreuses qu'au clavier/souris */
    .pb-team-btn { padding: 10px 16px; }
}
