/* ------------------------------------------------------------------------
   Zeiterfassung - Gestaltung
   Zurueckhaltend und sachlich: die Anwendung soll nach Kanzlei aussehen,
   nicht nach Startup. Wenige Farben, klare Kanten, Zahlen in gleicher
   Laufweite, damit Spalten untereinander stehen.
   Aufbau: zuerst fuer das Telefon, ab 760px kommt die Seitenspalte dazu.
   ------------------------------------------------------------------------ */

:root {
    color-scheme: light;             /* fest: sonst faerbt der Dunkelmodus
                                       die Eingabefelder unlesbar ein */

    --marine:        #1b3a5c;
    --marine-tief:   #142d49;
    --marine-hell:   #2d5680;
    --tinte:         #15202b;
    --gedeckt:       #5b6b7c;
    --leise:         #8798a8;
    --grund:         #f4f6f8;
    --flaeche:       #ffffff;
    --flaeche-matt:  #fafbfc;
    --kante:         #e2e7ec;
    --kante-stark:   #cfd7df;

    --gruen:         #1f7a4d;
    --gruen-matt:    #eaf5ef;
    --bernstein:     #8a6000;
    --bernstein-matt:#fdf5e3;
    --rot:           #a32e2e;
    --rot-matt:      #fbeceb;

    --r:    8px;
    --r-kl: 6px;
    --schatten:    0 1px 2px rgba(21, 32, 43, .06);
    --schatten-md: 0 4px 14px rgba(21, 32, 43, .10);

    --kopf-hoehe: 56px;
    --leiste-hoehe: 60px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--grund);
    color: var(--tinte);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; color: var(--tinte); }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .9rem; }
p  { margin: 0 0 .75rem; }
a  { color: var(--marine-hell); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Zahlen immer gleich breit - sonst zappeln Summenspalten */
.zahl, td.zahl, th.zahl, .kennwert-wert, .summe {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* ----------------------------------------------------------------- Kopf */

.kopf {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--kopf-hoehe);
    background: var(--marine);
    color: #fff;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 1rem;
    box-shadow: var(--schatten-md);
}
.kopf .marke {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -.01em;
    color: #fff;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.kopf .marke:hover { text-decoration: none; }
.kopf .marke small {
    display: block;
    font-size: .68rem;
    font-weight: 400;
    letter-spacing: .02em;
    color: rgba(255,255,255,.62);
    text-transform: uppercase;
}
.kopf .schub { margin-left: auto; }
.kopf-person {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: rgba(255,255,255,.88);
    font-size: .85rem;
}
.kopf-person .kreis {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,.16);
    display: grid; place-items: center;
    font-weight: 600; font-size: .78rem;
    color: #fff;
}
.kopf a.still { color: rgba(255,255,255,.72); font-size: .85rem; }
.kopf a.still:hover { color: #fff; text-decoration: none; }

/* Laufende Uhr im Kopf */
.kopf-uhr {
    display: flex; align-items: center; gap: .45rem;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.18);
    padding: .3rem .6rem;
    border-radius: 99px;
    font-size: .82rem;
    font-variant-numeric: tabular-nums;
    color: #fff;
}
.kopf-uhr .punkt {
    width: 7px; height: 7px; border-radius: 50%;
    background: #7fd4a3;
    animation: pulsieren 2s ease-in-out infinite;
}
@keyframes pulsieren { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ------------------------------------------------------------- Grundraster */

.rahmen {
    display: block;
    max-width: 1180px;
    margin: 0 auto;
    padding: 1rem 1rem calc(var(--leiste-hoehe) + 1.5rem);
}

.navi { display: none; }           /* am Telefon unten, siehe Fussleiste */

/* --------------------------------------------------------------- Flaechen */

.karte {
    background: var(--flaeche);
    border: 1px solid var(--kante);
    border-radius: var(--r);
    box-shadow: var(--schatten);
    margin-bottom: 1rem;
    overflow: hidden;
}
.karte-kopf {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--kante);
    display: flex; align-items: center; gap: .6rem;
    background: var(--flaeche-matt);
}
.karte-kopf h2 { font-size: .95rem; }
.karte-kopf .schub { margin-left: auto; }
.karte-leib { padding: 1rem; }
.karte-leib.eng { padding: 0; }

.hinweis-leer {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--gedeckt);
}
.hinweis-leer svg { color: var(--kante-stark); margin-bottom: .5rem; }

