@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,500&display=swap");

/* ======================================================================
   Hollermeier Kalkulationssoftware — Corporate Design
   Waldgrün / Salbei / Terrakotta / Messing
   ====================================================================== */

:root {
  --forest:     #1c2b24;
  --forest-2:   #243731;
  --sage:       #7ea183;
  --sage-pale:  #dfeae0;
  --rust:       #c07a3c;
  --rust-soft:  #f6e7dc;
  --brass:      #cda35a;
  --brass-soft: #f6ecd6;
  --mist:       #eef3ee;
  --white:      #ffffff;

  --text:       #1c2b24;
  --text-soft:  #44564c;
  --text-mute:  #7c8a80;
  --line:       #d3e0d5;
  --line-soft:  #e7eee7;

  --ok:         #4a6b50;
  --warn:       #c19a3b;
  --danger:     #c0533c;

  --font:       "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:       ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --maxw:       1180px;
  --r-sm:       8px;
  --r-md:       14px;
  --r-lg:       18px;

  --shadow-card: 0 14px 30px -22px rgba(28,43,36,0.4);
  --shadow-lift: 0 20px 50px -28px rgba(28,43,36,0.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--mist);
  line-height: 1.6;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--rust); text-decoration: none; }
a:hover { text-decoration: underline; }

h1,h2,h3,h4,h5 { letter-spacing: -0.025em; line-height: 1.15; }

