/* Mezger CRM – Oberfläche nach Corporate Design Handbuch v1.1 (Juli 2026) */

@font-face {
  font-family: "Montserrat";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/montserrat-600.c9799d10d224.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/inter-variable.65850a373e25.woff2") format("woff2");
}

:root {
  /* Die elf definierten Markenfarben (Handbuch §3) */
  --navy: #1f2d3d;
  --tiefblau: #255e72;
  --petrol: #2e7d8c;
  --petrol-hell: #5ab0c0;
  --eislicht: #8fd6e2;
  --limette: #a8cc22;
  --anthrazit: #243239;
  --grau: #6b7a85;
  --linie: #d8e2e7;
  --hellgrund: #f5f8f9;
  --weiss: #ffffff;
  --brand-gradient: linear-gradient(135deg, #1f2d3d 0%, #255e72 55%, #2e7d8c 100%);

  --font-head: "Montserrat", Arial, sans-serif;
  --font-body: "Inter", Arial, sans-serif;
  --radius: 6px;

  /* Logo: 180 px Mindestbreite digital, Schutzraum = halber Kugeldurchmesser (§2.5/§2.6) */
  --logo-width: 180px;
  --logo-clear: 21px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 400 15px/1.55 var(--font-body);
  color: var(--anthrazit);
  background: var(--weiss);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--petrol); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 {
  margin: 0 0 .5em;
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--navy);
  text-align: left;
}
h1 { font-size: 27px; line-height: 1.2; }
h2 { font-size: 19px; line-height: 1.25; }
h3 { font-size: 16px; }
.muted { color: var(--grau); }
.error { color: #b3261e; }
.inline { display: inline; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

button.link {
  background: none; border: 0; padding: 0; color: var(--petrol);
  font: inherit; cursor: pointer;
}
button.link:hover { text-decoration: underline; }
button.primary {
  background: var(--navy); color: var(--weiss); border: 0; border-radius: var(--radius);
  padding: .65em 1.2em; font: 500 15px var(--font-body); cursor: pointer;
}
button.primary:hover { background: var(--tiefblau); }
button.primary:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--petrol); outline-offset: 2px;
}

/* Kopfzeile: nur das Zeichen (Mikes Entscheidung), Markenverlauf als schmale Kante darüber.
   Zeichen 40 px, Schutzraum = halber Kugeldurchmesser ≈ 14 px. */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--logo-clear);
  background: var(--weiss);
  border-top: 4px solid transparent;
  border-image: var(--brand-gradient) 1;
  border-bottom: 1px solid var(--linie);
}
.topbar .brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.topbar .brand img { width: 40px; height: 40px; display: block; }
.brand-label {
  font-family: var(--font-head); font-weight: 600; font-size: 18px;
  letter-spacing: .04em; color: var(--navy);
}
.login .brand { display: block; line-height: 0; }
.login .brand img { width: var(--logo-width); height: auto; display: block; }
.topbar nav { display: flex; gap: 1.25rem; align-items: center; font-weight: 500; }
.topbar nav a { color: var(--navy); }
.topbar nav .user { color: var(--grau); font-weight: 400; }
.badge {
  display: inline-block; min-width: 1.4em; padding: 0 .45em; margin-left: .15em;
  border-radius: 999px; background: var(--petrol); color: var(--weiss);
  font: 600 12px/1.4 var(--font-body); text-align: center; vertical-align: 1px;
}

main { padding: 1.5rem var(--logo-clear); }
.page-title { font-size: 22px; margin-bottom: 1rem; }
.crumbs { margin: 0 0 .25rem; font-size: 13px; color: var(--grau); }

