/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  padding: 20px;
  background: #f9f9f9;
}

#app {
  width: 100%;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
}

.months-row,
.weeks-row {
  display: grid;
  grid-template-columns: 200px repeat(52, 1fr);
}

.month-cell {
  background: #e0e0e0;
  text-align: center;
  font-weight: bold;
  padding: 6px 0;
  border: 1px solid #ccc;
  font-size: 14px;
}

.week-cell {
  background: #f5f5f5;
  text-align: center;
  padding: 4px 0;
  border: 1px solid #eee;
  font-size: 11px;
}

.week-cell.current {
  background-color: #ffcc00;
  font-weight: bold;
  border-radius: 4px;
}

/* Team-Bereich */
.team-area {
  margin-top: 10px;
}

.team-row {
  display: grid;
  grid-template-columns: 200px repeat(52, 1fr);
  grid-template-rows: 8px auto;
  /* 1) Heatmap, 2) Tasks */
  border-bottom: 1px solid #ccc;
  position: relative;
  background: #fff;
  align-items: start;
}

.name-column {
  grid-row: 1 / span 2;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-weight: bold;
  position: sticky;
  left: 0;
  z-index: 5;
  border-right: 1px solid #ccc;
  height: 100%;
}

.member-heatmap {
  grid-column: 2 / -1;
  grid-row: 1 / 2;
  height: 8px;
  display: grid;
  grid-template-columns: repeat(52, 1fr);
  gap: 0;
}

.member-heatmap .cell {
  border-top: 1px solid #eee;
}

.tasks-container {
  grid-column: 2 / -1;
  grid-row: 2 / 3;
  position: relative;
  margin: 0;
  padding: 0;
  /* Höhe kommt inline aus Vue */
}

.absence-band {
  position: absolute;
  z-index: 4;
  /* .task-block liegt üblicherweise darunter (z-index: 3) */
  border: 1px dashed rgba(229, 57, 53, 0.65);
  background: repeating-linear-gradient(45deg,
      rgba(229, 57, 53, 0.12) 0 6px,
      rgba(229, 57, 53, 0.18) 6px 12px);
  cursor: pointer;
  /* Doppelklick zum Editieren */
}

.muted {
  color: #666;
  font-size: 12px;
  margin-top: 6px;
}



/* 100%-Linie */
.capacity-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #e53935;
  opacity: 0.9;
  pointer-events: none;
  z-index: 2;
}

/* Projekte */
.projects {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  position: relative;
}

.project-block {
  display: block;
  min-width: 200px;
  min-height: 200px;
  padding: 10px;
}

.project-edit-button {
  background: transparent;
  border: none;
  font-size: 14px;
  cursor: pointer;
  position: absolute;
  bottom: 15px;
}

.project-edit-button:hover {
  color: #1976d2;
}

/* Tasks */
.task-block {
  position: absolute;
  /* top + height kommen inline */
  background: #4caf50;
  color: #fff;
  padding: 5px;
  font-size: 12px;
  border-radius: 4px;
  cursor: grab;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 3;
}

/* Drag / Resize */
.task-block {
  touch-action: none;
}

/* wichtig für Touch-Drag */
.task-block.dragging {
  opacity: .95;
  box-shadow: 0 8px 16px rgba(0, 0, 0, .25);
  z-index: 5;
  /* über Urlaub-Overlay (z-index:4) */
}

.task-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  background: transparent;
}

.task-handle.left {
  left: 0;
}

.task-handle.right {
  right: 0;
}


.task-edit-button {
  background: transparent;
  border: none;
  font-size: 14px;
  cursor: pointer;
  margin-left: 5px;
}

.task-edit-button:hover {
  color: #1976d2;
}

/* Formular */
.task-form {
  background: #fff8e1;
  border: 1px solid #ffecb3;
  padding: 5px;
  margin-top: 5px;
  display: flex;
  gap: 5px;
  align-items: center;
  position: absolute;
}

.task-form input {
  width: 100px;
  padding: 3px;
  font-size: 12px;
}

.task-form button {
  background: #2196f3;
  color: white;
  border: none;
  padding: 5px 8px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
}

.task-form button:hover {
  background: #1976d2;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: #fff;
  position: absolute;
  left: 20px;
  top: 20px;
  padding: 20px;
  border-radius: 8px;
  min-width: 300px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-content select {
  padding: 6px;
  margin-top: 8px;
}

.modal-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

.modal-content input {
  display: block;
  margin: 10px 0;
  width: 100%;
  padding: 6px;
  font-size: 14px;
}

/* Controls */
.controls {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.controls input {
  padding: 6px;
  font-size: 14px;
}

.controls button {
  padding: 6px 10px;
  font-size: 14px;
  background: #2196f3;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.controls button:hover {
  background: #1976d2;
}

/* Add-Button */
.add-task-button {
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 16px;
  cursor: pointer;
}

.add-task-button:hover {
  background: #388e3c;
}

/* Save/Load + Resizer */
.loadandsave {
  position: fixed;
  top: 0px;
  right: 10px;
}

.resizer {
  position: fixed;
  bottom: 5px;
  right: 10px;
}

/* Legende */
.util-legend {
  margin: 6px 0 12px;
  width: 420px;
}

.util-legend-bar {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(to right,
      hsl(120, 70%, 45%) 0%,
      hsl(60, 70%, 50%) 50%,
      hsl(30, 80%, 55%) 80%,
      hsl(0, 80%, 55%) 100%);
}

.util-legend-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #555;
  margin-top: 4px;
}

.project-view {
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
}

.pv-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.pv-header .spacer {
  flex: 1;
}

.gantt {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gantt-row {
  display: grid;
  align-items: stretch;
}

.gcell {
  border: 1px solid #eee;
  min-height: 34px;
  position: relative;
}

.gcell.title {
  background: #fafafa;
  font-weight: bold;
  display: flex;
  align-items: center;
  padding: 0 8px;
}

.gcell.gweek {
  font-size: 11px;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gcell.ggrid {
  padding: 0;
  overflow: visible;
  position: relative;
}

.gbar {
  position: absolute;
  top: 6px;
  height: 22px;
  border-radius: 4px;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}

.gbar-label {
  font-size: 11px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .2);
}

.btn {
  padding: 6px 10px;
  font-size: 14px;
  background: #2196f3;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn:hover {
  background: #1976d2;
}

.muted {
  color: #666;
  font-size: 12px;
}

.gcell.gweek.gweek-body {
  position: relative;
}

.gweek-body.active {
  /* Hintergrundfarbe kommt inline aus :style (Projektfarbe) */
  border-top: 1px solid rgba(0, 0, 0, .06);
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}

/* Abrundungen nur an Start/Ende */
.gweek-body.start {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.gweek-body.end {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

/* kleines Label auf der Startzelle */
.gbar-label {
  position: absolute;
  top: -18px;
  left: 0;
  padding: 2px 6px;
  font-size: 11px;
  background: #000;
  color: #fff;
  border-radius: 3px;
  white-space: nowrap;
}