/* === Reset === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* === Hidden override === */
[hidden] {
  display: none !important;
}

/* === Body === */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #0f1117;
  color: #e0e0e6;
  min-height: 100vh;
}

/* === Login Screen === */
.login-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.login-box {
  text-align: center;
  width: 100%;
  max-width: 380px;
  padding: 2rem;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-error {
  color: #e5534b;
  font-size: 0.82rem;
  min-height: 1.2em;
}

/* === App Screen === */
.app-screen {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* === Sidebar === */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: #14151f;
  border-right: 1px solid #2a2b35;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1rem;
}

.btn-neue-analyse {
  width: 100%;
  margin-bottom: 1rem;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.session-item {
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  background: transparent;
  text-align: left;
  color: #b0b0b8;
  font-family: inherit;
  width: 100%;
}

.session-item:hover {
  background: #1a1b23;
}

.session-item.active {
  background: rgba(83, 74, 183, 0.15);
  border-left: 3px solid #534AB7;
  color: #fff;
}

.session-datum {
  font-size: 0.78rem;
  color: #888;
  margin-bottom: 0.2rem;
}

.session-summary {
  font-size: 0.82rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === Main Area === */
.main-area {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.main-header {
  margin-bottom: 1.5rem;
}

.main-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
}

/* === Inputs / Forms === */
.input, input[type="text"], input[type="password"], textarea, select {
  background: #1a1b23;
  border: 1px solid #2a2b35;
  color: #e0e0e6;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.input:focus, input[type="text"]:focus, input[type="password"]:focus, textarea:focus, select:focus {
  border-color: #534AB7;
}

select {
  cursor: pointer;
  appearance: auto;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* === Buttons === */
.btn {
  background: #534AB7;
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  font-family: inherit;
}

.btn:hover {
  background: #6358c4;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  border: 1px solid #2a2b35;
  color: #b0b0b8;
}

.btn-outline:hover {
  border-color: #534AB7;
  color: #fff;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-radius: 6px;
}

/* === Upload Zone === */
.upload-zone {
  margin-bottom: 1.5rem;
}

.dropzone {
  border: 2px dashed #2a2b35;
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.dropzone.drag-over {
  border-color: #534AB7;
  background: rgba(83, 74, 183, 0.08);
}

.dropzone-text {
  font-size: 0.9rem;
  color: #888;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  font-size: 0.85rem;
  color: #b0b0b8;
}

.file-name {
  color: #b0b0ff;
  font-weight: 500;
}

/* === Spinner === */
.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #2a2b35;
  border-top-color: #534AB7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner-text {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #888;
}

/* === Tabs === */
.tabs {
  display: flex;
  border-bottom: 1px solid #2a2b35;
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.65rem 1.2rem;
  font-size: 0.88rem;
  color: #888;
  cursor: pointer;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font-family: inherit;
  transition: color 0.2s, border-color 0.2s;
}

.tab:hover {
  color: #c0c0c8;
}

.tab.active {
  color: #fff;
  border-bottom-color: #534AB7;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* === Cards === */
.card {
  background: #1a1b23;
  border: 1px solid #2a2b35;
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 0.75rem;
}

/* === Task Cards === */
.task-card {
  background: #1a1b23;
  border: 1px solid #2a2b35;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.6rem;
  border-left: 4px solid #555;
  transition: opacity 0.3s, transform 0.3s;
}

.task-card.status-offen {
  border-left-color: #888;
}

.task-card.status-in_arbeit {
  border-left-color: #3b82f6;
}

.task-card.status-erledigt {
  border-left-color: #4ade80;
}

.task-card.status-wiedervorlage {
  border-left-color: #eab308;
}

.task-card.status-delegiert {
  border-left-color: #a78bfa;
}

.task-card.erledigt {
  opacity: 0.5;
  transform: scale(0.97);
}

.task-card.erledigt .task-actions {
  pointer-events: none;
  display: none;
}

/* Task Header */
.task-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.status-offen { background: #888; }
.status-dot.status-in_arbeit { background: #3b82f6; }
.status-dot.status-erledigt { background: #4ade80; }
.status-dot.status-wiedervorlage { background: #eab308; }
.status-dot.status-delegiert { background: #a78bfa; }

.task-seit {
  color: #888;
}

.task-created {
  margin-left: auto;
  color: #666;
  font-size: 0.75rem;
}

/* Task Body */
.task-body {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #e0e0e6;
  margin-bottom: 0.5rem;
}

/* Task Meta */
.task-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: #888;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.task-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.task-meta-label {
  color: #666;
}

/* Task Actions */
.task-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid #2a2b35;
}

.task-actions select {
  width: auto;
  padding: 0.3rem 0.5rem;
  font-size: 0.78rem;
  border-radius: 6px;
}

.task-actions .btn-sm {
  font-size: 0.75rem;
}

/* Delegate dropdown (inline) */
.delegate-dropdown {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.delegate-dropdown select {
  width: auto;
  padding: 0.3rem 0.5rem;
  font-size: 0.78rem;
}

/* === Task Comments === */
.task-comments {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid #1f2029;
}

.comment {
  padding: 0.4rem 0;
  font-size: 0.8rem;
  color: #b0b0b8;
  border-bottom: 1px solid #1f2029;
}

.comment:last-of-type {
  border-bottom: none;
}

.comment-time {
  font-size: 0.7rem;
  color: #666;
  margin-left: 0.5rem;
}

.comment-form {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.comment-form input {
  flex: 1;
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
}

.comment-form .btn-sm {
  white-space: nowrap;
}

/* === Neue Aufgabe Form === */
.neue-aufgabe-form {
  background: #14151f;
  border: 1px solid #2a2b35;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.25rem;
}

.neue-aufgabe-form h3 {
  font-size: 0.9rem;
  color: #fff;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.form-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.form-row .input, .form-row select {
  flex: 1;
  min-width: 140px;
}

.form-row .btn {
  flex-shrink: 0;
}

/* === Protocol Cards === */
.protocol-card {
  background: #1a1b23;
  border: 1px solid #2a2b35;
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 0.75rem;
}

.protocol-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.protocol-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.protocol-card-body {
  font-size: 0.85rem;
  color: #b0b0b8;
  line-height: 1.55;
  white-space: pre-wrap;
}

.todo-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #534AB7;
  flex-shrink: 0;
}

/* === Badges === */
.badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-wiedervorlage { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.badge-neu { background: rgba(83, 74, 183, 0.15); color: #8b83d6; }
.badge-bereich { background: rgba(255, 255, 255, 0.06); color: #888; font-size: 0.68rem; }

/* === Status Badges === */
.status-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.status-badge.status-offen { background: rgba(255,255,255,0.08); color: #b0b0b8; }
.status-badge.status-in_arbeit { background: rgba(59,130,246,0.15); color: #3b82f6; }
.status-badge.status-erledigt { background: rgba(74,222,128,0.15); color: #4ade80; }
.status-badge.status-wiedervorlage { background: rgba(234,179,8,0.15); color: #eab308; }
.status-badge.status-delegiert { background: rgba(167,139,250,0.15); color: #a78bfa; }

/* === Summary Box === */
.summary-box {
  background: #1a1b23;
  border: 1px solid #2a2b35;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #b0b0b8;
}

.summary-datum {
  font-size: 0.78rem;
  color: #666;
  margin-bottom: 0.3rem;
}

.summary-anwesend {
  font-size: 0.78rem;
  color: #666;
  margin-top: 0.5rem;
}

/* === Extra Sections (Unbekannte Personen, Offene Fragen) === */
.extra-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #2a2b35;
}

.extra-title {
  font-size: 0.85rem;
  color: #888;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.extra-list {
  list-style: none;
  padding: 0;
}

.extra-item {
  font-size: 0.82rem;
  color: #b0b0b8;
  padding: 0.3rem 0 0.3rem 1rem;
  position: relative;
}

.extra-item::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: #534AB7;
}

/* === Copy Bar === */
.copy-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #2a2b35;
}

.copy-feedback {
  font-size: 0.82rem;
  color: #4ade80;
  opacity: 0;
  transition: opacity 0.3s;
}

.copy-feedback.visible {
  opacity: 1;
}

/* === Skeleton Tab === */
.skelett-section {
  margin-bottom: 1.5rem;
}

.skelett-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.75rem;
}

.skelett-card {
  background: #1a1b23;
  border: 1px solid #2a2b35;
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.skelett-card.removed {
  text-decoration: line-through;
  opacity: 0.4;
}

.skelett-card-content {
  flex: 1;
}

.skelett-card-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: #e0e0e6;
  margin-bottom: 0.25rem;
}

.skelett-card-text {
  font-size: 0.8rem;
  color: #888;
  line-height: 1.4;
}

.skelett-card-person {
  font-size: 0.75rem;
  color: #a78bfa;
  margin-top: 0.2rem;
}

.skelett-remove-btn {
  background: transparent;
  border: 1px solid #2a2b35;
  color: #888;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.72rem;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
}

.skelett-remove-btn:hover {
  border-color: #e5534b;
  color: #e5534b;
}

.skelett-add-form {
  background: #14151f;
  border: 1px solid #2a2b35;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
}

.skelett-add-form h3 {
  font-size: 0.9rem;
  color: #fff;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

/* === Results Area === */
.results-area {
  flex: 1;
}

/* === Responsive === */
@media (max-width: 768px) {
  .app-screen {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid #2a2b35;
  }

  .main-area {
    padding: 1rem;
  }

  .form-row {
    flex-direction: column;
  }

  .task-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}
