/* =========================================================================
   Planning V2 Core Styles (PlanningPME inspired)
   Premium, Glassmorphism, Micro-animations
   ========================================================================= */

.pe-resource-view {
    --pv2-resource-row-height: 60px;
    --pv2-member-row-height: 32px;
    --pv2-event-bar-height: 52px;
    --pv2-temporary-transfer-color: #f59e0b;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background-color: #121212;
    color: #e0e0e0;
    font-family: 'Inter', sans-serif;
    user-select: none;
}

/* ── HEADER TIMELINE ── */
.pe-timeline-header-wrapper {
    display: flex;
    flex: 0 0 75px;
    background-color: #1a1a1a;
    border-bottom: 1px solid #333;
    overflow: visible;
    position: relative;
    z-index: 100;
}

.pe-corner-header {
    width: 250px;
    min-width: 250px;
    background-color: #1a1a1a;
    border-right: 1px solid #333;
    z-index: 105;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    padding-right: 4px;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
}

/* Right-side arrow housing — same height as header, narrow strip */
.pe-corner-header-right {
    width: 36px;
    min-width: 36px;
    background-color: #1a1a1a;
    border-left: 1px solid #333;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Navigation arrow buttons */
.pe-nav-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    background-color: #222;
    color: #ccc;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.1s ease;
    padding: 0;
    flex-shrink: 0;
}

.pe-nav-arrow:hover {
    background-color: #2c3e50;
    color: #fff;
    border-color: #4a90d9;
}

.pe-nav-arrow:active {
    transform: scale(0.92);
    background-color: #1a2f45;
}

.pe-nav-arrow .material-symbols-outlined {
    font-size: 20px;
    line-height: 1;
}

.pe-timeline-headers {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.pe-timeline-header-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.pe-header-row {
    display: flex;
    flex: 1;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
    position: relative;
    z-index: 2;
}

.pe-header-row:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
}

.pe-header-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #b0b0b0;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.pe-header-cell.clickable {
    cursor: pointer;
}

.pe-header-cell.clickable:hover {
    background-color: #2c3e50;
    color: #fff;
}

.pe-header-cell.day-cell {
    flex-direction: column;
    justify-content: center;
    padding: 2px 0;
}

.pe-header-cell .day-name {
    font-size: 0.65rem;
    color: #888;
    line-height: 1;
}

.pe-header-cell .day-num {
    font-size: 0.75rem;
    font-weight: 600;
    color: #ccc;
    line-height: 1.2;
}

.pe-header-cell.today-cell {
    background-color: rgba(46, 204, 113, 0.2); /* Soft green */
    color: #2ecc71;
}

.pe-header-cell.today-cell .day-name,
.pe-header-cell.today-cell .day-num {
    color: #2ecc71;
}

/* ── MAIN BODY & GRID ── */
.pe-main-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* ── Y-AXIS (Left Column) ── */
.pe-y-axis-wrapper {
    width: 250px;
    min-width: 250px;
    background-color: #161616;
    border-right: 1.5px solid #333d4b;
    overflow-y: hidden; /* Scrollbar hidden - synced with grid */
    overflow-x: hidden;
    z-index: 5;
    box-shadow: 2px 0 10px rgba(0,0,0,0.5);
}

.pe-y-axis-wrapper::-webkit-scrollbar {
    display: none;
}

.pe-y-cell {
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

.pe-y-row {
    height: var(--pv2-resource-row-height);
    min-height: var(--pv2-resource-row-height);
    max-height: var(--pv2-resource-row-height);
    display: flex;
    align-items: center;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.14);
    padding: 0 12px;
    box-sizing: border-box;
    overflow: hidden;
    transition: background-color 0.2s ease;
}

.pe-team-row {
    background-color: #1c2024;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.16);
}

.pe-team-row:hover {
    background-color: #2b3238;
}

.pe-member-row {
    background-color: #161616;
    padding-left: 24px;
    font-size: 0.8rem;
    color: #a0a0a0;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.10);
}

.pe-member-row:hover {
    background-color: #1e1e1e;
    color: #fff;
}

.pe-member-name {
    font-size: 0.8rem;
    color: #e0e0e0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pe-logistics-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    line-height: 1.2;
}

