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

:root {
  --primary:     #3e3f58;
  --primary-h:   #52547a;
  --bg:          #ffffff;
  --surface:     #f5f5f7;
  --surface2:    #ebebee;
  --border:      #e0e0e6;
  --text:        #1a1a2e;
  --text-dim:    #6b6b80;
  --green:       #2d9c6e;
  --red:         #d94f4f;
  --radius:      14px;
  --header-h:    60px;
  --footer-h:    44px;
  --site-panel-w: 260px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Header ───────────────────────────────────────────── */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--header-h);
  background: var(--primary);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
}

.header-logo {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
}
.header-logo svg { height: 28px; width: auto; fill: #ffffff; }
.header-title {
  font-size: 17px; font-weight: 600; color: #ffffff;
  letter-spacing: -0.2px; white-space: nowrap;
}

.header-spacer { flex: 1; }

.header-right {
  display: flex; align-items: center; gap: 12px;
}

.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255,255,255,0.35); flex-shrink: 0;
  transition: background .3s;
}
.status-dot.ok  { background: #5effa0; }
.status-dot.err { background: #ff6b6b; }

.nav-btn {
  background: none; border: none;
  color: rgba(255,255,255,0.75);
  font-family: inherit; font-size: 13px;
  cursor: pointer; padding: 4px 8px;
  border-radius: 6px; transition: all .15s;
}
.nav-btn:hover { color: #fff; background: rgba(255,255,255,0.12); }

.header-user-name {
  color: rgba(255,255,255,0.9); font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 200px;
}
.nav-btn-logout { opacity: 0.75; }
.nav-btn-logout:hover { opacity: 1; }

/* ── Shared shell layout ──────────────────────────────── */
/* <main> fills the space between fixed header and fixed footer */
main#main {
  position: fixed;
  top: var(--header-h); bottom: var(--footer-h);
  left: 0; right: 0;
  overflow: hidden; /* each view scrolls internally */
}

/* Views: only the active one is shown */
.view { display: none; height: 100%; }
.view.active { display: flex; flex-direction: column; }

/* ── Chat view ────────────────────────────────────────── */
#app {
  /* Row layout: site-panel + chat-area */
  flex-direction: row !important;
}

/* ── Site panel ───────────────────────────────────────── */
#site-panel {
  width: var(--site-panel-w);
  min-width: 180px; max-width: 600px;
  flex-shrink: 0;
  display: flex; flex-direction: column;
  border-right: 1.5px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  position: relative;
  transition: width .22s ease, border-color .22s ease;
}
#site-panel.hidden {
  width: 0; min-width: 0; border-right-color: transparent;
}
#site-panel.resizing {
  transition: none;
}

/* Drag-to-resize handle on the right edge */
#site-panel-resize-handle {
  position: absolute; top: 0; right: 0;
  width: 5px; height: 100%;
  cursor: col-resize;
  z-index: 10;
}
#site-panel-resize-handle:hover,
#site-panel-resize-handle.active {
  background: var(--primary);
  opacity: .35;
}

.site-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.site-panel-title {
  font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-dim);
  white-space: nowrap;
}
/* Collapse button (‹) inside panel header */
.site-panel-toggle {
  background: none; border: none; color: var(--text-dim);
  font-size: 16px; line-height: 1; cursor: pointer;
  padding: 2px 4px; border-radius: 4px;
  transition: color .12s, background .12s;
}
.site-panel-toggle:hover { color: var(--text); background: var(--surface2); }

/* Persistent sidebar toggle tab — always visible on the left edge of chat-area */
.site-panel-expand-tab {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 16px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1.5px solid var(--border);
  border-left: none; border-radius: 0 6px 6px 0;
  color: var(--text-dim); font-size: 13px; cursor: pointer;
  transition: color .12s, background .12s;
  z-index: 5;
}
.site-panel-expand-tab:hover { color: var(--primary); background: var(--surface2); }

#site-tree {
  flex: 1; overflow-y: auto; padding: 6px 0;
}

