/* =============================================================================
   PLANNING V2 — Toolbar
   ============================================================================= */

.p2-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    border-bottom: 1px solid var(--border-panel);
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: var(--p2-z-toolbar);
    min-height: var(--p2-header-height);
    /* pas de overflow-x pour ne pas rogner le dropdown du Hub */
}
@media (max-width: 1400px) {
    .p2-tb-btn-label { display: none; }
    .p2-tb-btn { padding: 5px 8px; }
}

/* ── Section gauche ─────────────────────────────────────────────────────────── */
.p2-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Section centrale (navigation) ─────────────────────────────────────────── */
.p2-toolbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.p2-week-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-body);
    border: 1px solid var(--border-panel);
    border-radius: var(--radius-md);
    padding: 3px;
}

.p2-nav-btn {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: background var(--trans-fast), color var(--trans-fast);
}
.p2-nav-btn:hover {
    background: var(--bg-card);
    color: var(--text-main);
}

.p2-week-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-main);
    padding: 0 8px;
    white-space: nowrap;
    min-width: 160px;
    text-align: center;
}

.p2-today-btn {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border-panel);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    cursor: pointer;
    transition: all var(--trans-fast);
}
.p2-today-btn:hover {
    background: var(--bg-body);
    color: var(--text-main);
}

/* ── Section droite ─────────────────────────────────────────────────────────── */
.p2-toolbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

/* ── Hub selector ───────────────────────────────────────────────────────────── */
.p2-hub-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-body);
    border: 1px solid var(--border-panel);
    border-radius: var(--radius-md);
    padding: 5px 10px;
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text-main);
    font-weight: 500;
    max-width: 200px;
    transition: border-color var(--trans-fast);
}
.p2-hub-selector:hover { border-color: var(--accent); }
.p2-hub-selector i { color: var(--accent); font-size: 14px; }
.p2-hub-selector .p2-hub-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.p2-hub-edit-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 150ms;
}
.p2-hub-edit-btn:hover {
    color: var(--accent);
    border-color: var(--border-panel);
    background: var(--bg-body);
}
.p2-hub-edit-input {
    background: var(--bg-body);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 5px 10px;
    font-size: var(--text-sm);
    color: var(--text-main);
    font-weight: 500;
    max-width: 200px;
    outline: none;
}

/* ── Boutons action toolbar ─────────────────────────────────────────────────── */
.p2-tb-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-panel);
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--trans-fast);
    white-space: nowrap;
    flex-shrink: 0;
}
.p2-tb-btn:hover { background: var(--bg-card); border-color: var(--accent); color: var(--accent); }
.p2-tb-btn i { font-size: 15px; }

.p2-tb-btn.primary,
.p2-tb-btn.is-active {
    background: var(--accent, #3B82F6) !important;
    border-color: var(--accent, #3B82F6) !important;
    color: #fff !important;
}
.p2-tb-btn.primary i,
.p2-tb-btn.is-active i { color: #fff !important; }
.p2-tb-btn.primary:hover,
.p2-tb-btn.is-active:hover { filter: brightness(1.08); }

.p2-tb-btn.event {
    background: rgba(245,158,11,.1);
    border-color: rgba(245,158,11,.3);
    color: #F59E0B;
}
.p2-tb-btn.event:hover { background: rgba(245,158,11,.2); }

/* ── Badge V2 dans la toolbar ───────────────────────────────────────────────── */
.p2-version-badge {
    font-size: 10px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #8B5CF6);
    color: #fff;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    letter-spacing: .5px;
}
