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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f1117;
  color: #e1e4e8;
  min-height: 100vh;
}

/* Login */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #0f1117;
}

.login-box {
  background: #1c1f26;
  border: 1px solid #2d3139;
  border-radius: 12px;
  padding: 48px;
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.login-box h1 {
  font-size: 24px;
  margin-bottom: 8px;
  color: #f0f0f0;
}

.login-box p {
  color: #8b949e;
  margin-bottom: 24px;
}

.login-box form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-box input {
  padding: 12px 16px;
  border: 1px solid #2d3139;
  border-radius: 8px;
  background: #0f1117;
  color: #e1e4e8;
  font-size: 16px;
  outline: none;
}

.login-box input:focus {
  border-color: #58a6ff;
}

.login-box button {
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: #238636;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  font-weight: 600;
}

.login-box button:hover {
  background: #2ea043;
}

.error {
  color: #f85149;
  margin-top: 12px;
  font-size: 14px;
}

.success-msg {
  color: #3fb950;
  margin-top: 12px;
  font-size: 14px;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #161b22;
  border-bottom: 1px solid #21262d;
}

header h1 {
  font-size: 20px;
  font-weight: 600;
}

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

/* Buttons */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary {
  background: #238636;
  color: #fff;
}

.btn-primary:hover {
  background: #2ea043;
}

.btn-primary:disabled {
  background: #1a5c2a;
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-secondary {
  background: #1f6feb;
  color: #fff;
}

.btn-secondary:hover {
  background: #388bfd;
}

.btn-secondary:disabled {
  background: #163d6f;
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-ghost {
  background: transparent;
  color: #8b949e;
  border: 1px solid #30363d;
}

.btn-ghost:hover {
  color: #e1e4e8;
  border-color: #8b949e;
}

.btn-danger {
  background: transparent;
  color: #f85149;
  border: none;
  padding: 4px 8px;
  font-size: 12px;
}

.btn-danger:hover {
  background: rgba(248, 81, 73, 0.1);
}

.btn-download {
  background: transparent;
  color: #58a6ff;
  border: none;
  padding: 4px 8px;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

.btn-download:hover {
  text-decoration: underline;
}

/* Usage Limits Widget */
.usage-limits {
  margin: 16px 24px 0;
  padding: 14px 20px;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
}

.usage-limits-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.usage-limits-title {
  font-size: 13px;
  font-weight: 600;
  color: #c9d1d9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.usage-limits-link {
  font-size: 11px;
  color: #58a6ff;
  text-decoration: none;
}

.usage-limits-link:hover {
  text-decoration: underline;
}

.usage-limits-items {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.usage-limit-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.usage-limit-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.usage-limit-name {
  font-size: 12px;
  font-weight: 500;
  color: #e1e4e8;
}

.usage-limit-reset {
  font-size: 11px;
  color: #8b949e;
}

.usage-limit-bar-wrap {
  width: 100%;
  height: 6px;
  background: #21262d;
  border-radius: 3px;
  overflow: hidden;
}

.usage-limit-bar {
  height: 100%;
  border-radius: 3px;
  background: #da3633;
  transition: width 0.5s ease, background 0.3s ease;
}

.usage-limit-bar.bar-low {
  background: #3fb950;
}

.usage-limit-bar.bar-mid {
  background: #d29922;
}

.usage-limit-bar.bar-high {
  background: #da3633;
}

.usage-limit-bar.bar-weekly {
  background: #1f6feb;
}

.usage-limit-bar.bar-sonnet {
  background: #8b5cf6;
}

.usage-limit-percent {
  font-size: 11px;
  font-weight: 600;
  color: #8b949e;
}

@media (max-width: 768px) {
  .usage-limits-items {
    grid-template-columns: 1fr;
  }
}

/* Board */
.board {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 16px;
  padding: 24px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.column {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

.column h2 {
  padding: 16px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8b949e;
  border-bottom: 1px solid #21262d;
  display: flex;
  align-items: center;
  gap: 8px;
}

.count {
  background: #30363d;
  color: #8b949e;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}

.task-list {
  padding: 8px;
  flex: 1;
  overflow-y: auto;
  min-height: 100px;
}

.task-list.drag-over {
  background: rgba(56, 139, 253, 0.05);
  border-radius: 0 0 8px 8px;
}

.column-warte {
  border-color: #d29922;
}

.column-warte h2 {
  color: #d29922;
}

/* Task Cards */
.task-card {
  background: #1c1f26;
  border: 1px solid #2d3139;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: border-color 0.15s, transform 0.1s;
}

.task-card:hover {
  border-color: #58a6ff;
}

.task-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.task-card h3 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  color: #f0f0f0;
}

.task-card p {
  font-size: 12px;
  color: #8b949e;
  line-height: 1.4;
  margin-bottom: 8px;
}

.task-card .task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #484f58;
}

.task-card .task-actions {
  display: flex;
  gap: 4px;
}

/* Task Output (aufklappbar in erledigten Karten) */
.task-card.has-output {
  cursor: pointer;
}

.task-card.has-output h3::after {
  content: ' \25BC';
  font-size: 10px;
  color: #484f58;
}

.task-card.has-output.expanded h3::after {
  content: ' \25B2';
}

.task-output {
  display: none;
  margin-top: 10px;
  padding: 12px;
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: #c9d1d9;
  max-height: 400px;
  overflow-y: auto;
  word-wrap: break-word;
}

.task-output.visible {
  display: block;
}

.task-output h1,
.task-output h2,
.task-output h3 {
  color: #f0f0f0;
  margin: 12px 0 6px;
  font-size: 15px;
}

.task-output h1 { font-size: 17px; }
.task-output h2 { font-size: 15px; }
.task-output h3 { font-size: 14px; }

.task-output p {
  color: #c9d1d9;
  font-size: 13px;
  margin-bottom: 8px;
}

.task-output pre {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 4px;
  padding: 10px;
  overflow-x: auto;
  margin: 8px 0;
  font-size: 12px;
}

.task-output code {
  background: #161b22;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.task-output pre code {
  background: none;
  padding: 0;
}

.task-output ul, .task-output ol {
  padding-left: 20px;
  margin-bottom: 8px;
}

.task-output li {
  font-size: 13px;
  margin-bottom: 4px;
}

.output-loading {
  color: #8b949e;
  font-style: italic;
  padding: 8px;
}

/* Status Bar */
footer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 24px;
  background: #161b22;
  border-top: 1px solid #21262d;
  font-size: 13px;
  color: #8b949e;
  min-height: 40px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #484f58;
  margin-top: 4px;
  flex-shrink: 0;
}

.status-indicator.active {
  background: #3fb950;
  animation: pulse 2s infinite;
}

.status-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

#status-text {
  font-weight: 500;
  color: #c9d1d9;
}

.status-detail {
  font-size: 12px;
  color: #6e7681;
  white-space: pre-wrap;
  max-height: 60px;
  overflow: hidden;
}

.status-timer {
  font-size: 12px;
  color: #6e7681;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

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

.modal {
  background: #1c1f26;
  border: 1px solid #30363d;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #21262d;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #f0f0f0;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #8b949e;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #f0f0f0;
}

.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.modal-body label {
  font-size: 13px;
  font-weight: 500;
  color: #8b949e;
  margin-top: 4px;
}

.modal-body input,
.modal-body textarea {
  padding: 10px 14px;
  border: 1px solid #30363d;
  border-radius: 6px;
  background: #0d1117;
  color: #e1e4e8;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: vertical;
}

.modal-body input:focus,
.modal-body textarea:focus {
  border-color: #58a6ff;
}

.modal-body textarea {
  min-height: 200px;
  line-height: 1.5;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid #21262d;
}

/* Warte auf Antwort - Claude Question */
.claude-question {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid #d29922;
  border-left: 3px solid #d29922;
  border-radius: 4px;
  background: rgba(210, 153, 34, 0.08);
}

.claude-question-label {
  font-size: 11px;
  font-weight: 600;
  color: #d29922;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.claude-question-text {
  font-size: 13px;
  color: #e1e4e8;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Answer Form */
.answer-form {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.answer-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #30363d;
  border-radius: 6px;
  background: #0d1117;
  color: #e1e4e8;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  min-height: 60px;
}

.answer-textarea:focus {
  border-color: #d29922;
}

.answer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-continue {
  background: #d29922;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-continue:hover {
  background: #e0a82e;
}

.btn-continue:disabled {
  background: #8a6615;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Conversation Overlay */
.conversation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.conversation-modal {
  background: #1c1f26;
  border: 1px solid #30363d;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.conversation-body {
  padding: 16px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.conversation-exchange {
  border: 1px solid #21262d;
  border-radius: 6px;
  padding: 12px;
  background: #161b22;
}

.conversation-question {
  margin-bottom: 8px;
  font-size: 13px;
  color: #e1e4e8;
  line-height: 1.5;
}

.conversation-question strong {
  color: #d29922;
}

.conversation-answer {
  font-size: 13px;
  color: #c9d1d9;
  line-height: 1.5;
  padding-top: 8px;
  border-top: 1px solid #21262d;
}

.conversation-answer strong {
  color: #3fb950;
}

.conversation-pending {
  font-size: 12px;
  color: #8b949e;
  font-style: italic;
  padding-top: 8px;
  border-top: 1px solid #21262d;
}

/* Responsive */
@media (max-width: 768px) {
  .board {
    grid-template-columns: 1fr;
  }

  header {
    flex-direction: column;
    gap: 12px;
  }

  .modal {
    width: 95%;
    max-height: 95vh;
  }
}