/* Tree nodes */
.tree-site {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text);
  transition: background .12s;
}
.tree-site:hover { background: var(--surface2); }
.tree-site.active { background: rgba(62,63,88,.1); color: var(--primary); }
.tree-site-icon { font-size: 15px; flex-shrink: 0; }
.tree-site-body { flex: 1; min-width: 0; }
.tree-site-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-site-meta { font-size: 10px; color: var(--text-dim); font-family: monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-site-chevron {
  color: var(--text-dim); font-size: 13px; flex-shrink: 0;
  transition: transform .2s ease;
  cursor: pointer; padding: 2px 4px; margin: -2px -4px; border-radius: 4px;
}
.tree-site-chevron:hover { color: var(--text); background: var(--surface2); }
.tree-site.open > .tree-site-chevron { transform: rotate(90deg); }

/* Smooth slide-down animation via max-height + opacity */
.tree-children {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .22s ease, opacity .18s ease;
}
.tree-children.open {
  max-height: 2000px;
  opacity: 1;
}

.tree-node {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  font-size: 12px; color: var(--text);
  cursor: pointer; border-radius: 6px;
  margin: 1px 6px;
  transition: background .12s;
}
.tree-node:hover { background: var(--surface2); }
.tree-node.active { background: rgba(62,63,88,.12); font-weight: 600; }
.tree-node.inaccessible { opacity: .45; cursor: default; }
.tree-node-icon { font-size: 13px; flex-shrink: 0; }
.tree-node-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-node-lock { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.tree-node-chevron {
  font-size: 11px; color: var(--text-dim); flex-shrink: 0;
  transition: transform .2s ease;
  cursor: pointer; padding: 2px 3px; margin: -2px -3px; border-radius: 3px;
}
.tree-node-chevron:hover { color: var(--text); background: var(--surface2); }
.tree-node.open > .tree-node-chevron { transform: rotate(90deg); }
.tree-node-loading { padding: 4px 14px; font-size: 11px; color: var(--text-dim); font-style: italic; }

.tree-actions {
  display: flex; align-items: center; gap: 2px; flex-shrink: 0;
  opacity: 0; transition: opacity .15s;
}
.tree-node:hover .tree-actions,
.tree-node.active .tree-actions { opacity: 1; }
.tree-icon-btn {
  font-size: 14px; line-height: 1;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 6px;
  background: none; cursor: pointer;
  transition: background .12s, border-color .12s;
  position: relative;
}
.tree-icon-btn:hover {
  background: rgba(62,63,88,.10);
  border-color: var(--border);
}
/* Native tooltip via title — browsers render it automatically */

/* ── Chat area (wraps messages + input) ──────────────────── */
#chat-area {
  flex: 1;
  position: relative;
  display: flex; flex-direction: column;
  min-width: 0; overflow: hidden;
}

/* ── Messages ─────────────────────────────────────────── */
#messages {
  flex: 1;
  overflow-y: auto;
  padding: 32px 0 16px;
  scroll-behavior: smooth;
}

/* Empty state */
#empty-state {
  min-height: 30vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; padding: 32px 24px 24px;
}
.empty-logo svg { height: 36px; width: auto; fill: var(--primary); }
#empty-state h2 {
  font-size: 17px; font-weight: 600;
  color: var(--primary); margin-top: 2px;
}
#empty-state > p {
  font-size: 13px; color: var(--text-dim);
  text-align: center; max-width: 380px;
}

/* (sites-section moved to #site-panel — see panel styles above) */

/* Action cards — replace old suggestion chips */
.action-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-top: 16px;
  max-width: 620px; width: 100%;
}
@media (max-width: 560px) {
  .action-cards { grid-template-columns: 1fr; max-width: 340px; }
}
.action-card {
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer; text-align: left;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s, transform .1s;
  display: flex; flex-direction: column; gap: 3px;
}
.action-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(62,63,88,.1);
  transform: translateY(-1px);
}
.action-card-icon { font-size: 18px; line-height: 1; margin-bottom: 2px; }
.action-card-title {
  font-size: 13px; font-weight: 600; color: var(--text);
}
.action-card-desc {
  font-size: 11px; color: var(--text-dim); line-height: 1.4;
}

/* Message rows */
.msg-row {
  display: flex; padding: 5px 24px;
  max-width: 820px; margin: 0 auto; width: 100%;
}
.msg-row.user { justify-content: flex-end; }
.msg-row.ai   { justify-content: flex-start; flex-direction: column; }

/* User bubble */
.user .bubble {
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 18px 18px 4px 18px;
  max-width: 72%;
  font-size: 14px;
  line-height: 1.55;
}