input, select, textarea, button {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.muted { color: var(--text-mute); }
.muted.small, .small { font-size: 0.82rem; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.accent { color: var(--rust); }

hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ----------------------------------------------------------------------
   Topbar (Admin)
   ---------------------------------------------------------------------- */
.app { padding-bottom: 80px; }
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.1rem; color: var(--forest);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-large { font-size: 1.7rem; gap: 14px; margin-bottom: 18px; }

.topnav { display: flex; gap: 28px; flex: 1; }
.topnav a {
  font-size: 0.92rem; font-weight: 600; color: var(--text-soft);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.topnav a:hover { color: var(--forest); text-decoration: none; }
.topnav a.active { color: var(--forest); border-bottom-color: var(--rust); }

.topbar-user { display: flex; align-items: center; gap: 16px; font-size: 0.88rem; }
.topbar-user .user-name { color: var(--text-soft); }
.topbar-user .logout {
  color: var(--rust); font-weight: 600;
}

.main { min-height: 60vh; }

/* ----------------------------------------------------------------------
   Hero / Cover-ähnlich
   ---------------------------------------------------------------------- */
.hero {
  background: var(--forest);
  color: var(--mist);
  padding: 60px 0 56px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; right: -120px; top: -120px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(126,161,131,0.22), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 800; color: #fff; max-width: 18ch;
  margin-bottom: 14px;
}
.hero-lead { color: #b9c8bd; font-size: 1.08rem; max-width: 54ch; margin-bottom: 30px; }
.eyebrow {
  font-weight: 600; font-size: 0.78rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--brass);
  margin-bottom: 18px;
}

.stat-row { display: flex; gap: 24px; margin-top: 36px; flex-wrap: wrap; }
.stat {
  padding: 18px 22px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(126,161,131,0.25);
  min-width: 130px;
}
.stat b { display: block; font-size: 1.6rem; color: #fff; font-weight: 800; letter-spacing: -0.02em; }
.stat span { color: #b9c8bd; font-size: 0.82rem; font-weight: 600; }
.stat.highlight { border-color: var(--brass); background: rgba(205,163,90,0.12); }
.stat.highlight b { color: var(--brass); }
.stat.success { border-color: var(--sage); background: rgba(126,161,131,0.15); }
.stat.success b { color: var(--sage); }

/* ----------------------------------------------------------------------
   Section / Block-Layout
   ---------------------------------------------------------------------- */
section.block { padding: 56px 0; }
.bg-white { background: var(--white); }

.sec-num {
  font-weight: 700; font-size: 0.78rem; letter-spacing: 0.16em;
  color: var(--rust); margin-bottom: 10px;
  text-transform: uppercase;
}
.sec-title {
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  font-weight: 800; color: var(--forest); margin-bottom: 10px;
}
.sec-intro {
  color: var(--text-soft); font-size: 1rem;
  max-width: 62ch; margin-bottom: 32px;
}

.head-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 28px; flex-wrap: wrap;
}
.head-actions { display: flex; gap: 10px; align-items: center; }

.back-link {
  display: inline-block; margin-bottom: 18px;
  font-size: 0.88rem; font-weight: 600; color: var(--text-soft);
}
.back-link:hover { color: var(--rust); text-decoration: none; }

.two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  align-items: start;
}

/* ----------------------------------------------------------------------
   Buttons / Pills
   ---------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 999px;
  border: none; cursor: pointer;
  transition: transform 80ms ease, box-shadow 200ms ease;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--rust); color: #fff;
  box-shadow: 0 10px 24px -10px rgba(192,122,60,0.7);
}
.btn-primary:hover { box-shadow: 0 14px 30px -10px rgba(192,122,60,0.8); }
.btn-dark { background: var(--forest); color: #fff; }
.btn-ghost {
  background: transparent; color: var(--forest);
  border: 2px solid var(--sage);
}
.btn-ghost:hover { background: rgba(126,161,131,0.12); }

.link-btn {
  background: transparent; border: 0; color: var(--rust);
  font-weight: 600; cursor: pointer; padding: 4px 8px;
}

.pill {
  display: inline-block;
  font-size: 0.7rem; padding: 4px 10px;
  border-radius: 20px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.pill-rust  { background: var(--rust); color: #fff; }
.pill-brass { background: rgba(205,163,90,0.2); color: #9a7124; border: 1px solid rgba(205,163,90,0.5); }
.pill-sage  { background: rgba(126,161,131,0.2); color: #466b4d; border: 1px solid rgba(126,161,131,0.5); }

/* Status-Pills */
.status-pill {
  display: inline-block;
  font-size: 0.72rem; padding: 4px 11px;
  border-radius: 20px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.status-pill.entwurf         { background: rgba(124,138,128,0.18); color: var(--text-soft); }
.status-pill.versendet,
.status-pill.offen           { background: var(--brass-soft); color: #8a6b1e; border: 1px solid rgba(205,163,90,0.4); }
.status-pill.angesehen       { background: rgba(126,161,131,0.18); color: var(--ok); }
.status-pill.teil_angenommen { background: var(--brass-soft); color: #8a6b1e; }
.status-pill.angenommen      { background: rgba(126,161,131,0.25); color: var(--ok); border: 1px solid var(--sage); }
.status-pill.abgelehnt       { background: var(--rust-soft); color: var(--danger); border: 1px solid rgba(192,83,60,0.4); }
.status-pill.abgelaufen      { background: rgba(124,138,128,0.18); color: var(--text-mute); }

/* Stufen-Pills (S/M/L) */
.stufe-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  font-size: 0.78rem; font-weight: 800; color: #fff;
  letter-spacing: 0;
}
.stufe-pill.stufe-S { background: var(--sage); }
.stufe-pill.stufe-M { background: var(--rust); }
.stufe-pill.stufe-L { background: var(--forest); }

/* Ampel-Punkte */
.ampel { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; }
.ampel-gruen { background: var(--sage); box-shadow: 0 0 0 3px rgba(126,161,131,0.2); }
.ampel-gelb  { background: var(--brass); box-shadow: 0 0 0 3px rgba(205,163,90,0.2); }
.ampel-rot   { background: var(--danger); box-shadow: 0 0 0 3px rgba(192,83,60,0.2); }

/* ----------------------------------------------------------------------
   Tabellen
   ---------------------------------------------------------------------- */
.data-table {
  width: 100%; background: var(--white);
  border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  border-collapse: separate; border-spacing: 0;
}
.data-table th {
  background: var(--mist);
  text-align: left;
  font-size: 0.74rem; letter-spacing: 0.08em;
  text-transform: uppercase; font-weight: 700;
  color: var(--text-mute);
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.95rem;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: rgba(238,243,238,0.5); }
.row-actions a { font-size: 0.85rem; font-weight: 600; }

/* ----------------------------------------------------------------------
   Karten, Formulare
   ---------------------------------------------------------------------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px 28px;
  box-shadow: var(--shadow-card);
  margin-bottom: 28px;
}
.card h3, .card h4 { color: var(--forest); margin-bottom: 14px; }
.card h3 { font-size: 1.15rem; }
.card h4 { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rust); margin-top: 18px; }
.card.sticky { position: sticky; top: 90px; }

.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px;
  align-items: end;
}
.form-grid > .span-2 { grid-column: 1 / -1; }
.form-grid label {
  display: flex; flex-direction: column;
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-mute);
}
.form-grid input,
.form-grid select,
.form-grid textarea {
  margin-top: 6px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--white);
  font-size: 0.96rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
}
.form-grid textarea { resize: vertical; min-height: 70px; }
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  outline: none;
  border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(192,122,60,0.15);
}
.form-grid h3, .form-grid h4 {
  grid-column: 1 / -1; color: var(--forest);
  font-size: 0.95rem; font-weight: 800;
  letter-spacing: -0.01em; text-transform: none;
  margin-top: 16px; padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}
.form-grid h3:first-child, .form-grid h4:first-child { border-top: 0; margin-top: 0; padding-top: 0; }

.form-h {
  grid-column: 1 / -1;
  font-size: 0.95rem; font-weight: 800; color: var(--forest);
  margin-top: 18px; padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input, .inline-form select {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 0.94rem;
}

.check-grid { display: flex; gap: 24px; flex-wrap: wrap; grid-column: 1 / -1; }
.check { flex-direction: row !important; align-items: center; gap: 8px; text-transform: none !important; font-size: 0.92rem !important; color: var(--text) !important; }
.check input { margin: 0; }

.check-list { padding-left: 20px; color: var(--text-soft); }
.check-list li { margin-bottom: 8px; }
.check-list li::marker { color: var(--rust); }

/* ----------------------------------------------------------------------
   Phase-Block / Bausteine-Tabelle
   ---------------------------------------------------------------------- */
.phase-block { margin-bottom: 30px; }
.phase-title {
  font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--rust); margin-bottom: 12px;
}

.baustein-table {
  width: 100%;
  background: var(--white);
  border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--line);
  border-collapse: separate; border-spacing: 0;
}
.baustein-table th, .baustein-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.baustein-table th {
  background: var(--mist);
  font-size: 0.7rem; letter-spacing: 0.08em;
  text-transform: uppercase; font-weight: 700;
  color: var(--text-mute);
  text-align: left;
}
.baustein-table tr:last-child td { border-bottom: 0; }
.baustein-table .col-rel,
.baustein-table .col-addon { width: 70px; text-align: center; }
.baustein-table .col-komp { width: 150px; }
.baustein-table .col-stunden { width: 100px; }
.baustein-table .col-name b { color: var(--forest); }
.baustein-table input[type="checkbox"] { transform: scale(1.2); accent-color: var(--rust); }
.baustein-table input, .baustein-table select {
  width: 100%; padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.88rem;
}
.baustein-table .stunden-input { text-align: right; font-family: var(--mono); }

/* ----------------------------------------------------------------------
   Kalkulator-Layout (Bausteine + Ergebnis-Sidebar)
   ---------------------------------------------------------------------- */
.kalk-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; margin-bottom: 26px; flex-wrap: wrap;
}
.kalk-grid {
  display: grid; grid-template-columns: 1fr 360px; gap: 28px;
  align-items: start;
}

.metric-list { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; }
.metric-list dt {
  font-size: 0.72rem; letter-spacing: 0.08em;
  text-transform: uppercase; font-weight: 700;
  color: var(--text-mute); align-self: center;
}
.metric-list dd { text-align: right; font-weight: 600; color: var(--forest); }
.metric-list dd.accent { color: var(--rust); font-weight: 800; font-size: 1.15em; }

.kalk-ergebnis .card { padding: 22px 24px; }
.kalk-ergebnis .card .btn { width: 100%; margin-top: 14px; }
/* Einzelnes Label in der Ergebnis-Sidebar sauber stapeln (Karte ist kein form-grid) */
.kalk-ergebnis label {
  display: flex; flex-direction: column;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-mute); margin-top: 4px;
}
.kalk-ergebnis label input {
  margin-top: 6px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 0.96rem; font-weight: 400;
  text-transform: none; letter-spacing: normal;
}
.kalk-ergebnis label input:focus {
  outline: none; border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(192,122,60,0.14);
}

/* ----------------------------------------------------------------------
   Quick Cards
   ---------------------------------------------------------------------- */
.quick-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.quick-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 200ms ease, border-color 200ms ease;
  box-shadow: var(--shadow-card);
}
.quick-card:hover {
  border-color: var(--rust);
  transform: translateY(-2px);
  text-decoration: none;
}
.qc-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--rust-soft); color: var(--rust);
  font-weight: 800; font-size: 1.2rem; margin-bottom: 14px;
}
.quick-card b { display: block; color: var(--forest); font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.quick-card span { color: var(--text-mute); font-size: 0.88rem; }

/* ----------------------------------------------------------------------
   Tabs (Einstellungen)
   ---------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.tabs a {
  padding: 10px 18px;
  font-size: 0.88rem; font-weight: 600; color: var(--text-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs a.active { color: var(--forest); border-bottom-color: var(--rust); }

/* ----------------------------------------------------------------------
   Angebote-Detail: Block-Card
   ---------------------------------------------------------------------- */
.block-card {
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 14px;
  padding: 0;
  overflow: hidden;
}
.block-card summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  display: flex; gap: 14px; align-items: center;
  font-weight: 600;
}
.block-card summary::-webkit-details-marker { display: none; }
.block-card summary b { color: var(--forest); flex: 1; }
.block-card .block-typ {
  font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--rust); font-weight: 700;
}
.block-card form { padding: 18px; background: var(--white); border-top: 1px solid var(--line-soft); }