.pe-logistics-name {
    font-size: 0.8rem;
    font-weight: bold;
    color: #e0e0e0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pe-logistics-role {
    font-size: 0.65rem;
    font-weight: 500;
}

.pe-toggle-icon {
    font-size: 1.2rem;
    margin-right: 8px;
    color: #888;
    flex-shrink: 0;
}

.pe-avatar {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff, #00c6ff);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: bold;
    flex-shrink: 0;
    margin-right: 8px;
}

/* ── TIMELINE GRID (Right Area) ── */
.pe-timeline-grid {
    flex: 1;
    position: relative;
    overflow-y: scroll;
    overflow-x: auto;
    background-color: #121212;
}

.pe-timeline-grid::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.pe-timeline-grid::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.pe-timeline-grid::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.pe-timeline-grid::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.pe-grid-bg {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background-image: linear-gradient(to right, #2a2a2a 1px, transparent 1px);
    background-size: 30px 100%;
    pointer-events: none;
    z-index: 1;
}

.pe-timeline-row {
    height: var(--pv2-resource-row-height);
    min-height: var(--pv2-resource-row-height);
    max-height: var(--pv2-resource-row-height);
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.14);
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    transition: background-color 0.2s ease;
}

.pe-timeline-row:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.pe-timeline-row.pe-drop-target {
    background-color: rgba(255, 255, 255, 0.08);
    outline: 1px solid rgba(46, 204, 113, 0.5); /* green border */
    outline-offset: -1px;
}

.pe-drop-target-column {
    position: absolute;
    top: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.08);
    outline: 1px solid rgba(46, 204, 113, 0.5); /* green border */
    outline-offset: -1px;
    z-index: 9998;
    pointer-events: none;
    display: none;
}

.pe-y-row.pe-team-row,
.pe-timeline-row.pe-team-row {
    height: var(--pv2-team-row-height, var(--pv2-resource-row-height));
    min-height: var(--pv2-team-row-height, var(--pv2-resource-row-height));
    max-height: var(--pv2-team-row-height, var(--pv2-resource-row-height));
}

.pe-y-row.pe-member-row,
.pe-timeline-row.pe-member-row {
    height: var(--pv2-member-row-height);
    min-height: var(--pv2-member-row-height);
    max-height: var(--pv2-member-row-height);
}

.pe-pointer-column-highlight {
    position: absolute;
    top: 0;
    bottom: 0;
    background-color: rgba(221, 212, 91, 0.08);
    box-sizing: border-box;
    z-index: 3;
    pointer-events: none;
    display: none;
}

.pe-pointer-row-highlight {
    position: absolute;
    left: 0;
    right: 0;
    background-color: rgba(221, 212, 91, 0.08);
    pointer-events: none;
    z-index: 2;
    display: none;
}

.pe-pointer-crosshair-vertical,
.pe-pointer-crosshair-header {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0.5px;
    background: rgba(221, 212, 91, 0.62);
    box-shadow: none;
    pointer-events: none;
    z-index: 10000;
    display: none;
}

.pe-pointer-crosshair-header {
    width: 0.75px;
    opacity: 0.78;
    z-index: 20;
}

.pe-pointer-crosshair-horizontal {
    position: absolute;
    left: 0;
    right: 0;
    height: 0.5px;
    background: rgba(221, 212, 91, 0.62);
    box-shadow: none;
    pointer-events: none;
    z-index: 10000;
    display: none;
}

/* ── EVENT BARS ── */
.pe-event-bar {
    position: absolute;
    top: 4px;
    height: var(--pv2-current-event-bar-height, var(--pv2-event-bar-height));
    border-radius: 4px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    font-size: 0.75rem;
    cursor: grab;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: box-shadow 0.2s ease, filter 0.2s ease;
    overflow: hidden;
}

.pe-event-bar.pe-dragging {
    z-index: 9999 !important;
    opacity: 0.9;
}

.pe-event-bar.pe-has-presence-tracks {
    overflow: visible;
}

.pe-event-bar.pe-truncated-left {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-left: none !important;
}

.pe-event-bar.pe-truncated-right {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-right: none !important;
}

.pe-event-bar:active {
    cursor: grabbing;
}

.pe-event-bar:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.5);
    filter: brightness(1.1);
}

.pe-event-bar.pe-slot {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #fff;
    border: 1px solid #475569;
}

