/* diind.ai UI — inspiriert von slothUI (https://www.slothui.com/) */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-soft: #eef2ff;
  --primary-border: #c7d2fe;
  --primary-accent: #8b5cf6;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-subtle: #f1f5f9;
  --surface-hover: #fafbfc;
  --input-muted-bg: #f8fafc;
  --thead-bg: #f8fafc;
  --progress-track: #e2e8f0;
  --code-bg: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 32px rgba(15, 23, 42, 0.06);
  --shadow-soft: 0 4px 24px rgba(99, 102, 241, 0.12);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* Admin: PDF analytics */
.admin-analytics-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  margin: 0.75rem 0 1rem;
}

.admin-analytics-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.admin-analytics-toolbar input[type="datetime-local"],
.admin-analytics-toolbar input[type="month"] {
  font: inherit;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.admin-analytics-toolbar input[type="datetime-local"]:focus,
.admin-analytics-toolbar input[type="month"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.admin-billing-toolbar {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.ui-datetime-input {
  margin-left: 0.25rem;
}

.admin-analytics-charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (min-width: 900px) {
  .admin-analytics-charts {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
  }
}

.admin-analytics-chart-box {
  position: relative;
  min-height: 220px;
  max-height: 360px;
}

.admin-analytics-chart-box--wide {
  max-height: 320px;
}

/* Pipeline: „Zuletzt bearbeitet“ (gleiche Karte wie Verlauf) */
.resume-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.resume-banner-actions button {
  margin: 0;
}

/* ----- Auth (Login) ----- */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-soft: #eef2ff;
  --primary-border: #c7d2fe;
  --shadow-soft: 0 4px 24px rgba(99, 102, 241, 0.12);
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(99, 102, 241, 0.18), transparent),
    radial-gradient(ellipse 80% 50% at 100% 100%, rgba(129, 140, 248, 0.12), transparent),
    var(--bg);
  transition: background 0.25s ease;
}

.auth-body--disqtrust {
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-soft: #fff7ed;
  --primary-border: #fdba74;
  --shadow-soft: 0 4px 24px rgba(234, 88, 12, 0.14);
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(234, 88, 12, 0.16), transparent),
    radial-gradient(ellipse 80% 50% at 100% 100%, rgba(251, 146, 60, 0.12), transparent),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.auth-brand--platform {
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.auth-brand-text {
  width: 100%;
}

.auth-brand-logo {
  height: auto;
  width: 100%;
  max-width: min(100%, 280px);
  max-height: 56px;
  object-fit: contain;
  object-position: left center;
  display: block;
  flex-shrink: 0;
}

.auth-brand-logo--platform {
  max-width: min(100%, 220px);
  max-height: 72px;
}

.auth-card h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-tagline {
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-card label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

/* Login: E-Mail + Passwort identisch (Klasse > type=email, damit kein Browser-Default durchschlägt) */
.auth-card .auth-field {
  width: 100%;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 1rem;
  background: var(--input-muted-bg);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

.auth-card .auth-field::placeholder {
  color: var(--text-muted);
}

.auth-card .auth-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: var(--surface);
}

.auth-card form label + .auth-field + label {
  margin-top: 0.85rem;
}

.auth-select-wrap {
  position: relative;
  width: 100%;
}

.auth-field--select {
  padding-right: 2.75rem;
  cursor: pointer;
}

.auth-select-chevron {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: -0.5625rem;
  pointer-events: none;
  color: var(--text-secondary);
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.auth-card button[type="submit"] {
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-soft);
}

.auth-card button[type="submit"]:hover {
  background: var(--primary-hover);
}

.error {
  color: var(--danger);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--danger-soft);
  border-radius: var(--radius-sm);
}

.auth-footer-link {
  margin-top: 1.25rem;
  margin-bottom: 0;
  text-align: center;
  font-size: 0.875rem;
}

.auth-footer-link a {
  color: var(--text-secondary);
  text-decoration: none;
}

.auth-footer-link a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ----- Dashboard shell ----- */
.dashboard {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 268px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.35rem;
}

.sidebar-brand-logo {
  height: auto;
  max-height: 36px;
  width: auto;
  max-width: min(100%, 158px);
  object-fit: contain;
  object-position: left center;
  display: block;
  flex-shrink: 1;
  min-width: 0;
}

.sidebar-product {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}

.nav-item:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.5rem 0;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.sidebar-user a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
}

.sidebar-user a:hover {
  color: var(--primary);
}

.main-area {
  flex: 1;
  min-width: 0;
  padding: 1.25rem 1.75rem 2rem;
  overflow: auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 0.5rem;
}

.breadcrumbs {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumbs span.sep {
  margin: 0 0.35rem;
  opacity: 0.6;
}

.breadcrumbs .current {
  color: var(--primary);
  font-weight: 600;
}

.page-title-block {
  margin-bottom: 1.25rem;
}

.page-title-block h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-subtitle {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-new {
  border: 1px solid var(--primary-border);
  color: var(--primary);
  background: var(--primary-soft);
}

.badge-new::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.content-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 1.5rem 1.75rem 1.75rem;
  margin-bottom: 1.25rem;
}

.content-card.history-card {
  padding: 1.25rem 1.5rem;
}

.wizard section {
  margin-bottom: 1.75rem;
}

.wizard section:last-child {
  margin-bottom: 0;
}

.wizard h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* Einstiegsmodus: Upload vs. Einzelunternehmen */
.entry-mode-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 1rem;
  flex-wrap: wrap;
}

.entry-mode-tab {
  border: 1px solid var(--primary-border);
  background: var(--surface-muted);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.entry-mode-tab:hover {
  border-color: var(--primary);
  color: var(--text);
}

.entry-mode-tab.is-active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--text);
}

