:root {
  --row-height: 76px;
  --bg-0: #0f0f0f;
  --bg-1: #1a1a1a;
  --bg-2: #141414;
  --border: #333;
  --border-2: #2a2a2a;
  --text: #e0e0e0;
  --text-dim: #888;
  --text-dim2: #666;
  --accent: #2a78d6;
  --green: #1baf7a;
  --yellow: #fab219;
  --red-bg: #3a1a1a;
  --red-text: #e87ba4;
  --green-bg: #12251c;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.app {
  height: 100vh;
  background-color: var(--bg-0);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* Project overview */
.project-overview {
  flex: 1;
  overflow-y: auto;
  padding: clamp(2rem, 6vw, 5rem) clamp(1.25rem, 7vw, 7rem);
  background: radial-gradient(circle at top right, rgba(42, 120, 214, 0.16), transparent 34%), var(--bg-0);
}

.brand-lockup {
  max-width: 1080px;
  margin: 0 auto 2rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-logo {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 6px;
  font-size: 17px;
}

.brand-hint {
  color: var(--text-dim);
}

.overview-header {
  max-width: 1080px;
  margin: 0 auto 2.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.overview-header h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 500;
}

.overview-intro {
  margin: 0.75rem 0 0;
  color: var(--text-dim);
  font-size: 14px;
}

.project-list {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.project-card {
  min-height: 190px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  background: linear-gradient(145deg, #1d1d1d, #151515);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

.project-card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-card h2 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 500;
}

.project-status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(27, 175, 122, 0.12);
}

.project-card-meta,
.project-card-tasks {
  margin: 0.75rem 0 0;
  color: var(--text-dim);
  font-size: 12px;
}

.project-card-tasks {
  color: #fff;
  font-weight: 500;
}

.project-card-actions {
  display: flex;
  gap: 8px;
}

.project-card-actions .btn {
  flex: 1;
}

.project-card-actions .project-delete {
  flex: 0 0 42px;
  padding: 8px;
  color: var(--red-text);
  border: 1px solid #5a2a2a;
  background: var(--red-bg);
}

.project-list-empty {
  grid-column: 1 / -1;
  padding: 3rem 1.5rem;
  color: var(--text-dim);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.back-projects {
  margin-right: 12px;
  padding: 4px;
  font-size: 22px;
}

/* Header */
.header {
  padding: 1.5rem;
  background-color: var(--bg-1);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title {
  display: flex;
  align-items: baseline;
  gap: 0;
}

.header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  color: #fff;
}

.project-vorgang {
  font-size: 14px;
  color: #888;
  font-weight: 400;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.btn {
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border: none;
}

iconify-icon {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.18em;
}

.btn-primary {
  background-color: var(--accent);
  color: #fff;
}

.btn-outline {
  background-color: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.flex1 {
  flex: 1;
}

/* Main layout */
.main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Task list sidebar */
.task-list {
  width: 280px;
  background-color: var(--bg-1);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding-top: 60px;
  padding-bottom: 10px;
  flex-shrink: 0;
  position: relative;
  scrollbar-width: none;
}

.task-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.task-list::before {
  content: "Aufgaben";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 59px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
}

.task-row {
  height: var(--row-height);
  padding: 10px 16px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  border-right: none;
}

.task-row:nth-child(even) {
  background-color: var(--bg-0);
}

.task-row:nth-child(odd) {
  background-color: var(--bg-1);
}

.task-row:hover {
  background-color: #2a2a2a;
}

.task-row.selected {
  background-color: #2a3a4a;
  border-right: 2px solid var(--accent);
}

.task-row.selected:hover {
  background-color: #2a3a4a;
}

.task-row.overdue {
  background: linear-gradient(90deg, rgba(217, 48, 37, 0.18), rgba(217, 48, 37, 0.05) 22%, rgba(20, 20, 20, 0.9) 100%);
  border-left: 4px solid #ff6b6b;
  box-shadow: inset 0 0 0 1px rgba(255, 107, 107, 0.35);
}

.task-row.overdue .name {
  color: #ffe3e3;
  font-weight: 700;
}

.task-row.overdue .dates {
  color: #ffb3b3;
}

.task-row .name {
  margin: 0;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-row .dates {
  font-size: 11px;
  color: var(--text-dim2);
}

.vorgang-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  background-color: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 4px;
  margin-right: 4px;
}

/* Timeline */
.timeline-wrap {
  flex: 1;
  background-color: var(--bg-0);
  overflow-x: auto;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

.month-headers {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--bg-1);
  border-bottom: 1px solid var(--border);
  height: 60px;
}

.month-cell {
  min-width: 64px;
  width: 64px;
  height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-dim);
  border-right: 1px solid var(--border);
  white-space: nowrap;
  padding: 0 0;
  background-color: rgba(255, 255, 255, 0.01);
}

.month-cell.weekend {
  background-color: rgba(255, 255, 255, 0.03);
  color: #7a7a7a;
}

.month-cell.current {
  color: var(--accent);
}

.header-month {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
  margin-bottom: 2px;
}

.header-day {
  font-size: 10px;
  font-weight: 500;
}

.today-line,
.deadline-line {
  position: absolute;
  top: 60px;
  bottom: 0;
  width: 2px;
  z-index: 5;
  pointer-events: none;
}

.today-line {
  background-color: var(--accent);
  opacity: 0.6;
}

.deadline-line {
  background-color: #d93025;
  opacity: 1;
}

.today-badge,
.deadline-badge {
  position: absolute;
  top: -20px;
  left: -8px;
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.today-badge {
  background-color: var(--accent);
}

.deadline-badge {
  background-color: #d93025;
}

.task-bars {
  flex: 1;
  width: 100%;
  min-width: 100%;
}

.task-bar-row {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 100%;
  height: var(--row-height);
  padding-right: 0;
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s;
}

.task-bar-row:nth-child(even) {
  background-color: var(--bg-0);
}

.task-bar-row:nth-child(odd) {
  background-color: var(--bg-1);
}

.task-bar-row.selected {
  background-color: #1a2a3a;
}

.task-bar {
  height: 40px;
  min-width: 64px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 0;
  position: relative;
  flex: 0 0 auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.task-bar.dragging {
  cursor: grabbing;
  z-index: 4;
  opacity: 1;
}

.task-bar.selected {
  border: 2px solid var(--accent);
}

.task-bar.overdue {
  border: 2px solid #ff6b6b;
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  background: rgba(255, 107, 107, 0.08);
}

.task-bar.overdue .fill {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  filter: saturate(1.2) brightness(0.95);
}

.task-bar.overdue .task-assignee,
.task-bar.overdue .progress-label {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

.task-bar .fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 4px;
  filter: brightness(1.35);
  z-index: 0;
}

.task-bar .task-assignee {
  position: absolute;
  left: 8px;
  z-index: 1;
  max-width: calc(100% - 48px);
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  padding-left: 1rem;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.task-bar .progress-label {
  position: relative;
  z-index: 1;
  font-size: 14px;
  padding-right: .5rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.task-bar .status-badge {
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  z-index: 3;
}

.task-bar .status-badge iconify-icon,
.status-icon iconify-icon {
  width: 1em;
  height: 1em;
}

.task-bar .status-badge iconify-icon {
  width: 20px !important;
  height: 20px !important;
  font-size: 20px !important;
}

.task-bar .milestone-point {
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-color: #fff;
  border-radius: 50%;
  z-index: 2;
}

/* Detail panel */
.detail-panel {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 340px;
  background-color: var(--bg-1);
  padding: 1.5rem;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.detail-panel.hidden {
  display: none;
}

.detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 20px;
}

.detail-panel h2 {
  margin: 0 0 1.5rem 0;
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  padding-right: 24px;
}

.detail-section {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.detail-section:first-of-type {
  padding-top: 0;
  border-top: none;
}

.detail-section-title {
  margin: 0 0 1rem;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-empty {
  margin: -0.25rem 0 0;
  color: var(--text-dim);
  font-size: 12px;
}

.detail-block .label {
  margin: 0 0 0.5rem 0;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.detail-block .value {
  margin: 0;
  font-size: 14px;
  color: #fff;
}

.detail-two-col {
  display: flex;
  gap: 1.5rem;
}

.progress-track {
  height: 8px;
  border-radius: 4px;
  background-color: var(--bg-0);
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-track .fill {
  height: 100%;
  border-radius: 4px;
}

.log-summary {
  margin: 0 0 0.5rem 0;
  font-size: 14px;
  color: #fff;
}

.log-entries {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0.75rem;
}

.log-entry-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #aaa;
  background-color: var(--bg-0);
  border-radius: 4px;
  padding: 8px;
}

.log-proof {
  color: var(--green);
  font-size: 10px;
  font-weight: 600;
}

.detail-actions-row {
  display: flex;
  gap: 8px;
}

.detail-delete {
  padding: 8px 12px;
  border-radius: 4px;
  border: none;
  background-color: var(--red-bg);
  color: var(--red-text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-overlay.hidden {
  display: none;
}

#modal-log-entry {
  z-index: 300;
}

.modal {
  background-color: var(--bg-1);
  border-radius: 8px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  border: 1px solid var(--border);
}

.modal-narrow {
  max-width: 360px;
}

.modal-wide {
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal h2 {
  margin: 0 0 1.5rem 0;
  font-size: 18px;
  font-weight: 500;
  color: #fff;
}

.modal-subtitle {
  margin: 0 0 1.5rem 0;
  font-size: 12px;
  color: var(--text-dim);
}

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.modal-header-row h2 {
  margin: 0;
}

.form-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field label {
  font-size: 12px;
  color: var(--text-dim);
  display: block;
  margin-bottom: 0.5rem;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="date"],
.field select,
.field textarea {
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background-color: var(--bg-0);
  color: #fff;
  font-size: 13px;
  font-family: inherit;
}

.field input[type="date"] {
  color-scheme: dark;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 2.5v4M8 2.5v4M3 9.5h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 17px 17px;
}

.field input[type="date"]::-webkit-datetime-edit,
.field input[type="date"]::-webkit-datetime-edit-text,
.field input[type="date"]::-webkit-datetime-edit-month-field,
.field input[type="date"]::-webkit-datetime-edit-day-field,
.field input[type="date"]::-webkit-datetime-edit-year-field {
  color: var(--text);
}

.field input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 1;
  width: auto;
  cursor: pointer;
}

.field textarea {
  resize: vertical;
  min-height: 60px;
}

.field input[type="range"] {
  width: 100%;
}

.field-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-checkbox label {
  margin: 0;
  cursor: pointer;
}

.field-checkbox input {
  cursor: pointer;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 1.5rem;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 20px;
}

/* Evaluation */
.eval-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  font-size: 13px;
}

.eval-total.over {
  background-color: var(--red-bg);
  border: 1px solid #5a2a2a;
}

.eval-total.under {
  background-color: var(--green-bg);
  border: 1px solid var(--green);
}

.eval-total .label {
  color: #fff;
  font-weight: 500;
}

.eval-total .value.over {
  color: var(--red-text);
  font-weight: 600;
}

.eval-total .value.under {
  color: var(--green);
  font-weight: 600;
}

.eval-overview {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: 24px;
  padding: 4px 0 20px;
}

.eval-pie {
  width: 168px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--border);
  position: relative;
}

.eval-pie::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: var(--bg-1);
}

.eval-pie-center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.eval-pie-center strong {
  color: #fff;
  font-size: 18px;
}

.eval-pie-center span {
  color: var(--text-dim);
  font-size: 11px;
}

.eval-pie-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eval-pie-legend-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.eval-pie-legend-item .swatch-sm {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.eval-pie-legend-item .name {
  color: #fff;
}

.eval-pie-legend-item .percentage {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.eval-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eval-area {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.eval-area-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background-color: var(--bg-0);
  cursor: pointer;
}

.eval-area-header .left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.eval-area-header .left .swatch-sm {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.eval-area-header .left .name {
  font-size: 13px;
  color: #fff;
  font-weight: 500;
}

.eval-area-header .right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.eval-area-header .right .completion {
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.eval-area-header .right .hours {
  font-size: 12px;
  color: var(--text-dim);
}

.eval-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.eval-badge.over {
  color: var(--red-text);
  background-color: var(--red-bg);
}

.eval-badge.under {
  color: var(--green);
  background-color: var(--green-bg);
}

.eval-area-body {
  padding: 10px 14px;
  background-color: var(--bg-2);
}

.eval-area-body .title {
  margin: 0 0 6px 0;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.eval-person-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text);
}

.eval-person-row .over-amount {
  color: var(--red-text);
  font-weight: 600;
}

.eval-area-body .note {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}

/* Footer legend */
.footer {
  padding: 1rem;
  background-color: var(--bg-1);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 24px;
  font-size: 12px;
  color: var(--text-dim);
  overflow-x: auto;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

.milestone-dot {
  width: 8px;
  height: 8px;
  background-color: #fff;
  border-radius: 50%;
  border: 2px solid var(--accent);
  display: inline-block;
}

.status-icon {
  font-weight: 700;
}

.legend-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  white-space: nowrap;
}

/* Scrollbars (subtle, webkit) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-0);
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 5px;
}