/* AI response — no bubble */
.ai-content {
  max-width: 100%;
  font-size: 14px; line-height: 1.7;
  color: var(--text); padding: 4px 0;
}
.ai-content p { margin-bottom: 8px; }
.ai-content p:last-child { margin-bottom: 0; }
.ai-content ul, .ai-content ol { padding-left: 20px; margin-bottom: 8px; }
.ai-content li { margin-bottom: 3px; }
.ai-content strong { font-weight: 600; color: var(--primary); }
.ai-content h1, .ai-content h2, .ai-content h3 {
  font-weight: 600; color: var(--primary); margin: 12px 0 6px;
}
.ai-content code {
  background: var(--surface); padding: 1px 5px;
  border-radius: 4px; font-size: 12px; font-family: monospace;
}
.ai-content pre {
  background: var(--surface); padding: 12px;
  border-radius: 8px; overflow-x: auto; margin-bottom: 8px;
}
.ai-content pre code { background: none; padding: 0; }
.ai-content blockquote {
  border-left: 3px solid var(--primary);
  padding-left: 12px; color: var(--text-dim); margin-bottom: 8px;
}

/* Source chips */
.source-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 10px;
}
.source-chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px; color: var(--text-dim);
  cursor: pointer; transition: all .15s;
  max-width: 240px;
}
.source-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(62,63,88,.06);
}
.source-chip .chip-score {
  font-weight: 600; color: var(--green); flex-shrink: 0;
}
.source-chip .chip-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.source-chip .tooltip {
  display: none;
  position: absolute; bottom: calc(100% + 8px); left: 0;
  background: var(--primary); color: #fff;
  padding: 8px 12px; border-radius: 8px;
  font-size: 12px; line-height: 1.5;
  width: 280px; z-index: 200;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.source-chip .tooltip::after {
  content: '';
  position: absolute; top: 100%; left: 16px;
  border: 6px solid transparent;
  border-top-color: var(--primary);
}
.source-chip:hover .tooltip { display: block; }

/* ── Result cards (replaces source chips) ─────────────── */
.result-header {
  font-size: 13px; color: var(--text-dim);
  padding: 2px 0 4px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.result-chat-btn {
  padding: 3px 10px; border-radius: 6px; font-family: inherit;
  font-size: 11px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
  border: 1px solid var(--primary); background: none; color: var(--primary);
  transition: all .13s;
}
.result-chat-btn:hover { background: var(--primary); color: #fff; }
.result-header .result-count {
  font-size: 15px; font-weight: 700; color: var(--primary);
}
.result-empty {
  font-size: 13px; color: var(--text-dim); padding: 4px 0;
}

.result-list {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}
.result-list-sources {
  margin-top: 8px;
}
.result-list-label {
  font-size: 10px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-dim);
  padding: 8px 14px 6px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.result-list-label {
  display: flex; align-items: center; justify-content: space-between;
}
.result-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.result-card:last-child { border-bottom: none; }
.result-card-clickable { cursor: pointer; }
.result-card-clickable:hover { background: rgba(62,63,88,.04); }
.result-card-selected { background: rgba(62,63,88,.07) !important; }
.result-chk {
  width: 15px; height: 15px; flex-shrink: 0; margin-top: 3px;
  accent-color: var(--primary); cursor: pointer;
}
.result-chat-sel-btn {
  padding: 2px 9px; border-radius: 6px; font-family: inherit;
  font-size: 11px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
  border: 1px solid var(--primary); background: none; color: var(--primary);
  transition: all .13s;
}
.result-chat-sel-btn:hover { background: var(--primary); color: #fff; }
.ctx-mode-pill {
  display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px;
  font-weight: 600; background: rgba(62,63,88,.1); color: var(--primary);
  margin-right: 6px;
}

.result-icon {
  font-size: 18px; line-height: 1; flex-shrink: 0;
  margin-top: 1px;
}
.result-body {
  flex: 1; min-width: 0;
}
.result-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result-path {
  font-size: 11px; color: var(--text-dim); font-family: monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.result-excerpt {
  font-size: 12px; color: var(--text-dim); line-height: 1.5;
  margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.result-right {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 5px; flex-shrink: 0;
}
.result-score {
  font-size: 12px; font-weight: 700; color: var(--green);
  white-space: nowrap;
}
.result-btn-open, .result-btn-similar {
  padding: 3px 9px;
  border-radius: 6px; font-family: inherit; font-size: 11px;
  cursor: pointer; transition: all .13s; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-dim);
}
.result-btn-open:hover {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.result-btn-similar:hover {
  background: var(--surface2); color: var(--text); border-color: var(--text-dim);
}
.result-btn-chat {
  padding: 3px 7px;
  border-radius: 6px; font-family: inherit; font-size: 11px;
  cursor: pointer; transition: all .13s; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--primary);
}
.result-btn-chat:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Thinking indicator */
.thinking {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; color: var(--text-dim); font-size: 13px;
}
.thinking-dots { display: flex; gap: 4px; }
.thinking-dots span {
  width: 6px; height: 6px;
  background: var(--primary); border-radius: 50%; opacity: .4;
  animation: pulse .9s infinite;
}
.thinking-dots span:nth-child(2) { animation-delay: .2s; }
.thinking-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes pulse {
  0%,60%,100% { opacity:.4; transform:scale(1); }
  30% { opacity:1; transform:scale(1.2); }
}

.error-msg { color: var(--red); font-size: 13px; }

/* ── Input area ───────────────────────────────────────── */
#input-area-wrap {
  position: relative;
  background: linear-gradient(transparent, var(--bg) 40%);
  padding: 16px 24px 12px;
  display: flex; justify-content: center;
  flex-shrink: 0;
}
#input-area {
  width: 100%; max-width: 820px;
}

/* mode-row and folder-picker removed (context-driven UI) */
#mode-row { display: none; }
#folder-picker { display: none; }
#folder-search {
  width: 100%; padding: 7px 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 13px;
  transition: border-color .15s;
}
#folder-search:focus { outline: none; border-color: var(--primary); }
#folder-results {
  display: none;
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.1);
  z-index: 100; max-height: 240px; overflow-y: auto;
}
.folder-result {
  padding: 9px 12px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.folder-result:last-child { border-bottom: none; }
.folder-result:hover { background: var(--surface); }
.folder-result-name {
  font-size: 13px; font-weight: 600; color: var(--text); display: block;
}
.folder-result-path {
  font-size: 11px; color: var(--text-dim); font-family: monospace;
  display: block; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.folder-selected-badge {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: rgba(62,63,88,.07); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px;
  font-size: 13px; margin-bottom: 8px;
}
.folder-sel-path {
  font-size: 11px; color: var(--text-dim); font-family: monospace;
}
.folder-sel-clear {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 16px; line-height: 1; padding: 0;
}
.folder-sel-clear:hover { color: var(--red); }

/* ── Context bar (always shown when context exists) ─────── */
@keyframes ctx-pop {
  0%   { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}
#chat-context-bar {
  display: none;
  align-items: center; gap: 8px;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: rgba(62,63,88,.07); border: 1px solid rgba(62,63,88,.2);
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  transition: background .2s, border-color .2s;
}
#chat-context-bar.ctx-visible {
  animation: ctx-pop 0.2s ease;
}
#chat-context-bar.ctx-bar-highlight {
  background: rgba(62,63,88,.14) !important;
  border-left-color: var(--primary) !important;
  border-color: rgba(62,63,88,.35) !important;
}
.ctx-content {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
}
#chat-context-label {
  font-size: 13px; font-weight: 600; color: var(--primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#chat-context-sub {
  font-size: 11px; color: var(--text-dim);
}
#ctx-action-area {
  display: flex; align-items: center; gap: 5px; flex-shrink: 0;
}
.ctx-action-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; font-family: inherit; font-size: 12px;
  border: 1.5px solid var(--border); border-radius: 7px;
  background: var(--bg); color: var(--text); cursor: pointer;
  white-space: nowrap; transition: border-color .12s, color .12s, background .12s;
}
.ctx-action-btn:hover {
  border-color: var(--primary); color: var(--primary);
  background: rgba(62,63,88,.05);
}
.folder-overview-actions {
  display: flex; gap: 6px; padding: 6px 0 2px; flex-wrap: wrap;
}
.folder-overview-actions .ctx-action-btn { opacity: 0.8; }
.folder-overview-actions .ctx-action-btn:hover { opacity: 1; }
.folder-overview-actions .ctx-action-btn:disabled { opacity: 0.45; cursor: wait; }
.ctx-clear {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 18px; line-height: 1; padding: 0 2px;
  flex-shrink: 0;
}
.ctx-clear:hover { color: var(--red); }