.manual-entry-form {
  margin-top: 0.5rem;
}

.manual-entry-form .manual-entry-input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--primary-border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  box-sizing: border-box;
}

.manual-entry-form .manual-entry-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

#estimateBox.estimate {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--primary-border);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.hint {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0 0 1rem;
}

.hint code {
  font-size: 0.8em;
  padding: 0.1rem 0.35rem;
  background: var(--code-bg);
  border-radius: 4px;
}

.muted {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.fail-reasons {
  white-space: pre-wrap;
  margin: 0.5rem 0 0;
  max-height: 14rem;
  overflow-y: auto;
  font-size: 0.8125rem;
}

/* Buttons */
button {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  margin: 0.35rem 0.5rem 0 0;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

button:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
}

button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

button.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

button.danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* Form controls */
label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin: 0.35rem 0;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="datetime-local"],
input[type="month"],
select,
textarea {
  font: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

select[multiple] {
  min-height: 5.5rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.grid-form {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

@media (min-width: 640px) {
  .grid-form {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.row-limit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 0.5rem 0 1rem;
}

.row-limit-select {
  min-width: min(100%, 22rem);
  flex: 1 1 16rem;
  max-width: 100%;
}

.row-limit-n {
  width: 8rem;
  flex-shrink: 0;
}

.estimate {
  padding: 1rem 1.15rem;
  background: linear-gradient(145deg, var(--surface-muted), var(--surface-subtle));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 0.75rem;
}

.estimate p {
  margin: 0.35rem 0;
}

.worker-choice-panel {
  padding: 1rem 1.15rem;
  background: linear-gradient(145deg, var(--surface-muted), var(--surface-subtle));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 0.75rem 0 1rem;
}

.worker-choice-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.worker-choice-hint {
  margin: 0 0 0.85rem;
  line-height: 1.5;
}

.worker-choice-panel label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.worker-choice-select {
  margin-bottom: 0;
  max-width: min(100%, 22rem);
}

/* Dropzone — slothUI-style upload */
.dropzone {
  border: 2px dashed var(--primary-border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  background: linear-gradient(180deg, var(--surface-muted) 0%, var(--surface-subtle) 100%);
  cursor: pointer;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  position: relative;
}

.dropzone:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.08);
}

.dropzone.drag {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: var(--shadow-soft);
}

.dropzone p,
.dropzone .dropzone-hint {
  margin: 0 0 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: block;
}

/* Klickbare Fläche: Label + File-Input als transparente Decke (kein programmatisches .click()). */
.dropzone-select-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 6.5rem;
  margin: 0;
  padding: 0.35rem 1rem 1rem;
  cursor: pointer;
}

.dropzone:not(.has-file) .dropzone-file-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 2rem; /* größeres Klickziel für einige Browser */
  z-index: 2;
}

.dropzone-pick-appearance {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.35rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--primary-border);
  background: var(--surface);
  color: var(--primary);
  pointer-events: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.dropzone-select-area:hover .dropzone-pick-appearance {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-hover);
}

.dropzone.has-file .dropzone-select-area {
  display: none;
}