/* ----------------------------------------------------------------------
   Meilensteine-Liste
   ---------------------------------------------------------------------- */
.ms-list { list-style: none; padding: 0; margin: 10px 0; }
.ms-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline;
}
.ms-list li:last-child { border-bottom: 0; }
.ms-list li.done b { text-decoration: line-through; color: var(--text-mute); }
.ms-list li b { color: var(--forest); }
.ms-list li > div { flex-basis: 100%; }
.ms-list.portal {
  counter-reset: msx;
  background: var(--mist);
  border-radius: var(--r-md);
  padding: 10px 22px;
}
.ms-list.portal li {
  counter-increment: msx;
  position: relative;
  padding-left: 36px;
}
.ms-list.portal li::before {
  content: counter(msx);
  position: absolute; left: 0; top: 12px;
  width: 24px; height: 24px;
  background: var(--rust); color: #fff;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 800;
}
.ms-list.portal li.done::before { background: var(--sage); }
.ms-delete { display: inline-block; margin-left: auto; }

/* ----------------------------------------------------------------------
   Link-List in Karten
   ---------------------------------------------------------------------- */
.link-list { list-style: none; padding: 0; }
.link-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.link-list li:last-child { border-bottom: 0; }

/* ----------------------------------------------------------------------
   Flash / Alerts
   ---------------------------------------------------------------------- */