/* Empty state hint */
.empty-hint {
  font-size: 12px; color: var(--text-dim);
  text-align: center; margin-top: 4px;
}

#new-chat-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-dim); cursor: pointer; font-size: 12px;
  padding: 4px 10px; white-space: nowrap; flex-shrink: 0; transition: all .15s;
}
#new-chat-btn:hover { background: var(--surface2); color: var(--text); border-color: var(--text-dim); }

#input-wrap {
  display: flex; gap: 8px; align-items: flex-end;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px; padding: 10px 10px 10px 16px;
  transition: border-color .15s;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
#input-wrap:focus-within { border-color: var(--primary); }
#query-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 14px; font-family: inherit;
  resize: none; max-height: 140px; line-height: 1.5;
}
#query-input::placeholder { color: var(--text-dim); }

.input-actions { display: flex; gap: 6px; align-items: flex-end; }


#send-btn {
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: var(--primary);
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; flex-shrink: 0;
}
#send-btn:hover { background: var(--primary-h); }
#send-btn:disabled { background: var(--border); cursor: not-allowed; }
#send-btn svg { width: 15px; height: 15px; }

#input-hint {
  font-size: 11px; color: var(--text-dim);
  margin-top: 6px; text-align: center;
}
.input-context {
  font-size: 11px; color: var(--text-dim);
  text-align: center; margin-top: 4px;
  min-height: 16px; opacity: .8;
}