.pe-event-bar.pe-segment {
    background: linear-gradient(135deg, #2980b9, #3498db); /* Blue for members */
    color: #fff;
    border: 1px solid #1f618d;
}

.pe-event-bar.pe-member-work-allocation {
    top: 50%;
    height: 18px;
    min-height: 18px;
    transform: translateY(-50%);
    border: 1px solid var(--pe-event-border-color, rgba(255, 255, 255, 0.34));
    border-radius: 0 !important;
    cursor: grab;
    overflow: visible;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 1px 4px rgba(0, 0, 0, 0.35);
}

.pe-member-cut-piece {
    z-index: 35 !important;
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 1px;
    cursor: grab !important;
}

.pe-member-cut-armed {
    filter: brightness(0.82);
}

.pe-member-cut-guide {
    position: absolute;
    top: -5px;
    bottom: -5px;
    right: -1px;
    width: 2px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(2, 6, 23, 0.75);
    pointer-events: none;
}

.pe-member-transfer-markers {
    position: absolute;
    inset: 0;
    z-index: 4;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
}

.pe-member-transfer-arrow {
    position: absolute;
    top: 1px;
    width: 9px;
    height: 9px;
    font-size: 9px !important;
    line-height: 9px !important;
    color: var(--pv2-temporary-transfer-color);
    pointer-events: none;
    transform: none;
}

.pe-member-transfer-arrow-start {
    left: 1px;
    transform-origin: top left;
}

.pe-member-transfer-arrow-end {
    right: 1px;
    transform-origin: top right;
}

.pe-temporary-member-indicator {
    flex: 0 0 auto;
    display: inline-block;
    font-size: 13px !important;
    line-height: 13px !important;
    color: var(--pv2-temporary-transfer-color);
    transform: none;
}

.pe-event-bar.pe-member-transfer-target {
    outline: 3px solid #fff;
    outline-offset: 2px;
    filter: brightness(1.18);
}

.pe-event-bar.pe-member-work-allocation .pe-resize-handle {
    top: 50%;
    bottom: auto;
    width: 10px;
    height: 22px;
    transform: translateY(-50%);
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.pe-event-bar.pe-member-work-allocation .pe-resize-left {
    left: -5px;
}

.pe-event-bar.pe-member-work-allocation .pe-resize-right {
    right: -5px;
}

.pe-event-bar.validated {
    background: linear-gradient(135deg, #27ae60, #2ecc71); /* Green for validated */
    border-color: #1e8449;
}

.pe-event-content {
    flex: 1;
    overflow: hidden;
    pointer-events: none; /* Let drag events pass through */
}

.pe-event-project-serial {
    align-self: stretch;
    flex: 0 0 24px;
    width: 24px;
    max-width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(0, 0, 0, 0.16);
    color: #ffffff;
    font-family: 'Consolas', 'Cascadia Code', monospace;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.2px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    pointer-events: none;
}

.pe-event-primary {
    width: 100%;
    height: 56px;
    min-height: 56px;
    flex: 0 0 56px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    overflow: hidden;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.pe-event-reference-details {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    padding: 4px 7px;
    font-family: 'Consolas', 'Cascadia Code', monospace;
}

.pe-event-reference-details > span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pe-event-reference-project {
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: 0.2px;
}

.pe-event-reference-subproject {
    color: #e2e8f0;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.05;
}

.pe-event-reference-demande {
    color: #cbd5e1;
    font-size: 0.70rem;
    font-weight: 600;
    line-height: 1.05;
}

.pe-event-work-segments {
    position: absolute;
    inset: 3px 0;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
}

.pe-event-work-segment {
    position: absolute;
    top: 0;
    bottom: 0;
    min-width: 2px;
    border-radius: 2px;
    background: var(--pe-event-gradient, rgba(255, 255, 255, 0.28));
    border: 1px solid var(--pe-event-border-color, rgba(255, 255, 255, 0.2));
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.pe-interactive-work-segment {
    pointer-events: auto;
}

.pe-work-segment-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 6px;
    background: transparent;
    z-index: 3;
}

.pe-work-segment-handle-left {
    left: 0;
    cursor: ew-resize;
}

.pe-work-segment-handle-right {
    right: 0;
    cursor: ew-resize;
}

.pe-day-work-edit-armed .pe-work-segment-handle {
    width: 10px;
}

.pe-day-work-edit-armed .pe-work-segment-handle:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0.5px 0 rgba(255, 255, 255, 0.92),
                inset -0.5px 0 rgba(255, 255, 255, 0.92);
}

.pe-day-work-edit-armed .pe-work-segment-handle:hover::after {
    content: "↔";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 1px 3px;
    border-radius: 3px;
    color: #f8fafc;
    background: rgba(15, 23, 42, 0.92);
    font-size: 9px;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.42);
    pointer-events: none;
    z-index: 5;
}

.pe-day-work-segment-active {
    filter: brightness(1.08);
}

.pe-event-bar.pe-has-presence-tracks .pe-event-work-segments {
    top: 0;
    bottom: var(--pv2-presence-section-height, 0px);
    border-radius: 0;
}

.pe-event-bar.pe-workday-envelope {
    background: rgba(148, 163, 184, 0.16) !important;
    border-color: rgba(203, 213, 225, 0.42) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 3px 6px rgba(0, 0, 0, 0.25);
}

.pe-event-bar.pe-workday-envelope .pe-event-project-serial,
.pe-event-bar.pe-workday-envelope .pe-event-reference-details {
    z-index: 2;
}

.pe-partial-boundary {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    z-index: 12;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 5px rgba(15, 23, 42, 0.75);
}

.pe-partial-boundary-start {
    left: 0;
}

.pe-partial-boundary-end {
    right: 0;
}

.pe-time-drag-tooltip {
    position: fixed;
    z-index: 10050;
    pointer-events: none;
    padding: 3px 7px;
    border-radius: 4px;
    border: 1px solid rgba(125, 211, 252, 0.8);
    background: rgba(8, 15, 25, 0.94);
    color: #e0f2fe;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'Consolas', 'Cascadia Code', monospace;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.pe-event-bar.pe-has-work-segments .pe-event-content {
    position: relative;
    z-index: 2;
}

/* ── RESIZE HANDLES ── */
.pe-resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: col-resize;
    z-index: 11;
    background-color: rgba(255,255,255,0.0);
    transition: background-color 0.2s ease;
}

.pe-resize-handle:hover {
    background-color: rgba(255,255,255,0.3);
}

.pe-resize-left {
    left: 0;
}

.pe-resize-right {
    right: 0;
}

.pe-event-bar.pe-member-work-allocation .pe-resize-handle,
.pe-event-bar.pe-member-work-allocation .pe-resize-handle:hover {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* ── DRAGGING/RESIZING STATES ── */
.pe-dragging {
    opacity: 0.8;
    z-index: 100 !important;
    cursor: grabbing !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.6);
    transition: none !important; /* Disable transition during JS move */
}

/* Releasing a task bar on this highlighted section opens its copy dialog. */
[data-planning-section-drop].pe-section-copy-target {
    box-shadow: inset 0 0 0 2px rgba(118, 184, 42, 0.95), 0 0 12px rgba(118, 184, 42, 0.34);
}

.pe-resizing {
    z-index: 100 !important;
    transition: none !important;
}

/* ── PLANNING V2 MODAL & DIALOG STYLES ── */
.pm-modal-content {
    background-color: #10141c !important;
    border: 1px solid #232b3b !important;
    color: #f3f4f6 !important;
}

.pm-modal-header,
.pm-modal-footer {
    background-color: #161b26 !important;
    border-color: #232b3b !important;
}

.pm-team-list .list-group-item {
    background-color: #121620;
    color: #d1d5db;
    border-color: #1f293d;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.pm-team-list .list-group-item:hover {
    background-color: #1c2333;
    color: #ffffff;
}

.pm-team-list .list-group-item.active {
    background-color: #1e293b;
    color: #ffffff;
    border-left: 3px solid #10b981;
    font-weight: 600;
}

.pm-input {
    background-color: #161b26 !important;
    border: 1px solid #2a3447 !important;
    color: #f3f4f6 !important;
}

.pm-input:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2) !important;
    color: #ffffff !important;
}

