/* Timora-Design-Tokens — einzige Quelle für Farbwerte in der Web-App.
   Palette aus dem Logo abgeleitet, Dokumentation: docs/branding.md */
:root {
    --stempla-violett: #7616E1;
    --stempla-violett-dunkel: #5E00A6;
    --stempla-purpur: #A501A7;
    --stempla-magenta: #C3008E;
    --stempla-rot: #FF503A;
    --stempla-orange: #FFA84C;

    --stempla-tinte: #2B1042;
    --stempla-flaeche: #FAF8FD;

    --stempla-verlauf: linear-gradient(90deg,
        var(--stempla-violett) 0%,
        var(--stempla-magenta) 45%,
        var(--stempla-rot) 75%,
        var(--stempla-orange) 100%);

    /* Abgeleitete Flächen/Linien (aus der Palette entwickelt, keine neuen Hex-Quellen
       außerhalb dieser Datei). */
    --stempla-linie: #E5DCF2;
    --stempla-flaeche-hell: #FFFFFF;
    --stempla-flaeche-aktiv: #F1E8FC;
    --stempla-text-gedimmt: #6C5A85;
    --stempla-erfolg: #1E7B4D;
    --stempla-erfolg-flaeche: #E7F6EE;
    --stempla-fehler: #B3261E;
    --stempla-fehler-flaeche: #FCEEED;
    --stempla-warnung-flaeche: #FFF4E5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--stempla-tinte);
    background: var(--stempla-flaeche);
}

a {
    color: var(--stempla-violett);
}

code {
    background: var(--stempla-flaeche-aktiv);
    border-radius: 4px;
    padding: 0.1em 0.35em;
    font-size: 0.9em;
}

/* --- App-Shell (Seitenleiste + Kopfzeile) ---------------------------------- */

.app {
    display: grid;
    grid-template-columns: 15rem 1fr;
    min-height: 100dvh;
}

.seitenleiste {
    background: var(--stempla-flaeche-hell);
    border-right: 1px solid var(--stempla-linie);
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wortmarke {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.wortmarke img {
    width: 2.2rem;
    height: 2.2rem;
}

.wortmarke span,
.verlaufstext {
    background: var(--stempla-verlauf);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-gruppe {
    margin: 0.9rem 0 0.25rem;
    padding: 0 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--stempla-text-gedimmt);
}

.nav-link {
    display: block;
    padding: 0.42rem 0.5rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--stempla-tinte);
}

.nav-link:hover {
    background: var(--stempla-flaeche-aktiv);
}

.nav-link.aktiv {
    background: var(--stempla-flaeche-aktiv);
    color: var(--stempla-violett-dunkel);
    font-weight: 600;
}

.hauptbereich {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.kopfzeile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1.5rem;
    background: var(--stempla-flaeche-hell);
}

.kopfzeile-titel {
    font-size: 1.15rem;
    font-weight: 650;
}

.kopfzeile-benutzer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--stempla-text-gedimmt);
}

.akzentlinie {
    height: 3px;
    background: var(--stempla-verlauf);
}

.inhalt {
    padding: 1.5rem;
    max-width: 72rem;
}

/* --- Bühne (öffentliche Start-/Loginseite) --------------------------------- */

.buehne {
    min-height: 80dvh;
    display: grid;
    place-content: center;
    justify-items: center;
    text-align: center;
    gap: 1rem;
    padding: 2rem;
}

.buehne img {
    width: 9rem;
    max-width: 40vw;
}

.buehne h1 {
    margin: 0;
    font-size: 3rem;
    letter-spacing: 0.02em;
}

.buehne p {
    margin: 0;
    font-size: 1.125rem;
}

.akzent {
    width: 9rem;
    height: 4px;
    border-radius: 2px;
    background: var(--stempla-verlauf);
}

/* --- Bausteine -------------------------------------------------------------- */

.karte {
    background: var(--stempla-flaeche-hell);
    border: 1px solid var(--stempla-linie);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.karte h1,
.karte h2 {
    margin-top: 0;
}

.kachel-raster {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 1rem;
}

.kachel {
    display: block;
    background: var(--stempla-flaeche-hell);
    border: 1px solid var(--stempla-linie);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: var(--stempla-tinte);
}

.kachel:hover {
    border-color: var(--stempla-violett);
}

.kachel h2 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    color: var(--stempla-violett-dunkel);
}

