/* =====================================================================
   SGG Checklisten – Design
   Mobile-first, gebaut für den Daumen auf der Baustelle.
   Farbwelt aus dem SGG-CI: Nachtblau, Königsblau, Sonnengelb, Rot.
   ===================================================================== */

:root {
    --nachtblau: #002673;
    --blau:      #0066ff;
    --gelb:      #f2cc19;
    --rot:       #e00b2c;
    --ok:        #1a8a4a;

    --bg:    #f2f4f8;
    --card:  #ffffff;
    --ink:   #16233f;
    --muted: #64748b;
    --line:  #dfe4ee;

    --radius: 14px;
    --shadow: 0 1px 3px rgba(0, 38, 115, 0.08);
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: Ubuntu, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
}

/* ---------- Kopfzeile ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--nachtblau);
    color: #fff;
}

.topbar-inner {
    max-width: 680px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
    color: #fff;
}

.brand-mark {
    background: var(--gelb);
    color: var(--nachtblau);
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 6px;
    /* schräg abgesetzt – wie ein frisch gezogener Farbstreifen */
    clip-path: polygon(0 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}

.brand-sub { font-weight: 500; opacity: 0.9; }

.nav {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
}

.nav a { color: #fff; text-decoration: none; padding: 8px 0; }
.nav a:hover { text-decoration: underline; }
.nav-user { opacity: 0.75; display: none; }
.nav-logout { opacity: 0.85; }

@media (min-width: 480px) {
    .nav-user { display: inline; }
}

/* ---------- Grundgerüst ---------- */

.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px 16px 48px;
}

.page-title {
    font-size: 26px;
    line-height: 1.2;
    margin: 8px 0 4px;
    color: var(--nachtblau);
}

.page-subtitle { margin: 0 0 16px; color: var(--muted); }

.section-title {
    font-size: 19px;
    color: var(--nachtblau);
    margin: 28px 0 10px;
}

.backlink {
    display: inline-block;
    margin-bottom: 4px;
    color: var(--blau);
    text-decoration: none;
    padding: 6px 0;
}

.footer {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    padding: 0 16px 32px;
}

.hint  { color: var(--muted); font-size: 14px; margin-top: 4px; }
.muted { color: var(--muted); }

/* ---------- Karten ---------- */

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

.card h2 { margin: 0 0 6px; font-size: 18px; color: var(--nachtblau); }

.empty { color: var(--muted); }
.empty a { color: var(--blau); }

.list-grid { display: grid; gap: 12px; }

.list-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease;
}

.list-card:active,
.list-card:hover { border-color: var(--blau); }

.list-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.list-title { font-weight: 700; font-size: 17px; }
.list-subtitle { color: var(--muted); font-size: 14px; margin-top: 2px; }

.badge {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--line);
}

.badge-ok {
    background: #e7f6ec;
    color: var(--ok);
    border-color: #bfe5cc;
}

/* ---------- Fortschritt: der frische Farbstrich ---------- */

.progress {
    height: 10px;
    background: #e8ecf4;
    border-radius: 6px;
    overflow: hidden;
}

.progress-lg { height: 14px; margin-top: 12px; }

.progress-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--nachtblau), var(--blau));
    /* schräge Abschlusskante wie ein Pinselstrich */
    clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
    transition: width 0.35s ease;
    min-width: 0;
}

.progress-label {
    font-size: 13px;
    color: var(--muted);
    margin: 6px 0 14px;
}

/* ---------- Aufgaben (Checkliste) ---------- */

.tasks { display: grid; gap: 10px; }

.task {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    min-height: 56px;          /* große Trefffläche für den Daumen */
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.task input[type="checkbox"] {
    width: 26px;
    height: 26px;
    margin: 1px 0 0;
    flex-shrink: 0;
    accent-color: var(--ok);
    cursor: pointer;
}

.task-body { display: grid; gap: 2px; }
.task-title { font-weight: 500; }

.task-meta {
    font-size: 13px;
    color: var(--ok);
    min-height: 1em;
}

.task.done { background: #f7faf8; border-color: #d5e8dc; }
.task.done .task-title { color: var(--muted); text-decoration: line-through; }

/* ---------- Aktivitäten (Admin) ---------- */

.activity { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }

.activity li { display: flex; gap: 10px; align-items: flex-start; }

.activity-check {
    color: var(--ok);
    font-weight: 700;
    line-height: 1.4;
}

.activity-text { display: grid; }
.activity-list { color: var(--blau); font-size: 13px; }
.activity-time { color: var(--muted); font-size: 13px; }

/* ---------- Tabellen (Admin) ---------- */

.table-wrap { overflow-x: auto; margin-top: 8px; }

.task-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 480px;
}

.task-table th {
    text-align: left;
    color: var(--muted);
    font-weight: 600;
    padding: 8px 10px;
    border-bottom: 2px solid var(--line);
    white-space: nowrap;
}

.task-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.cell-status { color: var(--muted); width: 24px; }
.row-done .cell-status { color: var(--ok); font-weight: 700; }

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    align-items: center;
}

/* ---------- Formulare ---------- */

.field { display: block; margin-bottom: 14px; }

.field span {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--nachtblau);
}

input[type="text"],
input[type="password"],
textarea,
select {
    width: 100%;
    font: inherit;               /* 16px verhindert Auto-Zoom auf iPhones */
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
}

textarea { resize: vertical; }

input:focus,
textarea:focus,
select:focus,
.btn:focus-visible,
.task input[type="checkbox"]:focus-visible {
    outline: 3px solid var(--gelb);
    outline-offset: 1px;
}

.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { min-width: 140px; padding: 8px 10px; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-block;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: var(--blau);
    border: none;
    border-radius: 10px;
    padding: 13px 20px;
    min-height: 48px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn:hover { background: #0055d6; }
.btn:active { transform: translateY(1px); }

.btn-block { width: 100%; }

.btn-small {
    min-height: 0;
    padding: 8px 14px;
    font-size: 14px;
}

.btn-ghost {
    background: #fff;
    color: var(--blau);
    border: 1px solid var(--blau);
}

.btn-ghost:hover { background: #f0f5ff; }

.btn-danger {
    background: #fff;
    color: var(--rot);
    border: 1px solid #f3b3bf;
}

.btn-danger:hover { background: #fdf0f2; }

/* ---------- Meldungen ---------- */

.alert {
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 15px;
}

.alert-ok    { background: #e7f6ec; color: #14602f; border: 1px solid #bfe5cc; }
.alert-error { background: #fdecef; color: #9c0a20; border: 1px solid #f3b3bf; }

/* ---------- Login-Seite ---------- */

.login-page {
    background: var(--nachtblau);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrap {
    width: 100%;
    max-width: 380px;
    padding: 24px 16px;
}

.login-brand {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
    color: #fff;
    font-size: 20px;
    margin-bottom: 18px;
}

.login-brand .brand-mark { font-size: 20px; }

.login-card { padding: 22px 20px; }
.login-card h1 { margin: 0 0 2px; font-size: 22px; color: var(--nachtblau); }
.login-card .hint { margin: 0 0 16px; }

.login-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    margin-top: 16px;
}

/* ---------- Sonstiges ---------- */

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