.pm-input option {
    background-color: #161b26;
    color: #f3f4f6;
}

.pm-btn-secondary {
    background-color: #27303f !important;
    border-color: #374151 !important;
    color: #d1d5db !important;
}

.pm-btn-secondary:hover {
    background-color: #374151 !important;
    color: #ffffff !important;
}

.pm-btn-outline {
    border-color: #374151 !important;
    color: #9ca3af !important;
}

.pm-btn-outline:hover {
    background-color: #1f293d !important;
    color: #ffffff !important;
}

.pm-member-chip {
    background-color: #1f293d;
    color: #f3f4f6;
    border: 1px solid #374151;
    border-radius: 6px;
}

.pm-chip-close:hover {
    color: #ef4444;
}


/* ── EVENT DIALOG TABS STYLES ── */
.pe-tabs .nav-link {
    color: #9ca3af !important;
    background-color: #121620 !important;
    border: 1px solid #232b3b !important;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    margin-right: 4px;
    border-radius: 6px 6px 0 0;
}

.pe-tabs .nav-link:hover {
    color: #ffffff !important;
    background-color: #1c2333 !important;
}

.pe-tabs .nav-link.active {
    color: #10b981 !important;
    background-color: #1e293b !important;
    border-color: #232b3b #232b3b #10b981 !important;
    border-bottom: 2px solid #10b981 !important;
    font-weight: 600;
}

