/* Miss Moneypenny — Designsystem nach vialero.de (Fraunces + Plus Jakarta Sans, Lila/Orange) */
@import url('/static/fonts/fonts.css');

:root {
  --lila-900: hsl(249 55% 22%);
  --lila-800: hsl(249 55% 25%);
  --lila-700: hsl(249 48% 35%);
  --lila-600: hsl(249 45% 45%);
  --lila-100: hsl(250 40% 96%);
  --lila-050: hsl(250 40% 98.5%);
  --orange: hsl(24 78% 48%);
  --orange-100: hsl(24 90% 95%);
  --ink: hsl(249 45% 20%);
  --muted: hsl(250 10% 45%);
  --muted-2: hsl(250 8% 62%);
  --border: hsl(250 15% 90%);
  --card: #fff;
  --page: hsl(250 30% 98%);
  --green: hsl(150 45% 36%); --green-100: hsl(150 45% 94%);
  --amber: hsl(38 85% 42%);  --amber-100: hsl(38 90% 94%);
  --red: hsl(0 62% 46%);     --red-100: hsl(0 70% 96%);
  --shadow: 0 8px 30px -8px hsl(249 30% 50% / .15);
  --shadow-lg: 0 20px 50px -20px hsl(249 30% 40% / .25);
  --r: 16px; --r-sm: 10px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--ink); background: var(--page); -webkit-font-smoothing: antialiased; }
a { color: var(--lila-700); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; color: var(--lila-800); letter-spacing: -.01em; }
h1 { font: 500 34px/1.15 var(--serif); font-variation-settings: 'opsz' 60; }
h1 .sub { display: block; font: 400 16px/1.5 var(--font); color: var(--muted); margin-top: 8px; letter-spacing: 0; }
h2 { font: 600 19px/1.3 var(--font); margin-bottom: 12px; }
h3 { font: 600 15px/1.4 var(--font); }
p { margin: 0 0 12px; }
code { font: 13px ui-monospace, Menlo, monospace; background: var(--lila-100); padding: 1px 6px; border-radius: 6px; }

/* Kopfzeile */
.topbar { position: sticky; top: 0; z-index: 10; background: hsl(0 0% 100% / .85); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--border); }
.topbar .inner { max-width: 1080px; margin: 0 auto; padding: 0 28px; height: 64px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--lila-800); font: 600 18px/1 var(--font); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 22px; height: 22px; border-radius: 50%; border: 5px solid var(--orange); box-shadow: inset 0 0 0 2px #fff; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--lila-100); color: var(--lila-800); text-decoration: none; }
.nav a.aktiv { color: var(--lila-800); background: var(--lila-100); }
.topbar .user { margin-left: auto; color: var(--muted); font-size: 13px; display: flex; gap: 12px; align-items: center; }
.topbar .user a { color: var(--lila-700); font-weight: 500; }

