/* ============================================================
   ZOO Lab – style.css (v0.1)
   Klares, ruhiges Design mit viel Weissraum.
   ============================================================ */

:root {
    --bg: #f7f6f3;
    --card: #ffffff;
    --ink: #26231f;
    --muted: #8a857c;
    --line: #e9e6e0;
    --accent: #e07a3f;
    --accent-ink: #b45f27;
    --ok: #3a8a5d;
    --err: #c0503f;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(38, 35, 31, .06), 0 4px 14px rgba(38, 35, 31, .05);
    --pc: #c9c2b6; /* project color, overridden inline */
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .6rem; }
.h1 { font-size: 1.45rem; font-weight: 700; margin-bottom: 1rem; }
.h2 { font-size: 1.05rem; font-weight: 700; margin: 1.4rem 0 .7rem; }
.h-slim { font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; }
.lead { margin-bottom: 1.4rem; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.wrap { overflow-wrap: anywhere; }
.center { text-align: center; }

/* ---------- topbar ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .8rem 1.2rem;
    background: var(--card);
    border-bottom: 1px solid var(--line);
}
.brand {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: .12em;
    color: var(--ink);
    text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-sub { font-size: .72rem; font-weight: 600; color: var(--muted); letter-spacing: .08em; margin-left: .4rem; }
.brand-big { display: block; text-align: center; font-size: 1.6rem; margin-bottom: 1.2rem; }
.profile { color: var(--ink); display: inline-flex; padding: .35rem; border-radius: 8px; }
.profile:hover { background: var(--bg); text-decoration: none; }

/* ---------- tabs (desktop) ---------- */
.tabs {
    display: flex;
    gap: .25rem;
    justify-content: center;
    padding: .55rem 1rem 0;
    max-width: 64rem;
    margin: 0 auto;
}
.tab {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem .95rem;
    border-radius: 999px 999px 0 0;
    color: var(--muted);
    font-weight: 600;
    font-size: .95rem;
}
.tab:hover { color: var(--ink); text-decoration: none; background: rgba(0,0,0,.03); }
.tab.active { color: var(--ink); background: var(--card); border: 1px solid var(--line); border-bottom-color: var(--card); }
.tab .icon { width: 19px; height: 19px; }

/* ---------- bottom nav (mobile) ---------- */
.bottomnav { display: none; }

/* ---------- shell / layout ---------- */
.shell {
    display: flex;
    gap: 1.4rem;
    align-items: flex-start;
    max-width: 64rem;
    margin: 0 auto;
    padding: 1.4rem 1.2rem 4rem;
}
.content { flex: 1; min-width: 0; }

/* ---------- project filter (vertikal, auch mobile) ---------- */
.filter {
    width: 15rem;
    flex-shrink: 0;
    position: sticky;
    top: 1rem;
}
.filter-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 .6rem; }
.filter-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem .6rem;
    border-radius: 9px;
    color: var(--ink);
    font-weight: 600;
    font-size: .93rem;
    margin-bottom: .15rem;
}
.filter-item:hover { background: var(--bg); text-decoration: none; }
.filter-item.active { background: color-mix(in srgb, var(--pc) 16%, white); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pc) 45%, white); }

.pt {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    background: var(--pc);
}
.pt-all { background: var(--line); color: var(--muted); }
.pt-lg { width: 46px; height: 46px; border-radius: 11px; font-size: 1.1rem; }

/* ---------- cards ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.pad { padding: 1.1rem 1.25rem; }
.list { margin-bottom: 1.2rem; }

/* dashboard */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1.6rem; }
.project-card {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .8rem .9rem;
    color: var(--ink);
    font-weight: 700;
}
.project-card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--pc) 55%, var(--line)); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.stat { padding: .9rem 1rem; }
.stat-num { font-size: 1.6rem; font-weight: 800; }
.stat-label { color: var(--muted); font-size: .85rem; }

/* project view */
.project-hero {
    width: 100%;
    max-width: 240px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}
.project-hero-empty { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 4rem; font-weight: 800; }

/* ---------- row lists (news etc.) ---------- */
.row-item {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .75rem 1.1rem .75rem .95rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    position: relative;
}
.row-item:last-child { border-bottom: 0; }
a.row-item:hover { background: var(--bg); text-decoration: none; }

/* Akzentstrich in Projektfarbe */
.news-item::before {
    content: "";
    width: 4px;
    align-self: stretch;
    border-radius: 4px;
    background: var(--pc);
    margin-right: .35rem;
}

.row-main { display: flex; flex-direction: column; gap: .1rem; flex: 1; min-width: 0; }
.row-title { font-weight: 600; }
.row-sub { display: block; }
.row-date { color: var(--muted); font-size: .8rem; white-space: nowrap; }