.dropzone.has-file {
  cursor: default;
  border-style: solid;
  border-color: var(--primary);
  background: linear-gradient(160deg, var(--primary-soft) 0%, var(--primary-border) 45%, var(--primary-soft) 100%);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.dropzone.has-file:hover {
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.dropzone .dropzone-hint {
  position: relative;
  z-index: 1;
  pointer-events: none;
}


.dropzone-file-label {
  margin: 0;
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
  word-break: break-all;
}

.dropzone-file-meta {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.dropzone-clear {
  position: absolute;
  z-index: 5;
  top: 0.65rem;
  right: 0.65rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-secondary);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  transition: color 0.12s, background 0.12s;
}

.dropzone-clear:hover {
  background: var(--surface);
  color: var(--danger);
}

.field-group {
  margin-bottom: 1rem;
  grid-column: 1 / -1;
}

@media (min-width: 640px) {
  .field-group.span-one {
    grid-column: span 1;
  }
}

.field-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.field-group-head > span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.btn-add-col {
  width: 2rem;
  height: 2rem;
  padding: 0;
  margin: 0;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s;
}

.btn-add-col:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

/* disq-trust.ai: Orange-Theme in der App (Session-Plattform) */
.tenant-disqtrust {
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --primary-soft: #fff7ed;
  --primary-border: #fdba74;
  --shadow-soft: 0 4px 24px rgba(234, 88, 12, 0.14);
}

.tenant-disqtrust button:not(.danger):not(.dropzone-clear):not(.primary) {
  border-color: var(--primary-border);
  color: var(--primary);
}

.tenant-disqtrust button:not(.danger):not(.dropzone-clear):not(.primary):hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-hover);
}

.tenant-disqtrust button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.tenant-disqtrust button.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

.tenant-disqtrust .dropzone {
  background: linear-gradient(180deg, var(--surface-muted) 0%, var(--surface-subtle) 100%);
}

.tenant-disqtrust .dropzone:hover {
  box-shadow: 0 0 0 1px rgba(234, 88, 12, 0.1);
}

.tenant-disqtrust .dropzone.has-file {
  background: linear-gradient(160deg, var(--primary-soft) 0%, var(--primary-border) 45%, var(--primary-soft) 100%);
  box-shadow: inset 0 0 0 1px rgba(234, 88, 12, 0.15);
}

.tenant-disqtrust .dropzone.has-file:hover {
  box-shadow: inset 0 0 0 1px rgba(234, 88, 12, 0.22);
}

.tenant-disqtrust .btn-add-col:hover {
  background: var(--primary-soft);
}

.col-select-row,
.contact-split-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.col-select-row select,
.contact-split-row select {
  flex: 1;
  min-width: 0;
}

.btn-row-remove {
  width: 2rem;
  height: 2rem;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.btn-row-remove:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

.contact-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.875rem;
}

.contact-mode label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

#uploadStatus {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.8125rem;
  margin-top: 0.75rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

thead {
  background: var(--thead-bg);
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.65rem;
  text-align: left;
}

th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--surface-hover);
}

/* Progress */
progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: none;
  background: var(--progress-track);
}

progress::-webkit-progress-bar {
  background: var(--progress-track);
  border-radius: 999px;
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--primary), var(--primary-accent));
  border-radius: 999px;
}

progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--primary), var(--primary-accent));
  border-radius: 999px;
}

#progText {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
}

.pipeline-parallel-hint {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.progress-worker-line {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
}

.activity-current {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  min-height: 1.25em;
}

.progress-sun-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.progress-main-col {
  flex: 1;
  min-width: 0;
}

.loading-sun-wrap {
  flex-shrink: 0;
  color: var(--primary);
  opacity: 0.35;
  transition: opacity 0.25s ease;
}

.loading-sun-wrap.is-active {
  opacity: 1;
}

.loading-sun-svg {
  display: block;
}

.loading-sun-wrap.is-active .loading-sun-rotor {
  animation: loading-sun-spin 10s linear infinite;
  transform-origin: 50px 50px;
}

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

@media (prefers-reduced-motion: reduce) {
  .loading-sun-wrap.is-active .loading-sun-rotor {
    animation: none;
  }
}

.activity-log-wrap {
  margin: 0.5rem 0 0;
}

.activity-log-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.35rem;
}

.activity-log-copy-btn {
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  margin: 0;
}

.activity-log {
  max-height: min(70vh, 28rem);
  overflow-y: auto;
  margin: 0;
  padding: 0.65rem 0.75rem;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary);
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
  overscroll-behavior: contain;
}

.activity-log-line + .activity-log-line {
  margin-top: 0.4rem;
}

.activity-log-time {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.progress-time-hint {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* Links in results */
#stepDone a {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  margin-right: 1rem;
}

#stepDone a:hover {
  text-decoration: underline;
}

.job-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.job-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}

.job-list li:last-child {
  border-bottom: none;
}

.archive-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}

.archive-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.archive-table th,
.archive-table td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.archive-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.archive-table tbody tr:hover {
  background: var(--surface-muted);
}

.archive-table code {
  font-size: 0.8em;
}

.archive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.archive-actions a {
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.8125rem;
}

.archive-actions a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .dashboard {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }

  .sidebar-user {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
    width: auto;
    margin-left: auto;
  }
}

