/* SecuroTec ProgCheck – Design. Farben zentral hier anpassen (Corporate Design). */
:root {
  --brand: #123454;        /* Hauptfarbe (Kopfleiste, Buttons) */
  --brand-2: #0b2238;      /* dunkler Ton */
  --accent: #008c8c;       /* Akzent (Fortschritt, erledigt) */
  --accent-soft: #e0f3f3;
  --ok: #1d8a4e;
  --warn: #b45f06;
  --bad: #b3261e;
  --bg: #f2f5f8;
  --card: #ffffff;
  --ink: #17212b;
  --muted: #637080;
  --line: #dbe2e9;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* Kopfleiste */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 14px 10px; background: var(--brand); color: #fff; border-bottom: 3px solid var(--accent); }
.top .title { flex: 1; min-width: 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .title b { font-weight: 800; letter-spacing: .2px; }
.top .right { display: flex; align-items: center; gap: 4px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; background: transparent; color: #fff; font-size: 24px; border-radius: 10px; cursor: pointer; }
.icon-btn:active { background: rgba(255,255,255,.15); }
.dot { position: absolute; top: 2px; right: 0; min-width: 18px; padding: 0 4px; border-radius: 9px; background: #ff8a3d; color: #fff; font: 700 11px/18px system-ui; text-align: center; font-style: normal; }
.logo-mark { width: 30px; height: 30px; flex: none; background: url(icons/icon-192.png) center/cover; border-radius: 8px; }
.logo-mark.big { width: 72px; height: 72px; border-radius: 18px; }
.net { font-size: 11px; padding: 3px 8px; border-radius: 10px; background: rgba(255,255,255,.18); }
.net.on { background: #1d8a4e; } .net.off { background: #6b7683; } .net.local { background: #b45f06; }

main { padding: 14px; padding-bottom: calc(100px + var(--safe-b)); max-width: 720px; margin: 0 auto; }
.hello { color: var(--muted); margin: 2px 2px 12px; }
.banner { background: #fff3e0; border: 1px solid #f0c987; color: #7a4a00; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }

/* Karten und Buttons */
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(18,52,84,.05); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card p { margin: 6px 0; }
.btn { appearance: none; border: 1px solid transparent; border-radius: 12px; padding: 13px 16px; font: 600 16px system-ui; cursor: pointer; text-align: center; display: inline-block; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:active { background: var(--brand-2); }
.btn.ghost { background: #fff; color: var(--brand); border-color: var(--line); }
.btn.danger { background: #fff; color: var(--bad); border-color: #efc4c1; }
.btn.block { display: block; width: 100%; margin-top: 10px; }
.btn.small-btn { padding: 9px 12px; font-size: 14px; }
.link { background: none; border: 0; color: var(--brand); text-decoration: underline; font-size: 15px; margin: 14px auto 0; display: block; cursor: pointer; }
.pill { font-size: 13px; padding: 3px 10px; border-radius: 20px; background: #e8edf2; color: var(--brand); font-weight: 600; white-space: nowrap; }
.pill.ok { background: #d9f0e3; color: var(--ok); } .pill.bad { background: #fbdad7; color: var(--bad); } .pill.warnp { background: #fdebd0; color: var(--warn); }
.bar { height: 8px; background: #e3e9ef; border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .25s; }
.muted { color: var(--muted); } .small { font-size: 13px; } .warn { color: var(--warn); } .big-ok { color: var(--ok); font-weight: 700; }
.empty { text-align: center; padding: 36px 10px; }
.row { display: flex; gap: 10px; margin-top: 14px; } .row > .btn { flex: 1; } .row.wrap { flex-wrap: wrap; } .row .small-btn { flex: 1; }

/* Anmeldung */
.setup { max-width: 420px; margin: 0 auto; padding: calc(36px + var(--safe-t)) 22px 30px; }
.brand { text-align: center; margin-bottom: 26px; }
.brand h1 { margin: 12px 0 4px; font-size: 26px; color: var(--brand); } .brand h1 span { font-weight: 400; color: var(--accent); }
.brand p { margin: 0; color: var(--muted); }
.lbl { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 14px; color: var(--brand); }
input[type=text], input[type=search], input[type=date], input[type=email], input[type=number], input[type=password], input[type=tel], input:not([type]), textarea { width: 100%; padding: 12px; border: 1px solid #c8d1da; border-radius: 10px; font: 16px system-ui; background: #fff; color: var(--ink); }
textarea { resize: vertical; }
#code { margin-bottom: 12px; }

/* Projektansicht */
.sticky { position: sticky; top: calc(56px + var(--safe-t)); z-index: 10; background: var(--bg); padding: 10px 14px 6px; border-bottom: 1px solid var(--line); max-width: 100%; }
.prog { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.filters { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.chip { border: 1px solid var(--line); background: #fff; color: var(--brand); border-radius: 20px; padding: 7px 12px; font: 600 14px system-ui; cursor: pointer; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.filters input { flex: 1; min-width: 80px; padding: 8px 10px; }
.doors { padding-top: 6px; }
.area { margin-bottom: 14px; }
.area-h { width: 100%; display: flex; justify-content: space-between; align-items: center; background: transparent; border: 0; padding: 10px 2px; font: 700 16px system-ui; color: var(--brand); cursor: pointer; text-align: left; }
.door { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
.door.done { background: var(--accent-soft); border-color: #b6dede; }
.chk { flex: none; width: 52px; height: 52px; border-radius: 50%; border: 3px solid #aab7c4; background: #fff; font: 700 26px system-ui; color: #fff; cursor: pointer; display: grid; place-items: center; }
.door.done .chk { background: var(--ok); border-color: var(--ok); }
.chk:active { transform: scale(.94); }
.dmain { flex: 1; min-width: 0; cursor: pointer; }
.dname { font-weight: 700; word-break: break-word; }
.dmeta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.dnote { font-size: 13px; margin-top: 4px; color: #3b4854; }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 14px calc(10px + var(--safe-b)); background: linear-gradient(transparent, var(--bg) 30%); }
.bottom .btn { max-width: 692px; margin: 0 auto; }

/* Sheet und Toast */
.sheet { position: fixed; inset: 0; z-index: 50; display: none; }
.sheet.open { display: block; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10,25,40,.5); }
.sheet-body { position: absolute; left: 0; right: 0; bottom: 0; max-height: 90vh; overflow: auto; background: #fff; border-radius: 20px 20px 0 0; padding: 18px 18px calc(18px + var(--safe-b)); max-width: 720px; margin: 0 auto; }
.sheet-body h2 { margin: 0 0 8px; font-size: 20px; color: var(--brand); }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.check input { width: 22px; height: 22px; accent-color: var(--brand); }
.check small { display: block; color: var(--muted); }
.photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.ph { position: relative; } .ph img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; display: block; }
.ph button { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; font-size: 16px; cursor: pointer; }
.photo-btn { width: 100%; }
.toast { position: fixed; left: 12px; right: 12px; bottom: calc(80px + var(--safe-b)); z-index: 60; background: #1b2733; color: #fff; padding: 12px 14px; border-radius: 12px; display: flex; gap: 12px; align-items: center; justify-content: space-between; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; max-width: 600px; margin: 0 auto; }
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast button { background: none; border: 0; color: #7fe0e0; font: 700 15px system-ui; cursor: pointer; }
@media (prefers-color-scheme: dark) { /* bewusst hell: gut lesbar im Freien */ }

.row.inline { margin-top: 0; align-items: stretch; } .row.inline input { flex: 1; } .row.inline .btn { flex: none; width: 56px; padding: 0; font-size: 22px; }
.x-del { margin-left: auto; width: 36px; height: 36px; border: 0; background: transparent; color: var(--bad); font-size: 24px; cursor: pointer; }
