/**
 * Taskbuilder - Gantt Chart add-on: styles for the Gantt view (wppm-gantt-view.js).
 * The view's shell, toolbar and "No dates" panel are styled by Taskbuilder core
 * (wppm-task-timeline-saas.css); everything here is the chart. Status colors come inline (--tv-status).
 */
/* ---------- Gantt ---------- */
.wppm-tv-shell .wppm-tv-gantt {
  --tv-row: 40px;
  --tv-head: 56px;
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--wppm-kb-border);
  border-radius: var(--wppm-kb-radius-sm);
  background: #fff;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.wppm-tv-shell .wppm-tv-g-side {
  min-width: 0;
  border-right: 1px solid var(--wppm-kb-border);
  background: #fff;
}
.wppm-tv-shell .wppm-tv-g-side-head {
  display: flex;
  align-items: flex-end;
  height: var(--tv-head);
  padding: 0 14px 9px;
  border-bottom: 1px solid var(--wppm-kb-border);
  background: var(--wppm-kb-bg);
  color: var(--wppm-kb-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.wppm-tv-shell .wppm-tv-g-row {
  position: relative;
  height: var(--tv-row);
  border-bottom: 1px solid #f1f5f9;
}
.wppm-tv-shell .wppm-tv-g-side .wppm-tv-g-row {
  display: flex;
  align-items: center;
  padding: 0 8px;
}
.wppm-tv-shell .wppm-tv-g-row.is-group {
  height: 32px;
  background: #f8fafc;
}
.wppm-tv-shell .wppm-tv-g-side .wppm-tv-g-row.is-group {
  overflow: hidden;
  padding: 0 14px;
  color: #334155;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: block;
  line-height: 32px;
}
.wppm-tv-shell .wppm-tv-g-name {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  height: 30px;
  min-height: 0;
  margin: 0;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--wppm-kb-ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  text-align: left;
  text-transform: none;
  cursor: pointer;
}
.wppm-tv-shell .wppm-tv-g-name:hover {
  background: var(--wppm-kb-primary-light);
  color: var(--wppm-kb-ink);
}
.wppm-tv-shell .wppm-tv-g-name-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.wppm-tv-shell .wppm-tv-g-id {
  flex: none;
  color: #94a3b8;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.wppm-tv-shell .wppm-tv-g-name.is-done .wppm-tv-g-name-text {
  color: var(--wppm-kb-muted);
  text-decoration: line-through;
}
.wppm-tv-shell .wppm-tv-g-main {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.wppm-tv-shell .wppm-tv-g-canvas {
  position: relative;
}
.wppm-tv-shell .wppm-tv-g-head {
  height: var(--tv-head);
  border-bottom: 1px solid var(--wppm-kb-border);
  background: var(--wppm-kb-bg);
}
.wppm-tv-shell .wppm-tv-g-band {
  position: relative;
  height: 28px;
}
.wppm-tv-shell .wppm-tv-g-band.is-top {
  border-bottom: 1px solid #eef0f4;
}
.wppm-tv-shell .wppm-tv-g-cell {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0 8px;
  border-left: 1px solid #eef0f4;
  color: #475569;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.wppm-tv-shell .wppm-tv-g-band.is-top .wppm-tv-g-cell {
  color: var(--wppm-kb-ink);
  font-weight: 700;
}
.wppm-tv-shell .wppm-tv-g-cell.is-day {
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 0;
  font-size: 11px;
  line-height: 1.1;
}
.wppm-tv-shell .wppm-tv-g-wd {
  color: #94a3b8;
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
}
.wppm-tv-shell .wppm-tv-g-cell.is-weekend {
  background: #f1f5f9;
}
.wppm-tv-shell .wppm-tv-g-cell.is-today {
  background: var(--wppm-kb-primary-light);
  color: var(--wppm-kb-primary-dark);
}
.wppm-tv-shell .wppm-tv-g-body {
  position: relative;
}
.wppm-tv-shell .wppm-tv-g-body.has-grid {
  background-image: repeating-linear-gradient(to right, #f1f5f9 0 1px, transparent 1px var(--tv-grid));
}
.wppm-tv-shell .wppm-tv-g-today {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 2px;
  margin-left: -1px;
  background: #ef4444;
  pointer-events: none;
}
.wppm-tv-shell .wppm-tv-g-today::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
}

/* Bars */
.wppm-tv-shell .wppm-tv-bar {
  position: absolute;
  top: 8px;
  z-index: 1;
  display: flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--tv-status, #6366f1);
  color: var(--tv-status-fg, #fff);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15,23,42,.15);
  cursor: pointer;
  user-select: none;
  touch-action: none;
  transition: box-shadow .12s ease, filter .12s ease;
}
.wppm-tv-shell .wppm-tv-bar.is-editable {
  cursor: grab;
}
.wppm-tv-shell .wppm-tv-bar:hover {
  filter: brightness(1.05);
  box-shadow: 0 4px 12px -4px rgba(15,23,42,.35);
}
.wppm-tv-shell .wppm-tv-bar:focus-visible {
  outline: 2px solid var(--wppm-kb-primary);
  outline-offset: 2px;
}
.wppm-tv-shell .wppm-tv-bar.is-dragging {
  z-index: 3;
  cursor: grabbing;
  opacity: .9;
  box-shadow: 0 8px 20px -6px rgba(15,23,42,.45);
  transition: none;
}
.wppm-tv-shell .wppm-tv-bar.is-done {
  opacity: .55;
}
.wppm-tv-shell .wppm-tv-bar.is-single {
  border-radius: 999px;
}
.wppm-tv-shell .wppm-tv-bar-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
}
/* Short bars: the name goes to the right of the bar instead of being cut off. */
.wppm-tv-shell .wppm-tv-bar.is-narrow .wppm-tv-bar-label {
  position: absolute;
  left: calc(100% + 6px);
  overflow: visible;
  color: var(--wppm-kb-ink);
  font-weight: 500;
}
.wppm-tv-shell .wppm-tv-bar-handle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 8px;
  border-radius: 0 7px 7px 0;
  cursor: ew-resize;
}
.wppm-tv-shell .wppm-tv-bar-handle::after {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  right: 3px;
  width: 2px;
  border-radius: 2px;
  background: rgba(255,255,255,.7);
  opacity: 0;
}
.wppm-tv-shell .wppm-tv-bar:hover .wppm-tv-bar-handle::after {
  opacity: 1;
}

@media (max-width: 782px) {
  .wppm-tv-shell .wppm-tv-gantt {
    grid-template-columns: 140px minmax(0, 1fr);
  }
  .wppm-tv-shell .wppm-tv-g-id {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wppm-tv-shell .wppm-tv-bar {
    transition: none;
  }
}

/* Bar: filled part = task progress */
.wppm-tv-shell .wppm-tv-bar-progress {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  background: rgba(15,23,42,.22);
  pointer-events: none;
}
.wppm-tv-shell .wppm-tv-bar:not(.is-narrow) .wppm-tv-bar-label {
  position: relative;
}
/* Bar details popup (appended to <body>, so it is not clipped by the scrolling chart) */
.wppm-tv-pop {
  position: fixed;
  z-index: 100000;
  box-sizing: border-box;
  width: 300px;
  max-width: calc(100vw - 16px);
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 32px -8px rgba(15,23,42,.35);
  color: #374151;
  font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  pointer-events: none;
}
.wppm-tv-pop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}
.wppm-tv-pop-name {
  min-width: 0;
  color: #111827;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.wppm-tv-pop-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 3px;
}
.wppm-tv-pop-label {
  flex: 0 0 104px;
  color: #6b7280;
}
.wppm-tv-pop-line b {
  min-width: 0;
  color: #111827;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.wppm-tv-pop-pill {
  flex: none;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Pagination under the chart */
.wppm-tv-shell .wppm-tv-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 12px;
  color: #6b7280;
  font-size: 13px;
}
.wppm-tv-shell .wppm-tv-pager-nums {
  display: flex;
  align-items: center;
  gap: 4px;
}
.wppm-tv-shell .wppm-tv-pager-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.wppm-tv-shell .wppm-tv-pager-btn:hover:not(:disabled) {
  background: #f1f5f9;
}
.wppm-tv-shell .wppm-tv-pager-btn:focus-visible {
  outline: 2px solid var(--wppm-kb-primary);
  outline-offset: 1px;
}
.wppm-tv-shell .wppm-tv-pager-btn.active {
  background: var(--wppm-kb-primary);
  color: #fff;
}
.wppm-tv-shell .wppm-tv-pager-btn:disabled {
  opacity: .4;
  cursor: default;
}
.wppm-tv-shell .wppm-tv-pager-gap {
  padding: 0 2px;
}
.wppm-tv-shell .wppm-tv-pager-size {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 400;
}
.wppm-tv-shell .wppm-tv-pager-size select {
  width: auto;
  min-width: 64px;
  height: 32px;
  margin: 0;
}
