/* Verfuegbarkeits-Portal – bewusst schlank, keine Build-Kette noetig. */
:root {
  --brand: #1c6b5a;
  --brand-dark: #14503f;
  --brand-soft: #e8f2ee;
  --ink: #1a1d1b;
  --muted: #6b7772;
  --line: #e1e8e5;
  --bg: #f6f8f7;
  --card: #ffffff;
  --ok: #1c7a4a;
  --ok-soft: #e6f4ec;
  --warn: #9a6512;
  --warn-soft: #fdf3e0;
  --err: #a32c2c;
  --err-soft: #fbeaea;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 40, 34, .06), 0 8px 24px rgba(20, 40, 34, .05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.wrap { width: 100%; max-width: 780px; margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 1080px; }

/* ---------- Kopfzeile ---------- */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--brand), #2f9179);
}
.brand strong { display: block; font-size: 15px; font-weight: 650; line-height: 1.2; }
.brand em { display: block; font-style: normal; font-size: 12.5px; color: var(--muted); }
.topnav { display: flex; gap: 18px; font-size: 14px; flex-wrap: wrap; }
.topnav a { color: var(--ink); text-decoration: none; }
.topnav a:hover { color: var(--brand); }
.topnav a.muted { color: var(--muted); }

main.wrap { flex: 1; padding-top: 36px; padding-bottom: 56px; }

/* ---------- Typografie ---------- */
h1 { font-size: 27px; line-height: 1.25; margin: 0 0 10px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 0 0 12px; font-weight: 650; }
.lead { font-size: 16.5px; color: var(--muted); margin: 0 0 28px; max-width: 56ch; }

/* ---------- Suche ---------- */
.searchbox { position: relative; margin-bottom: 8px; }
.searchbox input[type=text] {
  width: 100%; padding: 15px 17px 15px 46px; font-size: 16.5px; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='19' height='19' viewBox='0 0 24 24' fill='none' stroke='%236b7772' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 16px center;
  transition: border-color .15s, box-shadow .15s;
}
.searchbox input[type=text]:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(28, 107, 90, .12);
}
.search-hint { font-size: 13.5px; color: var(--muted); margin: 0 0 24px; }

/* ---------- Artikelkarten ---------- */
.results { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.card-link { display: flex; align-items: center; gap: 16px; text-decoration: none; color: inherit; }
.card-link:hover { border-color: #cfdbd6; }
a.card:hover { border-color: var(--brand); }
.card-main { flex: 1; min-width: 0; display: block; }
/* Als <span> im Markup, damit ein <a> sie umschliessen darf – Umbruch macht erst display:block. */
.card-title { display: block; font-weight: 600; font-size: 15.5px; margin: 0 0 3px; }
.card-meta { display: block; font-size: 13px; color: var(--muted); margin: 0; }

.badge {
  flex: none; font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-out { background: var(--warn-soft); color: var(--warn); }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty svg { opacity: .4; margin-bottom: 10px; }

/* ---------- Detailseite ---------- */
.article-head { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.article-head h1 { font-size: 22px; margin-bottom: 8px; }
.kv { font-size: 14px; color: var(--muted); margin: 0; }
.status-row { margin-top: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Formulare ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.field { margin-bottom: 16px; }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
input[type=email], input[type=text], input[type=password], input[type=number], input[type=time], textarea, select {
  width: 100%; padding: 11px 13px; font-size: 15.5px; font-family: inherit; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 9px; background: #fff;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(28,107,90,.12); }
/* Zahl und Uhrzeit brauchen keine volle Zeilenbreite. */
input[type=number] { width: 140px; }
input[type=time] { width: 130px; }
.checkline { display: flex; gap: 10px; align-items: flex-start; font-size: 13.8px; line-height: 1.55; color: var(--muted); }
.checkline input { margin-top: 3px; flex: none; width: 17px; height: 17px; accent-color: var(--brand); }
.checkline a { color: var(--brand); }

.btn {
  display: inline-block; padding: 12px 22px; font-size: 15.5px; font-weight: 600; font-family: inherit;
  color: #fff; background: var(--brand); border: none; border-radius: 9px; cursor: pointer;
  text-decoration: none; transition: background .15s;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-sm { padding: 7px 14px; font-size: 13.5px; }
.btn-danger { background: var(--err); }
.btn-danger:hover { background: #8a2424; }

/* ---------- Hinweise ---------- */
.notice { display: flex; gap: 13px; padding: 15px 17px; border-radius: var(--radius); margin-bottom: 22px; font-size: 14.8px; }
.notice p { margin: 4px 0 0; }
.notice-icon { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; }
.notice-ok { background: var(--ok-soft); color: #14532d; } .notice-ok .notice-icon { background: var(--ok); }
.notice-warn { background: var(--warn-soft); color: #6b4708; } .notice-warn .notice-icon { background: var(--warn); }
.notice-error { background: var(--err-soft); color: #7a1f1f; } .notice-error .notice-icon { background: var(--err); }
.notice-info { background: var(--brand-soft); color: var(--brand-dark); } .notice-info .notice-icon { background: var(--brand); }

/* ---------- Admin ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat b { display: block; font-size: 26px; font-weight: 650; line-height: 1.15; letter-spacing: -.02em; }
.stat span { font-size: 13px; color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafcfb; font-weight: 600; }
tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.wg-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; margin-bottom: 20px; }
.wg-item { display: flex; gap: 10px; align-items: center; padding: 10px 13px; border: 1.5px solid var(--line); border-radius: 9px; background: var(--card); cursor: pointer; font-size: 14.5px; }
.wg-item:hover { border-color: var(--brand); }
.wg-item input { accent-color: var(--brand); width: 17px; height: 17px; flex: none; }
.wg-item .count { margin-left: auto; font-size: 12.5px; color: var(--muted); }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.pill { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #eef2f0; color: var(--muted); white-space: nowrap; }
.pill-active { background: var(--ok-soft); color: var(--ok); }
.pill-pending { background: var(--warn-soft); color: var(--warn); }
.pill-notified { background: var(--brand-soft); color: var(--brand-dark); }

/* ---------- Fusszeile ---------- */
.footer { border-top: 1px solid var(--line); background: var(--card); padding: 18px 0; font-size: 13px; color: var(--muted); }
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--muted); }

.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  h1 { font-size: 23px; }
  main.wrap { padding-top: 26px; }
  .card-link { flex-wrap: wrap; gap: 10px; }
}