/* Pipeline: „Ansprechpartner"-Spaltenzuordnung temporär ohne sichtbare UI (Logik in app.html).
   Reaktivieren: SHOW_CONTACT_MAPPING_UI = true; Klasse contact-mapping-ui-hidden am Wrapper löschen. */
.contact-mapping-ui-hidden {
  display: none !important;
}

/* ----- Theme toggle ----- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.theme-toggle:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
  color: var(--text);
}

.theme-toggle-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.sidebar-theme {
  padding: 0.35rem 0.5rem 0;
}

.sidebar-theme .theme-toggle {
  width: 100%;
  justify-content: center;
}

.auth-theme-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.auth-theme-row .theme-toggle {
  width: 100%;
  justify-content: center;
}

/* ----- Dark mode (Portfolio-Stil: tiefschwarz, Charcoal-Karten, soft radius) ----- */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #121212;
  --surface-muted: #1a1a1a;
  --surface-subtle: #161616;
  --surface-hover: #222222;
  --input-muted-bg: #1a1a1a;
  --thead-bg: #1a1a1a;
  --progress-track: #2a2a2a;
  --code-bg: #1a1a1a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #737373;
  --danger-soft: rgba(220, 38, 38, 0.12);
  --shadow-card: none;
  --shadow-soft: none;
  --radius-lg: 24px;
  --radius-xl: 28px;
  --primary-soft: rgba(99, 102, 241, 0.14);
  --primary-border: rgba(129, 140, 248, 0.35);
}

html[data-theme="dark"] body.tenant-disqtrust {
  --primary: #fb923c;
  --primary-hover: #f97316;
  --primary-soft: rgba(251, 146, 60, 0.14);
  --primary-border: rgba(251, 146, 60, 0.38);
}

html[data-theme="dark"] .auth-body,
html[data-theme="dark"] .auth-body--diind,
html[data-theme="dark"] .auth-body--disqtrust {
  background: var(--bg);
}

html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: none;
  border-radius: var(--radius-xl);
}

html[data-theme="dark"] .sidebar {
  background: var(--bg);
  border-right-color: var(--border);
}

html[data-theme="dark"] .nav-item:hover {
  background: var(--surface-muted);
}

html[data-theme="dark"] .nav-item.active {
  background: var(--surface);
  border: 1px solid var(--border);
}

html[data-theme="dark"] .theme-toggle {
  border-radius: 999px;
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .theme-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

html[data-theme="dark"] button:not(.danger):not(.dropzone-clear):not(.primary) {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-secondary);
}

html[data-theme="dark"] button:not(.danger):not(.dropzone-clear):not(.primary):hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

html[data-theme="dark"] .tenant-disqtrust button:not(.danger):not(.dropzone-clear):not(.primary) {
  border-color: var(--primary-border);
  color: var(--primary);
}

html[data-theme="dark"] .tenant-disqtrust button:not(.danger):not(.dropzone-clear):not(.primary):hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-hover);
}

html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="datetime-local"],
html[data-theme="dark"] input[type="month"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .auth-card .auth-field {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] .auth-card .auth-field:focus {
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

html[data-theme="dark"] .dropzone {
  background: var(--surface-muted);
  border-color: var(--border-strong);
}

html[data-theme="dark"] .dropzone:hover,
html[data-theme="dark"] .dropzone.drag {
  background: var(--surface-hover);
  box-shadow: none;
}

html[data-theme="dark"] .dropzone.has-file {
  background: var(--surface);
  box-shadow: none;
}

html[data-theme="dark"] .dropzone-pick-appearance {
  background: var(--surface);
  border-color: var(--border-strong);
}

html[data-theme="dark"] .dropzone-clear {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: none;
}

html[data-theme="dark"] .estimate,
html[data-theme="dark"] .worker-choice-panel {
  background: var(--surface-muted);
  border-color: var(--border);
}

html[data-theme="dark"] table {
  border-color: var(--border);
}

html[data-theme="dark"] .activity-log {
  background: var(--surface-muted);
  border-color: var(--border);
}

html[data-theme="dark"] .error {
  background: var(--danger-soft);
  border: 1px solid rgba(220, 38, 38, 0.35);
}

html[data-theme="dark"] .badge-new {
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

html[data-theme="dark"] button.primary,
html[data-theme="dark"] .auth-card button[type="submit"] {
  border-radius: 999px;
  box-shadow: none;
}

html[data-theme="dark"] .nav-item {
  border-radius: 999px;
}

html[data-theme="dark"] .hint code {
  background: var(--code-bg);
  border: 1px solid var(--border);
}

@media (max-width: 900px) {
  .sidebar-theme {
    width: 100%;
  }

  .sidebar-theme .theme-toggle {
    width: auto;
  }
}

