/* Vektor Box – 1:1 an Vektor NetStack Portal (index.php) angelehnt */

:root {
  --bg: #f1f5f9;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --panel: #ffffff;
  --header: #0f172a;
  --sky: #38bdf8;
  --badge: #0284c7;
  --badge-hover: #0ea5e9;
  --ok: #166534;
  --ok-bg: #dcfce7;
  --danger: #991b1b;
  --danger-bg: #fee2e2;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
}

a { color: var(--badge); text-decoration: none; }
a:hover { color: var(--badge-hover); }

/* ===== Global Header (NetStack) ===== */
.global-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  min-height: 56px;
  height: auto;
  background: var(--header);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 16px;
  z-index: 1000;
  border-bottom: 1px solid #1e293b;
}

.logo-area {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  flex-shrink: 0;
  padding-top: 6px;
}
.logo-area span { color: var(--sky); }

.nav-rail-wrap {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex: 1;
  min-width: 0;
  justify-content: flex-end;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, max-content));
  gap: 8px;
  justify-content: end;
  flex: 1;
  min-width: 0;
}

.nav-cell {
  min-width: 0;
  cursor: grab;
  touch-action: none;
}
.nav-cell.dragging {
  opacity: 0.45;
}
.nav-cell.drag-over {
  outline: 2px dashed #38bdf8;
  outline-offset: 2px;
  border-radius: 6px;
}
.nav-cell .btn-dashboard,
.nav-cell .badge-mandant,
.nav-cell form {
  width: 100%;
  justify-content: center;
  white-space: nowrap;
}