/* ── Footer ───────────────────────────────────────────── */
footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--footer-h);
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  gap: 16px;
}
.footer-link {
  color: rgba(255,255,255,0.65);
  font-size: 12px; text-decoration: none;
  cursor: pointer; background: none; border: none;
  font-family: inherit; transition: color .15s;
}
.footer-link:hover { color: #fff; }
.footer-sep { color: rgba(255,255,255,0.3); font-size: 11px; }

/* ── Overlays / Modals ────────────────────────────────── */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(20,20,40,.5);
  z-index: 200; align-items: center; justify-content: center;
}
.overlay.open { display: flex; }

/* ── Node Action Panel ───────────────────────────────────── */
.nap-card {
  background: var(--bg); border-radius: var(--radius);
  width: 320px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  overflow: hidden;
}
.nap-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 600; color: var(--text);
  gap: 12px;
}
#nap-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#nap-actions { display: flex; flex-direction: column; padding: 10px; gap: 6px; }
.nap-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--bg);
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--text); cursor: pointer; text-align: left;
  transition: border-color .12s, background .12s;
}
.nap-btn:hover { border-color: var(--primary); background: rgba(62,63,88,.05); color: var(--primary); }
.nap-btn-icon { font-size: 16px; flex-shrink: 0; }

#modal {
  background: var(--bg); border-radius: var(--radius);
  width: 90%; max-width: 760px; max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  overflow: hidden;
}
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface);
}
.modal-title { font-weight: 600; font-size: 15px; color: var(--primary); }
.modal-close {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 22px; line-height: 1;
}
.modal-close:hover { color: var(--primary); }
.modal-body {
  padding: 20px; overflow-y: auto;
  font-size: 13px; line-height: 1.8;
  white-space: pre-wrap; color: var(--text-dim);
}

/* Impressum modal */
#impressum-modal {
  background: var(--bg); border-radius: var(--radius);
  width: 90%; max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  overflow: hidden;
}
#impressum-modal .modal-body {
  white-space: normal; font-size: 14px; color: var(--text);
}
#impressum-modal address { font-style: normal; }

/* About overlay */
#about-overlay {
  display: none; position: fixed; inset: 0;
  background: var(--bg); z-index: 300;
  flex-direction: column; align-items: center;
  justify-content: center; gap: 20px; padding: 40px;
}
#about-overlay.open { display: flex; }
#about-overlay .about-logo svg { height: 60px; width: auto; fill: var(--primary); }
#about-overlay h2 {
  font-size: 26px; font-weight: 700; color: var(--primary);
}
#about-overlay p {
  font-size: 15px; color: var(--text-dim);
  text-align: center; max-width: 500px;
}
#about-overlay .about-close {
  margin-top: 8px; padding: 10px 28px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 10px; font-size: 14px;
  font-family: inherit; cursor: pointer; font-weight: 500;
}
#about-overlay .about-close:hover { background: var(--primary-h); }

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Admin view — sidebar layout ──────────────────────── */
:root { --sidebar-w: 200px; }

#admin-view.active {
  display: flex; flex-direction: row;
  overflow: hidden;           /* sidebar and content scroll independently */
  background: var(--surface);
}

/* ── Sidebar ──────────────────────────────────────────── */
.admin-sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--primary);
  display: flex; flex-direction: column;
  overflow-y: auto;
  padding: 16px 0 0;
}

.admin-sidebar-title {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: rgba(255,255,255,.45);
  padding: 0 16px 10px;
}