/* ── COLLAPSIBLE À PLANIFIER SIDEBAR STYLES ── */
.pv2-sidebar-collapsed {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.pv2-sidebar-collapsed:hover {
    background-color: #14202c !important;
}

.pv2-sidebar-vertical-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    letter-spacing: 0.06em;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    color: #9ca3af;
    transition: color 0.15s ease;
}

.pv2-sidebar-collapsed:hover .pv2-sidebar-vertical-text {
    color: #38bdf8;
}

/* ── RESOURCE VIEW SECTION GRID HEADERS / FULL BANNERS ── */
.pe-section-grid-header {
    height: 24px;
    min-height: 24px;
    max-height: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 3px solid transparent;
    box-sizing: border-box;
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    display: flex;
    align-items: center;
}

.pe-event-bar.pe-external-duration-draft {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.48), rgba(14, 165, 233, 0.38));
    border: 1px dashed rgba(125, 211, 252, 0.95);
    color: #e0f2fe;
    opacity: 0.68;
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(2, 132, 199, 0.15), 0 4px 10px rgba(0, 0, 0, 0.35);
}

.pe-section-grid-header:hover {
    filter: none;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.pe-section-grid-bat {
    background: rgba(204, 121, 167, 0.14) !important;
    border-left-color: #CC79A7;
    color: #f2bdd9 !important;
}

.pe-section-grid-ind {
    background: rgba(86, 180, 233, 0.14) !important;
    border-left-color: #56B4E9;
    color: #a9ddf5 !important;
}

.pe-section-grid-chauffeurs {
    background: rgba(2, 132, 199, 0.14) !important;
    border-left-color: #0284c7;
    color: #8dd3f5 !important;
}

.pe-section-grid-magasiniers {
    background: rgba(20, 184, 166, 0.14) !important;
    border-left-color: #14b8a6;
    color: #8de2d7 !important;
}

.pe-section-grid-banner-inner {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    padding: 0 10px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    user-select: none;
}

.pe-section-banner-icon {
    font-size: 0.88rem;
    line-height: 1;
    opacity: 0.9;
}

.pe-section-empty-row {
    height: 28px;
    min-height: 28px;
    max-height: 28px;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.08);
    background-color: #141414;
    box-sizing: border-box;
}

/* =========================================================================
   Task Bar: Vertical Sequential Label (pv2-bar-seq) + Info (pv2-bar-info)
   ========================================================================= */

/* الجزء الأيسر: الرقم التسلسلي للمشروع الفرعي — يُعرض عمودياً دائماً */
.pv2-bar-seq {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 16px;
    min-width: 16px;
    overflow: hidden;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    opacity: 0.9;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    padding: 2px 0;
    background: rgba(0, 0, 0, 0.18);
    white-space: nowrap;
    color: #fff;
    user-select: none;
}

/* الجزء الأيمن: معلومات المهمة (مرجع الطلب / الاسم) */
.pv2-bar-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    padding: 0 5px;
    font-size: 0.72rem;
    color: #fff;
}

.pv2-history-button {
    min-width: 31px;
    padding-inline: 0.35rem;
}