.kachel p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--stempla-text-gedimmt);
}

.meldung {
    border-radius: 8px;
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
}

.meldung-erfolg {
    background: var(--stempla-erfolg-flaeche);
    color: var(--stempla-erfolg);
}

.meldung-fehler {
    background: var(--stempla-fehler-flaeche);
    color: var(--stempla-fehler);
}

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

.formular {
    display: grid;
    gap: 0.9rem;
    max-width: 40rem;
}

.formular-zeile {
    display: grid;
    gap: 0.25rem;
}

.formular-zeile > label {
    font-size: 0.85rem;
    font-weight: 600;
}

.formular-spalten {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.9rem;
}

.formular-hinweis {
    font-size: 0.8rem;
    color: var(--stempla-text-gedimmt);
}

input[type="text"],
input[type="date"],
input[type="datetime-local"],
input[type="number"],
input[type="file"],
select,
textarea {
    font: inherit;
    color: inherit;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--stempla-linie);
    border-radius: 6px;
    background: var(--stempla-flaeche-hell);
    width: 100%;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--stempla-violett);
    outline-offset: 1px;
}

.knopf {
    display: inline-block;
    font: inherit;
    font-weight: 600;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--stempla-linie);
    background: var(--stempla-flaeche-hell);
    color: var(--stempla-tinte);
    cursor: pointer;
    text-decoration: none;
}

.knopf:hover {
    border-color: var(--stempla-violett);
}

.knopf-primaer {
    background: var(--stempla-violett);
    border-color: var(--stempla-violett);
    color: #fff;
}

.knopf-primaer:hover {
    background: var(--stempla-violett-dunkel);
    border-color: var(--stempla-violett-dunkel);
}

.knopf-gefahr {
    color: var(--stempla-fehler);
}

.knopf-still {
    border-color: transparent;
    background: transparent;
    font-weight: 500;
}

.knopf-still:hover {
    border-color: var(--stempla-linie);
}

/* --- Tabellen ----------------------------------------------------------------- */

.tabelle {
    width: 100%;
    border-collapse: collapse;
    background: var(--stempla-flaeche-hell);
    border: 1px solid var(--stempla-linie);
    border-radius: 10px;
    overflow: hidden;
}

.tabelle th,
.tabelle td {
    text-align: left;
    padding: 0.55rem 0.8rem;
    border-bottom: 1px solid var(--stempla-linie);
    vertical-align: top;
}

.tabelle thead th {
    background: var(--stempla-flaeche-aktiv);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--stempla-violett-dunkel);
}

.tabelle tbody tr:last-child td {
    border-bottom: none;
}

.tabelle .zeilenaktionen {
    text-align: right;
    white-space: nowrap;
}

/* --- Status-Plaketten ---------------------------------------------------------- */

.plakette {
    display: inline-block;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.plakette-anwesend {
    background: var(--stempla-erfolg-flaeche);
    color: var(--stempla-erfolg);
}

.plakette-abwesend {
    background: var(--stempla-flaeche-aktiv);
    color: var(--stempla-text-gedimmt);
}

.plakette-warnung {
    background: var(--stempla-warnung-flaeche);
    color: var(--stempla-rot);
}

.plakette-info {
    background: var(--stempla-flaeche-aktiv);
    color: var(--stempla-violett-dunkel);
}

/* --- Kleinkram ------------------------------------------------------------------ */

.werkzeugleiste {
    display: flex;
    align-items: end;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.werkzeugleiste .formular-zeile {
    min-width: 11rem;
}

.gedimmt {
    color: var(--stempla-text-gedimmt);
}

.mitarbeiter-foto {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--stempla-linie);
}

.assistent-schritte {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.assistent-schritt {
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--stempla-linie);
    font-size: 0.85rem;
    background: var(--stempla-flaeche-hell);
}

.assistent-schritt.erledigt {
    background: var(--stempla-erfolg-flaeche);
    color: var(--stempla-erfolg);
    border-color: transparent;
}

.assistent-schritt.aktiv {
    background: var(--stempla-flaeche-aktiv);
    color: var(--stempla-violett-dunkel);
    border-color: var(--stempla-violett);
    font-weight: 600;
}

@media (max-width: 56rem) {
    .app {
        grid-template-columns: 1fr;
    }

    .seitenleiste {
        border-right: none;
        border-bottom: 1px solid var(--stempla-linie);
    }
}
