/* Env Plan (/env-plan): planning board. Uses MudBlazor palette variables so it follows the theme. */
.env-plan-page { max-width: none; }
.env-plan-page {
    --ep-person: #2f80ed;
    --ep-equipment: #e08a00;
    --ep-supply: #8e44ad;
    --ep-span: rgba(46, 160, 67, .10);
    --ep-weekend: rgba(127, 127, 127, .07);
    --ep-today: rgba(47, 128, 237, .08);
    --ep-free: #2ea043;
    --ep-part: #d4a72c;
    --ep-full: #2f80ed;
    --ep-over: #d1242f;
}

.ep-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 12px; }
.ep-toolbar .ep-branch { max-width: 200px; }
.ep-toolbar .ep-search { max-width: 260px; }
.ep-date-nav { display: flex; align-items: center; gap: 4px; }
.ep-date-nav .ep-date { flex: none; width: 180px; max-width: none; }
.ep-range { margin-left: 6px; white-space: nowrap; }

.ep-container { display: flex; flex-direction: column; gap: 0; }

/* Drag to move height between the gantt and the resource pool (js/env-plan-layout.js). */
.ep-splitter { flex: none; height: 14px; display: flex; align-items: center; justify-content: center; cursor: row-resize; touch-action: none; user-select: none; outline: none; }
.ep-splitter::before { content: ""; width: 56px; height: 4px; border-radius: 2px; background: var(--mud-palette-lines-default); transition: background .12s, width .12s; }
.ep-splitter:hover::before, .ep-splitter:focus-visible::before, body.ep-resizing .ep-splitter::before { width: 96px; background: var(--mud-palette-primary); }
body.ep-resizing { cursor: row-resize; user-select: none; }
.ep-pane { border: 1px solid var(--mud-palette-lines-default); border-radius: 8px; background: var(--mud-palette-surface); overflow: hidden; }
.ep-pane-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; border-bottom: 1px solid var(--mud-palette-lines-default); }
.ep-legend { display: inline-flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; font-size: 12px; color: var(--mud-palette-text-secondary); }
.ep-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: -6px; }
.ep-legend i.ep-span-key { background: var(--ep-span); border: 1px solid rgba(46, 160, 67, .45); }

/* ---- gantt ---- */
.ep-gantt-scroll { overflow: auto; max-height: var(--ep-gantt-height, 58vh); }
.ep-gantt { display: grid; min-width: max-content; font-size: 12.5px; }
.ep-gantt > * { border-bottom: 1px solid var(--mud-palette-lines-default); border-right: 1px solid var(--mud-palette-lines-default); }
.ep-sticky { position: sticky; left: 0; z-index: 2; background: var(--mud-palette-surface); }
.ep-head { position: sticky; top: 0; z-index: 3; background: var(--mud-palette-background-gray, var(--mud-palette-surface)); padding: 6px 8px; font-weight: 600; text-align: center; line-height: 1.25; }
.ep-head.ep-sticky { z-index: 4; text-align: left; }
.ep-head.ep-hours { position: sticky; height: 34px; padding: 0; }
.ep-head.ep-hours span { position: absolute; top: 9px; transform: translateX(-50%); font-weight: 500; color: var(--mud-palette-text-secondary); }
.ep-head.ep-hours span:first-child { transform: translateX(4px); }
.ep-head.ep-today { color: var(--mud-palette-primary); }
.ep-empty { grid-column: 1 / -1; padding: 24px; text-align: center; color: var(--mud-palette-text-secondary); }

.ep-job { display: flex; gap: 4px; padding: 6px 8px; cursor: pointer; align-items: flex-start; }
.ep-job:hover { background: var(--mud-palette-action-default-hover); }
.ep-job-text { min-width: 0; line-height: 1.3; }
.ep-job-text > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.ep-job-counts { display: flex; gap: 6px; align-items: center; margin-top: 3px; }
.ep-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; color: #fff; font-size: 11px; text-align: center; line-height: 16px; }
.ep-count.ep-kind-1 { background: var(--ep-person); }
.ep-count.ep-kind-2 { background: var(--ep-equipment); }
.ep-count.ep-kind-3 { background: var(--ep-supply); }

