/* MietzScan – Oberfläche im MietzMedia-Stil: leicht, freundlich, klar */

@font-face { font-family: 'Montserrat'; font-weight: 400; font-style: normal; src: url('../fonts/Montserrat-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Montserrat'; font-weight: 400; font-style: italic; src: url('../fonts/Montserrat-Italic.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Montserrat'; font-weight: 600; font-style: normal; src: url('../fonts/Montserrat-SemiBold.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-style: normal; src: url('../fonts/Montserrat-Bold.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Montserrat'; font-weight: 900; font-style: normal; src: url('../fonts/Montserrat-Black.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Montserrat'; font-weight: 900; font-style: italic; src: url('../fonts/Montserrat-BlackItalic.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; src: url('../fonts/JetBrainsMono-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; font-weight: 700; src: url('../fonts/JetBrainsMono-Bold.ttf') format('truetype'); font-display: swap; }

:root {
  --cream: #F7F5EF;
  --bg: #FBFBF9;
  --navy: #020033;
  --navy-soft: #1a1a4a;
  --mint: #36D0A6;
  --teal: #4297A6;
  --grad: linear-gradient(90deg, #36D0A6 0%, #4297A6 100%);
  --white: #ffffff;
  --ink: #1b1b2f;
  --muted: #6b6b80;
  --line: #e9e7e1;
  --good: #22a06b;
  --good-bg: #e6f7ef;
  --mid: #e0a300;
  --mid-bg: #fff6dc;
  --bad: #e5484d;
  --bad-bg: #fde9ea;
  --info: #4297A6;
  --info-bg: #e7f3f5;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(2, 0, 51, 0.04), 0 8px 24px rgba(2, 0, 51, 0.05);
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --sans: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--navy); margin: 0 0 .5rem; line-height: 1.15; }
h1 { font-weight: 900; font-size: 2rem; letter-spacing: -.01em; }
h2 { font-weight: 900; font-size: 1.4rem; }
h3 { font-weight: 700; font-size: 1.05rem; }
.grad { display: block; font-style: italic; font-weight: 900; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
h1 .grad { font-size: 1.35rem; margin-top: .15rem; }
.label { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); font-size: .85rem; }

/* ---- Layout ---- */
.app { display: flex; min-height: 100vh; }
.side { width: 250px; flex: 0 0 250px; background: var(--white); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 1.5rem 1.1rem; position: sticky; top: 0; height: 100vh; }
.side-logo img { height: 64px; width: auto; display: block; margin: 0 .3rem 1.6rem; }
.side-nav { display: flex; flex-direction: column; gap: .25rem; }
.side-nav a { display: flex; align-items: center; gap: .7rem; padding: .65rem .85rem; border-radius: 12px; color: var(--navy); font-weight: 600; font-size: .95rem; transition: background .15s; }
.side-nav a:hover { background: #f1f5f4; text-decoration: none; }
.side-nav a.active { background: var(--navy); color: #fff; }
.side-nav .ico { width: 1.3rem; text-align: center; opacity: .8; }
.side-user { margin-top: auto; padding: .9rem; background: #f1f5f4; border-radius: 14px; font-size: .88rem; }
.side-user-name { font-weight: 700; color: var(--navy); }
.side-user-role { font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); margin: .15rem 0 .5rem; }
.side-logout { font-size: .82rem; }
.side-sig { display: flex; gap: .7rem; align-items: center; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .74rem; color: var(--muted); line-height: 1.35; }
.side-sig img { width: 36px; height: auto; flex: 0 0 36px; }
.side-sig strong { color: var(--navy); }
.main { flex: 1; padding: 2.2rem 2.6rem 4rem; max-width: 1180px; width: 100%; }

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .side { width: 100%; flex: none; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .8rem 1rem; }
  .side-logo img { height: 36px; margin: 0 .5rem 0 0; }
  .side-nav { flex-direction: row; flex: 1; }
  .side-nav a { padding: .45rem .7rem; font-size: .85rem; }
  .side-user { margin: 0; padding: .4rem .7rem; display: flex; gap: .6rem; align-items: center; }
  .side-user-role { margin: 0; }
  .side-sig { display: none; }
  .main { padding: 1.2rem 1rem 3rem; }
}

/* ---- Karten ---- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem 1.7rem; margin-bottom: 1.4rem; }
.card-navy { background: var(--navy); color: #fff; }
.card-navy h2, .card-navy h3 { color: #fff; }
.card-navy .label { color: var(--mint); }
.card-navy .muted { color: #b9b9d0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.grid { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* ---- Buttons & Formulare ---- */
.btn { display: inline-flex; align-items: center; gap: .45rem; border: 0; border-radius: 999px; padding: .68rem 1.3rem; font: 600 .92rem var(--sans); cursor: pointer; transition: transform .1s, box-shadow .15s, opacity .15s; text-decoration: none !important; line-height: 1.2; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--grad); color: var(--navy); box-shadow: 0 6px 16px rgba(54, 208, 166, .35); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-ghost { background: transparent; color: var(--navy); border: 2px solid var(--line); }
.btn-ghost:hover { border-color: var(--teal); }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-sm { padding: .42rem .9rem; font-size: .82rem; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; transform: none; }
label { display: block; font-weight: 600; font-size: .88rem; color: var(--navy); margin-bottom: .9rem; }
input:not([type]), input[type=date], input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], select, textarea {
  display: block; width: 100%; margin-top: .35rem; padding: .7rem .9rem; border: 2px solid var(--line); border-radius: 12px; background: #fff; font: 400 .95rem var(--sans); color: var(--ink); transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--mint); }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.form-row > * { flex: 1; min-width: 200px; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: auto; margin: 0; }

/* ---- Flash ---- */
.flash { padding: .8rem 1.1rem; border-radius: 12px; margin-bottom: 1.2rem; font-weight: 600; font-size: .92rem; }
.flash-success, .ok { background: var(--good-bg); color: var(--good); }
.flash-error { background: var(--bad-bg); color: var(--bad); }
.flash-info { background: var(--info-bg); color: var(--teal); }

/* ---- Tabellen ---- */
table.list { width: 100%; border-collapse: collapse; font-size: .92rem; }
.card { overflow-x: auto; }
table.list th { text-align: left; font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); padding: .4rem .6rem; border-bottom: 1px solid var(--line); }
table.list td { padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr:hover td { background: #f6f9f8; }

/* ---- Badges ---- */
.badge { display: inline-block; font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; padding: .25rem .6rem; border-radius: 999px; font-weight: 700; }
.badge-light { background: var(--info-bg); color: var(--teal); }
.badge-deep { background: var(--navy); color: var(--mint); }
.badge-good { background: var(--good-bg); color: var(--good); }
.badge-mid { background: var(--mid-bg); color: #a67a00; }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-grey { background: #eeece6; color: var(--muted); }

/* ---- Scan-Typ-Auswahl ---- */
.type-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: .5rem 0 1.4rem; }
.type-card { position: relative; border: 2px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; cursor: pointer; transition: border-color .15s, box-shadow .15s; background: #fff; }
.type-card:hover { border-color: var(--teal); }
.type-card input { position: absolute; opacity: 0; }
.type-card.selected { border-color: var(--mint); box-shadow: 0 0 0 4px rgba(54, 208, 166, .18); }
.type-card.locked { opacity: .6; cursor: not-allowed; background: #fafaf8; }
.type-card .lock { position: absolute; top: 1rem; right: 1rem; font-size: 1.4rem; }
.type-card h3 { margin-top: .2rem; }
.type-card ul { margin: .5rem 0 0; padding-left: 1.1rem; font-size: .86rem; color: var(--muted); }

/* ---- Score ---- */
.score-ring { --p: 0; --c: var(--mint); width: 150px; height: 150px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), #e9e6dd 0); display: grid; place-items: center; position: relative; flex: 0 0 150px; }
.score-ring::before { content: ''; position: absolute; inset: 14px; background: #fff; border-radius: 50%; }
.score-ring .num { position: relative; font-weight: 900; font-size: 2.6rem; color: var(--navy); line-height: 1; }
.score-ring .num small { display: block; font-size: .7rem; font-family: var(--mono); letter-spacing: .1em; color: var(--muted); font-weight: 400; margin-top: .2rem; }
.score-ring.good { --c: var(--good); } .score-ring.mid { --c: var(--mid); } .score-ring.bad { --c: var(--bad); }
.score-hero { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; }
.score-hero .num { color: var(--navy); }
.cat-bar { margin-bottom: .85rem; }
.cat-bar .cat-row { display: flex; justify-content: space-between; font-size: .88rem; font-weight: 600; margin-bottom: .25rem; }
.cat-bar .cat-row span:last-child { font-family: var(--mono); }
.bar { height: 10px; background: #ecebe4; border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--grad); }
.bar.mid > i { background: linear-gradient(90deg, #f3c044, #e0a300); }
.bar.bad > i { background: linear-gradient(90deg, #f07a7e, #e5484d); }

/* ---- Checks ---- */
.check-list { display: flex; flex-direction: column; gap: .5rem; }
.check-item { display: grid; grid-template-columns: 2rem 1fr auto; gap: .6rem; align-items: start; padding: .75rem .9rem; border-radius: 14px; background: #fafaf8; border: 1px solid #eeede8; }
.check-item .dot { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; font-weight: 900; color: #fff; }
.check-item.ok .dot { background: var(--good); } .check-item.warn .dot { background: var(--mid); } .check-item.fail .dot { background: var(--bad); } .check-item.info .dot { background: var(--info); }
.check-item .t { font-weight: 700; color: var(--navy); font-size: .95rem; }
.check-item .d { font-size: .86rem; color: var(--muted); margin-top: .1rem; }
.check-item .fix { font-size: .86rem; margin-top: .45rem; padding: .5rem .7rem; background: var(--info-bg); border-radius: 10px; color: #244; display: none; }
.check-item.open .fix { display: block; }
.explain { margin-top: .7rem; padding-top: .7rem; border-top: 1px dashed #c9dedb; display: grid; gap: .6rem; color: var(--ink); }
.explain .label { margin-bottom: .15rem; }
.explain ol { margin: .2rem 0 0; padding-left: 1.2rem; }
.explain li { margin-bottom: .2rem; }
.check-item .tog { font-size: .75rem; font-family: var(--mono); color: var(--teal); background: none; border: 0; cursor: pointer; white-space: nowrap; }
.check-item.ok .tog { display: none; }
.prio { counter-reset: p; }
.prio .check-item { background: #fff; border-color: var(--line); }

/* ---- Fortschritt ---- */
.progress-wrap { max-width: 640px; margin: 3rem auto; text-align: center; }
.progress-ring { width: 120px; height: 120px; margin: 0 auto 1.5rem; border-radius: 50%; border: 8px solid #ecebe4; border-top-color: var(--mint); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-steps { text-align: left; margin: 1.5rem auto; max-width: 420px; font-size: .9rem; }
.progress-steps div { padding: .35rem 0; color: var(--muted); }
.progress-steps div.done { color: var(--good); } .progress-steps div.now { color: var(--navy); font-weight: 700; }

/* ---- Auth ---- */
.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 1rem; background: radial-gradient(circle at 20% 10%, #e3f6ef 0, #ffffff 55%); }
.auth-card { background: #fff; border-radius: 24px; box-shadow: var(--shadow); padding: 2.4rem 2.2rem; width: 100%; max-width: 420px; }
.auth-logo { height: 68px; width: auto; margin-bottom: 1.4rem; }
.auth-card h1 { font-size: 1.6rem; }
.auth-foot { font-size: .78rem; color: var(--muted); text-align: center; margin-top: 1.4rem; }

/* ---- Sonstiges ---- */
.kpi { padding: 1.1rem 1.2rem; }
.kpi .v { font-size: 1.7rem; font-weight: 900; color: var(--navy); line-height: 1.1; }
.kpi .l { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin-top: .2rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .big { font-size: 2.2rem; }
.lockrow { display: inline-flex; align-items: center; gap: .4rem; }
.toggle { position: relative; width: 44px; height: 24px; border-radius: 999px; background: #d8d5cb; border: 0; cursor: pointer; transition: background .15s; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle.on { background: var(--mint); } .toggle.on::after { left: 23px; }
details.sec { margin-bottom: 1rem; }
details.sec summary { cursor: pointer; list-style: none; }
details.sec summary::-webkit-details-marker { display: none; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sec-head .counts { font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.sec-head .counts b { color: var(--navy); }
hr.soft { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
.page-table td.u { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: .78rem; }

/* Plan-Liste im Report */
ol.plan { counter-reset: p; list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .6rem; }
ol.plan li { counter-increment: p; position: relative; padding: .7rem .9rem .7rem 3rem; background: #fafaf8; border: 1px solid #eeede8; border-radius: 14px; }
ol.plan li::before { content: counter(p); position: absolute; left: .9rem; top: .75rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--navy); color: var(--mint); font-weight: 900; font-size: .85rem; display: grid; place-items: center; }
.type-pick { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
