/* MK Auftrags-Cockpit – Corporate Design: Taupe #6F6149 / Creme #EDE7DC */

:root {
  /* Marke */
  --taupe: #6F6149;
  --taupe-dark: #4F4433;
  --taupe-darker: #3A3227;
  --creme: #EDE7DC;

  /* Flächen */
  --bg: #F3EFE6;
  --panel: #FFFDF9;
  --panel-soft: #F8F4EC;
  --border: #DCD1BB;
  --border-soft: #EFE8DA;

  /* Schrift */
  --ink: #2B2620;
  --ink-2: #6A6155;
  --ink-3: #958C7D;

  /* Sequenzielle Taupe-Reihe, hell -> dunkel (monoton in der Helligkeit) */
  --ramp-1: #E3DBCB;
  --ramp-2: #C9BCA3;
  --ramp-3: #A89878;
  --ramp-4: #8A7A59;
  --ramp-5: #6F6149;
  --ramp-6: #544937;

  /* Status – reserviert, nie als Datenfarbe */
  --gut: #4C6B4F;
  --warnung: #B08327;
  --ernst: #A34A3F;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(63,54,40,.05), 0 8px 24px rgba(63,54,40,.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--taupe-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.75rem; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 1.02rem; margin: 0 0 14px; color: var(--taupe-darker); }
h3 { font-size: 0.95rem; margin: 0 0 10px; }

/* ---------- Grundgerüst ---------- */

.layout { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.container { padding: 28px 32px 64px; max-width: 1400px; }

/* ---------- Seitenspalte ---------- */

.sidebar {
  background: var(--taupe-darker);
  color: var(--creme);
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 100vh;
}
.sidebar a { color: var(--creme); }
.sidebar a:hover { text-decoration: none; }

.marke { display: flex; align-items: center; gap: 11px; padding: 0 8px 4px; }
.marke-zeichen {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--taupe); color: var(--creme);
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.95rem; letter-spacing: -0.02em;
}
.marke { flex-wrap: nowrap; }
.marke-name { display: block; font-weight: 700; line-height: 1.15; font-size: 0.95rem; }
.marke-zusatz { display: block; font-size: 0.72rem; opacity: 0.55; }

.gruppe-titel {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em;
  opacity: 0.45; padding: 0 10px; margin-bottom: 7px;
}
.menue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.menue a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 9px;
  font-size: 0.92rem;
}
.menue a:hover { background: rgba(237,231,220,.08); }
.menue a.is-active { background: var(--taupe); font-weight: 600; }