.flash-wrap { padding-top: 24px; }
.flash {
  padding: 12px 18px;
  border-radius: var(--r-sm);
  margin-bottom: 12px;
  font-size: 0.92rem;
  border-left: 4px solid var(--sage);
  background: var(--sage-pale);
  color: var(--text-soft);
}
.flash-danger { border-left-color: var(--rust); background: var(--rust-soft); color: #6b3414; }
.flash-success { border-left-color: var(--sage); background: var(--sage-pale); color: #2f4a35; }
.flash-info { border-left-color: var(--brass); background: var(--brass-soft); color: #6e561f; }
.flash-warning { border-left-color: var(--brass); background: var(--brass-soft); color: #6e561f; }

/* ----------------------------------------------------------------------
   Footer
   ---------------------------------------------------------------------- */
.footer {
  background: var(--forest);
  color: #8fa295;
  padding: 30px 0;
  font-size: 0.84rem;
  margin-top: 60px;
}
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ======================================================================
   Install-Wizard
   ====================================================================== */
.install { background: var(--mist); min-height: 100vh; padding: 40px 16px; }
.install-shell { max-width: 820px; margin: 0 auto; }
.install-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 36px;
}
.install-header .brand { font-size: 1.4rem; }
.install-header .eyebrow { margin-bottom: 0; color: var(--rust); }
.install-progress {
  display: flex; gap: 6px; margin-bottom: 18px;
}
.prog-step {
  flex: 1; height: 6px; border-radius: 3px;
  background: var(--line);
}
.prog-step.active { background: var(--rust); }
.prog-step.done { background: var(--sage); }

.install-card {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 44px 48px;
  box-shadow: var(--shadow-lift);
  border: 1px solid var(--line);
}
.install-card h1.sec-title { margin-bottom: 14px; }
.install-card code {
  font-family: var(--mono);
  background: var(--mist);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.92em;
}

/* ======================================================================
   Auth (Login)
   ====================================================================== */
.auth {
  background: var(--forest);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
  position: relative; overflow: hidden;
}
.auth::after {
  content: ""; position: absolute;
  right: -150px; bottom: -150px;
  width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(126,161,131,0.18), transparent 70%);
}
.auth-shell { width: 100%; max-width: 480px; position: relative; z-index: 1; }
.auth-card {
  background: var(--white);
  padding: 44px 44px 36px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lift);
}
.auth-card h1 { font-size: 1.7rem; margin-bottom: 24px; color: var(--forest); }
.auth-card .btn { width: 100%; }
.auth-hint {
  margin-top: 28px; padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.86rem; color: var(--text-mute);
}

/* ======================================================================
   PORTAL — Was der Kunde sieht (edel)
   ====================================================================== */
.portal { background: var(--mist); padding-bottom: 0; }
.pwrap { max-width: 860px; margin: 0 auto; padding: 0 32px; }

/* ---- Cover ---- */
.portal-cover {
  background:
    radial-gradient(900px 500px at 78% -10%, rgba(126,161,131,0.20), transparent 60%),
    linear-gradient(176deg, #213329 0%, var(--forest) 60%);
  color: var(--mist);
  padding: 64px 0 76px;
  position: relative;
  overflow: hidden;
}
.portal-cover::before {
  content:""; position:absolute; left:0; right:0; bottom:0; height:1px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
  opacity: 0.5;
}
.cover-inner { max-width: 860px; margin: 0 auto; padding: 0 32px; position: relative; z-index: 1; }
.cover-logo { margin-bottom: 52px; }
.cover-logo img { max-height: 52px; width: auto; display: block; }
.cover-logo .mark { display: inline-flex; align-items: center; gap: 14px; }
.cover-logo .mark .bn { font-weight: 800; font-size: 1.45rem; color: #fff; letter-spacing: -0.02em; }

.cover-eyebrow {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--brass); margin-bottom: 20px;
}
.portal-cover h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800; color: #fff; max-width: 20ch;
  letter-spacing: -0.03em; line-height: 1.08;
}
.cover-recipient { color: #9fb3a4; font-size: 1rem; margin-top: 14px; }
.cover-intro {
  color: #c6d3c8; font-size: 1.12rem; line-height: 1.65;
  max-width: 60ch; margin-top: 22px; font-weight: 300;
}
.cover-meta {
  margin-top: 38px; display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap; font-size: 0.9rem; color: #9fb3a4;
}
.cover-meta .dot { opacity: 0.5; }
.cover-meta .warn { color: var(--brass); font-weight: 600; }
.cover-pdf { color: var(--mist); text-decoration: none; border-bottom: 1px solid rgba(238,243,238,0.4); padding-bottom: 1px; }
.cover-pdf:hover { color: #fff; border-color: var(--brass); text-decoration: none; }

.portal-flash-wrap { max-width: 860px; margin: 0 auto; padding: 24px 32px 0; }

/* ---- Strecke / Blöcke ---- */
.portal-blocks { padding: 72px 0 40px; }
.portal-h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.3rem); font-weight: 800;
  color: var(--forest); letter-spacing: -0.025em; margin-bottom: 12px;
}
.portal-intro { color: var(--text-soft); font-size: 1.05rem; max-width: 60ch; margin-bottom: 44px; }

.lblock {
  display: grid; grid-template-columns: 64px 1fr; gap: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 34px 38px;
  margin-bottom: 22px;
  box-shadow: 0 24px 50px -34px rgba(28,43,36,0.5);
  position: relative;
  transition: box-shadow 220ms ease, transform 220ms ease;
}
.lblock:hover { box-shadow: 0 30px 60px -34px rgba(28,43,36,0.6); }
.lblock-num {
  font-size: 1.5rem; font-weight: 800; color: var(--line);
  letter-spacing: -0.02em; line-height: 1; padding-top: 4px;
}
.lblock-main { min-width: 0; }
.lblock-diagnose { border-top: 3px solid var(--sage); }
.lblock-projekt  { border-top: 3px solid var(--rust); }
.lblock-retainer { border-top: 3px solid var(--brass); }
.lblock.is-angenommen { background: linear-gradient(180deg, rgba(126,161,131,0.07), transparent 22%); }
.lblock.is-angenommen .lblock-num { color: var(--sage); }
.lblock.is-aenderungswunsch, .lblock.is-abgelehnt { background: linear-gradient(180deg, rgba(205,163,90,0.08), transparent 22%); }

.lblock-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; border-bottom: 1px solid var(--line-soft);
  padding-bottom: 18px; margin-bottom: 20px;
}
.lblock-kicker {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--rust); margin-bottom: 6px;
}
.lblock-head h3 {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem); font-weight: 800;
  color: var(--forest); letter-spacing: -0.02em; line-height: 1.15;
}
.lblock-price { text-align: right; white-space: nowrap; }
.lblock-price .amount {
  display: block; font-size: 1.7rem; font-weight: 800;
  color: var(--forest); letter-spacing: -0.02em;
}
.lblock-price .period { font-size: 0.82rem; color: var(--text-mute); font-weight: 600; }

