:root {
  --primary: #0d1d3b;
  --accent: #009cde;
  --bg-soft: #f4f6fb;
  --text-base: #0f172a;
  --target-band: rgba(13, 29, 59, 0.42);
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Google Sans', 'Manrope', 'Segoe UI', sans-serif;
  --card-shadow: 0 10px 30px rgba(13, 29, 59, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  font-family: var(--font-body);
  color: var(--text-base);
  background: var(--bg-soft);
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.bg-orb {
  pointer-events: none;
  position: absolute;
  border-radius: 999px;
  filter: blur(56px);
}

.bg-orb-a {
  top: -6rem;
  left: 2rem;
  width: 16rem;
  height: 16rem;
  background: rgba(0, 156, 222, 0.2);
}

.bg-orb-b {
  top: 5rem;
  right: -2rem;
  width: 20rem;
  height: 20rem;
  background: rgba(13, 29, 59, 0.1);
}

.bg-orb-c {
  bottom: -3rem;
  left: 30%;
  width: 18rem;
  height: 18rem;
  background: rgba(255, 255, 255, 0.85);
}

.app-card {
  border-radius: 1.5rem;
  background: #ffffff;
  border: 1px solid rgba(13, 29, 59, 0.08);
  box-shadow: var(--card-shadow);
}

.app-card h2,
.font-display {
  font-family: var(--font-display);
}

.app-header__logo {
  display: block;
  width: auto;
  height: 2.125rem;
  margin-bottom: 0.5rem;
}

.editor-shell {
  position: relative;
  height: 24rem;
  border-radius: 1rem;
  border: 1px solid rgba(13, 29, 59, 0.15);
  background: #ffffff;
  overflow: hidden;
}

.highlight-layer,
.draft-input {
  margin: 0;
  padding: 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
  font-family: var(--font-body);
  letter-spacing: 0.01em;
}

.highlight-layer {
  position: absolute;
  inset: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #1f2937;
  pointer-events: none;
}

.draft-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  resize: none;
  background: transparent;
  color: transparent;
  caret-color: var(--primary);
  outline: none;
  overflow: auto;
}

.draft-input::placeholder {
  color: #64748b;
}

.hl {
  border-radius: 0.35rem;
  padding: 0 0.07rem;
  position: relative;
  pointer-events: auto;
}

.hl-red {
  background: rgba(239, 68, 68, 0.24);
}

.hl-yellow {
  background: rgba(245, 158, 11, 0.22);
}

.hl-green {
  background: rgba(34, 197, 94, 0.2);
}

.hl-blue {
  background: transparent;
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-thickness: 2px;
  text-decoration-color: #2563eb;
}

.korrektorat-item {
  border: 1px solid #dbeafe;
  background: #eff6ff;
}

.highlight-layer {
  z-index: 1;
}

.draft-input {
  z-index: 2;
}

.editor-shell.has-analysis .highlight-layer {
  z-index: 3;
  pointer-events: auto;
}

.editor-shell.has-analysis .draft-input {
  pointer-events: none;
}

.readability-circle {
  --value: 0;
  --ring-color: #ef4444;
  width: min(240px, 60vw);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    conic-gradient(from 180deg, transparent 0 60%, var(--target-band) 60% 80%, transparent 80% 100%),
    conic-gradient(
      from 180deg,
      var(--ring-color) 0 calc(var(--value) * 1%),
      rgba(203, 213, 225, 0.48) calc(var(--value) * 1%) 100%
    ),
    radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.06), transparent 70%);
}

.readability-circle__inner {
  width: 74%;
  height: 74%;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #e2e8f0;
  display: grid;
  place-content: center;
  text-align: center;
}

.readability-circle__value {
  font-size: 2.5rem;
  line-height: 1;
  font-weight: 800;
  color: #0d1d3b;
}

.readability-circle__label {
  margin-top: 0.3rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.pillar-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  background: #f8fafc;
  overflow: hidden;
}

.pillar-item[open] {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.pillar-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.7rem 0.8rem;
}

.pillar-summary::-webkit-details-marker {
  display: none;
}

.pillar-summary__left {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.pillar-mini-ring {
  --value: 0;
  --ring-color: #ef4444;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: conic-gradient(
    from 180deg,
    var(--ring-color) 0 calc(var(--value) * 1%),
    rgba(203, 213, 225, 0.5) calc(var(--value) * 1%) 100%
  );
  flex-shrink: 0;
}

.pillar-mini-ring span {
  width: 74%;
  height: 74%;
  border-radius: 999px;
  background: #ffffff;
  display: grid;
  place-items: center;
  font-size: 0.64rem;
  font-weight: 700;
  color: #334155;
}

