/*
  Osna-Solution Look & Feel: Markenfarben (Teal #3DACCC, Schwarz, zwei
  Grautoene, Weiss) und Montserrat als durchgaengige UI-Schrift. Fuer
  technische Datenfelder (Domains, IPs, Befehle, Pfade) bleibt bewusst
  eine Monospace-Schrift erhalten - das ist reine Lesbarkeits-
  Entscheidung fuer ein Admin-Werkzeug, kein Bruch mit dem Markenauftritt.
*/

:root {
  /* Markenfarben (aus dem Styleguide) */
  --brand-teal: #3daccc;
  --brand-teal-dark: #2c8aa6;
  --brand-black: #000000;
  --brand-gray-dark: #4d4d4d;
  --brand-gray-light: #cccccc;
  --brand-gray-bg: #f2f2f2;
  --brand-white: #ffffff;

  /* Semantische Zuordnung - Variablennamen bewusst beibehalten (werden
     an mehreren Stellen inline in index.html/app.js referenziert),
     nur die Werte sind neu auf die Marke gemappt. */
  --paper: var(--brand-gray-bg);
  --ink: var(--brand-black);
  --ink-soft: var(--brand-gray-dark);
  --line: var(--brand-gray-light);
  --transfer-blue: var(--brand-teal);
  --transfer-blue-soft: #e4f4f8;
  --stamp-red: #c0392b;
  --stamp-red-soft: #fbe9e7;
  --amber: #b8860b;
  --amber-soft: #f6ecd9;

  --font-display: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--brand-gray-bg);
  color: var(--ink);
  font-family: var(--font-body);
  min-height: 100vh;
}

body {
  padding-bottom: 60px;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Kopfleiste (durchgehender dunkler Balken, Logo ist ein weisses SVG) ---- */
.topbar {
  background: var(--brand-black);
  border-bottom: 3px solid var(--brand-teal);
}

.topbar-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-brand img {
  height: 30px;
  width: auto;
  display: block;
}

.topbar-brand .product-name {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--brand-white);
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  padding-left: 14px;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.topbar-nav-link {
  background: none;
  border: none;
  padding: 4px 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.6);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-nav-link:hover { color: rgba(255, 255, 255, 0.85); }

.topbar-nav-link.active {
  color: var(--brand-teal);
  border-bottom-color: var(--brand-teal);
}

.topbar-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.25);
}

.topbar-logout {
  background: transparent;
  color: var(--brand-white);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 7px 14px;
  font-size: 11px;
}

.topbar-logout:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

body { padding-top: 26px; }

.wizard-subhead {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-top: 10px;
}

.role-tag {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 3px;
}

.role-tag.admin { background: var(--brand-teal); color: var(--brand-white); }
.role-tag.customer { background: var(--brand-gray-light); color: var(--ink); }

/* ---- Karten / Sektionen ---- */
.panel {
  background: var(--brand-white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 24px;
  margin-bottom: 22px;
}

.panel h2 {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 14px;
  margin: 0 0 16px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel h2::before {
  content: "";
  width: 16px;
  height: 3px;
  background: var(--brand-teal);
  display: inline-block;
  border-radius: 2px;
}

/* ---- Formulare ---- */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.field input, .field select {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--brand-white);
  color: var(--ink);
}

.field input:focus, .field select:focus, button:focus-visible, .row-check:focus-visible {
  outline: 2px solid var(--brand-teal);
  outline-offset: 1px;
}

button {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 12px;
  padding: 11px 22px;
  border: 1px solid var(--brand-teal);
  border-radius: 5px;
  background: var(--brand-teal);
  color: var(--brand-white);
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}

button:hover:not(:disabled) {
  background: var(--brand-teal-dark);
  border-color: var(--brand-teal-dark);
}

button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

button.secondary:hover:not(:disabled) {
  background: var(--brand-gray-bg);
  border-color: var(--brand-gray-light);
}

button.danger { border-color: var(--stamp-red); color: var(--stamp-red); background: transparent; }
button.danger:hover:not(:disabled) { background: var(--stamp-red-soft); }

button:disabled { opacity: 0.4; cursor: not-allowed; }

.error-text {
  color: var(--stamp-red);
  font-size: 12px;
  font-family: var(--font-mono);
  margin-top: 6px;
}

.hint {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: -4px;
  margin-bottom: 14px;
}

/* ---- Modus-Umschalter (voller Account vs. selektiv) ---- */
.mode-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  width: fit-content;
  margin-bottom: 18px;
}

