<style>
:root {
  --navy: #1a2332;
  --navy-light: #2d3e50;
  --blue: #3b82f6;
  --blue-dark: #2563eb;
  --blue-light: #60a5fa;
  --blue-bg: #eff6ff;
  --teal: #14b8a6;
  --teal-light: #5eead4;
  --teal-bg: #f0fdfa;
  --amber: #f59e0b;
  --amber-light: #fbbf24;
  --amber-bg: #fffbeb;
  --rose: #f43f5e;
  --rose-light: #fb7185;
  --green: #10b981;
  --green-light: #34d399;
  --bg: #fafbfc;
  --white: #ffffff;
  --text: #1a2332;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Public Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.header {
  background: var(--navy);
  padding: 0 32px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 16px rgba(0,0,0,0.1);
}

.logo {
  font-family: 'Bitter', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-family: 'Public Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--blue);
  color: white;
}

.btn-primary:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: rgba(255,255,255,0.8);
  border: 1.5px solid rgba(255,255,255,0.2);
}

.btn-secondary:hover {
  border-color: rgba(255,255,255,0.4);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 12px;
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}

.wizard {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 24px var(--shadow);
  overflow: hidden;
}

.wizard-progress {
  background: var(--bg);
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 16px;
}

.progress-line {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.progress-line-fill {
  height: 100%;
  background: var(--blue);
  transition: width 0.3s;
}

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

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.3s;
}

.step.active .step-number {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.step.completed .step-number {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.step-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
}

.step.active .step-label {
  color: var(--text);
  font-weight: 600;
}

.wizard-content {
  padding: 48px 56px;
}

.step-content {
  display: none;
}

.step-content.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.step-header {
  margin-bottom: 32px;
}

.step-title {
  font-family: 'Bitter', serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--navy);
}

.step-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 0.9rem;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'Public Sans', sans-serif;
  font-size: 0.95rem;
  transition: all 0.2s;
  background: white;
}

.form-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
}

.form-row-4 {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 12px;
}