.pillar-summary__title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pillar-summary__chevron {
  color: #64748b;
  font-weight: 700;
  transition: transform 0.18s ease;
}

.pillar-item[open] .pillar-summary__chevron {
  transform: rotate(90deg);
}

.pillar-details {
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 0.65rem 0.8rem 0.7rem;
}

.pillar-details ul {
  margin: 0;
  padding-left: 1rem;
  color: #475569;
  font-size: 0.8rem;
  line-height: 1.45;
}

.pillar-details li + li {
  margin-top: 0.22rem;
}

.pillar-detail-list {
  list-style: none;
  padding-left: 0;
}

.pillar-detail-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #f8fafc;
  padding: 0.45rem 0.55rem;
}

.pillar-detail-item + .pillar-detail-item {
  margin-top: 0.4rem;
}

.pillar-detail-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.pillar-detail-item__name {
  font-size: 0.76rem;
  font-weight: 700;
  color: #1e293b;
}

.pillar-detail-item__score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.8rem;
  height: 1.2rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e3a8a;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0 0.4rem;
}

.pillar-detail-item__text {
  margin-top: 0.22rem;
  font-size: 0.74rem;
  line-height: 1.35;
  color: #475569;
}

.highlight-tooltip {
  position: fixed;
  z-index: 80;
  max-width: min(340px, calc(100vw - 24px));
  border-radius: 0.5rem;
  padding: 0.45rem 0.55rem;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.72rem;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.35);
  pointer-events: none;
}

.analysis-toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 250px;
  max-width: min(92vw, 360px);
  border: 1px solid rgba(13, 29, 59, 0.15);
  border-radius: 0.9rem;
  background: rgba(13, 29, 59, 0.95);
  color: #f8fafc;
  box-shadow: var(--card-shadow);
  padding: 0.75rem 0.9rem;
  text-align: left;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.analysis-toast:hover {
  transform: translateY(-1px);
}