.mode-toggle button {
  border: none;
  border-radius: 0;
  background: var(--brand-white);
  color: var(--ink);
}

.mode-toggle button.active {
  background: var(--brand-teal);
  color: var(--brand-white);
}

/* ---- Manifest-Tabelle (Quelle -> Ziel) ---- */
.manifest-group { margin-bottom: 18px; }

.manifest-group h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.manifest-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 13px;
}

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

.manifest-row.disabled { opacity: 0.5; }

.row-check { width: 16px; height: 16px; accent-color: var(--brand-teal); }

.row-label strong { font-weight: 700; font-family: var(--font-body); }
.row-label span.meta { color: var(--ink-soft); font-size: 11px; display: block; font-family: var(--font-mono); }

.stamp-slot { min-width: 108px; text-align: right; }

/* Status-Badge nach Ausfuehrung eines Migrationsschritts */
.stamp {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  opacity: 0;
  transform: scale(0.85);
  animation: badge-in 180ms ease-out forwards;
}

.stamp.ok { background: var(--transfer-blue-soft); color: var(--brand-teal-dark); }
.stamp.err { background: var(--stamp-red-soft); color: var(--stamp-red); }
.stamp.skip { background: var(--amber-soft); color: var(--amber); }

@keyframes badge-in {
  0% { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .stamp { animation: none; opacity: 1; transform: scale(1); }
}

/* ---- Ausfuehrungs-Log ---- */
.step-log {
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ---- Schritt-fuer-Schritt-Assistent (Akkordeon) ---- */
.wizard {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wizard-step {
  background: var(--brand-white);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.wizard-step-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
}

.wizard-step-header:hover:not(:disabled) {
  background: var(--brand-gray-bg);
  border-color: transparent;
}

.wizard-step[data-status="locked"] .wizard-step-header {
  cursor: default;
}

.wizard-step[data-status="locked"] .wizard-step-header:hover {
  background: none;
}

.wizard-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  background: var(--brand-gray-light);
  color: var(--ink-soft);
}

.wizard-step-num .num-check { display: none; font-size: 14px; }

.wizard-step[data-status="active"] .wizard-step-num,
.wizard-step[data-status="done"] .wizard-step-num {
  background: var(--brand-teal);
  color: var(--brand-white);
}

.wizard-step[data-status="done"] .wizard-step-num .num-digit { display: none; }
.wizard-step[data-status="done"] .wizard-step-num .num-check { display: inline-block; }

.wizard-step-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  flex-shrink: 0;
}

.wizard-step[data-status="locked"] .wizard-step-title,
.wizard-step[data-status="todo"] .wizard-step-title {
  color: var(--ink-soft);
}

.wizard-step-summary {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-lock { display: none; color: var(--brand-gray-light); }

.icon-chevron {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--ink-soft);
  transition: transform 140ms ease;
  flex-shrink: 0;
}

.wizard-step[data-status="locked"] .icon-chevron { display: none; }
.wizard-step[data-status="locked"] .icon-lock { display: inline-block; }
.wizard-step[data-status="active"] .icon-chevron { transform: rotate(180deg); }

.wizard-step-body {
  display: none;
  padding: 0 20px 20px;
  animation: wizard-body-in 160ms ease-out;
}

.wizard-step[data-status="active"] .wizard-step-body { display: block; }

@keyframes wizard-body-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .wizard-step-body { animation: none; }
}

.step-line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dotted var(--line);
}

.step-line .msg { color: var(--stamp-red); }

/* ---- Utility ---- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.actions { display: flex; gap: 10px; margin-top: 18px; }

.hidden { display: none !important; }

footer.legal {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 40px;
}

@media (max-width: 720px) {
  .field-row, .two-col { grid-template-columns: 1fr; }
  .topbar-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
}