/* Organigramm: CEO über den Agenten */
.org-ceo {
  display: block; position: relative;
  padding: 10px 28px 10px 11px; border-radius: 10px;
  background: var(--taupe); border: 1px solid rgba(237,231,220,.18);
}
.org-ceo:hover { border-color: rgba(237,231,220,.45); }
.org-ceo.is-active { box-shadow: inset 3px 0 0 var(--creme); }
.org-rolle { display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.65; }
.org-name { display: block; font-weight: 600; font-size: 0.92rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-kurz {
  display: block; font-size: 0.74rem; opacity: 0.55; margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.org-linie { width: 2px; height: 12px; background: rgba(237,231,220,.2); margin-left: 21px; }
.org-liste { list-style: none; margin: 0; padding-left: 13px; border-left: 2px solid rgba(237,231,220,.2); }
.org-liste li { position: relative; margin-bottom: 3px; }
.org-liste li::before {
  content: ""; position: absolute; left: -13px; top: 19px;
  width: 11px; height: 2px; background: rgba(237,231,220,.2);
}
.org-agent { display: block; position: relative; padding: 8px 28px 8px 10px; border-radius: 9px; }
.org-agent:hover { background: rgba(237,231,220,.08); }
.org-agent.is-active { background: rgba(237,231,220,.12); box-shadow: inset 3px 0 0 var(--creme); }

.punkt { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.org-ceo .punkt, .org-agent .punkt { position: absolute; right: 11px; top: 15px; }
.punkt-aktiv { background: #86B187; }
.punkt-geplant { background: #D9B441; }

.sidebar-fuss { margin-top: auto; border-top: 1px solid rgba(237,231,220,.14); padding-top: 14px; }
.nutzer { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.nutzer-kreis {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--taupe); display: grid; place-items: center;
  font-weight: 600; font-size: 0.85rem;
}
.nutzer-name { font-size: 0.88rem; font-weight: 600; }
.nutzer-links { font-size: 0.74rem; opacity: 0.6; }
.nutzer-links a { text-decoration: underline; }
.legende { font-size: 0.72rem; opacity: 0.5; padding: 10px 8px 0; }
.legende .punkt { margin-right: 3px; }

/* ---------- Kopfzeile ---------- */

.kopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.gruss { font-size: 0.92rem; color: var(--ink-2); margin: 0 0 2px; }
.kopf-datum {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 14px; font-size: 0.86rem; color: var(--ink-2);
  box-shadow: var(--shadow);
}

/* ---------- Kacheln und Karten ---------- */

.kachelreihe { display: grid; align-items: start; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kachel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 17px 18px; box-shadow: var(--shadow);
}
.kachel-titel { font-size: 0.82rem; color: var(--ink-2); margin-bottom: 7px; }
.kachel-wert { font-size: 1.85rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kachel-zusatz { font-size: 0.78rem; color: var(--ink-3); margin-top: 5px; }

.raster { display: grid; gap: 16px; margin-bottom: 18px; align-items: start; }
.raster-2 { grid-template-columns: 1.35fr 1fr; }
.raster-3 { grid-template-columns: repeat(3, 1fr); }
.spalte { display: flex; flex-direction: column; gap: 16px; }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card-kopf { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.card-kopf h2 { margin: 0; }
.card-kopf a { font-size: 0.82rem; }

/* ---------- Balken: eine Taupe-Reihe, direkt beschriftet ---------- */


.balkenliste { display: flex; flex-direction: column; gap: 13px; }
.balken-zeile { display: grid; grid-template-columns: 132px 1fr 46px; align-items: center; gap: 12px; }
.balken-name { font-size: 0.85rem; }
.balken-spur {
  display: block;
  background: var(--border-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}
.balken-fuell { display: block; height: 100%; border-radius: 999px; background: var(--taupe); min-width: 6px; }
.balken-wert { font-size: 0.85rem; font-weight: 600; text-align: right; color: var(--ink-2); }

/* ---------- Listen und Tabellen ---------- */

.eintraege { display: flex; flex-direction: column; }
.eintrag { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.eintrag-rechts { display: flex; align-items: center; gap: 9px; }
.eintrag:last-child { border-bottom: 0; }
.eintrag-haupt { display: block; font-weight: 600; font-size: 0.9rem; }
.eintrag-neben { display: block; font-size: 0.78rem; color: var(--ink-3); }
.eintrag-rechts .eintrag-neben { display: inline-block; }
.card-kopf .eintrag-neben { display: inline-block; }


table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border-soft); font-size: 0.88rem; }
th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); font-weight: 600; }
tbody tr:hover { background: var(--panel-soft); }
tbody tr:last-child td { border-bottom: 0; }

.marke-punkt {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.76rem; background: var(--panel-soft); border: 1px solid var(--border); color: var(--ink-2);
}

.status-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.status-tabs a {
  padding: 6px 13px; border-radius: 999px; font-size: 0.83rem;
  background: var(--panel); border: 1px solid var(--border); color: var(--ink-2);
}
.status-tabs a:hover { text-decoration: none; border-color: var(--taupe); }
.status-tabs a.active { background: var(--taupe); border-color: var(--taupe); color: var(--creme); }

/* ---------- Hinweisband ---------- */

.band {
  background: linear-gradient(100deg, var(--taupe-dark), var(--taupe));
  color: var(--creme); border-radius: var(--radius); padding: 20px 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
}
.band h2 { color: var(--creme); margin-bottom: 4px; }
.band p { margin: 0; opacity: 0.85; font-size: 0.9rem; max-width: 70ch; }
.band a.btn { background: var(--creme); color: var(--taupe-darker); }

/* ---------- Formulare und Knöpfe ---------- */

.btn, button, input[type="submit"] {
  display: inline-block; padding: 9px 17px; border-radius: 9px;
  background: var(--taupe); color: var(--creme); border: 0;
  font-size: 0.9rem; font-family: inherit; cursor: pointer;
}
.btn:hover, button:hover { background: var(--taupe-dark); text-decoration: none; }
input[type="text"], input[type="password"], input[type="date"], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--panel); font-family: inherit; font-size: 0.9rem; color: var(--ink);
}
label { display: block; font-size: 0.82rem; color: var(--ink-2); margin-bottom: 4px; }

.hint {
  background: #FBF3DC; border: 1px solid #E8D9A8; color: #6B551C;
  padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 0.88rem;
}
.unter { margin-top: -2px; color: var(--ink-2); }
.liste { margin: 0; padding-left: 20px; }
.liste li { margin-bottom: 6px; }
.leer { color: var(--ink-3); font-size: 0.9rem; }

/* ---------- Anmeldeseite ---------- */

.login-seite { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.login-karte { width: 370px; }

@media (max-width: 1100px) { .raster-2, .raster-3 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .container { padding: 20px; }
}

.balken-zeile.ist-leer { opacity: 0.42; }
.balken-zeile.ist-leer .balken-fuell { min-width: 0; }


/* ---------- Startzustand (noch kein Auftrag) ---------- */

.start {
  background: linear-gradient(100deg, var(--taupe-dark), var(--taupe));
  color: var(--creme);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  align-items: start;
}
.start h2 { color: var(--creme); font-size: 1.08rem; margin-bottom: 8px; }
.start p { margin: 0; font-size: 0.92rem; opacity: 0.9; max-width: 52ch; }

.start-wege { display: flex; flex-direction: column; gap: 10px; }
.weg {
  display: flex; align-items: flex-start; gap: 13px;
  background: rgba(237,231,220,.1);
  border: 1px solid rgba(237,231,220,.18);
  border-radius: 11px; padding: 13px 15px;
}
.weg:hover { background: rgba(237,231,220,.17); text-decoration: none; }
.weg-nr {
  flex: 0 0 auto; width: 25px; height: 25px; border-radius: 50%;
  background: var(--creme); color: var(--taupe-darker);
  display: grid; place-items: center; font-weight: 700; font-size: 0.82rem;
}
.weg-titel { display: block; font-weight: 600; font-size: 0.92rem; }
.weg-text { display: block; font-size: 0.8rem; opacity: 0.85; margin-top: 2px; }

.strecke { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.strecke li {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 12px; border-radius: 9px; background: var(--panel-soft);
  font-size: 0.88rem;
}
.strecke-nr {
  flex: 0 0 auto; width: 21px; height: 21px; border-radius: 50%;
  background: var(--border); color: var(--taupe-darker);
  display: grid; place-items: center; font-size: 0.72rem; font-weight: 700;
}

@media (max-width: 1100px) { .start { grid-template-columns: 1fr; } }

/* Balkenbreiten als Klassen - Inline-Styles sind per CSP gesperrt */
.balken-fuell { width: 0; }
.b-0 { width: 0%; }
.b-5 { width: 5%; }
.b-10 { width: 10%; }
.b-15 { width: 15%; }
.b-20 { width: 20%; }
.b-25 { width: 25%; }
.b-30 { width: 30%; }
.b-35 { width: 35%; }
.b-40 { width: 40%; }
.b-45 { width: 45%; }
.b-50 { width: 50%; }
.b-55 { width: 55%; }
.b-60 { width: 60%; }
.b-65 { width: 65%; }
.b-70 { width: 70%; }
.b-75 { width: 75%; }
.b-80 { width: 80%; }
.b-85 { width: 85%; }
.b-90 { width: 90%; }
.b-95 { width: 95%; }
.b-100 { width: 100%; }
.b-0 { min-width: 0; }
.zeile-link { cursor: pointer; }

/* ---------- Formulare: Raster und Felder ---------- */

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; }
.field { margin-bottom: 14px; }
.grid-2 .field, .grid-3 .field { margin-bottom: 0; }
form.card h2 { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
form.card h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
input[type="tel"], input[type="email"], input[type="number"] {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--panel); font-family: inherit; font-size: 0.9rem; color: var(--ink);
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--taupe); outline-offset: 1px; }

.btn-secondary { background: var(--panel-soft); color: var(--taupe-darker); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border-soft); }

.error {
  background: #F6E4E1; border: 1px solid #E0BDB7; color: #7A3229;
  padding: 11px 15px; border-radius: 10px; margin-bottom: 16px; font-size: 0.88rem;
}

/* ---------- Checkliste und Verlauf auf der Auftragsseite ---------- */

.checklist { display: flex; flex-direction: column; gap: 8px; }
.checklist label {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.9rem; color: var(--ink); margin: 0;
  padding: 8px 12px; border-radius: 9px; background: var(--panel-soft);
}
.checklist input[type="checkbox"] { width: auto; accent-color: var(--taupe); }
.checklist button { align-self: flex-start; margin-top: 6px; }

.log-entry { padding: 10px 0; border-bottom: 1px solid var(--border-soft); font-size: 0.9rem; }
.log-entry:last-child { border-bottom: 0; }
.log-meta { font-size: 0.76rem; color: var(--ink-3); margin-bottom: 3px; }

.login-wrap { width: 100%; }

@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.feld-gross { min-height: 220px; }
.hint-text { white-space: pre-wrap; }
.notiz-form { margin-bottom: 16px; }