.lblock-prose { color: var(--text-soft); font-size: 1.02rem; line-height: 1.7; margin-bottom: 6px; }
.lblock-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 36px; margin-top: 16px; }
.lblock-lists .ll-col h4 {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--rust); margin: 14px 0 10px;
}
.lblock-lists ul { list-style: none; padding: 0; margin: 0; }
.lblock-lists li {
  position: relative; padding-left: 24px; margin-bottom: 9px;
  color: var(--text-soft); font-size: 0.96rem; line-height: 1.5;
}
.lblock-lists li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--sage); font-weight: 800; font-size: 0.85rem;
}
.lblock-lists ul.addons li::before { content: "+"; color: var(--brass); }

.ms-head {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--rust); margin: 22px 0 14px;
}
.ms-rail { list-style: none; padding: 0; margin: 0; }
.ms-rail li {
  position: relative; padding-left: 30px; padding-bottom: 18px;
  border-left: 2px solid var(--line); margin-left: 6px;
}
.ms-rail li:last-child { border-left-color: transparent; padding-bottom: 0; }
.ms-rail .ms-dot {
  position: absolute; left: -7px; top: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--rust);
}
.ms-rail li.done .ms-dot { background: var(--sage); border-color: var(--sage); }
.ms-rail li.done b { color: var(--text-mute); text-decoration: line-through; }
.ms-rail b { color: var(--forest); }