.nav-reset-btn {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  padding: 0;
  margin-top: 4px;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.9rem;
}
.nav-reset-btn:hover {
  color: #fff;
  border-color: #64748b;
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge-mandant {
  background: var(--badge);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
}
.badge-mandant:hover { background: var(--badge-hover); color: #fff; }

.btn-dashboard {
  background: #1e293b;
  color: #f8fafc;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid #334155;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  min-height: 30px;
}
.btn-dashboard:hover { background: #334155; color: #f8fafc; }
.btn-dashboard.active {
  background: #0284c7;
  border-color: #0284c7;
}

button.btn-dashboard {
  font-family: inherit;
}

/* ===== Content ===== */
.app-content-container {
  margin-top: 0;
  width: 100%;
  min-height: calc(100vh - 60px);
  box-sizing: border-box;
  padding: 20px;
  overflow-y: auto;
}

.page-intro {
  max-width: 900px;
  margin-bottom: 10px;
}
.page-intro h1 {
  margin: 0 0 10px 0;
  color: #0f172a;
  font-size: 1.75rem;
  font-weight: 800;
}
.page-intro p {
  color: var(--muted);
  font-size: 1rem;
  margin: 0 0 30px 0;
}

/* Hub-Karten wie NetStack-Dashboard */
.hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 900px;
}
@media (max-width: 700px) {
  .hub-grid { grid-template-columns: 1fr; }
}

.hub-card {
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: var(--radius);
  display: block;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: transform 0.15s;
  color: inherit;
}
.hub-card:hover {
  transform: translateY(-2px);
  color: inherit;
}
.hub-card h3 {
  margin: 0 0 8px 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.hub-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}
.hub-card.tone-amber h3 { color: #b45309; }
.hub-card.tone-blue h3 { color: #0369a1; }
.hub-card.tone-teal h3 { color: #0f766e; }
.hub-card.tone-green h3 { color: #15803d; }
.hub-card.tone-purple h3 { color: #6d28d9; }
.hub-card.tone-red h3 { color: #b91c1c; }
.hub-card.tone-indigo h3 { color: #3730a3; }

/* Panels / Forms */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  padding: 20px;
  max-width: 900px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 18px;
  max-width: 1100px;
}
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}

h1, h2, h3 { margin: 0 0 10px; }
h1 { color: #0f172a; font-size: 1.75rem; font-weight: 800; }
h2 { color: #0f172a; font-size: 1.2rem; font-weight: 700; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

label { display: grid; gap: 6px; font-size: 0.9rem; font-weight: 600; color: #334155; }
input, select, textarea {
  font: inherit;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid #bae6fd;
  border-color: var(--badge);
}

button, .btn {
  background: var(--badge);
  color: #fff;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: inherit;
}
button.secondary, .btn.secondary {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
}
button.danger { background: #ef4444; }
button:hover, .btn:hover { filter: brightness(1.06); text-decoration: none; color: #fff; }

.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.table thead tr {
  background: #f1f5f9;
  border-bottom: 2px solid #cbd5e1;
}
.table th {
  color: #475569;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.flash {
  padding: 10px 12px;
  border-radius: 4px;
  margin-bottom: 15px;
  font-weight: 500;
  max-width: 900px;
}
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--danger-bg); color: var(--danger); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin-bottom: 24px;
}
.stat {
  padding: 15px;
  border-radius: 4px;
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
}
.stat.amber { background: #fffbeb; border-left-color: #f59e0b; }
.stat.green { background: #f0fdf4; border-left-color: #22c55e; }
.stat span {
  display: block;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  color: #1e40af;
}
.stat.amber span { color: #78350f; }
.stat.green span { color: #166534; }
.stat strong {
  display: block;
  font-size: 28px;
  margin-top: 5px;
  color: #1e3a8a;
}
.stat.amber strong { color: #78350f; }
.stat.green strong { color: #14532d; }

/* ===== Archiv-Baum (Explorer) ===== */
.archive-browser .archive-panel,
.archive-panel-compact {
  padding: 0;
  overflow-x: auto;
}
.archive-tree {
  font-family: ui-monospace, "Cascadia Mono", "Consolas", "Courier New", monospace;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
}
.archive-root {
  margin-bottom: 10px;
}
.archive-folder {
  display: block;
}
.archive-folder > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  padding: 2px 4px;
  border-radius: 4px;
}
.archive-folder > summary::-webkit-details-marker { display: none; }
.archive-folder > summary:hover {
  background: #e0f2fe;
}
.archive-client > summary {
  font-size: 1.05rem;
  font-weight: 700;
  padding: 8px 6px;
  margin: 2px 0;
  border-radius: 6px;
}
.archive-client:not([open]) > summary {
  background: #f8fafc;
  border: 1px solid var(--line);
}
.archive-client[open] > summary {
  background: #e0f2fe;
  border: 1px solid #bae6fd;
}
.archive-index {
  color: var(--badge);
  font-weight: 800;
}
.archive-count {
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--font);
}
.archive-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
  white-space: pre;
}
.archive-row {
  display: flex;
  align-items: baseline;
  white-space: pre;
  gap: 0;
}
.archive-guides {
  color: #94a3b8;
  user-select: none;
  flex-shrink: 0;
}
.archive-icon {
  margin-right: 2px;
}
.archive-label {
  font-family: var(--font);
  font-size: 0.95rem;
}
.archive-file {
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--badge);
}
.archive-file:hover {
  text-decoration: underline;
}
.archive-file-row {
  padding: 1px 0;
}
.archive-empty {
  padding: 4px 8px 8px 28px;
  font-family: var(--font);
  font-size: 0.85rem;
}
.archive-line .archive-folder {
  display: inline;
}
.archive-line .archive-folder > summary {
  display: inline-flex;
}

.palette-item, .tree-node {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  margin-bottom: 8px;
}
.palette-item {
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: inherit;
  font-weight: 600;
  background: #fff;
}
.palette-item:hover { border-color: var(--sky); background: #f0f9ff; }
.tree-list { list-style: none; margin: 0; padding-left: 0; }
.tree-list ul {
  list-style: none;
  margin: 8px 0 0;
  padding-left: 18px;
  border-left: 2px solid #bae6fd;
}
.tree-node-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.tree-meta { font-size: 0.85rem; color: var(--muted); font-weight: 500; }

/* ===== Erfassungs-Station (3 Spalten) ===== */
.capture-page { max-width: none; }
.capture-page .panel { max-width: none; }

.capture-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
  padding: 10px 14px;
}
.capture-topbar-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.capture-topbar-main strong {
  font-size: 1.05rem;
  color: #0f172a;
}
.top-id-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.top-id-item {
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.78rem;
}
.top-id-item strong {
  color: #475569;
  margin-right: 4px;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.manual-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.manual-block:first-of-type {
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
}
.manual-label {
  display: grid;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
}
.ask-result {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.35;
}
.ask-result.ok {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}
.ask-result.err {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.research-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .research-grid { grid-template-columns: 1fr; }
}
.research-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.85rem;
}
.research-preview {
  height: min(80vh, 900px);
}

.research-hub .research-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.research-q-label {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  font-size: 0.85rem;
}
.research-q-label input {
  font-weight: 400;
}
.research-join {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
}
.research-join label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  cursor: pointer;
}
.research-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.research-filters-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85rem;
}
.research-filter-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr auto;
  gap: 8px;
  align-items: center;
}
.research-filter-remove {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.research-filter-remove:hover {
  color: var(--danger);
  border-color: #fecaca;
  background: var(--danger-bg);
}
.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-secondary:hover {
  background: #f8fafc;
  color: var(--ink);
}
.research-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.research-result-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #fff;
}
.research-result-card.inbox-first {
  border-left: 4px solid var(--badge);
  background: #f0f9ff;
}
.research-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
}
.research-primary-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--badge);
  background: #e0f2fe;
  padding: 2px 6px;
  border-radius: 4px;
}
.research-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--badge);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
}
.research-chain-path {
  margin-top: 6px;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.4;
}
.research-tree-path {
  margin-top: 4px;
  font-size: 0.82rem;
}
.research-meta {
  margin-top: 8px;
  font-size: 0.85rem;
}
.research-actions {
  margin-top: 10px;
  font-size: 0.85rem;
}

.capture-grid {
  display: grid;
  grid-template-columns: var(--cap-left, 220px) 8px var(--cap-mid, 260px) 8px minmax(320px, 1fr);
  gap: 0;
  align-items: stretch;
  min-height: 70vh;
}
@media (max-width: 1100px) {
  .capture-grid {
    grid-template-columns: 1fr;
  }
  .capture-resizer { display: none; }
}

.capture-col {
  min-width: 0;
  overflow: auto;
}
.capture-resizer {
  width: 8px;
  margin: 0 2px;
  cursor: col-resize;
  background: transparent;
  position: relative;
  align-self: stretch;
  border-radius: 4px;
  touch-action: none;
  user-select: none;
}
.capture-resizer::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 2px;
  right: 2px;
  border-radius: 3px;
  background: #cbd5e1;
  transition: background 0.15s;
}
.capture-resizer:hover::before,
.capture-resizer:focus-visible::before,
.capture-grid.is-resizing .capture-resizer.active::before {
  background: #0284c7;
}
.capture-grid.is-resizing {
  cursor: col-resize;
  user-select: none;
}
.capture-grid.is-resizing iframe,
.capture-grid.is-resizing img {
  pointer-events: none;
}

.capture-col h2 { font-size: 1rem; margin-bottom: 6px; }
.capture-col h3 { font-size: 0.95rem; margin: 14px 0 8px; }
.capture-chain-col .muted { font-size: 0.8rem; line-height: 1.35; }

.capture-input-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.capture-input-row input { flex: 1; min-width: 0; }
.capture-input-row button { flex-shrink: 0; }

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip-form { margin: 0; }
.chip-btn {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.chip-btn:hover { background: #e0f2fe; }

.dup-chip {
  display: inline-block;
  background: #fff;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  padding: 2px 8px;
  margin: 0 4px;
  font-size: 0.85rem;
}

.capture-chain {
  list-style: none;
  margin: 12px 0 20px;
  padding: 0 0 0 18px;
  border-left: 3px solid #38bdf8;
  position: relative;
}
.chain-step {
  position: relative;
  margin-bottom: 10px;
  padding-left: 6px;
  cursor: grab;
  touch-action: none;
}
.chain-step.dragging {
  opacity: 0.45;
}
.chain-step.drag-over {
  outline: 2px dashed #0284c7;
  outline-offset: 2px;
  border-radius: 8px;
}
.chain-step::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0284c7;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #38bdf8;
}
.chain-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: -17px;
  top: 24px;
  bottom: -10px;
  width: 2px;
  background: #bae6fd;
}
.chain-node {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
}
.chain-grip {
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: -1px;
  user-select: none;
  cursor: grab;
  flex-shrink: 0;
}
.chain-num {
  background: #0f172a;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.chain-label {
  font-weight: 600;
  flex: 1;
  font-size: 0.88rem;
  line-height: 1.25;
  word-break: break-word;
}
.chain-src {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--muted);
  background: #f1f5f9;
  padding: 2px 5px;
  border-radius: 4px;
}
.chain-actions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  padding-left: 28px;
}
.chain-actions button {
  padding: 3px 8px;
  font-size: 0.8rem;
}
.inline-form { display: inline; margin: 0; }
.chain-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 8px;
}

