/* ============================================================
   Gemeinsame Gestaltung fuer den geschuetzten Bereich
   (passt zum Stil der oeffentlichen Startseite)
   ============================================================ */
:root {
  --bg: #0f172a;
  --bg-soft: #111c33;
  --surface: #ffffff;
  --text: #1e293b;
  --text-soft: #64748b;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --border: #e2e8f0;
  --danger: #dc2626;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: #f8fafc;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Topbar ===== */
.topbar {
  background: var(--bg);
  color: #fff;
  padding: 0 24px;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar .brand { font-weight: 700; }
.topbar a { color: #cbd5e1; font-weight: 500; }
.topbar a:hover { color: #fff; }

/* ===== Zentrierte Karte (Login / Setup) ===== */
.center {
  min-height: calc(100vh - 60px);
  display: flex; align-items: center; justify-content: center;
  padding: 32px 16px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  width: 100%; max-width: 400px;
  box-shadow: 0 10px 40px rgba(15,23,42,0.08);
}
.auth-card h1 { font-size: 1.4rem; margin-bottom: 6px; letter-spacing: -0.01em; }
.auth-card .sub { color: var(--text-soft); font-size: 0.95rem; margin-bottom: 24px; }

/* ===== Formulare ===== */
label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
input[type="email"], input[type="password"], textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  margin-bottom: 18px;
  background: #fff;
}
input:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; }
button {
  width: 100%;
  padding: 12px 16px;
  border: none; border-radius: 10px;
  background: var(--accent); color: #fff;
  font: inherit; font-weight: 600; cursor: pointer;
  transition: background 0.12s ease;
}
button:hover { background: #1d4ed8; }
button.inline { width: auto; padding: 8px 14px; font-size: 0.85rem; }
button.danger { background: var(--danger); }
button.danger:hover { background: #b91c1c; }

/* ===== Meldungen ===== */
.alert {
  padding: 12px 14px; border-radius: 10px; font-size: 0.92rem; margin-bottom: 18px;
}
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-ok { background: #dcfce7; color: #166534; }

/* ===== Dashboard ===== */
.container { max-width: 1040px; margin: 0 auto; padding: 40px 24px; }
.container h1 { font-size: 1.6rem; letter-spacing: -0.01em; margin-bottom: 4px; }
.container .sub { color: var(--text-soft); margin-bottom: 28px; }
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px; margin-bottom: 24px;
}
.panel h2 { font-size: 1.1rem; margin-bottom: 16px; }
.note {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 12px;
  display: flex; justify-content: space-between; gap: 14px; align-items: flex-start;
}
.note:last-child { margin-bottom: 0; }
.note .text { white-space: pre-wrap; word-break: break-word; }
.note .meta { color: var(--text-soft); font-size: 0.8rem; margin-top: 6px; }
.empty { color: var(--text-soft); font-style: italic; }
.note form { margin: 0; }
.note .actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-top: 10px; }

/* Sekundaerer Button (Bearbeiten) und Abbrechen-Link */
.btn-secondary {
  display: inline-block;
  padding: 8px 14px; border-radius: 10px;
  background: #e2e8f0; color: var(--text);
  font-size: 0.85rem; font-weight: 600; text-decoration: none;
}
.btn-secondary:hover { background: #cbd5e1; text-decoration: none; }
.btn-link { color: var(--text-soft); font-size: 0.85rem; font-weight: 600; align-self: center; }
.note textarea { margin-bottom: 10px; }

/* ===== Zwei-Spalten-Layout: Hauptbereich + rechte Navigation ===== */
.layout { display: flex; gap: 24px; align-items: flex-start; }
.main { flex: 1; min-width: 0; }
.notes-list { margin-top: 20px; }
.sidebar { width: 260px; flex-shrink: 0; position: sticky; top: 84px; }

.sidebar details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 12px; overflow: hidden;
}
.sidebar summary {
  cursor: pointer; padding: 14px 16px; font-weight: 600; font-size: 0.95rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.sidebar summary::-webkit-details-marker { display: none; }
.sidebar summary::after { content: '\25B8'; color: var(--text-soft); transition: transform 0.15s ease; }
.sidebar details[open] summary::after { transform: rotate(90deg); }
.sidebar .group-body { padding: 0 16px 12px; display: flex; flex-direction: column; gap: 6px; }
.sidebar .group-body a { color: var(--text-soft); font-size: 0.9rem; text-decoration: none; padding: 4px 0; }
.sidebar .group-body a:hover { color: var(--accent); text-decoration: none; }

/* ===== Claude-Kachel ===== */
.tile {
  display: flex; gap: 16px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: 14px; padding: 20px;
  background: #f8fafc;
}
.tile-icon {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.tile-body h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.tile-body p { color: var(--text-soft); font-size: 0.92rem; margin-bottom: 14px; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Hinweisbox ===== */
.hint {
  margin-top: 16px; background: #eff6ff; color: #1e40af;
  padding: 12px 14px; border-radius: 10px; font-size: 0.9rem; line-height: 1.5;
}

/* ===== Status und Ergebnis der Claude-Kachel ===== */
.status-line { margin-top: 14px; font-size: 0.9rem; min-height: 1.2em; }
.status-line.running { color: var(--accent); }
.status-line.ok { color: #166534; }
.status-line.err { color: var(--danger); }
.result-box {
  margin-top: 14px; background: #0f172a; color: #e2e8f0;
  border-radius: 12px; padding: 18px; font-size: 0.85rem; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word; max-height: 460px; overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Bereiche optisch abgrenzen */
.panel section, section.panel { scroll-margin-top: 84px; }
section.panel { scroll-margin-top: 84px; }

/* ===== Mobil: Navigation unter den Hauptbereich ===== */
@media (max-width: 840px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; position: static; }
}