/* Ungelesene hervorheben */
.row-item.unread { background: color-mix(in srgb, var(--pc) 7%, white); }
.row-item.unread .row-title { font-weight: 700; }
.newdot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

/* ---------- buttons ---------- */
.btn {
    display: inline-block;
    padding: .5rem .95rem;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
    font-weight: 600;
    font-size: .92rem;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.3;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, var(--line)); }
.btn-danger:hover { background: color-mix(in srgb, var(--err) 8%, white); }
.btn-sm { padding: .3rem .7rem; font-size: .84rem; }
.btn-block { display: block; width: 100%; }
.actions { display: flex; gap: .6rem; align-items: center; margin-top: 1rem; flex-wrap: wrap; }
.actions-inline { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.inline-form { display: inline; }

/* ---------- forms ---------- */
.label { display: block; font-weight: 600; font-size: .88rem; margin: 1rem 0 .3rem; }
.input {
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}
.input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 0; border-color: var(--accent); }
textarea.input { resize: vertical; }
.checks { display: flex; flex-direction: column; gap: .25rem; }
.check { display: flex; align-items: center; gap: .5rem; margin: .45rem 0; font-size: .95rem; }
.req { color: var(--err); font-weight: 700; }

/* surveys */
.question { margin-bottom: 1.3rem; }
.q-label { font-weight: 600; margin: 0 0 .5rem; }
.q-img { display: block; max-width: min(420px, 100%); border-radius: 10px; margin: .4rem 0 .8rem; cursor: zoom-in; }
.option { display: flex; align-items: center; gap: .5rem; padding: .4rem .6rem; border-radius: 8px; cursor: pointer; margin-bottom: .15rem; }
.option:hover { background: var(--bg); }
.option input { accent-color: var(--accent); }
.scale { display: flex; gap: .4rem; flex-wrap: wrap; }
.scale-opt { border: 1px solid var(--line); border-radius: 9px; }
.survey-intro { margin-bottom: 1.2rem; }
.survey-hint { font-size: .9rem; color: var(--muted); }
.survey-meta { margin: 0 0 1rem; }
.submit-card { margin-top: 1.2rem; }
.qa { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.qa:last-child { border-bottom: 0; }
.qa-answer { margin: .15rem 0 0; color: var(--muted); }

/* ---------- chips & flashes ---------- */
.chip {
    display: inline-block;
    padding: .1rem .55rem;
    border-radius: 999px;
    background: var(--line);
    font-size: .74rem;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
}
.chip-green { background: #e0f0e6; color: var(--ok); }
.chip-red { background: #f7e2dd; color: var(--err); }
.chip-grey { background: var(--line); color: var(--muted); }
.chip-blue { background: #e2eaf7; color: #3f5f9f; }
.chip-purple { background: #ece2f4; color: #71479c; }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 .3rem;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    margin-left: .3rem;
}

.flash { padding: .7rem 1rem; border-radius: 9px; margin-bottom: .8rem; font-weight: 600; font-size: .92rem; }
.flash-ok { background: #e0f0e6; color: var(--ok); }
.flash-error { background: #f7e2dd; color: var(--err); }

.hint { padding: .9rem 1.1rem; margin-bottom: 1.1rem; }
.hint p { margin: 0 0 .6rem; }

/* ---------- news article ---------- */
.news-article { max-width: 46rem; margin: 0 auto; }
.news-body { margin-top: 1rem; }
.news-body img { max-width: 100%; height: auto; border-radius: 10px; }
.news-body h1, .news-body h2, .news-body h3 { margin-top: 1.4rem; }
.news-body ul, .news-body ol { padding-left: 1.3rem; }
.news-body code { background: var(--bg); padding: .1rem .35rem; border-radius: 5px; font-size: .9em; }
.news-body blockquote { margin: 1rem 0; padding: .2rem 0 .2rem 1rem; border-left: 3px solid var(--line); color: var(--muted); }

/* ---------- software ---------- */
.software-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.software-card { padding: 1rem 1.1rem; color: var(--ink); }
.software-card:hover { border-color: var(--accent); }
.software-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .35rem; }
.software-title { font-weight: 700; }
.strong { font-weight: 700; }
.software-note { font-size: .85rem; color: var(--muted); margin: .5rem 0 0; }

/* ---------- tasks ---------- */
.task-group { margin-bottom: 1.4rem; }
.task-project { margin-bottom: .6rem; }
.task-item { display: flex; align-items: flex-start; gap: .6rem; padding: .5rem .2rem; }
.task-check, .task-bullet { flex-shrink: 0; margin-top: .28rem; }
.task-check { accent-color: var(--ok); width: 1.05rem; height: 1.05rem; }
.task-bullet { width: 9px; height: 9px; border-radius: 50%; background: var(--pc); display: inline-block; }
.task-item.done .task-note, .task-item.done { color: var(--muted); }
.task-note { font-size: .88rem; color: var(--muted); margin: .1rem 0 0 0 1.65rem; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; margin-bottom: 1.2rem; }
.table { border-collapse: collapse; width: 100%; font-size: .9rem; background: var(--card); }
.table th, .table td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- images admin ---------- */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .9rem; margin-top: 1rem; }
.image-card { padding: .7rem; text-align: center; }
.image-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; margin-bottom: .4rem; }

/* ---------- misc panels ---------- */
.progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 0 0 1.1rem; }
.progress-bar { height: 100%; background: var(--accent); border-radius: 999px; transition: width .2s ease; }
.survey-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .8rem; }
.swatches { display: flex; gap: .5rem; flex-wrap: wrap; margin: .3rem 0 1rem; }
.swatch { width: 30px; height: 30px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.pdot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: baseline; }
.swatch.selected, .swatch:hover { border-color: var(--ink); }

.backup-codes { columns: 2; font-size: 1.05rem; list-style: none; padding: 0; }
.backup-codes li { margin-bottom: .4rem; }
.totp-secret { font-size: 1.15rem; letter-spacing: .1em; margin: .8rem 0; }

.link-panel { margin-bottom: 1rem; }

/* ---------- onboarding ---------- */
.onboard { max-width: 34rem; margin: 0 auto; }
.onboard-step { text-align: center; margin-bottom: 1.4rem; }
.onboard-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .8rem; margin-bottom: 1.4rem; }
.onboard-project { padding: 1rem .8rem; text-align: center; color: var(--ink); }
.onboard-desc { font-size: .85rem; color: var(--muted); margin: .5rem 0 0; }
.onboard-text { margin: 1rem 0; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.lightbox[hidden] { display: none; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(20, 18, 15, .6); }
.lightbox-box { position: relative; max-width: min(900px, 92vw); text-align: center; }
.lightbox-body img { max-width: 100%; max-height: 78vh; border-radius: 8px; }
.lightbox-close { margin-top: .8rem; }

/* ---------- login / slim pages ---------- */
body.center-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem; }
.slim { width: 100%; max-width: 26rem; padding: 1.8rem 1.9rem; }