.capture-confirm {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 8px;
}
.capture-confirm-btn {
  background: #15803d;
  font-size: 1rem;
  padding: 12px 18px;
}

.doc-preview-frame {
  width: 100%;
  height: min(85vh, 920px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}
.doc-preview-img {
  width: 100%;
  max-height: min(85vh, 920px);
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.ocr-details { margin-top: 12px; font-size: 0.85rem; }
.ocr-mini-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}
.ocr-mini-list code {
  background: #f1f5f9;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.8rem;
}

/* Login */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  padding: 28px 24px;
}
.login-card .logo-area {
  color: #0f172a;
  font-size: 1.4rem;
  margin-bottom: 4px;
}
.login-card .logo-area span { color: var(--badge); }
.login-card .logo-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 18px;
}

/* ===== Stammdaten ===== */
.stammdaten-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}
.stammdaten-tabs a {
  padding: 8px 2px 10px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.stammdaten-tabs a.is-active,
.stammdaten-tabs a:hover {
  color: var(--ink);
  border-bottom-color: var(--badge);
}
.stammdaten-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .stammdaten-grid { grid-template-columns: 1fr; }
}
.stammdaten-profile-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.stammdaten-avatar {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stammdaten-plan {
  background: #0f172a;
  color: #f8fafc;
  border-color: #1e293b;
}
.stammdaten-plan .muted { color: #94a3b8; }
.stammdaten-pill {
  background: #1e293b;
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
}
.stammdaten-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 700px) {
  .stammdaten-form-grid { grid-template-columns: 1fr; }
}
.stammdaten-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  padding-top: 22px;
}
.mail-address-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}
.mail-address-box code {
  flex: 1;
  min-width: 180px;
  font-size: 0.95rem;
  color: var(--badge);
  font-weight: 700;
  word-break: break-all;
}
.mail-drop-path {
  display: block;
  margin-top: 6px;
  padding: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  font-size: 0.8rem;
  word-break: break-all;
}
.mail-tips {
  background: #f0f9ff;
  border-color: #bae6fd;
}
.mail-tips ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.55;
  font-size: 0.9rem;
}
.mail-tips code {
  background: #e0f2fe;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.85rem;
}