.ep-cell { position: relative; padding: 4px; min-height: 52px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 3px; }
.ep-cell.ep-in-span { background: var(--ep-span); }
.ep-cell.ep-weekend { background-image: linear-gradient(var(--ep-weekend), var(--ep-weekend)); }
.ep-cell.ep-today { box-shadow: inset 2px 0 0 var(--mud-palette-primary); }
/* Drop targets (native drag/drop; classes toggled by js/env-plan-layout.js). */
body.ep-dragging .ep-cell[data-ep-drop] { outline: 2px dashed rgba(47, 128, 237, .35); outline-offset: -3px; }
.ep-cell[data-ep-drop].ep-drop-hover { background-color: rgba(47, 128, 237, .14); outline-color: var(--mud-palette-primary); }
/* Day view: one drop slot per hour, behind the planned bars. While dragging, bars let the drop through. */
.ep-hour-slot { position: absolute; top: 0; bottom: 0; z-index: 0; }
.ep-hour-slot.ep-drop-hover { background-color: rgba(47, 128, 237, .22); box-shadow: inset 0 0 0 2px var(--mud-palette-primary); }
body.ep-dragging .ep-day-cell .ep-bar, body.ep-dragging .ep-day-cell .ep-day-supplies { pointer-events: none; }
.ep-day-cell { display: block; padding: 0; }
.ep-day-grid { position: absolute; inset: 0; pointer-events: none; }
.ep-day-grid i { position: absolute; top: 0; bottom: 0; border-left: 1px dotted var(--mud-palette-lines-default); }
.ep-day-supplies { position: absolute; left: 4px; display: flex; gap: 3px; flex-wrap: wrap; }

.ep-chip, .ep-bar { display: inline-block; max-width: 100%; padding: 1px 6px; border-radius: 4px; font-size: 11.5px; line-height: 18px; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ep-chip:hover, .ep-bar:hover { filter: brightness(1.1); }
.ep-kind-1 { background: var(--ep-person); }
.ep-kind-2 { background: var(--ep-equipment); }
.ep-kind-3 { background: var(--ep-supply); }
.ep-conflict { box-shadow: 0 0 0 2px var(--ep-over); }
.ep-bar { position: absolute; height: 18px; z-index: 1; }
.ep-more { font-size: 11px; color: var(--mud-palette-primary); cursor: pointer; }
.ep-agg { display: flex; align-items: center; gap: 4px; font-size: 11.5px; }
.ep-actual { flex-basis: 100%; font-size: 10.5px; color: var(--mud-palette-text-secondary); }
.ep-day-cell .ep-actual { position: absolute; right: 6px; bottom: 2px; flex-basis: auto; }

.ep-lane-label { display: flex; align-items: center; gap: 6px; padding: 3px 8px 3px 30px; font-size: 12px; background: var(--mud-palette-background-gray, var(--mud-palette-surface)); }
.ep-lane-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-lane-cell { min-height: 28px; cursor: copy; }
.ep-lane-cell:hover { background-color: rgba(47, 128, 237, .05); }
.ep-lane-fill { min-height: 28px; }
.ep-dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; }

/* ---- TimeSelect (Components/Shared/TimeSelect.razor): Hour / Minute / AM-PM dropdowns ---- */
.time-select { min-width: 0; }
.time-select-label { display: block; margin: 0 0 2px 2px; color: var(--mud-palette-text-secondary); }
.time-select-row { display: flex; gap: 6px; }
.time-select-row .time-select-part { flex: 1 1 0; min-width: 0; margin-top: 0; }

/* ---- resource pool ---- */
.ep-pool-head, .ep-pool-row { display: grid; grid-template-columns: 18px minmax(160px, 2fr) minmax(110px, 1.2fr) minmax(110px, 1.2fr) 80px 56px minmax(120px, 1.5fr); gap: 8px; align-items: center; padding: 4px 12px; }
.ep-pool-head { font-size: 12px; font-weight: 600; color: var(--mud-palette-text-secondary); border-bottom: 1px solid var(--mud-palette-lines-default); }
.ep-pool { max-height: var(--ep-pool-height, 34vh);overflow-y: auto; min-height: 60px; }
.ep-pool .mud-drop-item, .ep-pool-row { cursor: grab; }
.ep-pool-row { font-size: 12.5px; border-bottom: 1px solid var(--mud-palette-lines-default); height: 28px; box-sizing: border-box; padding-top: 0; padding-bottom: 0; }
.ep-pool-row:hover { background: var(--mud-palette-action-default-hover); }
.ep-pool-row > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-pool-name { font-weight: 500; }
.ep-num { text-align: right; }
.ep-status-free { background: var(--ep-free); }
.ep-status-part { background: var(--ep-part); }
.ep-status-full { background: var(--ep-full); }
.ep-status-over { background: var(--ep-over); }
.ep-legend i.ep-status-free, .ep-legend i.ep-status-part, .ep-legend i.ep-status-full, .ep-legend i.ep-status-over { border-radius: 50%; }

@media (max-width: 760px) {
    .ep-pool-head, .ep-pool-row { grid-template-columns: 18px minmax(120px, 2fr) minmax(80px, 1fr) 64px; }
    .ep-pool-head > :nth-child(4), .ep-pool-row > :nth-child(4),
    .ep-pool-head > :nth-child(6), .ep-pool-row > :nth-child(6),
    .ep-pool-head > :nth-child(7), .ep-pool-row > :nth-child(7) { display: none; }
}
