/* ============================================================
   TEAMS.CSS — Espaces d'équipe : module plein écran autonome
   Réutilise les tokens globaux (--bg-*, --text-*, --accent-*,
   --border, --shadow-*, --cahier-*) pour rester cohérent en
   clair/sombre, tout en assumant une identité visuelle propre
   (bannières dégradées, avatars colorés, kanban).
   ============================================================ */

#teamsFullscreen {
    display: none;
    height: 100%;
    overflow-y: auto;
    background: var(--bg-primary);
}

.teams-topbar {
    display: flex; align-items: center; gap: 14px; padding: 14px 20px;
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
    background: var(--bg-secondary); backdrop-filter: blur(10px);
}
.teams-back-btn {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--bg-hover); color: var(--text-secondary);
    font-size: 0.7rem; font-weight: 700; cursor: pointer; transition: all 0.18s ease;
}
.teams-back-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }
.teams-topbar-title { font-size: 0.85rem; font-weight: 800; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.teams-topbar-title i { color: var(--accent); }
.teams-body { max-width: 1200px; margin: 0 auto; padding: 28px 24px 60px 24px; }

.teams-btn {
    padding: 8px 16px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-secondary);
    color: var(--text-secondary); font-size: 0.7rem; font-weight: 700; cursor: pointer; display: inline-flex;
    align-items: center; gap: 7px; transition: all 0.18s ease;
}
.teams-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-strong); }
.teams-btn.primary { background: var(--ink); color: var(--ink-text); border: none; }
.teams-btn.primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.teams-btn.small { padding: 5px 11px; font-size: 0.62rem; }

/* ---- En-tête d'accueil ---- */
.teams-hero-static { text-align: center; padding: 30px 20px 36px 20px; }
.teams-hero-static h1 { font-size: 1.7rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.6px; margin-bottom: 8px; }
.teams-hero-static p { font-size: 0.82rem; color: var(--text-muted); max-width: 460px; margin: 0 auto 20px auto; line-height: 1.6; }
.teams-hero-actions { display: flex; gap: 10px; justify-content: center; }