/* --------------------------------------------------------------- Kennwerte */

.kennwerte {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .6rem;
    margin-bottom: 1rem;
}
.kennwert {
    background: var(--flaeche);
    border: 1px solid var(--kante);
    border-radius: var(--r);
    padding: .8rem .9rem;
    box-shadow: var(--schatten);
}
.kennwert-titel {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--leise);
    font-weight: 600;
    margin-bottom: .25rem;
}
.kennwert-wert {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--marine);
}
.kennwert-zusatz { font-size: .78rem; color: var(--gedeckt); margin-top: .15rem; }
.kennwert.betont { background: var(--marine); border-color: var(--marine); }
.kennwert.betont .kennwert-titel { color: rgba(255,255,255,.7); }
.kennwert.betont .kennwert-wert  { color: #fff; }
.kennwert.betont .kennwert-zusatz{ color: rgba(255,255,255,.75); }

/* ----------------------------------------------------------- Formularteile */

label, .feld-titel {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--gedeckt);
    margin-bottom: .3rem;
}
input[type=text], input[type=password], input[type=date], input[type=number],
input[type=month], select, textarea {
    width: 100%;
    font: inherit;
    font-size: 16px;            /* unter 16px zoomt iOS beim Antippen */
    color: var(--tinte);
    background: #fff;
    border: 1px solid var(--kante-stark);
    border-radius: var(--r-kl);
    padding: .6rem .7rem;
    min-height: 44px;           /* bequem mit dem Daumen */
    appearance: none;
    transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 72px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--marine-hell);
    box-shadow: 0 0 0 3px rgba(45,86,128,.14);
}
input::placeholder, textarea::placeholder { color: var(--leise); }
select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235b6b7c' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .7rem center;
    padding-right: 2rem;
}

.feld { margin-bottom: .85rem; }
.feld-reihe { display: grid; gap: .85rem; }
.feld-hilfe { font-size: .76rem; color: var(--leise); margin-top: .25rem; }
.feld-hilfe.aktiv { color: var(--gruen); font-weight: 600; }
.feld-hilfe.fehler { color: var(--rot); font-weight: 600; }

/* Schalter fuer "abrechenbar" */
.schalter {
    display: flex; align-items: center; gap: .55rem;
    font-size: .88rem; font-weight: 500; color: var(--tinte);
    margin: 0; cursor: pointer; padding: .3rem 0;
}
.schalter input { width: auto; min-height: 0; margin: 0; }
.schalter input[type=checkbox] {
    width: 18px; height: 18px; accent-color: var(--marine);
}