.admin-nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 16px;
  border: none; border-radius: 0; background: none;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,.65); cursor: pointer;
  transition: background .12s, color .12s;
  text-align: left; width: 100%;
}
.admin-nav-item:hover   { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav-item.active  { background: rgba(255,255,255,.15); color: #fff; }
.admin-nav-icon { font-size: 15px; flex-shrink: 0; }

.admin-sidebar-sep {
  height: 1px; background: rgba(255,255,255,.1);
  margin: 8px 0;
}

.admin-sidebar-bottom {
  margin-top: auto; padding: 12px 0 12px;
}
.admin-nav-back {
  display: block; width: 100%;
  padding: 10px 16px; border: none; background: none;
  font-family: inherit; font-size: 13px;
  color: rgba(255,255,255,.5); cursor: pointer;
  text-align: left; transition: color .12s;
}
.admin-nav-back:hover { color: #fff; }

/* ── Content area ─────────────────────────────────────── */
.admin-content {
  flex: 1; overflow-y: auto;
  padding: 28px 28px;
  min-width: 0; /* prevent flex blowout */
}

/* Keep .admin-container for any legacy reference; strip to no-op */
.admin-container { width: 100%; }

/* Dashboard panel area — no card border, just content flow */
.admin-panel-area { width: 100%; }

/* Panel */
.admin-panel {
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.admin-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  gap: 12px;
}
.admin-panel-header h3 {
  font-size: 14px; font-weight: 600; color: var(--primary);
}
.admin-panel-header > div {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

/* Table */
.admin-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.admin-table thead { background: var(--surface); }
.admin-table th {
  padding: 10px 16px;
  text-align: left; font-weight: 600;
  color: var(--text-dim); font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface); }

.actions-cell { text-align: right; white-space: nowrap; }
.text-mono { font-family: monospace; font-size: 12px; }
.text-dim  { color: var(--text-dim); }

/* ── Quellsysteme — status-first cards ───────────────── */
.sys-cards {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px;
}
.sys-card {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); overflow: hidden;
}
.sys-card-top {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px 10px;
}
.sys-card-indicator {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  margin-top: 5px; background: var(--border); transition: background .3s;
}
.ind-ok      { background: var(--green); }
.ind-err     { background: var(--red); }
.ind-testing { background: #c8a000; animation: pulse .8s infinite; }
.sys-card-info { flex: 1; min-width: 0; }
.sys-card-name {
  font-size: 14px; font-weight: 600; color: var(--text);
}
.sys-card-url {
  font-size: 11px; font-family: monospace; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.sys-card-badges { flex-shrink: 0; }
.sys-card-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding: 0 16px 10px; font-size: 12px;
}
.sys-card-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ── Indizierung — target cards ──────────────────────── */
.target-list-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.target-select-all-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--text-dim); cursor: pointer;
}
.target-cards { display: flex; flex-direction: column; }
.target-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.target-card:last-child { border-bottom: none; }
.target-card:hover { background: var(--surface); }
.target-chk { width: 15px; height: 15px; flex-shrink: 0; margin-top: 3px; accent-color: var(--primary); cursor: pointer; }
.target-card-body { flex: 1; min-width: 0; }
.target-card-name { font-size: 13px; font-weight: 600; color: var(--text); }
.target-card-path {
  font-size: 11px; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.target-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

/* ── Sync-Verlauf — job cards ────────────────────────── */
.job-cards { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.job-card {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); padding: 14px 16px;
}
.job-card-running { border-color: var(--primary); background: rgba(62,63,88,.03); }
.job-card-error   { border-color: var(--red);     background: rgba(217,79,79,.03); }
.job-card-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.job-card-left { display: flex; align-items: center; gap: 8px; }
.job-card-system { font-size: 13px; font-weight: 600; color: var(--text); }
.job-card-time   { font-size: 12px; }
.job-card-stats  {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 12px; margin-top: 8px; color: var(--text-dim);
}
.job-stat-err { color: var(--red); }
.job-err-btn {
  background: none; border: none; padding: 0;
  font: inherit; cursor: pointer;
  color: var(--red);
  text-decoration: underline dotted;
}
.job-err-btn:hover { opacity: .75; }
.job-error-detail {
  margin-top: 8px; padding: 8px 10px;
  background: rgba(217,79,79,.07); border-radius: 6px;
  font-size: 12px; color: var(--red);
}

/* Buttons */
.btn-primary {
  padding: 7px 16px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 8px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background .15s;
  white-space: nowrap;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-h); }
.btn-primary:disabled { background: var(--border); cursor: not-allowed; }

.btn-secondary {
  padding: 7px 14px;
  background: var(--surface2); color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 8px; font-family: inherit;
  font-size: 13px; cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.btn-secondary:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-secondary:disabled { opacity: .5; cursor: not-allowed; }

.btn-danger {
  padding: 7px 14px;
  background: none; color: var(--red);
  border: 1.5px solid var(--red);
  border-radius: 8px; font-family: inherit;
  font-size: 13px; cursor: pointer; transition: all .15s;
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-icon {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px; background: none;
  font-family: inherit; font-size: 12px;
  cursor: pointer; transition: all .15s;
  margin-left: 6px;
}
.btn-test { color: var(--primary); }
.btn-test:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-edit { color: var(--text-dim); }
.btn-edit:hover { background: var(--surface2); color: var(--text); border-color: var(--text-dim); }
.btn-del  { color: var(--red); }
.btn-del:hover  { background: var(--red); color: #fff; border-color: var(--red); }

.btn-add {
  padding: 4px 12px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 6px;
  font-family: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: background .15s; flex-shrink: 0;
}
.btn-add:hover { background: var(--primary-h); }

/* Actions row */
.admin-actions {
  display: flex; gap: 10px; align-items: center;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* Empty state */
.admin-empty {
  padding: 32px; text-align: center;
  color: var(--text-dim); font-size: 13px;
}
.admin-error { color: var(--red); }

/* Select in admin */
#admin-system-select {
  padding: 7px 32px 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px; background: var(--bg);
  color: var(--text); font-family: inherit; font-size: 13px;
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%236b6b80' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  min-width: 200px;
}
#admin-system-select:focus { outline: none; border-color: var(--primary); }

/* Badges */
.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 10px; font-size: 11px; font-weight: 600;
}
.badge-blue   { background: rgba(62,63,88,.1); color: var(--primary); }
.badge-green  { background: rgba(45,156,110,.12); color: var(--green); }
.badge-red    { background: rgba(217,79,79,.12); color: var(--red); }
.badge-yellow  { background: rgba(200,150,0,.12); color: #a07000; }
.badge-paused  { background: rgba(200,150,0,.12); color: #a07000; }
.badge-site   { background: rgba(100,80,180,.1); color: #5a4aaa; font-size: 11px; }
.job-sites    { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 3px; }
.btn-resume { color: var(--green); }
.btn-resume:hover { background: var(--green); color: #fff; border-color: var(--green); }

/* Stats */
.admin-stats-row {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding: 20px;
}
.stats-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 24px; min-width: 160px;
}
.stats-value {
  font-size: 28px; font-weight: 700; color: var(--primary);
}
.stats-label {
  font-size: 12px; color: var(--text-dim); margin-top: 2px;
}

/* Dashboard KPI row */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 24px;
}
@media (max-width: 700px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }
.kpi-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
}
.kpi-value {
  font-size: 26px; font-weight: 700; color: var(--primary); line-height: 1.1;
}
.kpi-label {
  font-size: 11px; color: var(--text-dim); margin-top: 4px;
  text-transform: uppercase; letter-spacing: .05em; font-weight: 600;
}
.kpi-sub {
  font-size: 11px; color: var(--text-dim); margin-top: 3px;
}

/* Dashboard section title */
.dash-section {
  font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-dim);
  margin: 24px 0 10px;
}

/* System status cards */
.system-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px; margin-bottom: 8px;
}
.system-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.system-card-name  { font-size: 14px; font-weight: 600; color: var(--text); }
.system-card-url   { font-size: 11px; color: var(--text-dim); font-family: monospace;
                     white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
                     margin-top: 2px; }
.system-card-meta  { margin-top: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Form */
.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-dim); margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: .04em;
}
.form-group input, .form-group select {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 14px;
  transition: border-color .15s;
}
.form-group input:focus, .form-group select:focus {
  outline: none; border-color: var(--primary);
}
.form-hint {
  margin-top: 5px; font-size: 11px; color: var(--text-dim);
}
.form-hint code {
  background: var(--surface2); padding: 1px 4px;
  border-radius: 3px; font-size: 11px;
}
.form-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 20px;
}

