/* Checkliste – schlankes, mobile-first Design */

* { box-sizing: border-box; }

:root {
    --bg: #f4f5f7;
    --card: #ffffff;
    --text: #1c1e21;
    --muted: #6b7280;
    --line: #e3e5e8;
    --accent: #1a7f37;
    --accent-dark: #14602a;
    --blue: #0b62a4;
    --red: #b42318;
    --amber: #92400e;
}

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
}

/* Kopfzeile */
.topbar {
    background: #1f2937;
    color: #fff;
    padding: 0.6rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1rem;
}
.topbar .brand {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    font-size: 1.05rem;
}
.topbar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.9rem;
    align-items: center;
    font-size: 0.92rem;
}
.topbar nav a { color: #d1d5db; text-decoration: none; padding: 0.15rem 0; }
.topbar nav a:hover { color: #fff; }
.topbar .nav-user { color: #9ca3af; margin-left: 0.5rem; }

.content { max-width: 60rem; margin: 0 auto; padding: 1rem; }

h1 { font-size: 1.4rem; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
a { color: var(--blue); }

/* Karten & Listen */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.muted { color: var(--muted); font-size: 0.9rem; }

/* Flash-Meldungen */
.flash { padding: 0.7rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.flash-success { background: #e6f4ea; color: var(--accent-dark); border: 1px solid #b7e1c3; }
.flash-error   { background: #fdecea; color: var(--red); border: 1px solid #f5c6c0; }
.flash-info    { background: #e8f1fa; color: var(--blue); border: 1px solid #c3dcf0; }

/* Formulare */
label { display: block; margin: 0.6rem 0 0.2rem; font-weight: 600; font-size: 0.92rem; }
input[type=text], input[type=password], input[type=number], select, textarea {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid #c9ccd1;
    border-radius: 8px;
    font: inherit;
    background: #fff;
}
textarea { min-height: 4.5rem; }
.checkbox-row { display: flex; align-items: center; gap: 0.5rem; margin: 0.5rem 0; }
.checkbox-row label { margin: 0; font-weight: 400; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.2rem 1rem; margin: 0.3rem 0; }

button, .btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.55rem 1rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    margin-top: 0.6rem;
}
button:hover, .btn:hover { background: var(--accent-dark); }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid #c9ccd1; }
.btn-secondary:hover { background: #f0f1f3; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #8f1c13; }
.btn-small { padding: 0.3rem 0.7rem; font-size: 0.85rem; margin-top: 0; }
form.inline { display: inline; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 10px; }
th, td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }

/* Status-Badges */
.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.badge-open   { background: #fef3c7; color: var(--amber); }
.badge-done   { background: #e6f4ea; color: var(--accent-dark); }
.badge-locked { background: #eceef1; color: var(--muted); }
.badge-admin  { background: #ede9fe; color: #5b21b6; }
.badge-inactive { background: #fdecea; color: var(--red); }

/* Aufgabenliste in einer Runde */
.task { display: flex; gap: 0.8rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task.locked { opacity: 0.65; }
.task .task-main { flex: 1; }
.task .task-title { font-weight: 600; }
.task .task-meta { font-size: 0.85rem; color: var(--muted); margin-top: 0.2rem; }
.task .task-meta .ok { color: var(--accent-dark); }
.task .task-meta .warn { color: var(--amber); }
.task-check button { min-width: 7.5rem; }
.note-input { margin-top: 0.4rem; display: flex; gap: 0.4rem; }
.note-input input { flex: 1; }

/* Vollbild-Display (rollierender QR-Code) */
body.fullscreen { background: #fff; }
body.fullscreen .content { max-width: none; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2vh; text-align: center; }
.display-station { font-size: clamp(1.4rem, 4vw, 2.6rem); font-weight: 700; margin-bottom: 1.5vh; }
#qr { width: min(78vmin, 560px); height: min(78vmin, 560px); }
#qr img, #qr canvas, #qr svg { width: 100% !important; height: 100% !important; }
.display-countdown { font-size: clamp(1rem, 2.5vw, 1.5rem); color: var(--muted); margin-top: 1.5vh; }
.display-error { color: var(--red); font-size: 1.3rem; }

/* Login */
.login-box { max-width: 22rem; margin: 8vh auto 0; }

/* Scanner */
#reader { width: 100%; max-width: 30rem; margin: 0 auto; }

@media (max-width: 40rem) {
    .content { padding: 0.7rem; }
    th, td { padding: 0.45rem 0.5rem; }
}