.time-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.area-item {
  background: var(--bg);
  padding: 16px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.area-info {
  flex: 1;
}

.area-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.area-details {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-remove {
  background: var(--rose);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-remove:hover {
  background: #dc2626;
}

.btn-add {
  background: var(--blue-bg);
  color: var(--blue);
  border: 1.5px dashed var(--blue);
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-add:hover {
  background: var(--blue);
  color: white;
  border-style: solid;
}

.task-list {
  display: grid;
  gap: 12px;
}

.task-item {
  background: var(--bg);
  padding: 16px 20px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}

.task-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.task-content {
  flex: 1;
}

.task-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.task-meta {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.task-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-pfk {
  background: var(--blue-bg);
  color: var(--blue-dark);
}

.badge-pfa {
  background: var(--teal-bg);
  color: var(--teal);
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.room-wizard {
  max-width: 800px;
  margin: 0 auto;
}

.room-header {
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: white;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 32px;
}

.room-number {
  font-family: 'Bitter', serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.room-progress {
  font-size: 0.9rem;
  opacity: 0.9;
}

.double-room-toggle {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--blue-bg);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.care-section {
  background: var(--bg);
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.section-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.care-item {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}

.care-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.care-number {
  font-weight: 700;
  color: var(--blue);
}

.frequency-options {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.radio-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.weekday-select {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
}

.weekday-btn {
  flex: 1;
  padding: 8px;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.weekday-btn.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.analysis-card {
  background: white;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.analysis-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.analysis-icon {
  font-size: 2rem;
}

.analysis-title {
  font-family: 'Bitter', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
}

.demand-grid {
  display: grid;
  gap: 16px;
}

.demand-area {
  background: var(--bg);
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid var(--blue);
}

.demand-area-name {
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.demand-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.demand-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.stat-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--blue);
}

.info-box {
  background: var(--blue-bg);
  border-left: 4px solid var(--blue);
  padding: 16px;
  border-radius: 8px;
  margin-top: 20px;
}

.info-box-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--blue-dark);
}

.info-box-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.tour-config {
  background: white;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-top: 24px;
}

.config-grid {
  display: grid;
  gap: 20px;
}

.config-area {
  background: var(--bg);
  padding: 20px;
  border-radius: 10px;
}

.config-area-name {
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
}

.tour-inputs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-warning {
  background: var(--amber-bg);
  border-left: 4px solid var(--amber);
  color: #92400e;
}

.alert-icon {
  font-size: 1.2rem;
}

.save-reminder {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--navy);
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  display: none;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.save-reminder.show {
  display: flex;
}

@media (max-width: 768px) {
  .header {
    padding: 0 16px;
  }
  
  .container {
    padding: 24px 16px;
  }
  
  .wizard-content {
    padding: 32px 24px;
  }
  
  .form-row,
  .form-row-3,
  .form-row-4 {
    grid-template-columns: 1fr;
  }
  
  .step-label {
    font-size: 0.7rem;
  }
  
  .progress-steps {
    gap: 8px;
  }
}

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.hidden {
  display: none !important;
}

/* TOUR EDITOR STYLES */
.tour-editor-container {
  min-height: 70vh;
}

.editor-toolbar {
  background: var(--bg);
  padding: 20px;
  border-bottom: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.toolbar-section {
  display: flex;
  gap: 12px;
  align-items: center;
}

.shift-selector {
  display: flex;
  gap: 4px;
  background: white;
  padding: 4px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
}

.shift-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s;
  color: var(--text-muted);
  font-family: 'Public Sans', sans-serif;
}

.shift-btn.active {
  background: var(--blue);
  color: white;
}

.shift-btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: transparent !important;
  color: var(--text-muted) !important;
}

.shift-badge {
  display: inline-block;
  background: var(--amber);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: 6px;
  letter-spacing: 0.5px;
}

.area-filter {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: white;
  font-family: 'Public Sans', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
}

.legend-inline {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
}

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

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 2px solid;
}

.legend-dot.pfk {
  background: var(--blue-bg);
  border-color: var(--blue);
}

.legend-dot.pfa {
  background: var(--teal-bg);
  border-color: var(--teal);
}

.legend-dot.ph {
  background: #faf5ff;
  border-color: var(--purple);
}

.legend-dot.regular {
  background: #f0fdf4;
  border-color: var(--green);
  border-style: dashed;
}

.tour-grid-wrapper {
  overflow-x: auto;
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.tour-grid {
  display: grid;
  gap: 0;
  min-width: fit-content;
}

.grid-row {
  display: contents;
}

.time-label {
  position: sticky;
  left: 0;
  background: white;
  z-index: 10;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 70px;
  border-right: 2px solid var(--border);
}

.time-label.shift-marker {
  background: var(--blue-bg);
  color: var(--blue-dark);
  font-weight: 700;
}

.tour-cell {
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  height: 50px;
  width: 250px;
  position: relative;
  padding: 0;
  transition: background 0.2s;
  overflow: visible;
}

.tour-cell:hover {
  background: var(--bg);
}

.tour-header-cell {
  position: sticky;
  top: 0;
  background: white;
  z-index: 50;
  padding: 12px;
  border-bottom: 2px solid var(--border);
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 250px;
}

.tour-block {
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  background: white;
  border: 2px solid var(--blue);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 0.75rem;
  cursor: grab;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  box-sizing: border-box;
  overflow: visible;
  z-index: 10;
}

.tour-block:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 20;
}

.tour-block.pfk {
  border-color: var(--blue);
  background: var(--blue-bg);
}

.tour-block.pfa {
  border-color: var(--teal);
  background: var(--teal-bg);
}

.tour-block.ph {
  border-color: var(--purple);
  background: #faf5ff;
}

.tour-block.regular {
  border-color: var(--green);
  background: #f0fdf4;
  border-style: dashed;
}

.tour-block.pause {
  border-color: #d97706;
  background: #fef3c7;
  border-style: dashed;
}

.tour-block.uebergabe {
  border-color: #0891b2;
  background: #ecfeff;
  border-style: solid;
  font-style: italic;
}

.tour-block.sammel {
  border-color: var(--blue);
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  border-width: 2px;
  border-style: solid;
  position: relative;
  transition: all 0.15s;
}
.tour-block.sammel:hover {
  background: linear-gradient(135deg, #bfdbfe 0%, #dbeafe 100%);
  transform: scale(1.01);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.block-title {
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--navy);
}

.block-detail {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.block-resize-handle {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 10px;
  background: rgba(0,0,0,0.2);
  cursor: ns-resize;
  border-radius: 0 0 2px 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  color: rgba(0,0,0,0.5);
  user-select: none;
}

.block-resize-handle:hover {
  background: rgba(0,0,0,0.4);
  color: rgba(0,0,0,0.8);
  height: 12px;
}

.block-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: rgba(255, 0, 0, 0.2);
  border: 1px solid rgba(255, 0, 0, 0.5);
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.75rem;
  color: #c00;
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.tour-block:hover .block-delete {
  display: flex;
}

.block-delete:hover {
  background: rgba(255, 0, 0, 0.4);
  border-color: #c00;
}
}

.editor-optimize {
  background: linear-gradient(135deg, var(--blue-bg) 0%, rgba(59, 130, 246, 0.05) 100%);
  padding: 20px 24px;
  border-top: 2px solid var(--border);
  text-align: center;
}

.editor-optimize .btn {
  font-size: 1rem;
  padding: 12px 24px;
}

.editor-footer {
  background: var(--bg);
  padding: 20px 24px;
  border-top: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-stats {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-actions {
  display: flex;
  gap: 8px;
}
</style>
