/* BlueStone Kunden-App – Styles (CI: Navy #061426, Blau #0057B8) */

@font-face {
  font-family: 'Montserrat'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('fonts/montserrat-v31-latin-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat'; font-weight: 800; font-style: normal; font-display: swap;
  src: url('fonts/montserrat-v31-latin-800.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('fonts/inter-v20-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('fonts/inter-v20-latin-600.woff2') format('woff2');
}

:root {
  --navy: #061426;
  --navy-soft: #0C2138;
  --blue: #0057B8;
  --blue-dark: #00448C;
  --tint: #EAF2FB;
  --text: #182432;
  --muted: #5A6675;
  --line: #E4E9F0;
  --bg: #F2F5F9;
  --ok: #1F7042;
  --ok-bg: #EAF7EF;
  --warn: #8a6d1a;
  --warn-bg: #FFF7E0;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 16px; line-height: 1.55;
  min-height: 100vh;
}
h1, h2, h3 { font-family: 'Montserrat', 'Inter', sans-serif; line-height: 1.2; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }

.bs-loading { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.bs-loading img { border-radius: 18px; }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  background: var(--navy); padding: 24px;
}
.login-card { width: 100%; max-width: 380px; }
.login-brand { text-align: center; margin-bottom: 30px; }
.login-brand img { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 20px; box-shadow: 0 14px 40px rgba(0,0,0,.4); }
.login-brand h1 { color: #fff; font-size: 1.35rem; font-weight: 800; }
.login-brand p { color: #9FB0C4; font-size: .85rem; margin-top: 4px; }
.login-form { background: #fff; border-radius: var(--radius); padding: 24px 20px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.login-form label { display: block; font-size: .8rem; font-weight: 600; margin: 0 0 6px; }
.login-form input {
  width: 100%; padding: 13px 15px; margin-bottom: 15px;
  border: 1.5px solid var(--line); border-radius: 11px; font: inherit;
}
.login-form input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(0,87,184,.14); }
.login-note { color: #9FB0C4; font-size: .78rem; text-align: center; margin-top: 18px; line-height: 1.5; }
.login-note a { color: #7FB2E8; }

/* ---------- Buttons ---------- */
.btn {
  display: flex; width: 100%; justify-content: center; align-items: center; gap: 8px;
  background: var(--blue); color: #fff;
  font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: .95rem;
  padding: 14px 20px; border-radius: 12px;
  transition: background-color .15s ease;
}
.btn:active { background: var(--blue-dark); }
.btn[disabled] { opacity: .6; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--ghost { background: var(--tint); color: var(--blue); }

/* ---------- App-Gerüst ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--navy); color: #fff;
  padding: 14px 18px calc(14px);
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  display: flex; align-items: center; gap: 12px;
}
.topbar-logo { width: 36px; height: 36px; border-radius: 9px; background: #fff; padding: 3px; }
.topbar-title { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1rem; }
.topbar-title small { display: block; font-family: 'Inter', sans-serif; font-weight: 400; font-size: .72rem; color: #9FB0C4; }
.topbar-logout { margin-left: auto; color: #9FB0C4; font-size: .78rem; font-weight: 600; padding: 8px; }

.objekt-select {
  margin: 0 18px; margin-top: 14px;
}
.objekt-select select {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--line); border-radius: 11px;
  background: #fff; font: inherit; font-weight: 600; font-size: .9rem;
}

.view { padding: 18px 18px calc(86px + var(--safe-b)); max-width: 560px; margin: 0 auto; }
.view h2 { font-size: 1.25rem; font-weight: 800; margin: 6px 0 16px; }
.view h3 { font-size: .95rem; margin: 22px 0 10px; }

/* ---------- Karten & Listen ---------- */
.card {
  background: #fff; border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(6,20,38,.06);
}
.card-tap { display: block; color: inherit; }
.card-tap:active { background: var(--tint); }
.card h4 { font-family: 'Montserrat', sans-serif; font-size: .95rem; margin-bottom: 2px; }
.card .meta { color: var(--muted); font-size: .8rem; }
.card-row { display: flex; gap: 14px; align-items: center; }
.card-row img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex: none; }
.card-row .grow { flex: 1; min-width: 0; }
.chev { color: #B6C0CC; font-size: 1.3rem; flex: none; }

.badge {
  display: inline-block; font-size: .68rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 99px;
}
.badge--neu { background: var(--tint); color: var(--blue); }
.badge--in_bearbeitung { background: var(--warn-bg); color: var(--warn); }
.badge--erledigt { background: var(--ok-bg); color: var(--ok); }

.hero-card {
  background: linear-gradient(120deg, var(--navy), #0D3665);
  color: #fff; border-radius: var(--radius);
  padding: 20px 18px; margin-bottom: 16px;
}
.hero-card h2 { color: #fff; margin: 0 0 4px; font-size: 1.15rem; }
.hero-card p { color: #B9C8DB; font-size: .85rem; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat {
  background: #fff; border-radius: var(--radius); padding: 14px;
  box-shadow: 0 2px 10px rgba(6,20,38,.06);
}
.stat b { display: block; font-family: 'Montserrat', sans-serif; font-size: 1.3rem; color: var(--blue); }
.stat span { font-size: .74rem; color: var(--muted); }

.empty { text-align: center; color: var(--muted); font-size: .9rem; padding: 30px 10px; }

/* ---------- Nachweis-Detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-weight: 600; font-size: .85rem; margin-bottom: 12px; }
.foto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 4px; }
.foto-grid a { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; background: var(--line); }
.foto-grid img { width: 100%; height: 100%; object-fit: cover; }
.foto-label {
  position: absolute; left: 8px; bottom: 8px;
  background: rgba(6,20,38,.85); color: #fff;
  font-size: .6rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px;
}
.foto-label--nachher { background: var(--blue); }
.check-list { list-style: none; }
.check-list li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: .92rem;
}
.check-list li:last-child { border-bottom: 0; }
.check-list .tick { color: var(--ok); flex: none; font-weight: 700; }

/* ---------- Formular (Meldung) ---------- */
.form label { display: block; font-size: .82rem; font-weight: 600; margin: 14px 0 6px; }
.form select, .form textarea, .form input[type="file"] {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 11px;
  background: #fff; font: inherit; font-size: .95rem;
}
.form textarea { min-height: 110px; resize: vertical; }
.form select:focus, .form textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(0,87,184,.14); }
.form .btn { margin-top: 18px; }
.form-hint { font-size: .76rem; color: var(--muted); margin-top: 6px; }

.msg { padding: 13px 16px; border-radius: 12px; font-size: .88rem; margin-bottom: 14px; border: 1.5px solid; }
.msg--ok { background: var(--ok-bg); border-color: #2E9E5B; color: var(--ok); }
.msg--err { background: #FBEFED; border-color: #C0392B; color: #96281B; }

/* ---------- Tab-Bar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  background: #fff; border-top: 1px solid var(--line);
  display: flex;
  padding-bottom: var(--safe-b);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 4px 8px;
  color: var(--muted); font-size: .64rem; font-weight: 600;
}
.tab svg { width: 22px; height: 22px; }
.tab.is-active { color: var(--blue); }

/* Offline-Hinweis */
.offline {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: #C0392B; color: #fff; text-align: center;
  font-size: .78rem; font-weight: 600; padding: 6px;
}

@media (min-width: 640px) {
  .view { padding-top: 26px; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