/* ===== Fristen / Ampel ===== */
.deadline-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1100px) {
  .deadline-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .deadline-stats { grid-template-columns: 1fr 1fr; }
}
.deadline-stat {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid #94a3b8;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 92px;
}
.deadline-stat-label,
.deadline-stat span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}
.deadline-stat strong {
  font-size: 1.75rem;
  line-height: 1.1;
  color: var(--ink);
}
.deadline-stat small { color: var(--muted); font-size: 0.75rem; }
.deadline-stat.ampel-red {
  border-left-color: #ef4444;
  border-color: #fecaca;
  background: #fef2f2;
}
.deadline-stat.ampel-red .deadline-stat-label,
.deadline-stat.ampel-red span { color: #991b1b; }
.deadline-stat.ampel-red strong { color: #b91c1c; }
.deadline-stat.ampel-yellow {
  border-left-color: #eab308;
  border-color: #fde68a;
  background: #fffbeb;
}
.deadline-stat.ampel-yellow .deadline-stat-label,
.deadline-stat.ampel-yellow span { color: #854d0e; }
.deadline-stat.ampel-yellow strong { color: #a16207; }
.deadline-stat.ampel-green {
  border-left-color: #22c55e;
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.deadline-stat.ampel-green .deadline-stat-label,
.deadline-stat.ampel-green span { color: #166534; }
.deadline-stat.ampel-green strong { color: #15803d; }
.deadline-stat-open {
  border-left-color: #0284c7;
  border-color: #bae6fd;
  background: #f0f9ff;
}
.deadline-stat-open .deadline-stat-label,
.deadline-stat-open span { color: #075985; }
.deadline-stat-open strong { color: #0369a1; }
.deadline-stat-done {
  border-left-color: #64748b;
  border-color: #cbd5e1;
  background: #f8fafc;
}
.deadline-stat-cancelled {
  border-left-color: #94a3b8;
  border-color: #e2e8f0;
  background: #f8fafc;
  opacity: 0.92;
}

.ampel-cell { white-space: nowrap; vertical-align: middle; }
.ampel-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #94a3b8;
  vertical-align: middle;
  flex-shrink: 0;
}
.ampel-dot.ampel-red { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.2); }
.ampel-dot.ampel-yellow { background: #eab308; box-shadow: 0 0 0 3px rgba(234,179,8,.22); }
.ampel-dot.ampel-green { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }

.ampel-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  background: #fff;
  color: var(--ink);
}
.ampel-badge.ampel-red { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.ampel-badge.ampel-yellow { background: #fffbeb; border-color: #fcd34d; color: #854d0e; }
.ampel-badge.ampel-green { background: #f0fdf4; border-color: #86efac; color: #166534; }

.deadline-row.ampel-red td:first-child { box-shadow: inset 4px 0 0 #ef4444; }
.deadline-row.ampel-yellow td:first-child { box-shadow: inset 4px 0 0 #eab308; }
.deadline-row.ampel-green td:first-child { box-shadow: inset 4px 0 0 #22c55e; }

.deadline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}
.deadline-actions .inline-form { margin: 0; }
button.deadline-delete,
.deadline-delete {
  color: #991b1b !important;
  border-color: #fecaca !important;
  background: #fff !important;
}
button.deadline-delete:hover,
.deadline-delete:hover {
  background: #fef2f2 !important;
  color: #7f1d1d !important;
}

.deadline-status-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.deadline-status-pill.status-done { background: #e2e8f0; color: #334155; }
.deadline-status-pill.status-cancelled { background: #f1f5f9; color: #64748b; }

.deadline-doc-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.deadline-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.deadline-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
}
.deadline-pill:hover { filter: brightness(0.98); }
.deadline-pill.ampel-red { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.deadline-pill.ampel-yellow { background: #fffbeb; border-color: #fcd34d; color: #854d0e; }
.deadline-pill.ampel-green { background: #f0fdf4; border-color: #86efac; color: #166534; }
.nav-cell a[href*='/fristen'] { position: relative; }
