:root {
    --erwartet: #f0a03c;
    --anwesend: #3cb464;
    --krank: #d64545;
    --abgeholt: #3c7ab4;
    --unentschuldigt: #999;
    --bg: #f5f6f8;
    --card: #ffffff;
    --text: #22252a;
    --border: #dcdfe4;
}

* { box-sizing: border-box; }

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

.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 20px;
    background: #1f2733;
    color: #fff;
    flex-wrap: wrap;
}
.topbar .brand { font-weight: 700; font-size: 1.1em; }
.topbar nav a {
    color: #cfd6e0;
    text-decoration: none;
    margin-right: 16px;
    font-size: 0.95em;
}
.topbar nav a:hover { color: #fff; }
.topbar .user-info { margin-left: auto; font-size: 0.9em; }
.topbar .logout { color: #f0a03c; margin-left: 12px; text-decoration: none; }

main { padding: 20px; max-width: 1100px; margin: 0 auto; }

h1 { font-size: 1.4em; }
h2 { font-size: 1.15em; margin-top: 30px; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 0.95em; }
th { background: #eef0f3; }

form.inline { display: inline; }

label { display: block; margin: 10px 0 4px; font-size: 0.9em; font-weight: 600; }
input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1em;
}
button, .btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    background: #2c3e50;
    color: #fff;
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
    margin-top: 10px;
}
button.secondary, .btn.secondary { background: #6c7885; }
button.danger, .btn.danger { background: var(--krank); }

.login-wrap {
    max-width: 380px;
    margin: 80px auto;
    text-align: center;
}

.flash-error {
    background: #fde3e3;
    border: 1px solid var(--krank);
    color: #7a1f1f;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.flash-ok {
    background: #e2f5e8;
    border: 1px solid var(--anwesend);
    color: #1f5c34;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Kachel-Dashboard */
.kachel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.kachel {
    border-radius: 10px;
    padding: 14px 10px;
    color: #fff;
    text-align: center;
    cursor: pointer;
    border: none;
    font-size: 1em;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}
.kachel .name { font-weight: 700; }
.kachel .status-label { font-size: 0.8em; opacity: 0.9; }
.kachel.status-erwartet { background: var(--erwartet); }
.kachel.status-anwesend { background: var(--anwesend); }
.kachel.status-krank { background: var(--krank); }
.kachel.status-abgeholt { background: var(--abgeholt); }
.kachel.status-unentschuldigt { background: var(--unentschuldigt); }
.kachel .icon { font-size: 1.1em; }

.fehlt-hinweis {
    font-size: 0.85em;
    margin-bottom: 10px;
    color: #555;
}

/* Scan-Vollbildanzeige */
.scan-result-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #fff;
    font-size: 2em;
    text-align: center;
    z-index: 999;
    padding: 20px;
}
.scan-result-overlay.ok { background: var(--anwesend); }
.scan-result-overlay.err { background: var(--krank); }
#reader { width: 100%; max-width: 480px; margin: 0 auto; }