.messages { list-style: none; margin: 0 0 1rem; padding: 0; }
.messages li {
  padding: .6rem .9rem; border-radius: var(--radius); border: 1px solid var(--linie);
  background: var(--hellgrund); margin-bottom: .4rem;
}
.messages li.success { border-color: var(--petrol); }
.messages li.warning { border-color: var(--limette); }
.messages li.error { border-color: #b3261e; color: #b3261e; }

/* Angebote */
.quote-section { margin-bottom: 1.75rem; }
.quote-section h2 { display: flex; align-items: center; gap: .5rem; font-size: 16px; }
.quote-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--weiss); }
.quote-table th {
  text-align: left; font: 600 12px var(--font-head); letter-spacing: .06em;
  text-transform: uppercase; color: var(--grau); padding: .5rem .6rem;
  border-bottom: 1px solid var(--linie);
}
.quote-table td { padding: .55rem .6rem; border-bottom: 1px solid var(--linie); }
.status-badge, .tag-quote {
  display: inline-block; padding: .15em .6em; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--linie); background: var(--hellgrund); color: var(--navy);
}
.tag-quote { margin-top: .4rem; margin-left: .3rem; text-decoration: none; }
.status-pending_review { background: var(--eislicht); border-color: var(--eislicht); }
.status-approved { background: var(--petrol); border-color: var(--petrol); color: var(--weiss); }
.status-sent { background: var(--navy); border-color: var(--navy); color: var(--weiss); }
.status-rejected { color: var(--grau); }

.review-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.review-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 1.5rem; }
@media (max-width: 900px) { .review-grid { grid-template-columns: 1fr; } }
.review-main, .review-side { background: var(--hellgrund); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1.25rem; }
.quote-form label, .confirm-box label { display: block; margin: .9rem 0 .3rem; font-weight: 500; color: var(--navy); }
.quote-form input[type=text], .quote-form textarea {
  width: 100%; padding: .6em .75em; border: 1px solid var(--linie); border-radius: var(--radius);
  font: inherit; color: var(--anthrazit); background: var(--weiss); line-height: 1.55;
}
.quote-form textarea { min-height: 24rem; resize: vertical; }
.readonly { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); padding: .6em .75em; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1.25rem; }
.actions button, .button {
  background: var(--weiss); color: var(--navy); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: .6em 1.1em; font: 500 14px var(--font-body); cursor: pointer; text-decoration: none; display: inline-block;
}
.actions button:hover, .button:hover { border-color: var(--petrol); text-decoration: none; }
.actions button.primary, .button.primary { background: var(--navy); color: var(--weiss); border-color: var(--navy); }
.actions button.danger { color: #b3261e; }
.review-side h3 { margin-top: 1.25rem; font-size: 14px; }
.review-side h3:first-child { margin-top: 0; }
.side-label { margin: .5rem 0 .2rem; font-size: 12px; color: var(--grau); text-transform: uppercase; letter-spacing: .06em; }
.side-list { margin: 0 0 .5rem; padding-left: 1.1rem; font-size: 14px; }
.prose.small { font-size: 13px; padding: .6rem .75rem; }
.small { font-size: 13px; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.timeline li { padding: .4rem 0; border-top: 1px solid var(--linie); }
.timeline .time { color: var(--grau); margin-right: .4rem; }
.timeline .note { color: var(--grau); margin-top: .15rem; }
.confirm-box { max-width: 760px; background: var(--hellgrund); border: 1px solid var(--linie); border-radius: var(--radius); padding: 1.25rem; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 500; }

/* Pipeline-Board */
.board {
  display: flex; gap: 1rem; align-items: flex-start;
  overflow-x: auto; padding-bottom: 1rem;
}
.column {
  flex: 0 0 284px;
  background: var(--hellgrund);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 12rem);
}
.column-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: .7rem .85rem;
  border-top: 3px solid var(--stage-color);
  border-radius: var(--radius) var(--radius) 0 0;
  font-family: var(--font-head); font-weight: 600; font-size: 12px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--navy);
}
.count {
  font: 500 12px var(--font-body); letter-spacing: 0; text-transform: none;
  background: var(--weiss); color: var(--grau); border: 1px solid var(--linie);
  border-radius: 999px; padding: 0 .55em;
}
.cards { padding: 0 .55rem .55rem; overflow-y: auto; min-height: 3rem; flex: 1; }
.card {
  background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: .65rem .75rem; margin-bottom: .55rem; cursor: grab;
}
.card:active { cursor: grabbing; }
.sortable-ghost { opacity: .4; }
.sortable-chosen { border-color: var(--petrol); }
.card-title { font-weight: 500; color: var(--navy); }
.card-sub { color: var(--grau); font-size: 13px; }
.tag {
  display: inline-block; margin-top: .4rem; padding: .1em .55em; font-size: 12px;
  background: var(--hellgrund); color: var(--petrol); border: 1px solid var(--linie);
  border-radius: 999px;
}
.card-meta {
  display: flex; gap: .6rem; align-items: center; margin-top: .5rem;
  font-size: 13px; color: var(--grau);
}
.card-meta a { margin-left: auto; }
/* Limette ausschließlich als Akzentpunkt, nie als Schrift (§3.2) */
.ki-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--limette);
  display: inline-block; position: relative;
}

