@charset "UTF-8";

/* =========================================================================
   Astronauts gamescom - Terminkalender
   Mobile first. Einspaltige Agenda, ab 720px zentriert mit Rand.
   Ersetzt die frueher eingebundene Bootstrap-Kopie (css/dashboard.css).
   ========================================================================= */

/* --- Schriften ----------------------------------------------------------- */

@font-face {
    font-family: "Nohemi";
    src: url("../fonts/Nohemi/Nohemi-VF.woff2") format("woff2-variations"),
         url("../fonts/Nohemi/Nohemi-VF.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Kinn Black";
    src: url("../fonts/Kinn/Kinn-Black.woff2") format("woff2");
    font-weight: 900;
    font-display: swap;
}

/* --- Tokens -------------------------------------------------------------- */

:root {
    --bg:          #0c0c0c;
    --surface:     #16161b;
    --surface-2:   #1f1f27;
    --line:        #2c2c36;
    --line-soft:   #22222a;

    --text:        #f5f5f7;
    --muted:       #9b9baa;
    --faint:       #6d6d7c;

    --accent:      #52d4ff;  /* Marken-Cyan */
    --accent-ink:  #04222d;
    --live:        #3ddc97;  /* laeuft gerade */
    --done:        #5f5f6d;  /* abgehakt */
    --mine:        #ff6b5e;  /* Admin: von mir betreut */
    --danger:      #ff5a4d;

    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-pill: 999px;

    --gutter: 16px;
    --tap: 44px;               /* Mindestgroesse fuer Touch-Ziele */
    --topbar-h: 56px;

    --safe-top:    env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* --- Grundlagen ---------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

/* Muss die display-Werte der Komponenten unten schlagen. */
[hidden] { display: none !important; }

html {
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Nohemi", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.2; }

:where(button, a, input, select, textarea, summary):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

.wrap {
    width: 100%;
    max-width: 720px;
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* --- Kopfleiste ---------------------------------------------------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(12, 12, 12, .88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line-soft);
    padding-top: var(--safe-top);
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: var(--topbar-h);
}

.brand {
    font-family: "Kinn Black", system-ui, sans-serif;
    font-size: 1.15rem;
    letter-spacing: .06em;
    color: var(--accent);
    white-space: nowrap;
}
.brand:hover { text-decoration: none; }

.user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: var(--tap);
    color: var(--muted);
    font-size: .8125rem;
}

.user__avatar {
    display: grid;
    place-items: center;
    width: 32px; height: 32px;
    flex: 0 0 32px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .02em;
}

/* --- Tagesleiste --------------------------------------------------------- */

.daystrip {
    position: sticky;
    top: calc(var(--topbar-h) + var(--safe-top));
    z-index: 25;
    background: rgba(12, 12, 12, .88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line-soft);
}

.daystrip__scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 10px var(--gutter);
    scrollbar-width: none;
}
.daystrip__scroll::-webkit-scrollbar { display: none; }

.day {
    scroll-snap-align: center;
    flex: 0 0 auto;
    display: grid;
    justify-items: center;
    gap: 1px;
    min-width: 52px;
    min-height: var(--tap);
    padding: 6px 10px;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font: inherit;
    cursor: pointer;
}

.day__wd   { font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em; }
.day__num  { font-size: 1.125rem; font-weight: 700; color: var(--text); line-height: 1.1; }

/* Aufbau-/Abbautage optisch zuruecknehmen */
.day:not(.day--fair) .day__num { color: var(--muted); }

.day--today { border-color: var(--accent); }
.day--today .day__wd { color: var(--accent); }

.day[aria-current="date"] {
    background: var(--accent);
    border-color: var(--accent);
}
.day[aria-current="date"] .day__wd,
.day[aria-current="date"] .day__num { color: var(--accent-ink); }

/* --- Tageskopf ----------------------------------------------------------- */

.dayhead {
    padding: 20px 0 4px;
}

.dayhead__date {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.dayhead__meta {
    margin-top: 2px;
    color: var(--muted);
    font-size: .875rem;
}

.countdown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    background: var(--accent-ink);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    color: var(--accent);
    font-size: .8125rem;
    font-weight: 600;
}

/* --- Agenda -------------------------------------------------------------- */

.agenda {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 0 calc(32px + var(--safe-bottom));
}

.appt {
    display: grid;
    grid-template-columns: 4.25rem 1fr;
    gap: 0 12px;
    position: relative;
    padding: 14px;
    border-radius: var(--r-md);
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-left: 3px solid var(--line);
}

/* Zeitschiene */
.appt__rail {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 2px;
}

.appt__start {
    font-size: 1.0625rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.01em;
}

.appt__end {
    color: var(--faint);
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
}

.appt__flag {
    margin-top: 6px;
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.appt__body { min-width: 0; }

.appt__title {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.appt__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.appt__section { margin-top: 12px; }

.appt__label {
    display: block;
    margin-bottom: 4px;
    color: var(--faint);
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .09em;
}

.appt__details {
    color: var(--muted);
    font-size: .9375rem;
    overflow-wrap: anywhere;
}
.appt__details a { overflow-wrap: anywhere; }

/* Zustaende */
.appt--live {
    border-left-color: var(--live);
    background: linear-gradient(
        100deg,
        color-mix(in srgb, var(--live) 9%, var(--surface)),
        var(--surface) 55%
    );
}
.appt--live .appt__flag { color: var(--live); }

.appt--done { opacity: .55; }
.appt--done .appt__title { text-decoration: line-through; text-decoration-color: var(--done); }
.appt--done .appt__flag { color: var(--done); }

.appt--mine { border-left-color: var(--mine); }
.appt--mine .appt__flag { color: var(--mine); }

/* --- Chips --------------------------------------------------------------- */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: .8125rem;
    line-height: 1.2;
    max-width: 100%;
}
.chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

a.chip { color: var(--text); }
a.chip:hover { border-color: var(--accent); text-decoration: none; }

.chip--talent { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.chip--count  { font-variant-numeric: tabular-nums; }
.chip--count[data-complete="1"] { color: var(--live); border-color: color-mix(in srgb, var(--live) 45%, transparent); }

/* --- Checkliste ---------------------------------------------------------- */

.checklist {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.check {
    display: grid;
    grid-template-columns: 26px 1fr;
    align-items: start;
    gap: 10px;
    min-height: var(--tap);
    padding: 7px 8px 7px 0;
    border-radius: var(--r-sm);
    cursor: pointer;
}
.check:active { background: var(--surface-2); }

.check input {
    appearance: none;
    -webkit-appearance: none;
    width: 26px; height: 26px;
    margin: 0;
    flex: 0 0 26px;
    border: 2px solid var(--line);
    border-radius: 7px;
    background: var(--bg);
    cursor: pointer;
    display: grid;
    place-content: center;
    transition: background-color .12s ease, border-color .12s ease;
}

.check input::after {
    content: "";
    width: 12px; height: 7px;
    border-left: 2.5px solid var(--accent-ink);
    border-bottom: 2.5px solid var(--accent-ink);
    transform: rotate(-45deg) translate(1px, -1px) scale(0);
    transition: transform .12s ease;
}

.check input:checked {
    background: var(--live);
    border-color: var(--live);
}
.check input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }

.check__text {
    font-size: .9375rem;
    padding-top: 3px;
    overflow-wrap: anywhere;
}

.check input:checked ~ .check__text {
    color: var(--done);
    text-decoration: line-through;
}

/* --- Kopierbarer Textblock ([tags=...] im Deliverable) -------------------- */

.tagblock {
    /* Gestapelt, damit der Kopiertext die volle Breite hat. Nebeneinander
       wird die Textspalte auf dem Handy so schmal, dass Hashtags und
       Mentions mitten im Wort umbrechen. */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 0 4px;
    padding: 9px 11px;
    border-radius: var(--r-sm);
    background: var(--bg);
    border: 1px solid var(--line);
    border-left: 2px solid var(--accent);
}

.tagblock__text {
    align-self: stretch;
    min-width: 0;
    font-size: .875rem;
    line-height: 1.4;
    color: var(--text);
    overflow-wrap: break-word;
}

@media (min-width: 480px) {
    .tagblock { flex-direction: row; align-items: center; }
    .tagblock__text { flex: 1 1 auto; align-self: auto; }
}

.tagblock .btn { flex: 0 0 auto; }

/* Abgehaktes Deliverable: Kopiertext mit zuruecknehmen, aber lesbar lassen. */
.check input:checked ~ .check__text .tagblock { opacity: .6; }
.check input:checked ~ .check__text .tagblock__text { text-decoration: line-through; }

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: var(--tap);
    padding: 10px 16px;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    font-size: .9375rem;
    cursor: pointer;
    text-align: center;
}
.btn:hover { border-color: var(--faint); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.btn--ghost { background: transparent; }

.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }

.btn--sm { min-height: 34px; padding: 5px 10px; font-size: .8125rem; border-radius: var(--r-sm); }

.btn--block { width: 100%; }

/* --- Leerer Tag ---------------------------------------------------------- */

.empty {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 48px 16px;
    border-radius: var(--r-md);
    border: 1px dashed var(--line);
    text-align: center;
}
.empty__icon  { font-size: 2rem; }
.empty__title { font-weight: 700; }
.empty__hint  { color: var(--muted); font-size: .875rem; }

/* --- Hinweisbox (Benachrichtigungen) ------------------------------------- */

.notice {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: var(--r-md);
    background: var(--surface);
    border: 1px solid var(--line);
}
.notice__body  { flex: 1 1 auto; min-width: 0; }
.notice__title { font-weight: 700; font-size: .875rem; }
.notice__text  { color: var(--muted); font-size: .8125rem; margin: 2px 0 0; }
.notice .btn   { flex: 0 0 auto; }

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

.panel {
    margin-top: 16px;
    border-radius: var(--r-md);
    background: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
}

.panel > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: var(--tap);
    padding: 10px 14px;
    font-weight: 600;
    font-size: .9375rem;
    cursor: pointer;
    list-style: none;
}
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary::before {
    content: "+";
    display: grid;
    place-items: center;
    width: 22px; height: 22px;
    border-radius: var(--r-sm);
    background: var(--surface-2);
    color: var(--accent);
    font-weight: 700;
}
.panel[open] > summary::before { content: "\2212"; }

.panel__body {
    display: grid;
    gap: 12px;
    padding: 4px 14px 16px;
    border-top: 1px solid var(--line-soft);
}

.field { display: grid; gap: 5px; }

.field > label {
    color: var(--muted);
    font-size: .8125rem;
    font-weight: 600;
}

.input {
    width: 100%;
    min-height: var(--tap);
    padding: 10px 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 1rem; /* verhindert Auto-Zoom auf iOS */
}
.input:focus { border-color: var(--accent); }

textarea.input { min-height: 84px; resize: vertical; line-height: 1.4; }
select.input   { appearance: none; background-image: none; }
select[multiple].input { min-height: 108px; padding: 6px; }

.field__hint { color: var(--faint); font-size: .75rem; }

.row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.row-actions > * { flex: 1 1 auto; }

/* Das "Betreut von"-Feld soll die Aktionszeile nicht sprengen. */
.row-actions > select.input { flex: 0 1 190px; width: auto; }

/* --- Dialog -------------------------------------------------------------- */

.dlg {
    width: min(560px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    color: var(--text);
}
.dlg::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(3px); }

.dlg__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-soft);
}
.dlg__title { font-size: 1.0625rem; font-weight: 700; }

.dlg__close {
    display: grid;
    place-items: center;
    width: 34px; height: 34px;
    border: 0;
    border-radius: var(--r-sm);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.dlg__body { padding: 16px; color: var(--muted); font-size: .9375rem; }
.dlg__body p { margin: 0 0 .6em; }

/* --- Toast --------------------------------------------------------------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(20px + var(--safe-bottom));
    transform: translate(-50%, 12px);
    z-index: 60;
    max-width: calc(100vw - 32px);
    padding: 11px 18px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: .875rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.toast[data-show="1"] { opacity: 1; transform: translate(-50%, 0); }

/* --- Ab Tablet ----------------------------------------------------------- */

@media (min-width: 640px) {
    .appt { grid-template-columns: 5rem 1fr; padding: 18px; }
    .dayhead__date { font-size: 1.75rem; }
    .row-actions > * { flex: 0 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
