﻿:root {
    --primary: #1a4d3e;
    --primary-light: #236b57;
    --accent: #e87722;
    --cream: #fdfbf7;
    --card: #ffffff;
    --border: #e8e2d9;
    --muted: #6b7280;
    --text: #1a1a1a;
    --danger: #a32a1f;
    --ok: #1f7a4d;
    --tab-height: 62px;
    --topbar-h: 48px;
    --carousel-h: 160px;
    --next-h: 56px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
    margin: 0; padding: 0; min-height: 100%;
    background: var(--cream); color: var(--text);
    font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1 { font-size: 1.35rem; margin: 8px 0 14px; color: var(--primary); }
h1 span, .brand b { color: var(--accent); }
h2 { font-size: 1rem; margin: 18px 0 8px; color: var(--primary); }
h3 { font-size: 1rem; margin: 0 0 2px; }
p { margin: 0 0 8px; }
a { color: var(--primary); }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; justify-content: space-between; align-items: center;
    min-height: var(--topbar-h); padding: 0 16px; background: var(--primary); color: #fff;
}
.brand { font-weight: 700; letter-spacing: 0.01em; }
.who { font-size: 0.82rem; opacity: 0.85; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.msg-link { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; color: #fff; }
.logout-btn {
    display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0;
    border: 0; border-radius: 8px; background: transparent; color: #fff; font: inherit; cursor: pointer;
}
.logout-btn:hover { background: rgba(255,255,255,.14); }
.logout-btn.confirm { padding: 0 12px; background: var(--accent); font-size: 0.85rem; font-weight: 700; }
.review-chip {
    display: none; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
    background: var(--accent); color: #fff; font-size: 0.82rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.review-chip svg { flex: none; }
@media (min-width: 640px) { .review-chip { display: inline-flex; } }
.tab-ico { position: relative; display: inline-flex; }
.tab-ico .dot { position: absolute; top: -2px; right: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
.tab .pill { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.72rem; font-weight: 800; }
.review-card {
    display: flex; align-items: center; gap: 14px; margin: 0 0 12px; padding: 14px 16px; border-radius: 12px;
    background: var(--accent); color: #fff; text-decoration: none; box-shadow: 0 2px 8px rgba(232,119,34,.35);
}
.review-card > span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.review-card b { font-size: 1.05rem; }
.review-card small { opacity: .92; font-size: 0.8rem; }
.badge {
    position: absolute; top: 0; right: -2px; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 800;
    line-height: 18px; text-align: center;
}

.content { flex: 1; padding: 12px 16px calc(var(--tab-height) + 24px); max-width: 720px; width: 100%; margin: 0 auto; }

.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; background: #fff; border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
}
.tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    height: var(--tab-height); text-decoration: none; color: var(--muted); font-size: 0.72rem; font-weight: 600;
}
.tab.active { color: var(--primary); }
.tab.active svg { color: var(--accent); }

/* ---- Big screens (PC, browser): navigation as a sidebar, wider content ---- */
.side-only { display: none; }
@media (min-width: 900px) {
    :root { --side-w: 216px; }
    .mobile-only { display: none !important; }
    .tabbar {
        top: var(--topbar-h); bottom: 0; right: auto; width: var(--side-w); overflow-y: auto;
        flex-direction: column; justify-content: flex-start; gap: 2px; padding: 14px 10px 20px;
        border-top: none; border-right: 1px solid var(--border); background: #fff;
    }
    .tab { flex: none; height: 44px; width: 100%; border-radius: 10px; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 14px; font-size: 0.92rem; }
    .tab.side-only { display: flex; }
    .tab:hover { background: #f4f1ea; }
    .tab.active { background: #eef2ef; }
    .side-label.side-only { display: block; margin: 16px 14px 4px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
    .shell > .content:not(.bleed) { width: calc(100% - var(--side-w)); max-width: 1120px; margin: 0 auto 0 var(--side-w); padding: 20px 36px 48px; }
    .shell > .content.bleed { margin: 0 auto; }
    .toast { left: calc(var(--side-w) + 24px); }
}

.card {
    background: var(--card); border: 1px solid var(--border); border-radius: 14px;
    padding: 14px; margin-bottom: 10px;
}
.card .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card .time { font-weight: 700; color: var(--primary); }
.card .place, .muted { color: var(--muted); font-size: 0.9rem; }
.card .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
a.card, a.card-link { display: block; text-decoration: none; color: inherit; }
.strong { font-weight: 700; }

.day { text-transform: none; font-size: 0.85rem; color: var(--muted); font-weight: 700; margin: 16px 0 6px; }

.chip {
    display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700;
    background: #eef2ef; color: var(--primary); white-space: nowrap;
}
.chip.open { background: #fdebd9; color: #a4510c; }
.chip.taken { background: #e3eefc; color: #1d4f91; }
.chip.assigned { background: #efe6fa; color: #5b349c; }
.chip.inprogress { background: #fff3c4; color: #7a5b00; }
.chip.done { background: #dff3e6; color: var(--ok); }
.chip.cancelled { background: #f1f1f1; color: #666; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }

.filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.filters button {
    flex: none; border: 1.5px solid var(--border); background: #fff; color: var(--muted);
    border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 0.85rem; font-weight: 600;
}
.filters button.on { background: var(--primary); border-color: var(--primary); color: #fff; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border-radius: 999px; padding: 10px 18px; font: inherit; font-weight: 700; font-size: 0.92rem;
    border: 1.5px solid transparent; cursor: pointer;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.green { background: var(--primary); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn.small { padding: 6px 14px; font-size: 0.82rem; }
a.btn { text-decoration: none; }

/* While typing, the bottom tab bar would only eat the space above the keyboard. */
body:has(input:focus, textarea:focus, select:focus) .tabbar { display: none; }
body:has(input:focus, textarea:focus, select:focus) .content { padding-bottom: 24px; }
.link { background: none; border: none; color: var(--primary); font: inherit; text-decoration: underline; padding: 8px 0; cursor: pointer; }
.back { display: inline-block; margin-bottom: 6px; text-decoration: none; font-weight: 600; }
.confirm { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.fab-row { display: flex; justify-content: flex-end; margin-bottom: 10px; }

label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--primary); margin-bottom: 12px; }
input, select, textarea {
    display: block; width: 100%; margin-top: 4px; padding: 11px 12px; font: inherit; color: var(--text);
    border: 1.5px solid var(--border); border-radius: 10px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { min-height: 84px; resize: vertical; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); }
label.check input { width: 22px; height: 22px; margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.banner {
    position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 15;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
    border-radius: 10px; padding: 10px 12px; font-size: 0.9rem; margin: 0 0 12px;
    box-shadow: 0 6px 16px -8px rgba(0,0,0,0.35);
}
.banner-close {
    flex: none; margin: -4px -6px 0 0; padding: 0 8px; border: none; background: none; color: inherit;
    font-size: 1.4rem; line-height: 1.4; opacity: 0.7; cursor: pointer;
}
.banner.error { background: #fdecea; border: 1px solid #f3b9b3; color: var(--danger); }
.banner.info { background: #e4f4ea; border: 1px solid #b6dec5; color: #14532d; }

.empty { color: var(--muted); text-align: center; padding: 32px 0; }
/* ---- Login / landing screen ---- */
.content.bleed { padding: 0; max-width: none; }
.login-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--primary); }
.login-hero { position: relative; height: clamp(240px, 42vh, 400px); overflow: hidden; background: var(--primary); }
.login-hero img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 80% 26%; }
.login-hero-shade {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(15,46,37,0.94) 0%, rgba(15,46,37,0.6) 36%, rgba(15,46,37,0) 72%);
}
.login-hero-text { position: absolute; left: 0; right: 0; bottom: 46px; padding: 0 20px; color: #fff; }
.login-hero-inner { max-width: 520px; margin: 0 auto; }
.login-hero-text h1 { color: #fff; font-size: 1.75rem; margin: 10px 0 2px; }
.login-hero-text h1 span { color: #f4a45c; }
.login-hero-text p { margin: 0; opacity: 0.92; font-size: 0.95rem; letter-spacing: 0.04em; }
.login-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,0.18); color: #fff;
}
.login-card {
    position: relative; flex: 1; width: 100%; margin: -30px auto 0; max-width: 520px;
    padding: 24px 20px 40px; background: var(--cream); border-radius: 26px 26px 0 0;
}
.login-card .banner { top: 8px; }
.login-card h2 { font-size: 1.25rem; margin: 0 0 2px; }
.login-card .muted { margin-bottom: 16px; }
@media (min-width: 640px) {
    .login-page { background: var(--cream); display: block; }
    .login-hero-text { bottom: 82px; }
    .login-hero-inner { padding: 0 20px; }
    .login-card {
        flex: none; margin-top: -56px; border-radius: 22px; background: #fff; border: 1px solid var(--border);
        box-shadow: 0 22px 44px -24px rgba(15,46,37,0.45);
    }
}

/* ---- Carousel ---- */
/* The carousel stays pinned under the top bar while the list below scrolls. */
.carousel {
    position: sticky; top: var(--topbar-h); z-index: 12;
    margin: -12px -16px 14px; height: var(--carousel-h); overflow: hidden;
    background: var(--primary); touch-action: pan-y; box-shadow: 0 8px 18px -10px rgba(15,46,37,0.55);
}
.carousel ~ .banner { top: calc(var(--topbar-h) + var(--carousel-h) + 8px); }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0s linear 0.7s; pointer-events: none; }
.slide.active { opacity: 1; z-index: 1; transition: opacity 0.7s ease; pointer-events: auto; }
.slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slide-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(15,46,37,0.92) 0%, rgba(15,46,37,0.55) 45%, rgba(15,46,37,0) 80%); }
.slide-text { position: absolute; left: 0; right: 0; bottom: 26px; padding: 0 18px; color: #fff; }
.slide-text h2 { color: #fff; font-size: 1.15rem; margin: 0 0 2px; }
.slide-text p { margin: 0; font-size: 0.85rem; opacity: 0.94; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slide-link { display: inline-block; margin-top: 3px; color: #f4a45c; font-weight: 700; font-size: 0.88rem; text-decoration: none; }
.dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 4px; }
.dot { width: 22px; height: 22px; padding: 0; border: none; background: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.dot::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.5); transition: width 0.25s, background 0.25s; }
.dot.active::before { width: 20px; background: #fff; }
@media (min-width: 640px) {
    :root { --carousel-h: 190px; }
    .carousel { margin: -12px 0 16px; border-radius: 0 0 16px 16px; }
}
@media (prefers-reduced-motion: reduce) { .slide, .slide.active { transition: none; } }

/* ---- Questions and comments ---- */
.chat { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 12px; }
.msg { display: flex; flex-direction: column; max-width: 88%; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.theirs { align-self: flex-start; align-items: flex-start; }
.bubble { padding: 9px 13px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.95rem; }
.msg.mine .bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 5px; }
.msg.theirs .bubble { background: #eef2ef; color: var(--text); border-bottom-left-radius: 5px; }
.meta { margin-top: 2px; font-size: 0.72rem; color: var(--muted); }
.card.unread { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.card.unread h3 { color: var(--primary); }
.preview {
    margin: 4px 0 2px; font-size: 0.9rem; color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.comments .banner { position: static; box-shadow: none; }
.comments textarea { min-height: 72px; }
.small { font-size: 0.78rem; }
/* ---- Team plan ---- */
.plan-scroll { overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; }
table.plan { border-collapse: separate; border-spacing: 0; min-width: 760px; width: 100%; font-size: 0.8rem; }
table.plan th, table.plan td { border-bottom: 1px solid var(--border); padding: 4px; vertical-align: top; }
table.plan thead th { position: sticky; top: var(--topbar-h); background: var(--cream); z-index: 3; text-align: center; font-weight: 700; color: var(--primary); }
table.plan th.who { position: sticky; left: 0; z-index: 4; background: var(--cream); text-align: left; min-width: 98px; max-width: 120px; font-size: 0.78rem; border-right: 1px solid var(--border); }
table.plan thead th.who { z-index: 5; }
table.plan th.who a { color: var(--primary); text-decoration: none; }
table.plan td { min-width: 108px; border-right: 1px solid #f1ece4; }
table.plan td.sum, table.plan th.sum { min-width: 46px; text-align: right; font-weight: 700; color: var(--primary); white-space: nowrap; }
table.plan .today { background: #fff6ec; }
table.plan tr.unassigned th.who { color: var(--accent); }
.pill { display: block; margin-bottom: 3px; padding: 4px 6px; border-radius: 8px; text-decoration: none; line-height: 1.25; background: #eef2ef; color: var(--primary); }
.pill b { display: block; font-size: 0.72rem; }
.pill span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill small { display: block; opacity: 0.75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.open { background: #fdebd9; color: #a4510c; }
.pill.taken { background: #e3eefc; color: #1d4f91; }
.pill.assigned { background: #efe6fa; color: #5b349c; }
.pill.inprogress { background: #fff3c4; color: #7a5b00; }
.pill.done { background: #dff3e6; color: var(--ok); }
/* ---- Push banner while the app is open ---- */
.toast {
    position: fixed; z-index: 60; top: calc(var(--topbar-h) + 8px); left: 12px; right: 12px; max-width: 696px; margin: 0 auto;
    display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer;
    padding: 12px 14px 12px 16px; border-radius: 12px; font: inherit;
    background: #fff; color: var(--text); border: 1px solid var(--border); border-left: 7px solid var(--accent);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.9), 0 14px 30px -6px rgba(0,0,0,0.55); animation: toast-in 0.25s ease-out;
}
.toast b { color: var(--primary); font-size: 1rem; }
.toast span { font-size: 0.88rem; color: var(--muted); }
@keyframes toast-in { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
/* ---- Next task, pinned under the top bar on "Meine Aufgaben" ---- */
.next-sticky {
    position: sticky; top: var(--topbar-h); z-index: 12; box-sizing: border-box; height: var(--next-h);
    display: flex; flex-direction: column; justify-content: center; gap: 1px; overflow: hidden;
    margin: 0 -16px 10px; padding: 6px 16px; background: #e4efe9; border-bottom: 2px solid var(--primary);
    box-shadow: 0 8px 14px -10px rgba(15,46,37,0.6); text-decoration: none; color: var(--text);
}
.next-sticky small { color: var(--muted); font-weight: 700; font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-sticky b { color: var(--primary); font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-sticky ~ .banner { top: calc(var(--topbar-h) + var(--next-h) + 8px); }
/* ---- Overview on "Meine Aufgaben" ---- */
.summary .next { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; margin-bottom: 10px; border-radius: 10px; background: #eef2ef; text-decoration: none; color: var(--text); }
.summary .next small { color: var(--muted); font-weight: 700; }
.summary .next b { color: var(--primary); font-size: 1.05rem; }
.summary .next span { color: var(--muted); font-size: 0.9rem; }
.summary .overdue { margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; background: #fdecea; border: 1px solid #f3b9b3; color: var(--danger); font-size: 0.88rem; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stats > a { display: flex; flex-direction: column; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: inherit; }
.stats > div, .stats > a { display: flex; flex-direction: column; }
.stats > div { display: flex; flex-direction: column; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.stats .num { font-size: 1.25rem; font-weight: 800; color: var(--primary); line-height: 1.2; }
.stats .lbl { font-size: 0.78rem; font-weight: 700; color: var(--text); }
.stats small { color: var(--muted); font-size: 0.74rem; }
.stats > a.alert, .stats > a.warn { background: inherit; }
.stats > a.alert { background: #fdecea; border-color: #e0524a; }
.stats > a.alert .num { color: var(--danger); }
.stats > a.warn { background: #fff6e0; border-color: #e8c25a; }
.stats > a.warn .num { color: #8a5a00; }
.stats > div.alert { background: #fdecea; border-color: #e0524a; }
.stats > div.alert .num { color: var(--danger); }
.stats > div.warn { background: #fff6e0; border-color: #e8c25a; }
.stats > div.warn .num { color: #8a5a00; }
.chip.urgent { background: #fdecea; color: var(--danger); border: 1px solid #f0b3ad; }
.urgent-title { margin: 12px 0 6px; color: var(--danger); }
.urgent-item { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; margin-bottom: 6px; border-radius: 10px; background: #fff7f6; border: 1px solid #f3c7c2; text-decoration: none; color: var(--text); }
.urgent-item .chip { align-self: flex-start; }
.urgent-item b { color: var(--primary); }
.urgent-item span:last-child { color: var(--muted); font-size: 0.85rem; }
/* ---- Inbox entries ---- */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 18px 0 8px; }
button.card.note { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

table.simple { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.simple td, table.simple th { padding: 8px 4px; border-bottom: 1px solid var(--border); text-align: left; }
table.simple td.num, table.simple th.num { text-align: right; white-space: nowrap; }

.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.month-nav strong { font-size: 1.05rem; color: var(--primary); }
.big-number { font-size: 2rem; font-weight: 800; color: var(--primary); line-height: 1.1; }

#blazor-error-ui {
    background: #fff3cd; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,0.2); display: none;
    left: 0; padding: 0.6rem 1.25rem 0.7rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.status-bar-safe-area { display: none; }
@supports (-webkit-touch-callout: none) {
    .status-bar-safe-area {
        display: flex; position: sticky; top: 0; height: env(safe-area-inset-top);
        background-color: var(--primary); width: 100%; z-index: 40;
    }
}
