:root {
  --color-primary: #00374C;
  --color-primary-dark: #00232F;
  --color-accent: #A2BD1B;
  --color-bg: #F5F7FA;
  --color-text: #1A1A1A;
  --font-family: 'Arial', 'Segoe UI', sans-serif;

  --status-freigegeben: #2e7d32;
  --status-aenderungen: #c62828;
  --status-bearbeitung: #b8860b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
}

/* ---------- Topbar ---------- */
#topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: var(--color-primary-dark);
  color: white;
  flex-wrap: wrap;
}

#brand { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
#logo { height: 120px; width: auto; display: none; }
#logo[src]:not([src=""]) { display: inline-block; }

#navbar { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 240px; }
#navbar input { flex: 1; padding: 6px 10px; border-radius: 4px; border: none; font-size: 14px; }

#navbar button, #viewportSwitch button {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
#navbar button:hover, #viewportSwitch button:hover { background: var(--color-accent); color: #1a1a1a; }
#viewportSwitch { display: flex; gap: 4px; }
#viewportSwitch button.active { background: var(--color-accent); color: #1a1a1a; }

/* ---------- Status-Badges ---------- */
#statusBar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: white;
  border-bottom: 1px solid #e0e0e0;
  
}
#statusBadges { display: flex; gap: 6px; }
.status-badge {
  border: none;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0.55;
  color: white;
}
.status-badge.active { opacity: 1; box-shadow: 0 0 0 2px white inset; }
.status-badge[data-status="freigegeben"] { background: var(--status-freigegeben); }
.status-badge[data-status="aenderungen_gewuenscht"] { background: var(--status-aenderungen); }
.status-badge[data-status="in_bearbeitung"] { background: var(--status-bearbeitung); }

#statusNote {
  padding: 6px 16px;
  background: var(--color-accent);
  color: #1a1a1a;
  font-size: 18px;
  font-weight: 600;
  display: none;
  text-align:center;
}

/* ---------- Layout ---------- */
#main { display: flex; height: calc(100% - 52px - 41px); }
body.has-note #main { height: calc(100% - 52px - 41px - 32px); }

#frameWrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  background: #ddd;
  overflow: auto;
  padding: 12px;
}

#siteFrame {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
  box-shadow: 0 0 8px rgba(0,0,0,0.15);
  transition: width 0.2s ease;
}
#siteFrame.picking { outline: 3px solid #c62828; cursor: crosshair; }

/* ---------- Sidebar mit Tabs ---------- */
#sidebar {
  width: 460px;
  flex-shrink: 0;
  background: white;
  border-left: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#tabBar { display: flex; border-bottom: 1px solid #e0e0e0; }
.tab-btn {
  flex: 1;
  padding: 12px 8px;
  background: white;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  border-bottom: 3px solid transparent;
}
.tab-btn.active { color: var(--color-primary-dark); border-bottom-color: var(--color-accent); }

.tab-panel { display: none; flex-direction: column; gap: 10px; padding: 20px; overflow-y: auto; flex: 1; }
.tab-panel.active { display: flex; }

h2 { margin: 0 0 4px 0; font-size: 17px; color: var(--color-primary-dark); }
.hint { font-size: 14px; color: #666; margin: 0 0 6px 0; line-height: 1.4; }
label { font-size: 14px; font-weight: 600; margin-top: 6px; }

select, textarea, input[type="text"] {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
  font-size: 16px;
  resize: vertical;
  width: 100%;
}

.checkbox-label { display: flex; align-items: center; gap: 6px; font-weight: 400 !important; font-size: 13px; }

/* Ampel */
#ampelRow { display: flex; gap: 6px; }
.ampel-btn {
  flex: 1;
  border: 2px solid #ddd;
  background: white;
  border-radius: 6px;
  padding: 8px 4px;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
}
.ampel-btn .dot { font-size: 18px; display: block; }
.ampel-btn.selected { border-color: var(--color-primary); background: #eef3f5; font-weight: 700; }

#pickBtn {
  padding: 8px;
  border: 1px dashed var(--color-primary);
  background: white;
  color: var(--color-primary-dark);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
#pickBtn.active { background: #c62828; color: white; border-color: #c62828; }

.primary-btn {
  margin-top: 10px;
  padding: 10px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}
.primary-btn:hover { background: var(--color-primary-dark); }

.accent-btn {
  padding: 10px;
  background: var(--color-accent);
  color: #1a1a1a;
  border: none;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
}
.accent-btn:disabled { opacity: 0.4; cursor: default; }

.secondary-btn {
  padding: 10px;
  background: white;
  border: 1px solid var(--color-primary);
  color: var(--color-primary-dark);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.secondary-btn:disabled { opacity: 0.4; cursor: default; }

/* Listen (Feedback-Items) */
#listSection { margin-top: 16px; border-top: 1px solid #e0e0e0; padding-top: 12px; }
#listSection h3 { margin: 0 0 8px 0; font-size: 14px; }
#feedbackListEl, #taskListEl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.feedback-item, .task-item {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  position: relative;
  background: #fafbfc;
}
.feedback-item .meta { font-weight: 700; margin-bottom: 2px; }
.feedback-item .preview { color: #444; }
.feedback-item.sent { opacity: 0.55; }
.feedback-item .sent-tag { font-size: 10px; color: #999; font-weight: 400; }

.removeBtn {
  position: absolute;
  top: 4px;
  right: 6px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #999;
}
.removeBtn:hover { color: #b00020; }

.tag-red { color: #c62828; }
.tag-amber { color: #b8860b; }
.tag-green { color: #2e7d32; }

.empty-hint { font-size: 12px; color: #999; }

#listActions { display: flex; gap: 6px; margin-top: 12px; }
#listActions .accent-btn { flex: 1.4; }
#listActions .secondary-btn { flex: 1; }

#statusMsg { font-size: 13px; min-height: 18px; margin-top: 6px; }
#statusMsg.ok { color: #1a7a1a; }
#statusMsg.error { color: #b00020; }

/* ---------- Aufgabenliste ---------- */
.task-item { display: flex; align-items: flex-start; gap: 8px; padding-right: 24px; }
.task-item input[type="checkbox"] { margin-top: 2px; }
.task-item.done .task-title { text-decoration: line-through; color: #999; }
.task-owner-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  color: white;
  font-weight: 700;
  white-space: nowrap;
}
.task-owner-tag.kunde { background: var(--color-primary); }
.task-owner-tag.agentur { background: var(--color-accent); color: #1a1a1a; }

#addTaskRow { display: flex; gap: 6px; margin-top: 8px; }
#addTaskRow input { flex: 1; }
#addTaskRow select { width: auto; }

/* ---------- Datei-Upload ---------- */
#dropzone {
  border: 2px dashed var(--color-primary);
  border-radius: 8px;
  padding: 24px 12px;
  text-align: center;
  color: var(--color-primary-dark);
  font-size: 13px;
  cursor: pointer;
  background: #f0f4f6;
}
#dropzone.dragover { background: #dde9ec; border-color: var(--color-accent); }
#fileInput { display: none; }

#assetListEl { list-style: none; margin: 12px 0 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.asset-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  position: relative;
  background: #fafbfc;
}
.asset-item a { color: var(--color-primary); text-decoration: none; font-weight: 600; word-break: break-all; }
.asset-item a:hover { text-decoration: underline; }
.asset-item .filesize { color: #999; font-size: 11px; white-space: nowrap; }