.lblock-foot {
  margin-top: 26px; padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.ack {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  font-weight: 700; font-size: 0.92rem;
}
.ack-yes { background: var(--sage-pale); color: var(--ok); }
.ack-change { background: var(--brass-soft); color: #8a6b1e; }
.ack-muted { background: rgba(124,138,128,0.14); color: var(--text-mute); font-weight: 600; }

.lblock-overview { grid-template-columns: 64px 1fr; }
.lblock-overview .lblock-num { color: var(--brass); }
.lblock-overview h3 { font-size: 1.3rem; font-weight: 800; color: var(--forest); margin-bottom: 16px; }

/* ---- AVV-Sektion ---- */
.portal-avv { padding: 30px 0 60px; }
.avv-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 40px 44px;
  box-shadow: 0 24px 50px -34px rgba(28,43,36,0.5);
  border-top: 3px solid var(--brass);
}
.avv-card.signed { display: flex; gap: 24px; align-items: flex-start; border-top-color: var(--sage); }
.avv-card.muted-card { border-top-color: var(--line); opacity: 0.9; }
.avv-icon {
  flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%;
  background: var(--sage-pale); color: var(--ok);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 800;
}
.avv-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

.portal-footer-prose {
  padding: 10px 0 60px;
  color: var(--text-soft); font-size: 0.95rem;
}
.portal-footer-prose .pwrap { max-width: 860px; }

.portal-foot {
  background: var(--forest);
  color: #8fa295;
  padding: 34px 0;
  font-size: 0.84rem;
}
.portal-foot .pwrap {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  align-items: center;
}
.portal-foot .mark { display: flex; align-items: center; gap: 10px; }
.portal-foot .mark svg { width: 28px; height: 24px; }
.portal-foot .mark .bn { color: #fff; font-weight: 700; }

/* Modal */
dialog.modal {
  border: 0; border-radius: var(--r-lg);
  padding: 32px 36px;
  max-width: 520px; width: 92%;
  box-shadow: 0 30px 80px rgba(0,0,0,0.3);
  /* Zentrierung wiederherstellen: das globale `* { margin:0 }` killt das
     margin:auto, mit dem der Browser ein offenes <dialog> zentriert. */
  margin: auto;
  inset: 0;
}
dialog.modal::backdrop {
  background: rgba(28,43,36,0.6);
  backdrop-filter: blur(2px);
}
dialog.modal h3 { color: var(--forest); margin-bottom: 12px; font-size: 1.3rem; }
dialog.modal label {
  display: block;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-mute);
  margin-top: 16px;
}
dialog.modal input, dialog.modal textarea {
  width: 100%; margin-top: 6px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 0.96rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}
dialog.modal .form-actions { margin-top: 24px; justify-content: flex-end; }

/* ----------------------------------------------------------------------
   Backend: Logo, Bausteine-Editor, Logo-Upload, Änderungswunsch
   ---------------------------------------------------------------------- */
.brand-logo { max-height: 30px; width: auto; display: block; }

/* Inline-Editor (Bausteine) — volle Breite, feste Spalten */
.editor-page .wrap { max-width: 1640px; }
.editor-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.editor-toolbar.bottom { margin-top: 20px; margin-bottom: 0; }
.table-scroll { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--line); box-shadow: var(--shadow-card); background: var(--white); }
.editor-table {
  width: 100%; background: var(--white);
  border-collapse: separate; border-spacing: 0;
  table-layout: fixed;          /* feste Spaltenbreiten aus colgroup */
  min-width: 1080px;
}
/* Spaltenbreiten: Frage bekommt den Löwenanteil */
.editor-table .col-typ    { width: 8%; }
.editor-table .col-frage  { width: 25%; }
.editor-table .col-name   { width: 16%; }
.editor-table .col-hint   { width: 16%; }
.editor-table .col-h      { width: 56px; }
.editor-table .col-weg    { width: 11%; }
.editor-table .col-phase  { width: 12%; }
.editor-table .col-active { width: 58px; }
.editor-table .col-del    { width: 58px; }
.editor-table tr.row-qual { background: rgba(186,117,23,0.05); }
.editor-table tr.row-qual td:nth-child(5) input,
.editor-table tr.row-qual td:nth-child(6) select,
.editor-table tr.row-qual td:nth-child(7) select { opacity: 0.4; }
.editor-table .cell-typ { font-size: 0.82rem; }