/* ---- Invitations en attente ---- */
.team-invites-banner {
    background: var(--accent-soft); border: 1px solid rgba(var(--accent-rgb),0.22);
    border-radius: 14px; padding: 16px 18px; margin-bottom: 22px;
}
.team-invites-title { font-size: 0.76rem; font-weight: 800; color: var(--text-primary); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.team-invite-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.team-invite-row:first-of-type { border-top: none; }
.team-invite-icon { font-size: 1.3rem; }
.team-invite-text { flex: 1; font-size: 0.72rem; color: var(--text-secondary); min-width: 220px; }

/* ---- Grille des équipes ---- */
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.team-card {
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
    cursor: pointer; transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
    animation: teamCardIn 0.4s cubic-bezier(0.16,1,0.3,1) backwards;
}
@keyframes teamCardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.team-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.team-card-cover { height: 84px; display: flex; align-items: center; padding: 14px 16px; position: relative; }
.team-card-cover::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 85% 15%, rgba(255,255,255,0.18), transparent 55%); }
.team-card-cover-icon { font-size: 2.2rem; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.3)); position: relative; z-index: 1; }
.team-card-body { padding: 14px 16px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.team-card-title { font-size: 0.9rem; font-weight: 800; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-card-role { font-size: 0.56rem; font-weight: 700; padding: 3px 9px; border-radius: 8px; width: fit-content; }
.team-role-owner { background: rgba(234,179,8,0.16); color: #eab308; }
.team-role-admin { background: var(--accent-soft); color: var(--accent); }
.team-role-member { background: var(--bg-hover); color: var(--text-muted); }
.team-card-stats { display: flex; gap: 12px; font-size: 0.64rem; color: var(--text-muted); margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border); }
.team-card-stats i { margin-right: 4px; opacity: 0.7; }

.teams-empty-state { grid-column: 1 / -1; text-align: center; padding: 60px 20px; }
.teams-empty-icon { font-size: 2.6rem; color: var(--accent); opacity: 0.35; margin-bottom: 14px; }
.teams-empty-state h3 { font-size: 0.95rem; color: var(--text-primary); margin-bottom: 6px; }
.teams-empty-state p { font-size: 0.74rem; color: var(--text-muted); max-width: 360px; margin: 0 auto; line-height: 1.6; }

/* ============================================================
   BANNIÈRE D'ÉQUIPE (hero) — façon "cover" Notion
   ============================================================ */
.team-hero {
    position: relative; padding: 22px 28px 20px 28px; margin: -28px -24px 0 -24px; overflow: hidden;
    border-radius: 0 0 22px 22px;
}
.team-hero-noise {
    position: absolute; inset: 0;
    background-image: radial-gradient(circle at 12% 20%, rgba(255,255,255,0.14) 0, transparent 4%),
                       radial-gradient(circle at 80% 10%, rgba(255,255,255,0.1) 0, transparent 5%),
                       radial-gradient(circle at 60% 75%, rgba(255,255,255,0.08) 0, transparent 6%),
                       radial-gradient(circle at 25% 85%, rgba(255,255,255,0.1) 0, transparent 4%);
    pointer-events: none;
}
.team-hero-back {
    position: relative; z-index: 1; background: rgba(255,255,255,0.16); backdrop-filter: blur(8px); border: none;
    color: #fff; padding: 7px 14px; border-radius: 8px; font-size: 0.66rem; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; gap: 7px; transition: all 0.2s ease; margin-bottom: 18px;
}
.team-hero-back:hover { background: rgba(255,255,255,0.28); transform: translateX(-2px); }
.team-hero-main { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 16px; }
.team-hero-icon { font-size: 3.2rem; cursor: pointer; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3)); transition: transform 0.2s ease; }
.team-hero-icon:hover { transform: scale(1.08) rotate(-4deg); }
.team-hero-text { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.team-hero-title-input {
    background: none; border: none; outline: none; color: #fff; font-size: 1.7rem; font-weight: 800;
    font-family: 'Inter', sans-serif; letter-spacing: -0.6px; text-shadow: 0 2px 10px rgba(0,0,0,0.2); padding: 0; width: 100%;
}
.team-hero-title-input:read-only { cursor: default; }
.team-hero-desc { font-size: 0.74rem; color: rgba(255,255,255,0.82); }
.team-hero-desc-empty { font-style: italic; opacity: 0.6; cursor: text; }
.team-hero-footer { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-top: 18px; flex-wrap: wrap; gap: 10px; }
.team-hero-avatars { display: flex; }
.team-hero-avatar {
    width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 0.72rem; border: 2px solid rgba(255,255,255,0.5);
    margin-left: -8px; box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.team-hero-avatar:first-child { margin-left: 0; }
.team-hero-avatar-more { background: rgba(0,0,0,0.35) !important; }
.team-hero-actions { display: flex; gap: 7px; }
.hero-btn { background: rgba(255,255,255,0.16); backdrop-filter: blur(8px); color: #fff; border: none; }
.hero-btn:hover { background: rgba(255,255,255,0.28); color: #fff; }
.hero-btn-danger:hover { background: rgba(220,38,38,0.5); }

.team-cover-popover, .team-icon-popover {
    position: absolute; z-index: 30; background: var(--bg-elevated); border: 1px solid var(--border-strong);
    border-radius: 12px; box-shadow: var(--shadow-lg); padding: 10px; display: none; gap: 8px; flex-wrap: wrap; max-width: 220px;
    top: 60px; right: 28px;
}
.team-icon-popover { left: 28px; right: auto; top: 90px; }
.team-cover-popover.open, .team-icon-popover.open { display: flex; }

/* ---- Onglets du détail d'équipe ---- */
.team-detail-tabs { padding: 4px 4px 0 4px; margin-top: 8px; }
.team-detail-content { padding-top: 18px; }

/* ---- Membres ---- */
.team-members-list { display: flex; flex-direction: column; gap: 8px; }
.team-member-row {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg-secondary);
    border: 1px solid var(--border); border-radius: 12px; flex-wrap: wrap; transition: all 0.15s ease;
}
.team-member-row:hover { border-color: var(--border-strong); }
.team-member-avatar {
    width: 34px; height: 34px; border-radius: 50%; color: #fff; display: flex; align-items: center;
    justify-content: center; font-weight: 800; font-size: 0.82rem; flex-shrink: 0;
}
.team-member-name { flex: 1; font-size: 0.78rem; font-weight: 700; color: var(--text-primary); min-width: 120px; }
.team-role-badge { font-size: 0.58rem; font-weight: 700; padding: 3px 10px; border-radius: 8px; }
.team-role-select { height: 30px; border-radius: 7px; background: var(--bg-hover); border: 1px solid var(--border); color: var(--text-primary); font-size: 0.64rem; padding: 0 8px; }
.team-role-select option { color: #191919; background: #ffffff; }

/* ---- Livres partagés ---- */
.team-shared-books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); gap: 12px; }
.team-shared-book-card {
    display: flex; align-items: center; gap: 12px; background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 14px; padding: 14px 16px; transition: all 0.18s ease;
}
.team-shared-book-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.team-shared-book-icon { font-size: 1.8rem; flex-shrink: 0; }
.team-shared-book-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.team-shared-book-title { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-shared-book-owner { font-size: 0.62rem; color: var(--text-muted); }

/* ============================================================
   ACTIVITÉ (Aperçu)
   ============================================================ */
.team-activity-panel { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 16px; padding: 20px 22px; }
.team-activity-title { font-size: 0.8rem; font-weight: 800; color: var(--text-primary); margin-bottom: 16px; display: flex; align-items: center; gap: 9px; }
.team-activity-timeline { display: flex; flex-direction: column; position: relative; padding-left: 4px; }
.team-activity-timeline::before { content: ''; position: absolute; left: 17px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.team-activity-item { display: flex; align-items: flex-start; gap: 14px; padding: 10px 0; position: relative; }
.team-activity-dot { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.6rem; flex-shrink: 0; z-index: 1; box-shadow: 0 0 0 4px var(--bg-secondary); }
.team-activity-text { display: flex; flex-direction: column; gap: 2px; font-size: 0.74rem; color: var(--text-primary); padding-top: 4px; }
.team-activity-date { font-size: 0.6rem; color: var(--text-muted); }

/* ============================================================
   OBJECTIFS — vrai tableau kanban
   ============================================================ */
.team-objectives-toolbar { margin-bottom: 16px; }
.team-kanban { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; }
.team-kanban-col { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 14px; padding: 12px; min-height: 200px; transition: all 0.15s ease; }
.team-kanban-col.drag-over { background: var(--accent-soft); border-color: var(--accent); }
.team-kanban-col-header { display: flex; align-items: center; gap: 8px; font-size: 0.72rem; font-weight: 800; color: var(--text-primary); padding: 4px 4px 12px 4px; }
.team-kanban-dot { width: 8px; height: 8px; border-radius: 50%; }
.team-kanban-dot.status-todo { background: var(--text-muted); }
.team-kanban-dot.status-in_progress { background: #2196f3; }
.team-kanban-dot.status-done { background: #4caf50; }
.team-kanban-count { margin-left: auto; font-size: 0.58rem; color: var(--text-muted); background: var(--bg-hover); padding: 1px 8px; border-radius: 8px; }
.team-kanban-col-body { display: flex; flex-direction: column; gap: 9px; }

.team-obj-card {
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 11px; padding: 12px 13px;
    cursor: grab; transition: all 0.15s ease;
}
.team-obj-card:active { cursor: grabbing; }
.team-obj-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.team-obj-card.dragging { opacity: 0.4; }
.team-obj-card-title { font-size: 0.76rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.team-obj-card-desc { font-size: 0.66rem; color: var(--text-muted); margin-bottom: 8px; line-height: 1.5; }
.team-obj-card-footer { display: flex; align-items: center; gap: 8px; font-size: 0.6rem; color: var(--text-muted); flex-wrap: wrap; }
.team-obj-card-author { font-weight: 700; }
.team-obj-comments-btn { margin-left: auto; background: var(--bg-hover); border: none; color: var(--text-muted); border-radius: 7px; padding: 3px 8px; font-size: 0.6rem; cursor: pointer; }
.team-obj-comments-btn:hover { color: var(--text-primary); }
.team-obj-comments { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }

.team-comments-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.team-comment-row { font-size: 0.68rem; color: var(--text-primary); }
.team-comment-text { color: var(--text-muted); margin-left: 4px; }
.team-comment-input-row { display: flex; gap: 6px; }
.team-comment-input-row .cahier-search { flex: 1; }

/* ============================================================
   DISCUSSION D'ÉQUIPE
   ============================================================ */
.team-discussion-panel { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; height: 60vh; }
.team-discussion-messages { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.team-discussion-msg { display: flex; gap: 10px; }
.team-discussion-msg-body { flex: 1; min-width: 0; }
.team-discussion-msg-head { display: flex; align-items: center; gap: 8px; font-size: 0.68rem; margin-bottom: 2px; }
.team-discussion-msg-head strong { color: var(--text-primary); }
.team-discussion-msg-head span { color: var(--text-muted); font-size: 0.6rem; }
.team-discussion-msg-text { font-size: 0.76rem; color: var(--text-secondary); line-height: 1.6; }
.team-discussion-input-row { display: flex; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--border); }
.team-discussion-input-row .cahier-search { flex: 1; }

/* ---- Fiche membre ---- */
.team-profile-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 10px 0; }
.team-profile-avatar { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 1.6rem; box-shadow: var(--shadow-md); }
.team-profile-name { font-size: 0.95rem; font-weight: 800; color: var(--cahier-text); margin-top: 4px; }
.team-profile-status { font-size: 0.68rem; color: var(--cahier-muted); background: var(--surface-4); padding: 3px 10px; border-radius: 8px; }
.team-profile-bio { font-size: 0.74rem; color: var(--cahier-text); line-height: 1.6; max-width: 320px; }
.team-profile-bio.muted { color: var(--cahier-muted-2); font-style: italic; }
.team-profile-meta { display: flex; flex-direction: column; gap: 4px; font-size: 0.62rem; color: var(--cahier-muted-2); margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--cahier-border); width: 100%; }
.team-member-avatar.is-clickable, .team-member-name.is-clickable { cursor: pointer; }
.team-member-avatar.is-clickable:hover { transform: scale(1.08); }
.team-member-name.is-clickable:hover { text-decoration: underline; }

/* ---- Ressources (liens) ---- */
.team-resources-list { display: flex; flex-direction: column; gap: 8px; }
.team-resource-row {
    display: flex; align-items: center; gap: 12px; background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 12px; padding: 12px 14px; text-decoration: none; color: inherit; transition: all 0.15s ease;
}
.team-resource-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.team-resource-row i { color: var(--accent); font-size: 1rem; }
.team-resource-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.team-resource-title { font-size: 0.78rem; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-resource-meta { font-size: 0.6rem; color: var(--text-muted); }

/* ---- Réactions emoji (discussion) ---- */
.team-reactions-row { display: flex; align-items: center; gap: 5px; margin-top: 6px; position: relative; flex-wrap: wrap; }
.team-reaction-pill { display: inline-flex; align-items: center; gap: 3px; font-size: 0.62rem; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-hover); color: var(--text-secondary); cursor: pointer; }
.team-reaction-pill.mine { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.team-reaction-add { width: 22px; height: 22px; border-radius: 50%; border: 1px dashed var(--border); background: none; color: var(--text-muted); cursor: pointer; font-size: 0.62rem; }
.team-reaction-add:hover { color: var(--text-primary); border-color: var(--border-strong); }
.team-reaction-picker {
    display: none; position: absolute; bottom: 26px; left: 0; z-index: 20; gap: 4px; padding: 5px 7px;
    background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-lg);
}
.team-reaction-picker.open { display: flex; }
.team-reaction-picker span { cursor: pointer; font-size: 0.95rem; padding: 2px; border-radius: 5px; transition: transform 0.1s ease; }
.team-reaction-picker span:hover { transform: scale(1.25); }

/* ---- Blocs de l'éditeur de page (séparateur, encadré, cases à cocher, tableau) ---- */
.team-page-header-actions { display: flex; align-items: center; gap: 6px; }
.chapter-editor-content .page-divider { border: none; border-top: 2px solid var(--cahier-border); margin: 16px 0; }
.chapter-editor-content .page-callout {
    background: var(--accent-soft); border-left: 3px solid var(--cahier-accent); border-radius: 8px;
    padding: 12px 14px; margin: 12px 0; font-size: 0.82rem; color: var(--cahier-text); line-height: 1.6;
}
.chapter-editor-content .page-todo { list-style: none; margin: 10px 0; padding: 0; }
.chapter-editor-content .page-todo li { margin: 4px 0; }
.chapter-editor-content .page-todo label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.82rem; }
.chapter-editor-content .page-table { border-collapse: collapse; margin: 12px 0; width: 100%; }
.chapter-editor-content .page-table-cell { border: 1px solid var(--cahier-border); padding: 8px 10px; font-size: 0.8rem; min-width: 60px; }

/* ---- Contenu de page en LECTURE (mêmes blocs, hors éditeur) ---- */
.page-divider { border: none; border-top: 2px solid var(--border); margin: 20px 0; }
.page-callout { background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 8px; padding: 14px 16px; margin: 16px 0; font-size: 0.85rem; color: var(--text-primary); line-height: 1.7; }
.page-todo { list-style: none; margin: 12px 0; padding: 0; }
.page-todo li { margin: 5px 0; }
.page-todo label { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-secondary); }
.page-table { border-collapse: collapse; margin: 16px 0; width: 100%; }
.page-table-cell { border: 1px solid var(--border); padding: 9px 12px; font-size: 0.82rem; }

/* ---- Pages : recherche, réorganisation, verrouillage ---- */
.team-page-card { position: relative; }
.team-page-locked-badge { position: absolute; top: 8px; right: 8px; font-size: 0.6rem; color: var(--text-muted); background: var(--bg-hover); width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.team-page-reorder { display: flex; flex-direction: column; gap: 2px; margin-left: auto; }
.team-page-reorder .icon-btn { width: 20px; height: 20px; font-size: 0.55rem; }
.team-page-reorder .icon-btn:disabled { opacity: 0.25; cursor: default; }
.team-page-locked-banner {
    display: flex; align-items: center; gap: 8px; font-size: 0.68rem; color: var(--text-muted);
    background: var(--bg-hover); padding: 8px 16px; border-bottom: 1px solid var(--cahier-border);
}
.team-page-wordcount { text-align: right; font-size: 0.6rem; color: var(--cahier-muted-2); padding: 4px 16px 0 16px; }
#teamPageLockBtn.active { color: var(--accent); }

/* ---- Corbeille d'équipe ---- */
.team-trash-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; background: var(--surface-3); border-radius: 8px; margin-bottom: 6px; font-size: 0.72rem; color: var(--cahier-text); }
.team-trash-row i { margin-right: 6px; opacity: 0.7; }

/* ---- Échéances à venir (Objectifs) ---- */
.team-upcoming-panel { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin-bottom: 16px; }
.team-upcoming-title { font-size: 0.72rem; font-weight: 800; color: var(--text-primary); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.team-upcoming-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 0.72rem; }
.team-upcoming-row:first-of-type { border-top: none; }
.team-upcoming-obj { color: var(--text-primary); font-weight: 600; }
.team-upcoming-date { color: var(--text-muted); font-size: 0.62rem; flex-shrink: 0; }
.team-upcoming-row.soon .team-upcoming-date { color: #f97316; font-weight: 700; }
.team-upcoming-row.overdue .team-upcoming-date { color: var(--danger); font-weight: 700; }

/* ---- Sondages ---- */
.team-polls-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.team-poll-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.team-poll-question { font-size: 0.78rem; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.team-poll-option {
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 7px 10px; margin-bottom: 5px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg-hover); cursor: pointer; font-size: 0.7rem; color: var(--text-secondary); transition: border-color 0.15s ease;
}
.team-poll-option:hover { border-color: var(--border-strong); }
.team-poll-option.voted { border-color: var(--accent); color: var(--text-primary); font-weight: 700; }
.team-poll-option-bar { position: absolute; inset: 0; background: var(--accent-soft); z-index: 0; transition: width 0.3s ease; }
.team-poll-option-label, .team-poll-option-pct { position: relative; z-index: 1; }
.team-poll-option-pct { font-size: 0.62rem; color: var(--text-muted); flex-shrink: 0; }
.team-poll-meta { font-size: 0.6rem; color: var(--text-muted); margin-top: 6px; }

/* ---- Modal d'invitation / partage ---- */
.team-invite-link-row { display: flex; gap: 6px; }
.team-invite-link-row input { flex: 1; font-size: 0.6rem; }

/* ============================================================
   PAGES D'ÉQUIPE — wiki collaboratif
   ============================================================ */
.team-pages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 12px; }
.team-page-card {
    display: flex; align-items: center; gap: 12px; background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 14px; padding: 14px 16px; cursor: pointer; transition: all 0.18s ease;
}
.team-page-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.team-page-icon { font-size: 1.7rem; flex-shrink: 0; }
.team-page-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.team-page-title { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-page-meta { font-size: 0.6rem; color: var(--text-muted); }
.team-page-editor-icon { cursor: pointer; font-size: 1.1rem; margin-right: 6px; }
.team-page-icon-popover {
    position: relative; display: none; flex-wrap: wrap; gap: 6px; padding: 8px 16px; border-bottom: 1px solid var(--cahier-border);
}
.team-page-icon-popover.open { display: flex; }

/* ---- Mentions "@" ---- */
.team-mention-tag { color: var(--accent); font-weight: 700; background: var(--accent-soft); padding: 1px 5px; border-radius: 5px; }
.team-mention-input-wrap { position: relative; flex: 1; }
.team-mention-dropdown {
    display: none; position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; z-index: 40;
    background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: 10px;
    box-shadow: var(--shadow-lg); max-height: 220px; overflow-y: auto; padding: 6px;
}
.team-mention-dropdown.open { display: block; }
.team-mention-option {
    display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 7px; cursor: pointer;
    font-size: 0.72rem; color: var(--text-primary); transition: background 0.12s ease;
}
.team-mention-option:hover { background: var(--bg-hover); }
.team-share-option {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px;
    background: var(--surface-3, var(--bg-hover)); border-radius: 9px; margin-bottom: 6px; font-size: 0.74rem; color: var(--text-primary);
}

/* ---- Sidebar ---- */
#teamsToggleBtn .cahier-alert-badge { position: static; margin-left: auto; box-shadow: none; }

@media (max-width: 900px) {
    .team-kanban { grid-template-columns: 1fr; }
    .teams-body { padding: 20px 14px 50px 14px; }
    .team-hero { margin: -20px -14px 0 -14px; padding: 18px 18px 16px 18px; }
}