.analysis-toast__indicator {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.analysis-toast.is-loading .analysis-toast__indicator {
  border: 2.5px solid rgba(148, 163, 184, 0.5);
  border-top-color: #009cde;
  animation: spin 0.9s linear infinite;
}

.analysis-toast.is-success {
  background: rgba(7, 89, 52, 0.95);
  border-color: rgba(34, 197, 94, 0.45);
  cursor: pointer;
}

.analysis-toast.is-success .analysis-toast__indicator {
  border: 2px solid rgba(110, 231, 183, 0.9);
}

.analysis-toast.is-success .analysis-toast__indicator::after {
  content: '✓';
  color: #6ee7b7;
  font-size: 0.82rem;
  font-weight: 800;
}

.analysis-toast.is-error {
  background: rgba(153, 27, 27, 0.95);
  border-color: rgba(248, 113, 113, 0.5);
}

.analysis-toast.is-error .analysis-toast__indicator {
  border: 2px solid rgba(254, 202, 202, 0.9);
}

.analysis-toast.is-error .analysis-toast__indicator::after {
  content: '!';
  color: #fecaca;
  font-size: 0.9rem;
  font-weight: 800;
}

.analysis-toast__content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.analysis-toast__title {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
}

.analysis-toast__text {
  margin-top: 0.1rem;
  font-size: 0.74rem;
  color: #dbeafe;
  line-height: 1.3;
}

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

@media (max-width: 640px) {
  .analysis-toast {
    right: 0.8rem;
    bottom: 0.8rem;
    left: 0.8rem;
    max-width: none;
  }
}

/* ── Login overlay ──────────────────────────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 29, 59, 0.55);
  backdrop-filter: blur(6px);
}

.login-overlay.hidden {
  display: none;
}

.login-card {
  width: 100%;
  max-width: 26rem;
  margin: 1rem;
  padding: 2rem;
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 20px 60px rgba(13, 29, 59, 0.2);
}

.login-card__logo {
  display: block;
  height: 1.75rem;
  width: auto;
  margin-bottom: 0.75rem;
}

.login-card__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.login-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
}

.login-input {
  display: block;
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.625rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}

.login-input:focus {
  border-color: var(--accent);
}

.login-btn-primary {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  border-radius: 0.75rem;
  background: var(--primary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 0;
  cursor: pointer;
  transition: filter 0.15s;
}

.login-btn-primary:hover {
  filter: brightness(1.15);
}

.login-btn-ms {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  background: #fff;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 0;
  cursor: pointer;
  transition: background 0.15s;
}

.login-btn-ms:hover {
  background: #f3f4f6;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.875rem 0;
  color: #9ca3af;
  font-size: 0.75rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.login-error {
  border-radius: 0.625rem;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

/* ── Provider toggle ────────────────────────────────────────────────────── */
.provider-toggle {
  display: flex;
  border-radius: 0.75rem;
  border: 1px solid #d1d5db;
  overflow: hidden;
  background: #fff;
}

.provider-btn {
  padding: 0.45rem 0.875rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.provider-btn.is-active {
  background: var(--primary);
  color: #fff;
}

.provider-btn:not(.is-active):hover {
  background: #f3f4f6;
}

/* ── History drawer ─────────────────────────────────────────────────────── */
.history-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  width: min(26rem, 100vw);
  background: #fff;
  border-left: 1px solid rgba(13, 29, 59, 0.1);
  box-shadow: -8px 0 32px rgba(13, 29, 59, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.history-drawer.is-open {
  transform: translateX(0);
}

.history-backdrop {
  position: fixed;
  inset: 0;
  z-index: 499;
  background: rgba(13, 29, 59, 0.35);
  backdrop-filter: blur(2px);
}

.history-backdrop.hidden {
  display: none;
}

.history-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.history-close-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: background 0.15s;
}

.history-close-btn:hover {
  background: #f3f4f6;
}

.history-tabs {
  display: flex;
  padding: 0.75rem 1.25rem 0;
  gap: 0.5rem;
  flex-shrink: 0;
}

.history-tab {
  padding: 0.375rem 0.875rem;
  border-radius: 0.625rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  color: #6b7280;
  background: transparent;
  transition: all 0.15s;
}

.history-tab.is-active {
  background: var(--primary);
  color: #fff;
}

.history-tab:not(.is-active):hover {
  background: #f3f4f6;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-empty {
  text-align: center;
  color: #9ca3af;
  font-size: 0.85rem;
  margin-top: 2rem;
}

.history-item {
  border: 1px solid rgba(13, 29, 59, 0.1);
  border-radius: 1rem;
  padding: 0.875rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.history-item:hover {
  border-color: var(--accent);
  background: #f0f9ff;
}

.history-item__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.history-item__name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  flex: 1;
  cursor: text;
  border-radius: 0.375rem;
  padding: 0.125rem 0.25rem;
  border: 1px solid transparent;
  transition: border-color 0.15s;
}

.history-item__name:hover {
  border-color: #d1d5db;
}

.history-item__name:focus {
  outline: none;
  border-color: var(--accent);
}

.history-item__actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.history-action-btn {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: all 0.15s;
}

.history-action-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.history-action-btn.is-share {
  font-size: 0.75rem;
}

.history-action-btn.is-share.is-shared {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #059669;
}

.history-item__meta {
  margin-top: 0.375rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: center;
}

.history-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.history-badge-primary {
  background: rgba(13, 29, 59, 0.08);
  color: var(--primary);
}

.history-badge-accent {
  background: rgba(0, 156, 222, 0.12);
  color: #0369a1;
}

.history-badge-date {
  color: #9ca3af;
  font-size: 0.7rem;
}

/* ── Document upload ────────────────────────────────────────────────────── */
.doc-drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  background: #fafafa;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}

.doc-drop-zone.is-dragover {
  border-color: var(--accent);
  background: #f0f9ff;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid rgba(13, 29, 59, 0.08);
  border-radius: 0.75rem;
  font-size: 0.8rem;
  background: #fafafa;
}

.doc-item__name {
  flex: 1;
  font-weight: 600;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-item__meta {
  color: #9ca3af;
  white-space: nowrap;
}

.doc-item__del {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #9ca3af;
  transition: all 0.15s;
}

.doc-item__del:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.doc-item__status {
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.doc-item__status.is-ingesting {
  background: #fef3c7;
  color: #92400e;
}

.doc-item__status.is-ready {
  background: #d1fae5;
  color: #065f46;
}

/* ── RAG toggle ─────────────────────────────────────────────────────────── */
.rag-toggle-track {
  position: relative;
  width: 2.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: #d1d5db;
  transition: background 0.2s;
}

.rag-toggle-track::after {
  content: '';
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.rag-toggle-track.is-on {
  background: var(--accent);
}

.rag-toggle-track.is-on::after {
  transform: translateX(1rem);
}

/* ── Collections / Wissensdatenbank ─────────────────────────────────────── */

.rag-topbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0 0.75rem;
  flex-wrap: wrap;
}

.coll-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.coll-card--uncategorized {
  background: #f8fafc;
  border-style: dashed;
}

.coll-card__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  user-select: none;
  min-height: 2.4rem;
}

.coll-card__header:hover {
  background: #f1f5f9;
}

.coll-card__name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e293b;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coll-card__name--muted {
  color: #64748b;
  font-weight: 500;
}

.coll-card__count {
  font-size: 0.7rem;
  color: #94a3b8;
  white-space: nowrap;
}

.coll-card__dot-plain {
  font-size: 0.85rem;
  flex-shrink: 0;
}

.coll-card__action {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  font-size: 0.7rem;
  color: #94a3b8;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.coll-card__action:hover {
  color: #475569;
  background: #e2e8f0;
}

.coll-card__action--del:hover {
  color: #ef4444;
  background: #fee2e2;
}

.coll-chevron {
  width: 0.875rem;
  height: 0.875rem;
  color: #94a3b8;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.coll-chevron--right {
  margin-left: auto;
}

.coll-toggle-btn {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid var(--coll-color, #6366f1);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
  padding: 0;
}

.coll-toggle-btn.is-on {
  background: var(--coll-color, #6366f1);
}

.coll-toggle-btn.is-partial {
  background: linear-gradient(135deg, var(--coll-color, #6366f1) 50%, transparent 50%);
}

.coll-card__body {
  border-top: 1px solid #e2e8f0;
  padding: 0.25rem 0;
}

.coll-card__empty {
  font-size: 0.75rem;
  color: #94a3b8;
  padding: 0.5rem 0.75rem;
}

/* ── Doc rows inside collection bodies ───────────────────────────────────── */
.doc-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-bottom: 1px solid #f1f5f9;
}

.doc-row:last-child {
  border-bottom: none;
}

.doc-row:hover {
  background: #f8fafc;
}

.doc-row__toggle {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 3px;
  border: 1.5px solid #cbd5e1;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s, border-color 0.15s;
}

.doc-row__toggle.is-on {
  background: #6366f1;
  border-color: #6366f1;
}

.doc-row__name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #334155;
  font-size: 0.78rem;
}

.doc-row__meta {
  font-size: 0.7rem;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
}

.doc-row__move {
  font-size: 0.7rem;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.1rem 0.25rem;
  color: #64748b;
  background: #fff;
  cursor: pointer;
  max-width: 8rem;
  flex-shrink: 0;
}

/* ── Collection inline form ──────────────────────────────────────────────── */
.coll-form {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.coll-form__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}

.coll-form__input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 0.82rem;
  color: #1e293b;
  background: #fff;
  outline: none;
  margin-bottom: 0.6rem;
  box-sizing: border-box;
}

.coll-form__input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.coll-form__colors {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.coll-form__swatch {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s, border-color 0.1s;
  flex-shrink: 0;
}

.coll-form__swatch:hover {
  transform: scale(1.2);
}

.coll-form__swatch.is-selected {
  border-color: #1e293b;
  transform: scale(1.1);
}

.coll-form__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* ── Upload section within Wissensdatenbank ──────────────────────────────── */
.rag-upload-header {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0.75rem 0 0.35rem;
}

/* ── Login info message (pending approval, etc.) ─────────────────────────── */
.login-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  color: #1d4ed8;
  font-size: 0.85rem;
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.5rem;
}

/* ── Admin modal ─────────────────────────────────────────────────────────── */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-modal.hidden { display: none; }

.admin-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.admin-modal__dialog {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  width: min(760px, 95vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.admin-modal__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
}

.admin-modal__close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: #64748b;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.15s;
}
.admin-modal__close:hover { background: #f1f5f9; }

.admin-user-list {
  overflow-y: auto;
  padding: 0.75rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-loading, .admin-error {
  text-align: center;
  padding: 2rem;
  color: #64748b;
  font-size: 0.9rem;
}
.admin-error { color: #dc2626; }

.admin-user-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  flex-wrap: wrap;
}

.admin-user-info {
  flex: 1;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.admin-user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1e293b;
}

.admin-user-email {
  font-size: 0.8rem;
  color: #475569;
}

.admin-user-meta {
  font-size: 0.75rem;
  color: #94a3b8;
}

.admin-user-badges {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.admin-status-badge, .admin-role-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
}

.status-approved { background: #dcfce7; color: #15803d; }
.status-pending  { background: #fef9c3; color: #92400e; }
.status-rejected { background: #fee2e2; color: #dc2626; }
.admin-role-badge { background: #fef3c7; color: #b45309; }

.admin-user-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.admin-action-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.admin-action-btn:hover { opacity: 0.8; }

.admin-action-btn.approve  { background: #dcfce7; color: #15803d; border-color: #86efac; }
.admin-action-btn.reject   { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
.admin-action-btn.promote  { background: #fef3c7; color: #b45309; border-color: #fcd34d; }
.admin-action-btn.demote   { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.admin-action-btn.delete   { background: #fff1f2; color: #be123c; border-color: #fda4af; }