/* Wiedervorlage-Ampel: funktionale Statusfarben (Rot/Gelb sind keine Markenfarben, Grün = Limette).
   Farbe sitzt nur im Punkt, der Text bleibt Anthrazit – so bleibt der Kontrast erhalten. */
.board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.legend { display: flex; gap: 1rem; margin: 0 0 1rem; font-size: 13px; color: var(--grau); }
.fu { display: inline-flex; align-items: center; gap: .35em; color: var(--anthrazit); white-space: nowrap; }
.fu-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--grau); }
.fu-green .fu-dot { background: var(--limette); }
.fu-yellow .fu-dot { background: #f2b705; }
.fu-red .fu-dot { background: #b3261e; }
.fu-red { font-weight: 500; }
.fu-form { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.fu-form input[type=date] {
  padding: .3em .5em; border: 1px solid var(--linie); border-radius: var(--radius); font: inherit;
}
.fu-form .button { padding: .35em .8em; font-size: 13px; }

/* Detail-Dialog */
.modal {
  border: 1px solid var(--linie); border-radius: var(--radius); padding: 0;
  width: min(640px, 92vw); color: var(--anthrazit);
}
.modal::backdrop { background: rgba(31, 45, 61, 0.55); }
.modal-body { padding: 1.5rem; }
.modal-header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.facts {
  display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.25rem;
  margin: .75rem 0 1.25rem; font-size: 14px;
}
.facts dt { color: var(--grau); }
.facts dd { margin: 0; }
.prose {
  white-space: pre-wrap; background: var(--hellgrund); border: 1px solid var(--linie);
  padding: .85rem 1rem; border-radius: var(--radius); max-width: 70ch; line-height: 1.6;
}

/* Anmeldung und Passwort: Karte auf dem Markenverlauf, Logo auf Weiß */
body.login-page { background: var(--brand-gradient); min-height: 100vh; }
body.login-page main { padding: 0; }
.login {
  max-width: 420px; margin: 10vh auto; background: var(--weiss);
  padding: var(--logo-clear); border-radius: var(--radius);
}
.login .brand { margin-bottom: 1.5rem; }
.login h1 { font-size: 22px; }
.login label { display: block; margin: 1rem 0 .3rem; font-weight: 500; color: var(--navy); }
.login input {
  width: 100%; padding: .6em .75em; border: 1px solid var(--linie);
  border-radius: var(--radius); font: inherit; color: var(--anthrazit);
}
.login input:focus { border-color: var(--petrol); }
.login button { margin-top: 1.4rem; width: 100%; }
.login .error { margin: .5rem 0 0; padding-left: 1.2em; }
.login .hint { font-size: 13px; color: var(--grau); margin: 0 0 .5rem; }