/* ---------- admin ---------- */
.admin-nav {
    display: flex;
    gap: .3rem;
    flex-wrap: wrap;
    max-width: 64rem;
    margin: .9rem auto 0;
    padding: 0 1.2rem;
}
.anav-item {
    padding: .35rem .75rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 600;
}
.anav-item:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.anav-item.active { background: var(--ink); color: #fff; }
.anav-item.active .badge { background: #fff; color: var(--ink); }
.admin-shell { padding-top: 1.1rem; }

.sep { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }

/* login / auth cards */
.login-card { max-width: 26rem; margin: 2.5rem auto; }
.profile-card { max-width: 34rem; margin-bottom: 1rem; }

/* surveys list */
.survey-item .chip { margin-right: .2rem; }

/* tasks */
.pchip { display: inline-flex; align-items: center; gap: .5rem; }
.list-subhead { margin: .9rem 0 .3rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 1.1rem; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
    .tabs { display: none; }
    .shell { flex-direction: column; padding: 1rem .9rem 5.5rem; }
    .filter { width: 100%; position: static; order: 2; }
    .filter-title { margin-top: .2rem; }
    .bottomnav {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: var(--card);
        border-top: 1px solid var(--line);
        justify-content: space-around;
        padding: .3rem .2rem calc(.3rem + env(safe-area-inset-bottom));
        z-index: 40;
    }
    .bn-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: .1rem;
        color: var(--muted);
        font-size: .68rem;
        font-weight: 600;
        padding: .3rem .5rem;
        position: relative;
        min-width: 3.4rem;
    }
    .bn-item.active { color: var(--accent-ink); }
    .bn-item .icon { width: 21px; height: 21px; }
    .bn-badge { position: absolute; top: 0; right: .2rem; margin: 0; }
    .h1 { font-size: 1.25rem; }
    .tablewrap { margin-left: -.9rem; margin-right: -.9rem; padding: 0 .9rem; }
    .actions-inline { margin-top: .3rem; }
    .row-item { flex-wrap: wrap; }
    .row-date { order: 3; }
}

@media (min-width: 761px) {
    .shell.narrow { max-width: 48rem; }
}