.editor-table th {
  position: sticky; top: 0; z-index: 2;
  background: var(--forest); color: var(--mist);
  text-align: left; font-size: 0.7rem; letter-spacing: 0.06em;
  text-transform: uppercase; font-weight: 700;
  padding: 12px 14px;
}
.editor-table th.ta-c { text-align: center; }
.editor-table td { padding: 5px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.editor-table td.ta-c { text-align: center; }
.editor-table tr:hover td { background: rgba(238,243,238,0.5); }
.editor-table input, .editor-table select {
  width: 100%; padding: 9px 11px;
  border: 1px solid transparent; border-radius: 7px;
  background: transparent; font-size: 0.92rem;
  text-overflow: ellipsis;
}
.editor-table input:hover, .editor-table select:hover { border-color: var(--line); background: var(--white); }
.editor-table input:focus, .editor-table select:focus {
  outline: none; background: var(--white);
  border-color: var(--rust); box-shadow: 0 0 0 3px rgba(192,122,60,0.14);
}
.editor-table .cell-strong { font-weight: 600; color: var(--forest); }
.editor-table .cell-num { text-align: right; font-family: var(--mono); }
.editor-table .col-phase ~ td select, .editor-table select { font-size: 0.86rem; color: var(--text-soft); }
.editor-table .ta-c input[type="checkbox"] { width: auto; transform: scale(1.25); accent-color: var(--rust); cursor: pointer; }
.editor-table tr.phase-sep td {
  background: linear-gradient(var(--sage-pale), var(--mist));
  color: var(--forest);
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.phase-count {
  display: inline-block; margin-left: 8px;
  background: var(--sage); color: #fff;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0;
  padding: 1px 8px; border-radius: 20px; vertical-align: middle;
}
.editor-table tr.inactive input.cell-strong { color: var(--text-mute); }
.editor-table tr.inactive { background: rgba(124,138,128,0.05); }
.editor-table tr.to-delete { background: var(--rust-soft) !important; }
.editor-table tr.to-delete input, .editor-table tr.to-delete select { text-decoration: line-through; color: var(--danger); }
.editor-table tr.new-row { background: rgba(126,161,131,0.09); }
.rm-new { font-size: 1.3rem; line-height: 1; color: var(--danger); }

/* Logo-Upload */
.logo-upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.logo-box {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px; background: var(--white);
}
.logo-prev {
  height: 90px; border-radius: 8px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--mist);
}
.logo-prev-light { background: var(--forest); }
.logo-prev img { max-height: 64px; max-width: 90%; }
.up-label { font-size: 0.74rem !important; }
.up-label input[type="file"] { font-size: 0.82rem; margin-top: 6px; }

/* Änderungswunsch-Notiz im Backend */
.change-note {
  background: var(--brass-soft); border-left: 3px solid var(--brass);
  border-radius: 6px; padding: 10px 14px; margin: 12px 0;
  font-size: 0.9rem; color: #6e561f;
}
.hint-preview {
  background: var(--sage-pale); border-radius: var(--r-sm);
  padding: 12px 16px; font-size: 0.9rem; color: var(--text-soft);
}

/* ----------------------------------------------------------------------
   Customer-Journey-Check (Kalkulations-Detail)
   ---------------------------------------------------------------------- */
.check-stage {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 26px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}
.check-stage .stage-head { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.check-stage .stage-head h3 { font-size: 1.1rem; color: var(--forest); margin-bottom: 2px; }
.qual-stage { border-top: 3px solid var(--brass); }

/* Qualifizierungs-Zeile */
.qz-row {
  display: grid; grid-template-columns: 1fr auto; gap: 10px 18px;
  align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-soft);
}
.qz-row:last-child { border-bottom: 0; }
.qz-frage b { color: var(--forest); font-weight: 600; }
.qz-answer { display: inline-flex; gap: 0; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.qz-answer .seg { position: relative; cursor: pointer; }
.qz-answer .seg input { position: absolute; opacity: 0; pointer-events: none; }
.qz-answer .seg span {
  display: block; padding: 8px 18px; font-size: 0.88rem; font-weight: 600;
  color: var(--text-soft); transition: background 120ms ease;
}
.qz-answer .seg + .seg span { border-left: 1px solid var(--line); }
.qz-answer .qual-ja  input:checked ~ span { background: var(--sage); color: #fff; }
.qz-answer .qual-teils input:checked ~ span { background: var(--brass); color: #fff; }
.qz-answer .qual-nein input:checked ~ span { background: var(--danger); color: #fff; }
.qz-note { grid-column: 1 / -1; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 0.9rem; }

/* Leistungs-Zeile */
.lz-row {
  display: grid; grid-template-columns: 1fr 320px; gap: 8px 22px;
  padding: 14px 0; border-bottom: 1px solid var(--line-soft);
  border-left: 3px solid transparent; padding-left: 14px; margin-left: -14px;
}
.lz-row:last-child { border-bottom: 0; }
.lz-row.weg-projekt    { border-left-color: var(--sage); }
.lz-row.weg-addon      { border-left-color: var(--brass); }
.lz-row.weg-retainer   { border-left-color: var(--rust); }
.lz-row.weg-kein_scope { border-left-color: var(--text-mute); opacity: 0.66; }
.lz-row.weg-offen      { border-left-color: var(--line); }
.lz-frage b { color: var(--forest); font-weight: 600; display: block; }
.lz-frage .lz-name { font-size: 0.78rem; color: var(--text-mute); }
.lz-zustand { width: 100%; margin-top: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 0.9rem; }
.lz-controls { display: grid; grid-template-columns: 1.2fr 1fr 70px; gap: 8px; align-items: end; }
.lz-controls .ctl { display: flex; flex-direction: column; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-mute); }
.lz-controls select, .lz-controls input { margin-top: 4px; padding: 8px 9px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 0.86rem; font-weight: 400; text-transform: none; letter-spacing: normal; }
.lz-controls .lz-stunden { text-align: right; font-family: var(--mono); }

/* Qualifizierungs-Badge in der Sidebar */
.qual-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--r-md);
  background: rgba(124,138,128,0.12); font-size: 0.86rem; font-weight: 600; color: var(--text-soft);
}
.qual-badge .ql-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--text-mute); }
.qual-badge .ql-score { margin-left: auto; font-family: var(--mono); font-weight: 700; }
.qual-badge.qb-gruen { background: var(--sage-pale); color: var(--ok); }
.qual-badge.qb-gruen .ql-dot { background: var(--sage); }
.qual-badge.qb-gelb { background: var(--brass-soft); color: #8a6b1e; }
.qual-badge.qb-gelb .ql-dot { background: var(--brass); }
.qual-badge.qb-rot { background: var(--rust-soft); color: var(--danger); }
.qual-badge.qb-rot .ql-dot { background: var(--danger); }

.scope-counts { margin-top: 10px; font-size: 0.8rem; color: var(--text-soft); line-height: 1.6; }
.scope-counts .sc-out { color: var(--text-mute); }
.scope-counts .sc-open { color: #8a6b1e; }

/* Portal: ausgeschlossene Punkte */
.lblock-excluded { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); }
.lblock-excluded h4 { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-mute); margin-bottom: 8px; }
.lblock-excluded ul { list-style: none; padding: 0; margin: 0; }
.lblock-excluded li { position: relative; padding-left: 22px; margin-bottom: 6px; color: var(--text-mute); font-size: 0.92rem; }
.lblock-excluded li::before { content: "×"; position: absolute; left: 0; color: var(--danger); font-weight: 800; }

/* ----------------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------------- */
@media (max-width: 920px) {
  .two-col, .kalk-grid, .quick-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .install-card { padding: 30px 24px; }
  .logo-upload-grid { grid-template-columns: 1fr; }
  .lz-row { grid-template-columns: 1fr; }
  .qz-row { grid-template-columns: 1fr; }
  .lblock { grid-template-columns: 1fr; padding: 26px 22px; }
  .lblock-num { font-size: 1.1rem; }
  .lblock-head { flex-direction: column; }
  .lblock-price { text-align: left; }
  .lblock-lists { grid-template-columns: 1fr; }
  .avv-card { padding: 28px 24px; }
  .avv-card.signed { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