/* Schnellwahl-Knoepfe fuer die Dauer */
.schnellwahl { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .45rem; }
.schnellwahl button {
    font: inherit; font-size: .82rem; font-weight: 600;
    color: var(--marine);
    background: #eef2f6;
    border: 1px solid var(--kante);
    border-radius: 99px;
    padding: .38rem .72rem;
    min-height: 34px;
    cursor: pointer;
    transition: background .12s, border-color .12s;
}
.schnellwahl button:hover { background: #e3eaf1; border-color: var(--kante-stark); }
.schnellwahl button:active { transform: translateY(1px); }

/* --------------------------------------------------------------- Knoepfe */

.knopf {
    display: inline-flex; align-items: center; justify-content: center;
    gap: .45rem;
    font: inherit; font-size: .9rem; font-weight: 600;
    min-height: 44px;
    padding: .6rem 1.1rem;
    border-radius: var(--r-kl);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background .12s, border-color .12s, color .12s;
}
.knopf:hover { text-decoration: none; }
.knopf-haupt  { background: var(--marine); color: #fff; }
.knopf-haupt:hover { background: var(--marine-tief); }
.knopf-rand   { background: #fff; color: var(--marine); border-color: var(--kante-stark); }
.knopf-rand:hover { background: var(--flaeche-matt); border-color: var(--marine-hell); }
.knopf-still  { background: transparent; color: var(--gedeckt); }
.knopf-still:hover { background: #eef1f4; color: var(--tinte); }
.knopf-gefahr { background: #fff; color: var(--rot); border-color: #e8c9c7; }
.knopf-gefahr:hover { background: var(--rot-matt); }
.knopf-gruen  { background: var(--gruen); color: #fff; }
.knopf-gruen:hover { background: #1a6841; }
.knopf-breit  { width: 100%; }
.knopf-klein  { min-height: 34px; padding: .35rem .7rem; font-size: .82rem; }
.knopf[disabled] { opacity: .5; cursor: not-allowed; }

.knopf-reihe { display: flex; flex-wrap: wrap; gap: .5rem; }

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

.meldung {
    display: flex; gap: .6rem; align-items: flex-start;
    padding: .75rem .9rem;
    border-radius: var(--r-kl);
    border: 1px solid;
    margin-bottom: 1rem;
    font-size: .88rem;
}
.meldung svg { flex: none; margin-top: .1rem; }
.meldung-erfolg  { background: var(--gruen-matt);    border-color: #bfe0cd; color: #14543a; }
.meldung-warnung { background: var(--bernstein-matt);border-color: #ecd9a8; color: #6b4b00; }
.meldung-info    { background: #eef3f8;              border-color: #cfdcea; color: #1d3c5c; }
.meldung-fehler  { background: var(--rot-matt);      border-color: #e8c9c7; color: #7e2222; }

/* --------------------------------------------------------------- Listen */

.liste { list-style: none; margin: 0; padding: 0; }
.listenzeile {
    display: flex; align-items: center; gap: .75rem;
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--kante);
}
.listenzeile:last-child { border-bottom: 0; }
.listenzeile:hover { background: var(--flaeche-matt); }

.balken-farbe {
    flex: none;
    width: 4px; align-self: stretch;
    border-radius: 2px;
    background: var(--marine);
    min-height: 34px;
}
.zeile-haupt { flex: 1 1 auto; min-width: 0; }
.zeile-titel {
    font-weight: 500; font-size: .92rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.zeile-unter {
    font-size: .78rem; color: var(--gedeckt);
    display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
    margin-top: .1rem;
}
.zeile-rechts { flex: none; text-align: right; }
.zeile-dauer {
    font-weight: 600; font-size: .95rem;
    font-variant-numeric: tabular-nums;
    color: var(--tinte);
}

/* Merker */
.merker {
    display: inline-flex; align-items: center; gap: .25rem;
    font-size: .7rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em;
    padding: .12rem .42rem;
    border-radius: 4px;
    border: 1px solid;
}
.merker-grau   { background: #eef1f4; border-color: var(--kante); color: var(--gedeckt); }
.merker-gruen  { background: var(--gruen-matt); border-color: #bfe0cd; color: #14543a; }
.merker-rot    { background: var(--rot-matt); border-color: #e8c9c7; color: #7e2222; }
.merker-marine { background: #eaf0f6; border-color: #cfdcea; color: var(--marine); }

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

.tabellen-huelle { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.daten {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}
table.daten th {
    text-align: left;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--leise);
    font-weight: 600;
    padding: .6rem 1rem;
    border-bottom: 1px solid var(--kante);
    background: var(--flaeche-matt);
    white-space: nowrap;
}
table.daten td {
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--kante);
    vertical-align: middle;
}
table.daten tr:last-child td { border-bottom: 0; }
table.daten tbody tr:hover { background: var(--flaeche-matt); }
table.daten th.zahl, table.daten td.zahl { text-align: right; }
table.daten tfoot td {
    font-weight: 700;
    background: var(--flaeche-matt);
    border-top: 2px solid var(--kante-stark);
    border-bottom: 0;
}

/* Leistungsnachweis: die Beschreibung bekommt den Platz, die uebrigen
   Spalten nur so viel wie noetig. Sonst wird der Fliesstext zu einer
   schmalen Saeule und bricht nach wenigen Woertern um. */
table.nachweis-tabelle { table-layout: fixed; width: 100%; }
table.nachweis-tabelle col.sp-datum   { width: 108px; }
table.nachweis-tabelle col.sp-projekt { width: 150px; }
table.nachweis-tabelle col.sp-person  { width: 96px; }
table.nachweis-tabelle col.sp-zeit    { width: 66px; }
table.nachweis-tabelle td { vertical-align: top; }
table.nachweis-tabelle td.leistung { line-height: 1.5; }
table.nachweis-tabelle td.leistung br + br { line-height: .6; }

@media (max-width: 860px) {
    table.nachweis-tabelle { table-layout: auto; min-width: 640px; }
    table.nachweis-tabelle td.leistung { min-width: 300px; }
}

/* Anteilsbalken in der Auswertung */
.anteil {
    height: 6px; border-radius: 3px;
    background: #eef1f4;
    overflow: hidden;
    min-width: 60px;
}
.anteil span { display: block; height: 100%; border-radius: 3px; background: var(--marine); }

/* --------------------------------------------------------------- Nachweise */

.nachweis-kasten {
    background: #fff;
    border: 1px solid var(--kante);
    border-radius: var(--r-kl);
    padding: .75rem .85rem;
    margin: .85rem 0;
}
.nachweis-reihe { display: flex; flex-wrap: wrap; gap: .5rem; }

.nachweis {
    position: relative;
    display: flex;
    border: 1px solid var(--kante);
    border-radius: var(--r-kl);
    background: var(--flaeche-matt);
    overflow: hidden;
    max-width: 100%;
}
.nachweis-oeffnen {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .4rem .55rem;
    color: var(--tinte);
    text-decoration: none;
    min-width: 0;
}
.nachweis-oeffnen:hover { background: #eef2f6; text-decoration: none; }
.nachweis img {
    width: 38px; height: 38px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--kante-stark);
    flex: none;
    background: #fff;
}
.nachweis-sinnbild {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: 4px;
    background: #eaf0f6;
    color: var(--marine);
    flex: none;
}
.nachweis-name {
    font-size: .82rem; font-weight: 500;
    max-width: 190px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nachweis-groesse {
    font-size: .72rem; color: var(--leise);
    font-variant-numeric: tabular-nums;
    flex: none;
}
.nachweis-weg {
    border: 0; border-left: 1px solid var(--kante);
    background: transparent;
    color: var(--leise);
    font-size: 1.1rem; line-height: 1;
    padding: 0 .55rem;
    cursor: pointer;
}
.nachweis-weg:hover { background: var(--rot-matt); color: var(--rot); }

/* Dateiauswahl sichtbar wie die uebrigen Felder */
input[type=file] {
    width: 100%;
    font: inherit; font-size: .88rem;
    color: var(--gedeckt);
    background: #fff;
    border: 1px dashed var(--kante-stark);
    border-radius: var(--r-kl);
    padding: .5rem .6rem;
    min-height: 44px;
    cursor: pointer;
}
input[type=file]:hover { border-color: var(--marine-hell); background: var(--flaeche-matt); }
input[type=file]::file-selector-button {
    font: inherit; font-size: .82rem; font-weight: 600;
    color: var(--marine);
    background: #eef2f6;
    border: 1px solid var(--kante);
    border-radius: 99px;
    padding: .3rem .7rem;
    margin-right: .6rem;
    cursor: pointer;
}

/* Nachweisliste im Leistungsnachweis */
.nachweis-zeile {
    display: flex; flex-wrap: wrap; gap: .3rem .5rem;
    margin-top: .3rem;
}
.nachweis-marke {
    display: inline-flex; align-items: center; gap: .25rem;
    font-size: .72rem;
    color: var(--marine);
    background: #eaf0f6;
    border: 1px solid #cfdcea;
    border-radius: 4px;
    padding: .1rem .35rem;
    text-decoration: none;
    max-width: 230px;
}
.nachweis-marke:hover { background: #dfe8f1; text-decoration: none; }
.nachweis-marke span {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* --------------------------------------------------------------- Fussleiste */

.fussleiste {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 50;
    height: var(--leiste-hoehe);
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--kante);
    display: flex;
}
.fussleiste a {
    flex: 1 1 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: .15rem;
    font-size: .68rem; font-weight: 600;
    color: var(--gedeckt);
    text-decoration: none;
    padding-top: .15rem;
}
.fussleiste a:hover { text-decoration: none; color: var(--marine); }
.fussleiste a.hier { color: var(--marine); }
.fussleiste a.hier svg { stroke: var(--marine); }
.fussleiste svg { stroke: var(--gedeckt); }

/* --------------------------------------------------------------- Anmeldung */

.anmelde-seite {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: linear-gradient(170deg, #1b3a5c 0%, #142d49 100%);
}
.anmelde-kasten {
    width: 100%; max-width: 380px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(8,20,35,.3);
    padding: 1.75rem 1.5rem 1.5rem;
}
.anmelde-marke { text-align: center; margin-bottom: 1.4rem; }
.anmelde-marke .zeichen {
    width: 46px; height: 46px;
    margin: 0 auto .6rem;
    border-radius: 10px;
    background: var(--marine);
    display: grid; place-items: center;
}
.anmelde-marke h1 { font-size: 1.2rem; }
.anmelde-marke p { color: var(--gedeckt); font-size: .84rem; margin: .15rem 0 0; }
.anmelde-fuss {
    text-align: center;
    font-size: .74rem;
    color: rgba(255,255,255,.55);
    margin-top: 1.1rem;
}

/* --------------------------------------------------------------- Kleinzeug */

.gedeckt { color: var(--gedeckt); }
.leise   { color: var(--leise); }
.klein   { font-size: .8rem; }
.fett    { font-weight: 600; }
.mittig  { text-align: center; }
.rechts  { text-align: right; }
.nowrap  { white-space: nowrap; }
.mb0 { margin-bottom: 0; } .mb1 { margin-bottom: .75rem; } .mb2 { margin-bottom: 1.25rem; }
.mt1 { margin-top: .75rem; }  .mt2 { margin-top: 1.25rem; }
.trenner { height: 1px; background: var(--kante); border: 0; margin: 1rem 0; }
.aufklapp summary {
    cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--marine);
    padding: .4rem 0; list-style: none;
}
.aufklapp summary::-webkit-details-marker { display: none; }
.aufklapp summary::before { content: "▸ "; }
.aufklapp[open] summary::before { content: "▾ "; }

/* Filterzeile */
.filter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
    align-items: end;
}
.filter .weit { grid-column: 1 / -1; }

/* Druckausgabe: nur der Inhalt, ohne Navigation */
@media print {
    .kopf, .fussleiste, .navi, .nicht-drucken { display: none !important; }
    body { background: #fff; font-size: 11pt; }
    .rahmen { max-width: none; padding: 0; }
    .karte { box-shadow: none; border-color: #bbb; break-inside: avoid; }
    .karte-kopf { background: #fff; }
    a { color: #000; }
}

/* ------------------------------------------------------- ab Tablet/Desktop */

@media (min-width: 760px) {
    body { font-size: 14.5px; }

    .rahmen {
        display: grid;
        grid-template-columns: 208px minmax(0, 1fr);
        gap: 1.5rem;
        padding: 1.5rem 1.5rem 2.5rem;
    }

    .navi {
        display: block;
        position: sticky;
        top: calc(var(--kopf-hoehe) + 1.5rem);
        align-self: start;
    }
    .navi a {
        display: flex; align-items: center; gap: .6rem;
        padding: .55rem .7rem;
        margin-bottom: .15rem;
        border-radius: var(--r-kl);
        color: var(--gedeckt);
        font-size: .9rem; font-weight: 500;
        text-decoration: none;
    }
    .navi a:hover { background: #e9edf1; color: var(--tinte); text-decoration: none; }
    .navi a.hier { background: var(--marine); color: #fff; }
    .navi a.hier svg { stroke: #fff; }
    .navi svg { stroke: var(--gedeckt); flex: none; }
    .navi a:hover svg { stroke: var(--tinte); }
    .navi-gruppe {
        font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
        color: var(--leise); font-weight: 700;
        padding: .9rem .7rem .3rem;
    }

    .fussleiste { display: none; }
    .rahmen { padding-bottom: 2.5rem; }

    .kennwerte { grid-template-columns: repeat(4, 1fr); gap: .85rem; }
    .feld-reihe.zwei  { grid-template-columns: 1fr 1fr; }
    .feld-reihe.drei  { grid-template-columns: 1fr 1fr 1fr; }
    .filter { grid-template-columns: repeat(4, 1fr); }
    .filter .weit { grid-column: auto; }
    .karte-leib { padding: 1.1rem; }

    h1 { font-size: 1.5rem; }
}

@media (min-width: 1000px) {
    .spalten-zwei {
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
        gap: 1rem;
        align-items: start;
    }
}

/* ------------------------------------------------------------------------
   Einsicht für die Kanzlei: Vorgänge mit Belegen
   ------------------------------------------------------------------------ */

.vorgang {
    padding: .9rem 1rem 1rem;
    border-bottom: 1px solid var(--kante);
}
.vorgang:last-child { border-bottom: 0; }
.vorgang-kopf { display: flex; align-items: flex-start; gap: .75rem; }
.vorgang-text {
    margin: .7rem 0 0;
    padding-left: calc(4px + .75rem);
    font-size: .89rem;
    line-height: 1.55;
    color: var(--tinte);
    max-width: 78ch;
}

.belege {
    margin: .85rem 0 0;
    padding: .75rem .85rem;
    background: var(--flaeche-matt);
    border: 1px solid var(--kante);
    border-radius: var(--r-kl);
}
.beleg-reihe { display: flex; flex-wrap: wrap; gap: .6rem; }

.beleg {
    display: block;
    width: 148px;
    border: 1px solid var(--kante-stark);
    border-radius: var(--r-kl);
    background: #fff;
    overflow: hidden;
    text-decoration: none;
    color: var(--tinte);
    transition: border-color .12s, box-shadow .12s, transform .12s;
}
.beleg:hover {
    text-decoration: none;
    border-color: var(--marine-hell);
    box-shadow: var(--schatten-md);
    transform: translateY(-1px);
}
.beleg img {
    display: block;
    width: 100%;
    height: 104px;
    object-fit: cover;
    object-position: top;
    background: #f0f2f5;
}
.beleg-sinnbild {
    display: grid; place-items: center;
    height: 104px;
    background: #eaf0f6;
    color: var(--marine);
}
.beleg-fuss {
    display: block;
    padding: .4rem .5rem;
    border-top: 1px solid var(--kante);
}
.beleg-name {
    display: block;
    font-size: .74rem; font-weight: 600;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
}
.beleg-groesse {
    display: block;
    font-size: .68rem; color: var(--leise);
    font-variant-numeric: tabular-nums;
    margin-top: .1rem;
}

/* Lupe: Beleg gross ansehen und durchblaettern */
/* Wichtig: display:flex schlaegt das hidden-Attribut des Browsers, die
   Lupe stuende sonst dauerhaft offen. Deshalb ausdruecklich ausblenden. */
.lupe[hidden] { display: none !important; }

.lupe {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(12, 22, 34, .92);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 3.2rem 1rem 4.2rem;
}
.lupe-buehne {
    flex: 1 1 auto;
    width: 100%;
    display: flex; align-items: center; justify-content: center;
    min-height: 0;
}
.lupe img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.lupe iframe {
    width: min(100%, 980px);
    height: 100%;
    border: 0; border-radius: 6px;
    background: #fff;
}
.lupe-fuss {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: .9rem 1rem;
    display: flex; align-items: center; justify-content: center;
    gap: 1rem; flex-wrap: wrap;
    color: rgba(255,255,255,.9);
    font-size: .85rem;
    text-align: center;
}
.lupe-fuss a { color: #9ec6ea; }
.lupe-zu, .lupe-vor {
    position: absolute;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: grid; place-items: center;
    transition: background .12s;
}
.lupe-zu:hover, .lupe-vor:hover { background: rgba(255,255,255,.26); }
.lupe-zu {
    top: .9rem; right: 1rem;
    width: 42px; height: 42px;
    font-size: 1.6rem; line-height: 1;
}
.lupe-vor {
    top: 50%; transform: translateY(-50%);
    width: 46px; height: 46px;
    font-size: 2rem; line-height: 1;
}
.lupe-zurueck { left: 1rem; }
.lupe-weiter  { right: 1rem; }

@media (max-width: 640px) {
    .beleg { width: calc(50% - .3rem); }
    .lupe-vor { width: 40px; height: 40px; font-size: 1.6rem; }
    .lupe { padding: 3rem .5rem 4.6rem; }
}

@media print {
    .belege { background: #fff; }
    .beleg { width: 120px; break-inside: avoid; }
    .lupe { display: none !important; }
    .vorgang { break-inside: avoid; }
}

/* Ohne Fussleiste (Nur-Lese-Konten) darf der Inhalt bis unten laufen */
body:not(:has(.fussleiste)) .rahmen { padding-bottom: 2rem; }