/* Admin Modal */
.admin-modal {
  background: var(--bg); border-radius: var(--radius);
  width: 90%; max-width: 580px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.18); overflow: hidden;
}
.admin-modal .modal-body { overflow-y: auto; }

/* Admin modal wide variant */
.admin-modal-wide { max-width: 720px; }

/* Ordner-Browser */
.browser-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.browser-breadcrumb {
  flex: 1; font-size: 13px; color: var(--text-dim);
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  min-width: 0;
}
.crumb { cursor: pointer; color: var(--primary); white-space: nowrap; }
.crumb:hover { text-decoration: underline; }
.crumb-sep { color: var(--text-dim); }
.browser-search {
  width: 200px; flex-shrink: 0;
  padding: 6px 10px;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 13px;
}
.browser-search:focus { outline: none; border-color: var(--primary); }

.browser-list { overflow-y: auto; max-height: 400px; }
.browser-loading { padding: 24px; text-align: center; color: var(--text-dim); font-size: 13px; }

.browser-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .1s;
  user-select: none;
}
.browser-item:last-child { border-bottom: none; }
.browser-item:hover { background: var(--surface); }
.browser-item input[type="checkbox"] {
  width: 16px; height: 16px; flex-shrink: 0;
  accent-color: var(--primary); cursor: pointer;
}
.browser-item-name {
  font-size: 13px; color: var(--text);
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.browser-item-name:hover { color: var(--primary); text-decoration: underline; }
.browser-item-path {
  font-size: 11px; color: var(--text-dim);
  font-family: monospace; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 200px;
}

.browser-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; gap: 10px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.browser-sel-count {
  font-size: 13px; font-weight: 600; color: var(--primary);
  min-width: 100px;
}

/* Stats Sites-Liste */
.admin-stats-row { flex-wrap: wrap; }
.stats-sites {
  flex: 1; min-width: 300px;
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden;
}
.stats-sites-header {
  padding: 10px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .05em;
}
.stats-sites-list { overflow-y: auto; max-height: 220px; }
.stats-card-site {
  border: none; border-bottom: 1px solid var(--border);
  border-radius: 0; padding: 10px 16px; min-width: unset;
}
.stats-card-site:last-child { border-bottom: none; }
.stats-site-name {
  font-size: 13px; font-weight: 600; color: var(--primary);
}
.stats-site-path {
  font-size: 11px; color: var(--text-dim); font-family: monospace;
  margin: 2px 0 6px;
}
.stats-site-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.stats-site-date { font-size: 11px; color: var(--text-dim); }

/* Browser bereits hinzugefügt */
.browser-item-added { background: rgba(45,156,110,.04); }
.browser-item-added .browser-item-name { color: var(--text-dim); }
.browser-item-locked { opacity: .55; background: rgba(0,0,0,.02); }
.browser-item-locked .browser-item-name { color: var(--text-dim); }
.browser-item-badge {
  font-size: 11px; font-weight: 600; color: var(--green);
  white-space: nowrap; flex-shrink: 0;
}
.browser-item-badge-locked { color: var(--text-dim); font-weight: 500; }

/* Sync-Fortschritt */
#sync-progress-card {
  margin: 0 0 24px;
  padding: 18px 20px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
}
.progress-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
  font-size: 14px; font-weight: 600; color: var(--primary);
}
.progress-counts {
  font-size: 13px; font-weight: 400; color: var(--text-dim);
}
.progress-track {
  width: 100%; height: 10px;
  background: var(--surface2);
  border-radius: 99px; overflow: hidden;
}
.progress-bar {
  height: 100%; border-radius: 99px;
  transition: width .4s ease;
}
.progress-bar-running {
  background: repeating-linear-gradient(
    -45deg,
    var(--primary) 0px,
    var(--primary) 12px,
    var(--primary-h) 12px,
    var(--primary-h) 24px
  );
  background-size: 34px 100%;
  animation: progress-stripe .6s linear infinite;
}
.progress-bar-done   { background: var(--green); }
.progress-bar-paused { background: #c8a000; }
.progress-bar-error  { background: var(--red); }

@keyframes progress-stripe {
  from { background-position: 0 0; }
  to   { background-position: 34px 0; }
}

/* Toast */
.admin-toast {
  position: fixed; bottom: calc(var(--footer-h) + 12px); left: 50%;
  transform: translateX(-50%) translateY(16px);
  padding: 9px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
  opacity: 0; transition: all .22s; pointer-events: none;
  z-index: 1000; white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
}
.admin-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-ok   { background: var(--green); color: #fff; }
.toast-err  { background: var(--red); color: #fff; }
.toast-warn { background: #c8a000; color: #fff; }

/* Confirm dialog */
.ui-confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(20,20,40,.5);
  z-index: 500; display: flex; align-items: center; justify-content: center;
}
.ui-confirm-box {
  background: var(--bg); border-radius: var(--radius);
  padding: 28px 28px 24px;
  width: 90%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.ui-confirm-msg {
  font-size: 15px; line-height: 1.55; color: var(--text);
  margin-bottom: 24px; white-space: pre-line;
}
.ui-confirm-actions {
  display: flex; justify-content: flex-end; gap: 10px;
}

/* KI-Modelle tab */
.ki-section-title {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-dim);
  margin: 24px 0 12px; padding-bottom: 8px;
  border-bottom: 1.5px solid var(--border);
}
.ki-section {
  background: var(--surface); border-radius: 10px;
  padding: 16px 18px; margin-bottom: 8px;
}