/* =========================================================================
   Calendar Overlays: Weekends, Public Holidays & Section Off-Hours
   ========================================================================= */

.pe-grid-calendar-overlays {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    min-height: 100%;
    pointer-events: none;
    z-index: 0;
}

.pe-grid-lines-container {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    min-height: 100%;
    pointer-events: none;
    z-index: 2;
}

.pe-grid-overlay-col {
    position: absolute;
    top: 0;
    bottom: 0;
    pointer-events: none;
    box-sizing: border-box;
}

/* Weekend distinction: clear, distinct dark slate background with crisp border */
.pe-grid-overlay-weekend {
    background-color: rgba(51, 65, 85, 0.35);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

/* Holiday distinction: solid subtle royal/indigo tint with clean border (NO stripes) */
.pe-grid-overlay-holiday {
    background-color: rgba(99, 102, 241, 0.16);
    border-left: 1px solid rgba(99, 102, 241, 0.35);
    border-right: 1px solid rgba(99, 102, 241, 0.35);
}

/* Header Cells: Weekend & Holiday */
.pe-header-cell-weekend {
    color: rgba(255, 255, 255, 0.6) !important;
}

.pe-header-cell-holiday {
    color: #e0e7ff !important;
    border-bottom: 2px solid #818cf8 !important;
}

.pe-header-holiday-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: #c7d2fe;
}

/* ── TIMELINE HEADER NAVIGATION & CRUMBS ── */
.pe-header-nav-bar {
    background-color: #161616;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
}

.pe-header-nav-crumb {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 1px 8px;
    height: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.pe-header-nav-crumb:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.pe-crumb-icon {
    font-size: 14px !important;
    line-height: 1;
    opacity: 0.85;
}

.pe-crumb-sep {
    color: #64748b;
    font-size: 0.75rem;
    line-height: 1;
    user-select: none;
}

.pe-header-active-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 4px;
    color: #34d399;
    font-size: 0.72rem;
    padding: 1px 8px;
    height: 20px;
    line-height: 1;
    user-select: none;
}

.pe-month-active-pill {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
    color: #a5b4fc;
}

.pe-crumb-subtext {
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: normal;
}

.pe-header-day-today {
    border-bottom: 2px solid #22c55e !important;
}

.pe-day-today-text {
    color: #4ade80 !important;
    font-weight: bold;
}

.pe-today-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #22c55e;
    flex-shrink: 0;
}

.pe-today-badge {
    background-color: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #4ade80;
    font-size: 0.62rem;
    font-weight: 600;
    border-radius: 3px;
    padding: 1px 5px;
    line-height: 1.2;
}

.pe-header-crumb-text {
    transition: color 0.15s ease;
}

.pe-header-cell.clickable:hover .pe-header-crumb-text {
    color: #ffffff;
    font-weight: 600;
}

/* Section Off-Hours Shading in Rows: Solid color tints (NO stripes) */
.pe-row-offhours {
    position: absolute;
    top: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    box-sizing: border-box;
}

/* Bâtiment (BAT) Off-Hours: Reddish Purple (#CC79A7) */
.pe-row-offhours-bat {
    background-color: rgba(204, 121, 167, 0.12);
    border-left: 1px dashed rgba(204, 121, 167, 0.3);
    border-right: 1px dashed rgba(204, 121, 167, 0.3);
}

/* Industrie (IND) Off-Hours: Sky Blue (#56B4E9) */
.pe-row-offhours-ind {
    background-color: rgba(86, 180, 233, 0.12);
    border-left: 1px dashed rgba(86, 180, 233, 0.3);
    border-right: 1px dashed rgba(86, 180, 233, 0.3);
}

/* Conducteurs / Transport Off-Hours: Petrol Blue (#0284c7) */
.pe-row-offhours-chauffeur {
    background-color: rgba(2, 132, 199, 0.12);
    border-left: 1px dashed rgba(2, 132, 199, 0.3);
    border-right: 1px dashed rgba(2, 132, 199, 0.3);
}

/* Magasin / Matériel Off-Hours: Teal (#14b8a6) */
.pe-row-offhours-magasinier {
    background-color: rgba(20, 184, 166, 0.12);
    border-left: 1px dashed rgba(20, 184, 166, 0.3);
    border-right: 1px dashed rgba(20, 184, 166, 0.3);
}