main { max-width: 1080px; margin: 0 auto; padding: 40px 28px 80px; }
.kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.eyebrow { display: inline-flex; align-items: center; gap: 12px; font: 600 11px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.eyebrow::before { content: ''; width: 28px; height: 2px; background: var(--orange); border-radius: 2px; }

/* Karten */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 26px 28px; margin-bottom: 20px; box-shadow: 0 1px 2px hsl(249 30% 50% / .04); }
.card.hero { box-shadow: var(--shadow); border-color: transparent; }
.card.leise { background: var(--lila-050); border-color: transparent; box-shadow: none; }
.card-kopf { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.hinweis { border-radius: var(--r-sm); padding: 12px 16px; margin: 0 0 14px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.hinweis.warn { background: var(--amber-100); color: hsl(38 80% 24%); }
.hinweis.fehler { background: var(--red-100); color: hsl(0 60% 30%); }
.hinweis.ok { background: var(--green-100); color: hsl(150 45% 22%); }
.hinweis.info { background: var(--lila-100); color: var(--lila-800); }
.hinweis ul { margin: 6px 0 0 18px; padding: 0; }

/* Schaltflächen */
.btn, button { font: 600 14px/1 var(--font); border: 0; border-radius: var(--r-sm); padding: 12px 18px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; white-space: nowrap; }
.btn:hover, button:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary, button.primary, button:not([class]) { background: var(--lila-700); color: #fff; box-shadow: 0 6px 18px -8px hsl(249 48% 35% / .6); }
.btn-primary:hover, button.primary:hover, button:not([class]):hover { background: var(--lila-800); }
.btn-orange { background: var(--orange); color: #fff; box-shadow: 0 8px 25px -8px hsl(24 78% 48% / .4); }
.btn-secondary, button.secondary { background: #fff; color: var(--lila-800); border: 1px solid var(--border); }
.btn-secondary:hover, button.secondary:hover { border-color: var(--lila-600); }
.btn-ghost, button.ghost { background: transparent; color: var(--lila-700); padding: 10px 12px; }
.btn-ghost:hover, button.ghost:hover { background: var(--lila-100); }
button.danger { background: var(--red); color: #fff; }
.btn-lg { padding: 15px 24px; font-size: 15px; }
.btn-sm, button.sm { padding: 8px 12px; font-size: 13px; }
.aktionen { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
form.inline { display: inline; }
button:disabled { opacity: .5; cursor: default; transform: none; }

/* Formulare */
label { display: block; font-size: 13px; font-weight: 600; color: var(--lila-800); margin-bottom: 6px; }
label .opt { font-weight: 400; color: var(--muted-2); }
.feld { margin-bottom: 16px; }
.feld .tipp { font-size: 12px; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], select, textarea {
  width: 100%; font: 15px/1.4 var(--font); color: var(--ink); background: #fff; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 11px 13px; transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--lila-600); box-shadow: 0 0 0 4px hsl(249 48% 35% / .12); }
textarea { resize: vertical; min-height: 80px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b6480' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid .breit { grid-column: 1 / -1; }
@media (max-width: 760px) { .grid, .grid-3 { grid-template-columns: 1fr; } }
.radio { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-sm); margin-bottom: 8px; cursor: pointer; font-weight: 400; font-size: 14px; color: var(--ink); }
.radio:hover { border-color: var(--lila-600); background: var(--lila-050); }
.radio input { margin-top: 3px; accent-color: var(--lila-700); }

/* Chips, Status */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--lila-100); color: var(--lila-800); white-space: nowrap; }
.chip.orange { background: var(--orange-100); color: hsl(24 78% 32%); }
.chip.gruen { background: var(--green-100); color: hsl(150 45% 24%); }
.chip.amber { background: var(--amber-100); color: hsl(38 80% 26%); }
.chip.rot { background: var(--red-100); color: hsl(0 60% 34%); }
.chip.grau { background: hsl(250 10% 94%); color: var(--muted); }
.chip .punkt { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Tabellen / Listen */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: 14px; }
th { background: var(--lila-050); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tr.klick { cursor: pointer; transition: background .1s; }
tr.klick:hover { background: var(--lila-050); }
td .haupt { font-weight: 600; color: var(--lila-800); }
td .neben { color: var(--muted); font-size: 13px; margin-top: 2px; }
.liste { display: flex; flex-direction: column; gap: 10px; }
.zeile { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px 20px; transition: box-shadow .12s, border-color .12s, transform .12s; }
.zeile:hover { box-shadow: var(--shadow); border-color: transparent; transform: translateY(-1px); }
.zeile .haupt { font-weight: 600; color: var(--lila-800); font-size: 15px; }
.zeile .neben { color: var(--muted); font-size: 13px; margin-top: 2px; }
.zeile .rechts { display: flex; gap: 10px; align-items: center; }

/* Schritte */
.schritte { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 8px 0 28px; }
.schritt { position: relative; padding: 0 16px 0 0; }
.schritt .nr { font: 500 30px/1 var(--serif); color: var(--muted-2); font-variation-settings: 'opsz' 48; }
.schritt .txt { font-size: 13px; font-weight: 600; color: var(--muted-2); margin-top: 8px; }
.schritt .linie { height: 2px; background: var(--border); margin-top: 12px; border-radius: 2px; }
.schritt.aktiv .nr { color: var(--orange); }
.schritt.aktiv .txt { color: var(--lila-800); }
.schritt.aktiv .linie { background: var(--orange); }
.schritt.fertig .nr { color: var(--lila-700); }
.schritt.fertig .txt { color: var(--lila-700); }
.schritt.fertig .linie { background: var(--lila-700); }

/* Befunde, Verlauf */
.befund { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.befund:last-child { border-bottom: 0; }
.befund .ikon { width: 22px; height: 22px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.befund.fehler .ikon { background: var(--red-100); color: var(--red); }
.befund.warnung .ikon { background: var(--amber-100); color: var(--amber); }
.befund.info .ikon { background: var(--lila-100); color: var(--lila-700); }
.befund .quelle { color: var(--muted-2); font-size: 12px; margin-left: 6px; }
.verlauf { list-style: none; margin: 0; padding: 0; }
.verlauf li { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.verlauf li:last-child { border-bottom: 0; }
.verlauf .zeit { color: var(--muted-2); font-variant-numeric: tabular-nums; }
.verlauf .typ { font-weight: 600; color: var(--lila-700); margin-right: 6px; }
details summary { cursor: pointer; font-weight: 600; color: var(--lila-700); list-style: none; display: flex; align-items: center; gap: 8px; }
details summary::before { content: '›'; font-size: 18px; transition: transform .12s; }
details[open] summary::before { transform: rotate(90deg); }
pre { background: var(--lila-050); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 14px 16px; white-space: pre-wrap; font: 13px/1.5 ui-monospace, Menlo, monospace; color: var(--ink); overflow-x: auto; }
pre.mail { font: 15px/1.6 var(--font); background: #fff; }

/* Fortschritt */
.laeuft { display: flex; gap: 16px; align-items: center; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--lila-100); border-top-color: var(--orange); animation: dreh .9s linear infinite; flex: none; }
@keyframes dreh { to { transform: rotate(360deg); } }

/* Login */
.login-seite { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 50% -10%, var(--lila-100), var(--page) 60%); padding: 24px; }
.login-karte { width: 100%; max-width: 400px; background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg); padding: 40px 40px 32px; }
.login-karte .brand { justify-content: center; margin-bottom: 26px; font-size: 20px; }
.login-karte h1 { font-size: 30px; text-align: center; margin-bottom: 6px; }
.login-karte .sub { text-align: center; color: var(--muted); margin-bottom: 26px; }
.login-karte button { width: 100%; justify-content: center; padding: 14px; font-size: 15px; margin-top: 6px; }
.login-fuss { text-align: center; color: var(--muted-2); font-size: 12px; margin-top: 22px; }

/* Leerer Zustand */
.leer { text-align: center; padding: 48px 24px; }
.leer h2 { font: 500 26px/1.2 var(--serif); margin-bottom: 8px; }
.leer p { color: var(--muted); max-width: 520px; margin: 0 auto 22px; }
.drei { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 34px 0 8px; text-align: left; }
.drei .nr { font: 500 34px/1 var(--serif); color: var(--orange); }
.drei h3 { margin: 10px 0 4px; }
.drei p { font-size: 14px; margin: 0; }
@media (max-width: 760px) { .drei, .schritte { grid-template-columns: 1fr 1fr; } .topbar .inner { padding: 0 16px; gap: 12px; } main { padding: 24px 16px 60px; } .nav a { padding: 8px 8px; } }
.suche { position: relative; margin-bottom: 18px; }
.suche input { padding-left: 42px; font-size: 16px; }
.suche::before { content: ''; position: absolute; left: 15px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6480' stroke-width='2.2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat center / contain; }
.muted { color: var(--muted); font-size: 13px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* Pipeline */
.segmente { display: inline-flex; gap: 4px; background: var(--lila-100); padding: 4px; border-radius: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.seg { background: transparent; color: var(--muted); box-shadow: none; padding: 9px 14px; border-radius: 9px; font-weight: 600; }
.seg:hover { transform: none; color: var(--lila-800); }
.seg.aktiv { background: #fff; color: var(--lila-800); box-shadow: 0 1px 3px hsl(249 30% 50% / .15); }
.seg .zahl, .schalter .zahl { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--lila-100); color: var(--lila-700); font-size: 11px; text-align: center; margin-left: 4px; }
.seg.aktiv .zahl { background: var(--orange-100); color: hsl(24 78% 34%); }
.filter { display: grid; grid-template-columns: 1fr 190px 190px auto; gap: 12px; align-items: center; margin-bottom: 20px; }
.filter .suche { margin: 0; }
.filter select { padding: 11px 36px 11px 13px; }
.schalter { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; color: var(--ink); margin: 0; white-space: nowrap; cursor: pointer; }
.schalter input { accent-color: var(--lila-700); width: 16px; height: 16px; }
.pipe { background: #fff; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.pipe-kopf, .pipe-zeile { display: grid; grid-template-columns: 2.2fr 1.4fr 2fr auto; gap: 16px; align-items: center; padding: 14px 20px; }
.pipe-kopf { background: var(--lila-050); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); }
.pipe-zeile { border-bottom: 1px solid var(--border); transition: background .1s; }
.pipe-zeile:last-child { border-bottom: 0; }
.pipe-zeile:hover { background: var(--lila-050); }
.pipe-zeile .haupt { font-weight: 600; color: var(--lila-800); font-size: 15px; }
.pipe-zeile .neben { color: var(--muted); font-size: 13px; margin-top: 2px; }
.pipe-zeile .neben.faellig { color: var(--red); font-weight: 600; }
.pipe-zeile .stand .neben { margin-top: 6px; }
.pipe-zeile .spur .neben { margin-left: 6px; }
.pipe-zeile .leer-spur { color: var(--muted-2); }
.pipe-zeile .aktion { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.pipe-zeile .aktion .ghost { color: var(--muted); }
a.chip:hover { text-decoration: none; filter: brightness(.96); }
@media (max-width: 900px) { .pipe-kopf { display: none; } .pipe-zeile { grid-template-columns: 1fr; gap: 8px; } .pipe-zeile .aktion { justify-content: flex-start; } .filter { grid-template-columns: 1fr 1fr; } }

.pipe-gruppe { display: flex; align-items: baseline; gap: 12px; padding: 18px 20px 10px; background: var(--lila-050); border-bottom: 1px solid var(--border); border-top: 1px solid var(--border); font-size: 14px; }
.pipe-gruppe .nr { font: 500 22px/1 var(--serif); color: var(--orange); }
.pipe-gruppe strong { color: var(--lila-800); }
.pipe-gruppe .muted { flex: 1; }
.pipe-gruppe .zahl { padding: 1px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.pipe-gruppe[hidden] { display: none; }
.prio { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 2px; background: var(--muted-2); }
.prio-hoch { background: var(--orange); box-shadow: 0 0 0 3px var(--orange-100); }
.prio-mittel { background: var(--lila-600); }
.prio-niedrig { background: var(--border); }
.dokumente { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dokumente .chip { font-weight: 500; }
.pipe-zeile .aktion { flex-direction: column; align-items: flex-end; gap: 4px; }
.pipe-zeile .aktion .alt button.link, button.link { background: none; color: var(--muted); font-weight: 500; font-size: 12px; padding: 2px 4px; box-shadow: none; }
button.link:hover { color: var(--lila-700); transform: none; text-decoration: underline; }
.pipe-zeile .aktion .btn-sm, .pipe-zeile .aktion button.sm { min-width: 150px; justify-content: center; }

/* Schmale Bildschirme */
@media (max-width: 760px) {
  body { overflow-x: hidden; }
  .topbar .inner { height: auto; padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .brand { font-size: 16px; }
  .nav { margin-left: 0; width: 100%; overflow-x: auto; white-space: nowrap; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .nav a { flex: none; padding: 7px 10px; font-size: 14px; }
  .topbar .user { display: none; }
  main { padding: 20px 14px 60px; }
  h1 { font-size: 27px; }
  h1 .sub { font-size: 14px; }
  .kopf { margin-bottom: 18px; }
  .kopf .btn { width: 100%; justify-content: center; }
  .segmente { display: flex; flex-wrap: nowrap; overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; }
  .seg { flex: none; padding: 8px 11px; font-size: 13px; }
  .filter { grid-template-columns: 1fr; gap: 8px; }
  .schalter { white-space: normal; }
  .pipe-kopf { display: none; }
  .pipe-zeile { grid-template-columns: 1fr; gap: 10px; padding: 14px 16px; }
  .pipe-zeile .aktion { flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
  .pipe-zeile .aktion .btn-sm, .pipe-zeile .aktion button.sm { min-width: 0; }
  .pipe-gruppe { flex-wrap: wrap; padding: 14px 16px 8px; }
  .pipe-gruppe .muted { flex-basis: 100%; order: 3; font-size: 12px; }
  .schritte { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 20px; }
  .schritt { padding-right: 0; }
  .schritt .nr { font-size: 20px; }
  .schritt .txt { font-size: 11px; }
  .card { padding: 18px 16px; border-radius: 14px; }
  .card.hero .btn-lg, .aktionen .btn-lg { width: 100%; justify-content: center; }
  .aktionen { gap: 8px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; }
  table { display: block; overflow-x: auto; }
  .zeile { grid-template-columns: 1fr; }
  .zeile .rechts { justify-content: flex-start; flex-wrap: wrap; }
  .drei { grid-template-columns: 1fr; }
  .login-karte { padding: 28px 22px; }
}
