/* ---------- Quittura: Farben und Grundlagen ----------
   Farbwelt: Signalrot für Hauptaktionen, Anthrazit für die Navigation, helle Grautöne für Flächen.
   Blau, Grün, Orange nur für Status. */
:root {
    --q-grund: #F3F4F6;
    --q-flaeche: #FFFFFF;
    --q-text: #2B2E33;
    --q-text2: #5F6670;
    --q-primaer: #E2001A;
    --q-primaer-dunkel: #B80015;
    --q-primaer-text: #C20017;
    --q-primaer-hell: #FDE8EA;
    --q-anthrazit: #2B2E33;
    --q-anthrazit-2: #3C4047;
    --q-info: #0A6EB4;
    --q-info-hell: #E6F1FA;
    --q-rand: #C9CED4;
    --q-linie: #E3E6EA;
    --q-positiv: #1E7A43;
    --q-positiv-hell: #E5F4EB;
    --q-negativ: #B80015;
    --q-negativ-hell: #FDE8EA;
    --q-kritisch: #A35A00;
    --q-kritisch-hell: #FDF3E1;
    --q-schatten: 0 1px 2px rgba(20, 22, 26, 0.06), 0 4px 16px rgba(20, 22, 26, 0.05);
    --q-schatten-hover: 0 2px 4px rgba(20, 22, 26, 0.08), 0 8px 24px rgba(20, 22, 26, 0.09);
    --q-radius: 10px;
    --q-seite-breite: 248px;
    /* Weitere Farben, damit das dunkle Design alles umstellen kann (keine festen Farben in den Regeln). */
    --q-rand-stark: #A9AFB7;
    --q-neutral-hell: #EEF0F2;
    --q-positiv-dunkel: #155C32;
    --q-auf-positiv: #FFFFFF;
    --q-aktiv: #2B2E33;
    --q-auf-aktiv: #FFFFFF;
    --q-beleg-grund: #EDEFF1;
    --q-warnung-grund: #FFF8D6;
    --q-warnung-rand: #E9C04A;
    --q-warnung-text: #5C3D00;
    --q-fehler-rand: #F0A3A3;
    --q-fehler-text: #7A1D16;
    --q-erfolg-rand: #9CCFAA;
    --q-erfolg-text: #1D5C36;
    --q-info-rand: #A9CDEA;
    --q-info-text: #084F82;
    --q-erkannt-rand: #F4A9B2;
    --q-erkannt-text: #7A0011;
    --q-notiz-grund: #FFFBEA;
    --q-notiz-rand: #F0D98C;
    --q-demo-grund: #FDF3E1;
    --q-demo-rand: #EBC98A;
    --q-demo-text: #5C3D00;
    --q-demo-link: #5C4300;
    --q-auswahl-pfeil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235F6670' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    --q-auswahl-pfeil-erkannt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C20017' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* ---------- Dunkles Design ----------
   Gesetzt von js/thema.js über data-bs-theme="dark" am <html> (Knopf im Menü, sonst Einstellung des Systems).
   Nur Farbwerte; Signalrot bleibt für Hauptaktionen, Flächen werden dunkel, Texte hell. Bootstrap stellt seine
   Bausteine über dasselbe Attribut um; seine Grundfarben folgen hier denen von Quittura. */
:root[data-bs-theme="dark"] {
    color-scheme: dark;
    --q-grund: #141619;
    --q-flaeche: #1E2125;
    --q-text: #E6E8EB;
    --q-text2: #A2A9B2;
    --q-primaer-dunkel: #F0263D;
    --q-primaer-text: #FF7A86;
    --q-primaer-hell: #3B1A1F;
    --q-anthrazit: #0D0F11;
    --q-anthrazit-2: #24282D;
    --q-info: #6DB3EC;
    --q-info-hell: #13283A;
    --q-rand: #3C424A;
    --q-linie: #2B3036;
    --q-positiv: #3FB06B;
    --q-positiv-hell: #142E1E;
    --q-negativ: #FF6B6B;
    --q-negativ-hell: #3A1B1D;
    --q-kritisch: #E3A64B;
    --q-kritisch-hell: #33270F;
    --q-schatten: 0 1px 2px rgba(0, 0, 0, 0.45), 0 4px 16px rgba(0, 0, 0, 0.25);
    --q-schatten-hover: 0 2px 4px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.35);
    --q-rand-stark: #5A616B;
    --q-neutral-hell: #2A2E33;
    --q-positiv-dunkel: #5CC484;
    --q-auf-positiv: #0B1F12;
    --q-aktiv: #DCE0E5;
    --q-auf-aktiv: #15171A;
    --q-beleg-grund: #2A2E33;
    --q-warnung-grund: #33290C;
    --q-warnung-rand: #8A6B1E;
    --q-warnung-text: #F1D58A;
    --q-fehler-rand: #7A2F33;
    --q-fehler-text: #FFB3B3;
    --q-erfolg-rand: #2E6B45;
    --q-erfolg-text: #9EE0B5;
    --q-info-rand: #2D5878;
    --q-info-text: #A9D2F5;
    --q-erkannt-rand: #7A2A35;
    --q-erkannt-text: #FFB1BA;
    --q-notiz-grund: #2E2A16;
    --q-notiz-rand: #6B5C24;
    --q-demo-grund: #2E2412;
    --q-demo-rand: #6B5424;
    --q-demo-text: #F1D58A;
    --q-demo-link: #F5DC9A;
    --q-auswahl-pfeil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A2A9B2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    --q-auswahl-pfeil-erkannt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF7A86' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    /* Bootstrap-Bausteine (Formularfelder, Karten, Tabellen, Meldungen) in denselben Tönen */
    --bs-body-bg: #1E2125;
    --bs-body-color: #E6E8EB;
    --bs-emphasis-color: #FFFFFF;
    --bs-secondary-color: rgba(230, 232, 235, 0.7);
    --bs-secondary-bg: #24282D;
    --bs-tertiary-bg: #1A1D21;
    --bs-border-color: #3C424A;
}
/* Die Seitenleiste ist schon dunkel: eine feine Kante trennt sie im dunklen Design vom Inhalt. */
:root[data-bs-theme="dark"] .q-seite { box-shadow: 1px 0 0 var(--q-linie); }
:root[data-bs-theme="dark"] #components-reconnect-modal { background-color: var(--q-flaeche); color: var(--q-text); }

/* Knopf Hell/Dunkel: Mond im hellen Design (wechselt zu dunkel), Sonne im dunklen. */
.q-thema-knopf svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.q-thema-sonne { display: none; }
:root[data-bs-theme="dark"] .q-thema-mond { display: none; }
:root[data-bs-theme="dark"] .q-thema-sonne { display: inline; }
.q-thema-kopf { margin-left: auto !important; }
.q-nav-unten { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; }
.q-nav-unten .q-nav-impressum { padding: 0 6px; }
.q-nav-rechtliches { display: flex; flex-wrap: wrap; gap: 2px 4px; }
.q-nav-thema { width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: #A9AFB7; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.q-nav-thema:hover { background: var(--q-anthrazit-2); color: #fff; }
.q-nav-thema:focus-visible { outline: 2px solid var(--q-primaer); outline-offset: 2px; }

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
    font-size: 14px;
    color: var(--q-text);
    background: var(--q-grund);
}

a, .btn-link {
    color: var(--q-primaer-text);
}

.btn-primary {
    color: #fff;
    background-color: var(--q-primaer);
    border-color: var(--q-primaer);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem var(--q-flaeche), 0 0 0 0.25rem var(--q-info);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--q-positiv);
}

.invalid {
    outline: 1px solid var(--q-negativ);
}

.validation-message {
    color: var(--q-negativ);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Es ist ein Fehler aufgetreten."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ---------- Rahmen: Seitenleiste + Inhalt ---------- */
.q-app { min-height: 100vh; min-height: 100dvh; }
.q-seite { position: fixed; inset: 0 auto 0 0; width: var(--q-seite-breite); z-index: 30; background: var(--q-anthrazit); color: #E9EBEE; display: flex; flex-direction: column; padding: max(18px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); overflow-y: auto; overscroll-behavior: contain; }
.q-inhaltsspalte { margin-left: var(--q-seite-breite); min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.q-logo { width: 34px; height: 34px; flex: none; border-radius: 8px; background: var(--q-primaer); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; }
.q-logo-zeichen { background: none; border-radius: 0; } /* Quittura-Zeichen (SVG mit eigenen runden Ecken) */
.q-marke { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; color: #fff; text-decoration: none; }
.q-marke:hover { color: #fff; }
.q-marke b { display: block; font-size: 18px; letter-spacing: .2px; }
.q-marke small { display: block; color: #A9AFB7; font-size: 11px; margin-top: -2px; }
.q-marke b { overflow-wrap: anywhere; line-height: 1.2; }
.q-firmenlogo { flex: none; background: #fff; border-radius: 8px; padding: 4px; display: inline-flex; align-items: center; justify-content: center; max-width: 96px; height: 42px; }
.q-firmenlogo img { max-width: 88px; max-height: 34px; display: block; }
.q-firmenlogo-klein { height: 28px; max-width: 70px; background: #fff; border-radius: 6px; padding: 2px; }
.q-marke-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55vw; }
.q-nav { display: flex; flex-direction: column; gap: 2px; }
.q-nav-gruppe { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #A9AFB7; padding: 14px 10px 6px; }
.q-nav-link { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 8px; color: #D5D9DE; text-decoration: none; font-weight: 500; }
.q-nav-zahl { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--q-primaer); color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.q-nav-link:hover { background: var(--q-anthrazit-2); color: #fff; }
.q-nav-link.active { background: var(--q-anthrazit-2); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--q-primaer); }
.q-nav-link:focus-visible, .q-nav-person:focus-visible, .q-nav-abmelden:focus-visible { outline: 2px solid var(--q-primaer); outline-offset: 2px; }
.q-nav-link svg, .q-nav-abmelden svg, .q-menue-knopf svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.q-nav-fuss { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--q-anthrazit-2); display: flex; align-items: center; gap: 6px; }
.q-nav-fuss form { margin: 0; }
.q-nav-impressum { display: block; padding: 8px 6px 0 6px; color: #A9AFB7; font-size: 11px; text-decoration: none; }
.q-nav-impressum:hover { color: #fff; text-decoration: underline; }

/* Hilfe: gut lesbarer Fliesstext, Inhaltsverzeichnis, Kapitel als Karten */
.q-hilfe { display: grid; gap: 16px; max-width: 900px; }
.q-hilfe-suche { display: flex; gap: 8px; flex-wrap: wrap; }
.q-hilfe-suche .q-eingabe { width: 260px; max-width: 100%; }
.q-hilfe-inhalt ol { margin: 0; padding-left: 22px; columns: 2 240px; column-gap: 32px; }
.q-hilfe-inhalt li { margin: 2px 0; break-inside: avoid; }
.q-hilfe-kapitel { scroll-margin-top: 16px; }
.q-hilfe-text { line-height: 1.55; display: flex; flex-direction: column; gap: 10px; }
.q-hilfe-text p, .q-hilfe-text ul, .q-hilfe-text ol, .q-hilfe-einleitung p { margin: 0; }
.q-hilfe-einleitung { display: flex; flex-direction: column; gap: 8px; line-height: 1.55; }
.q-hilfe-einleitung p:first-child { color: var(--q-text2); font-size: 15px; }
.q-hilfe-text ul, .q-hilfe-text ol { padding-left: 22px; }
.q-hilfe-text li + li { margin-top: 4px; }
.q-hilfe-text h3 { margin: 6px 0 0 0; font-size: 15px; }
.q-hilfe-text h4 { margin: 4px 0 0 0; font-size: 14px; }
.q-hilfe-text code { font-size: 0.92em; background: var(--q-grund); padding: 1px 4px; border-radius: 4px; }
.q-hilfe-text .q-tabelle th { white-space: normal; }
.q-nav-person { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; color: #fff; text-decoration: none; }
.q-nav-person:hover { background: var(--q-anthrazit-2); color: #fff; }
.q-nav-name { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-nav-name small { display: block; font-weight: 400; color: #A9AFB7; font-size: 11px; }
.q-avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--q-primaer); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.q-nav-abmelden { width: 40px; height: 40px; border: 0; border-radius: 8px; background: none; color: #D5D9DE; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.q-nav-abmelden:hover { background: var(--q-anthrazit-2); color: #fff; }
.q-mobilkopf, .q-menue-schleier { display: none; }
.q-main { flex: 1 1 auto; width: 100%; max-width: 1240px; padding: 24px 28px 48px; box-sizing: border-box; }

/* Handy und schmale Tablets: Kopfleiste + ausklappbares Menü (ohne JavaScript) */
@media (max-width: 899px) {
    .q-mobilkopf { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; gap: 8px; background: var(--q-anthrazit); color: #fff; padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)); min-height: calc(52px + env(safe-area-inset-top)); }
    .q-menue-knopf { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; cursor: pointer; margin: 0;
        border: 0; background: none; color: #fff; padding: 0; }
    .q-menue-knopf:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
    .q-menue-knopf svg { width: 22px; height: 22px; }
    .q-marke-klein { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; }
    .q-marke-klein .q-logo { width: 28px; height: 28px; font-size: 15px; }
    .q-seite { transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; width: min(84vw, 300px); }
    .q-app.q-menue-offen .q-seite { transform: none; visibility: visible; transition: transform .2s ease; box-shadow: 8px 0 32px rgba(0,0,0,.25); }
    .q-app.q-menue-offen .q-menue-schleier { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(20, 22, 26, .45); }
    .q-inhaltsspalte { margin-left: 0; min-height: 0; }
    .q-main { padding: 14px max(12px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
    .q-nav-link { min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) { .q-seite { transition: none; } }

/* ---------- Seitenkopf ---------- */
.q-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.q-kopf h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.q-pfad { font-size: 13px; color: var(--q-text2); margin-bottom: 4px; }
.q-pfad a { text-decoration: none; }
.q-kpis { display: flex; flex-wrap: wrap; gap: 32px; }
.q-kpi { display: flex; flex-direction: column; gap: 2px; }
.q-kpi-label { font-size: 13px; color: var(--q-text2); }
.q-kpi-wert { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Karten, Kacheln, Raster ---------- */
.q-karte { background: var(--q-flaeche); border: 1px solid var(--q-linie); border-radius: var(--q-radius); box-shadow: var(--q-schatten); padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.q-karte h2 { margin: 0; font-size: 16px; font-weight: 700; }
.q-zweispaltig { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.q-zweispaltig > * { flex: 1 1 420px; }
.q-raster2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.q-raster3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
@media (max-width: 640px) { .q-raster3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.q-kacheln { display: flex; flex-wrap: wrap; gap: 16px; }
.q-kachel { width: 188px; height: 188px; box-sizing: border-box; background: var(--q-flaeche); border: 1px solid var(--q-linie); border-top: 3px solid var(--q-primaer); border-radius: var(--q-radius); box-shadow: var(--q-schatten); padding: 16px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--q-text); }
.q-kachel:hover { color: var(--q-text); box-shadow: var(--q-schatten-hover); transform: translateY(-1px); }
.q-kachel-titel { font-size: 16px; font-weight: 600; line-height: 1.3; }
.q-kachel-unter { font-size: 13px; color: var(--q-text2); }
.q-kachel-zahl { margin-top: auto; font-size: 40px; font-weight: 700; line-height: 1; color: var(--q-text); }
.q-kachel-fuss { font-size: 12px; color: var(--q-text2); }
@media (max-width: 640px) { .q-kacheln { gap: 10px; } .q-kachel { width: calc(50% - 5px); height: 150px; padding: 14px; } .q-kachel-zahl { font-size: 32px; } }

/* ---------- Formularfelder ---------- */
.q-feld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.q-label { font-size: 13px; color: var(--q-text2); }
.q-pflicht { color: var(--q-negativ); }
.q-eingabe { font: inherit; font-size: 15px; min-height: 40px; padding: 6px 10px; border: 1px solid var(--q-rand); border-radius: 8px; background: var(--q-flaeche); color: var(--q-text); width: 100%; box-sizing: border-box; }
.q-eingabe:focus { outline: 2px solid var(--q-primaer); outline-offset: 0; border-color: var(--q-primaer); }
.q-eingabe[disabled] { background: var(--q-grund); color: var(--q-text2); }
.q-eingabe.q-rechts { text-align: right; }
.q-hinweis { font-size: 12px; color: var(--q-text2); }
@media (max-width: 640px) { .q-eingabe { font-size: 16px; min-height: 44px; } }

/* ---------- Schaltflächen ---------- */
.q-btn { font: inherit; font-weight: 600; min-height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--q-rand); background: var(--q-flaeche); color: var(--q-text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.q-btn:hover { background: var(--q-grund); border-color: var(--q-rand-stark); color: var(--q-text); }
.q-btn:focus-visible { outline: 2px solid var(--q-info); outline-offset: 2px; }
.q-btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.q-btn-primaer { background: var(--q-primaer); color: #fff; border-color: var(--q-primaer); }
.q-btn-primaer:hover { background: var(--q-primaer-dunkel); border-color: var(--q-primaer-dunkel); color: #fff; }
.q-btn-positiv { background: var(--q-positiv); color: var(--q-auf-positiv); border-color: var(--q-positiv); }
.q-btn-positiv:hover { background: var(--q-positiv-dunkel); color: var(--q-auf-positiv); }
.q-btn-negativ { color: var(--q-negativ); border-color: var(--q-negativ); }
.q-btn-negativ:hover { background: var(--q-negativ-hell); color: var(--q-negativ); }
.q-btn-ghost { border-color: transparent; background: transparent; }
.q-btn-gross { min-height: 52px; font-size: 16px; }
.q-aktionen { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
@media (max-width: 640px) {
    .q-fussleiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; background: var(--q-flaeche); border-top: 1px solid var(--q-linie); box-shadow: 0 -4px 16px rgba(20,22,26,.08); padding: 10px max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
    .q-fussleiste .q-btn { flex: 1 1 auto; min-height: 52px; }
}

/* ---------- Status und Meldungen ---------- */
.q-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12px; padding: 3px 10px; border-radius: 20px; white-space: nowrap; color: var(--q-text2); background: var(--q-neutral-hell); }
.q-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.q-badge-info { color: var(--q-info); background: var(--q-info-hell); }
.q-badge-positiv { color: var(--q-positiv); background: var(--q-positiv-hell); }
.q-badge-negativ { color: var(--q-negativ); background: var(--q-negativ-hell); }
.q-badge-entwurf { color: var(--q-text2); background: var(--q-grund); border: 1px dashed var(--q-rand); }
.q-meldung { border-radius: 8px; padding: 10px 12px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.q-meldung-warnung { background: var(--q-warnung-grund); border-color: var(--q-warnung-rand); color: var(--q-warnung-text); }
.q-meldung-fehler { background: var(--q-negativ-hell); border-color: var(--q-fehler-rand); color: var(--q-fehler-text); }
.q-meldung-erfolg { background: var(--q-positiv-hell); border-color: var(--q-erfolg-rand); color: var(--q-erfolg-text); }
.q-meldung-info { background: var(--q-info-hell); border-color: var(--q-info-rand); color: var(--q-info-text); }

/* ---------- Berechnung ---------- */
.q-rechnung { background: var(--q-grund); border: 1px solid var(--q-linie); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.q-rechnung-zeile { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.q-rechnung-total { font-size: 16px; font-weight: 700; color: var(--q-text); border-top: 1px solid var(--q-rand); padding-top: 6px; }

/* ---------- Belege ---------- */
.q-beleg-gross { position: relative; background: var(--q-beleg-grund); border-radius: 10px; min-height: 280px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.q-beleg-gross img { max-width: 100%; max-height: 560px; display: block; }
.q-beleg-gross iframe { width: 100%; height: 560px; border: 0; background: #fff; }
.q-beleg-leer { color: var(--q-text2); text-align: center; padding: 24px; }
.q-miniaturen { display: flex; flex-wrap: wrap; gap: 8px; }
.q-miniatur { position: relative; width: 72px; height: 72px; border-radius: 8px; border: 1px solid var(--q-rand); background: var(--q-flaeche); padding: 0; overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; color: var(--q-negativ); }
.q-miniatur img { width: 100%; height: 100%; object-fit: cover; }
.q-miniatur.aktiv { border: 2px solid var(--q-primaer); }
.q-miniatur-neu { position: absolute; left: 4px; top: 4px; font-size: 10px; font-weight: 700; background: var(--q-primaer); color: #fff; border-radius: 6px; padding: 1px 5px; }
.q-datei-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
/* Startseite: Beleg für den Eingangskorb fotografieren (unterwegs, ein Tippen) */
.q-schnellfoto { margin: 0 0 20px; display: flex; flex-direction: column; gap: 10px; }
.q-schnellfoto-knopf { position: relative; justify-content: flex-start; gap: 12px; min-height: 64px; padding: 10px 18px; text-align: left; }
.q-schnellfoto-knopf span { display: flex; flex-direction: column; line-height: 1.2; font-size: 17px; }
.q-schnellfoto-knopf small { font-size: 13px; font-weight: 400; opacity: .85; }
.q-schnellfoto-knopf[aria-disabled="true"] { opacity: .7; pointer-events: none; }
@media (min-width: 900px) { .q-schnellfoto { max-width: 420px; } }

/* ---------- Listen ---------- */
.q-liste { display: flex; flex-direction: column; gap: 10px; }
.q-listeneintrag { display: flex; flex-direction: column; gap: 6px; background: var(--q-flaeche); border: 1px solid var(--q-linie); border-radius: var(--q-radius); box-shadow: var(--q-schatten); padding: 12px 16px; text-decoration: none; color: var(--q-text); }
.q-listeneintrag:hover { color: var(--q-text); box-shadow: var(--q-schatten-hover); }
.q-zeile { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.q-klein { font-size: 13px; color: var(--q-text2); }
.q-betrag { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.q-chip { min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--q-rand); background: var(--q-flaeche); color: var(--q-text); display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.q-chip:hover { color: var(--q-text); background: var(--q-grund); }
.q-chip.aktiv { background: var(--q-aktiv); border-color: var(--q-aktiv); color: var(--q-auf-aktiv); font-weight: 600; }
.q-verlauf { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--q-text2); }
.q-belege-karte { }
@media (max-width: 900px) { .q-belege-karte { order: -1; } }

/* ---------- Tabellen ---------- */
/* Bezugsrahmen für unsichtbare Spaltentitel (visually-hidden): sonst ragen sie aus dem Scrollbereich und verbreitern die Seite. */
.q-tabelle { position: relative; }
.q-tabelle { width: 100%; border-collapse: collapse; }
.q-tabelle th { background: var(--q-grund); color: var(--q-text2); font-size: 12px; font-weight: 600; text-align: left; padding: 10px 12px; white-space: nowrap; }
.q-tabelle td { padding: 10px 12px; border-top: 1px solid var(--q-linie); vertical-align: top; }
.q-tabelle tr.aktiv td { background: var(--q-primaer-hell); }
.q-tabelle tr.aktiv td:first-child { box-shadow: inset 3px 0 0 var(--q-primaer); }
.q-tabelle tfoot td { background: var(--q-grund); font-weight: 700; }
.q-r { text-align: right !important; font-variant-numeric: tabular-nums; }
.q-link-knopf { font: inherit; font-weight: 600; color: var(--q-primaer-text); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.q-link-knopf:hover { text-decoration: underline; }
.q-balken { height: 10px; border-radius: 5px; background: var(--q-neutral-hell); overflow: hidden; }
.q-balken > div { height: 10px; border-radius: 5px; background: var(--q-primaer); }
.q-balken-gruen > div { background: var(--q-positiv); }

/* Listenansicht: Karten oder Tabelle, Vorschaubilder */
.q-segment { display: inline-flex; border: 1px solid var(--q-rand); border-radius: 8px; overflow: hidden; }
.q-segment button { border: 0; background: var(--q-flaeche); color: var(--q-text); padding: 6px 14px; font: inherit; cursor: pointer; }
.q-segment button + button { border-left: 1px solid var(--q-rand); }
.q-segment button.aktiv { background: var(--q-aktiv); color: var(--q-auf-aktiv); font-weight: 700; }
.q-segment a { background: var(--q-flaeche); }
.q-segment a + a { border-left: 1px solid var(--q-rand); }
.q-segment a.aktiv { background: var(--q-aktiv); color: var(--q-auf-aktiv) !important; font-weight: 700; }
.q-nur-schmal { display: none !important; }
/* Gerät: Computer = Maus/Trackpad (fein, mit Hover); sonst Handy/Tablet mit Touch. Ohne Angabe gilt Handy. */
.q-text-computer { display: none !important; }
.q-nur-computer { display: none !important; }
/* Ablagefeld für Drag & Drop (nur Computer) */
.q-ablage { position: relative; flex-direction: column; align-items: center; gap: 4px; padding: 22px 16px; margin-top: 12px; border: 2px dashed var(--q-rand); border-radius: 10px; text-align: center; color: var(--q-text); background: var(--q-grund); transition: background .15s, border-color .15s; }
.q-ablage svg { color: var(--q-primaer); }
.q-ablage-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.q-ablage.q-ablage-aktiv, .q-ablage:hover { border-color: var(--q-primaer); background: var(--q-primaer-hell); }
@media (hover: hover) and (pointer: fine) {
    .q-nur-handy, .q-text-handy { display: none !important; }
    .q-text-computer { display: inline !important; }
    .q-nur-computer { display: block !important; }
    .q-ablage.q-nur-computer { display: flex !important; }
}
@media (max-width: 700px) {
    .q-nur-breit { display: none !important; }
    .q-nur-schmal { display: flex !important; }
}
.q-tabelle-rahmen { background: var(--q-flaeche); border: 1px solid var(--q-linie); border-radius: var(--q-radius); box-shadow: var(--q-schatten); overflow-x: auto; }
.q-tabelle tbody tr:hover td { background: var(--q-grund); }
.q-zelle-text { max-width: 360px; }
.q-zelle-text > a, .q-zelle-text { overflow-wrap: anywhere; }
.q-karte-mit-bild { flex-direction: row; align-items: flex-start; gap: 12px; }
.q-karte-mit-bild.aktiv { box-shadow: inset 3px 0 0 var(--q-primaer), var(--q-schatten); }
.q-karte-inhalt { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.q-karte-titel { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: var(--q-text); text-decoration: none; }
.q-karte-check { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; }
.q-vorschau { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 6px; border: 1px solid var(--q-linie); background: var(--q-grund); flex-shrink: 0; text-decoration: none; font-size: 11px; font-weight: 700; color: var(--q-primaer-text); }
.q-vorschau > img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; }
.q-vorschau-leer { color: var(--q-rand); }
.q-vorschau-anzahl { position: absolute; right: -6px; top: -6px; background: var(--q-primaer); color: #fff; border-radius: 10px; font-size: 10px; min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
/* Position setzt quittura.js (immer ganz im Fenster); fixed, damit Tabellen mit Scrollbereich nichts abschneiden. */
.q-vorschau-gross { display: none; position: fixed; left: -9999px; top: 0; z-index: 60; background: var(--q-flaeche); padding: 6px; border-radius: 8px; box-shadow: 0 6px 24px rgba(20, 22, 26, 0.35); pointer-events: none; }
.q-vorschau-gross img { display: block; max-width: min(420px, 45vw); max-height: calc(100vh - 32px); }
.q-vorschau-gross iframe { display: block; width: min(420px, 45vw); height: min(560px, calc(100vh - 32px)); border: 0; }

/* Vorschaufenster für PDFs und Belege (quittura.js). */
.q-pdf-offen { overflow: hidden; }
.q-pdf-fenster { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.q-pdf-schleier { position: absolute; inset: 0; background: rgba(20, 22, 26, 0.55); }
.q-pdf-rahmen { position: relative; display: flex; flex-direction: column; width: min(1000px, calc(100vw - 32px)); height: calc(100vh - 32px); background: var(--q-flaeche); border-radius: 10px; overflow: hidden; box-shadow: 0 12px 40px rgba(20, 22, 26, 0.4); }
.q-pdf-kopf { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--q-linie); }
.q-pdf-titel { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-pdf-inhalt { flex: 1; width: 100%; border: 0; background: #525659; }
.q-pdf-kopf { flex-wrap: wrap; }
.q-zoom-knoepfe { display: inline-flex; gap: 4px; }
.q-zoom-knoepfe .q-btn { min-width: 40px; }
.q-bild-buehne { position: relative; flex: 1; overflow: hidden; background: #3a3d42; touch-action: none; cursor: grab; user-select: none; }
.q-bild-buehne.q-bild-zieht { cursor: grabbing; }
.q-bild-inhalt { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; max-height: none; pointer-events: none; }
@media (max-width: 600px) {
    .q-pdf-rahmen { width: 100vw; height: 100dvh; border-radius: 0; }
    .q-pdf-titel { flex-basis: 100%; }
}
@media (hover: hover) { .q-vorschau:hover .q-vorschau-gross { display: block; } }

/* Eingangskorb */
.q-korb-wahl summary { cursor: pointer; color: var(--q-primaer-text); font-weight: 600; }
.q-korb-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 8px; }
.q-korb-bild { position: relative; aspect-ratio: 3 / 4; border: 2px solid var(--q-linie); border-radius: 8px; background: var(--q-grund); padding: 0; overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--q-primaer-text); }
.q-korb-bild img { width: 100%; height: 100%; object-fit: cover; }
.q-korb-bild.aktiv { border-color: var(--q-primaer); box-shadow: 0 0 0 2px var(--q-primaer-hell); }
.q-korb-bild.aktiv::after { content: "✓"; position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 11px; background: var(--q-primaer); color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.q-vorlage-box { border: 1px dashed var(--q-rand); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.q-check { display: flex; gap: 8px; align-items: center; }
.q-eingabe-klein { width: auto; min-height: 32px; padding: 4px 8px; }
.q-detail-kopf { position: sticky; top: 0; z-index: 15; background: var(--q-flaeche); margin: -16px -20px 0; padding: 14px 20px 12px; border-bottom: 1px solid var(--q-linie); border-radius: var(--q-radius) var(--q-radius) 0 0; box-shadow: 0 6px 10px -8px rgba(20, 22, 26, 0.25); }
@media (max-width: 899px) { .q-detail-kopf { top: calc(52px + env(safe-area-inset-top)); } }
.q-massenleiste { position: sticky; bottom: env(safe-area-inset-bottom); z-index: 20; display: flex; gap: 12px; align-items: center; justify-content: space-between; background: var(--q-flaeche); border-top: 2px solid var(--q-primaer); padding: 10px 16px; box-shadow: 0 -4px 12px rgba(20, 22, 26, 0.15); border-radius: var(--q-radius) var(--q-radius) 0 0; }
.q-einspaltig { display: flex; flex-direction: column; gap: 16px; }
.q-notiz-intern { background: var(--q-notiz-grund); border: 1px solid var(--q-notiz-rand); border-radius: 8px; padding: 10px; }
.q-formular-box { border: 1px solid var(--q-rand); border-top: 3px solid var(--q-primaer); border-radius: var(--q-radius); background: var(--q-flaeche); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.q-feldgruppe { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.q-feldgruppe legend { width: 100%; margin-bottom: 4px; }
.q-korb-raster-gross { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.q-korb-eintrag { display: flex; flex-direction: column; gap: 4px; }
/* Mitbezahlte Kollegen */
.q-feld-personen .q-eingabe { max-width: 120px; }
.q-kollegen { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.q-kollege { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 4px 0 12px; border-radius: 16px; background: var(--q-grund); border: 1px solid var(--q-rand); font-size: 14px; }
.q-kollege button { width: 28px; height: 28px; border: 0; background: none; border-radius: 50%; font-size: 18px; line-height: 1; color: var(--q-text2); cursor: pointer; }
.q-kollege button:hover { background: var(--q-linie); color: var(--q-text); }
.q-kollege-nicht-dabei { background: var(--q-kritisch-hell); border-color: var(--q-kritisch); }
.q-mitbezahlt { min-width: 640px; }
.q-mitbezahlt td { color: var(--q-text2); }
.q-mitbezahlt td.q-r { white-space: nowrap; }
.q-korb-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--q-text2); }
.q-korb-status .q-lesen-punkt { width: 8px; height: 8px; }
.q-korb-status-fertig { color: var(--q-positiv); font-weight: 600; font-variant-numeric: tabular-nums; }
.q-anmelde-karte { max-width: 480px; margin: 40px auto; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }

/* Demo-Instanz: Rollenwahl */
.q-demo-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 6px 16px; background: var(--q-demo-grund); color: var(--q-demo-text); font-size: 13px; border-bottom: 1px solid var(--q-demo-rand); }
.q-demo-leiste strong { background: var(--q-primaer); color: #fff; border-radius: 4px; padding: 1px 6px; font-size: 11px; letter-spacing: .05em; }
.q-demo-leiste a { color: var(--q-demo-link); font-weight: 600; text-decoration: underline; min-height: 32px; display: inline-flex; align-items: center; }
.q-demo-wahl h2 { font-size: 18px; font-weight: 700; margin: 0 0 6px 0; }
.q-demo-karten { display: grid; gap: 10px; margin-top: 14px; }
.q-demo-karte { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--q-radius); background: var(--q-flaeche); border: 1px solid var(--q-linie); box-shadow: var(--q-schatten); color: var(--q-text); text-decoration: none; border-left: 4px solid var(--q-primaer); }
.q-demo-karte:hover { background: var(--q-grund); color: var(--q-text); }
.q-demo-rolle { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--q-primaer-text); }
.q-demo-name { font-size: 16px; font-weight: 700; }
@media (max-width: 899px) {
    .q-demo-leiste { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; padding: 6px 12px; scrollbar-width: none; }
    .q-demo-leiste::-webkit-scrollbar { display: none; }
}

/* Belegerkennung: automatisch ausgefüllte Felder */
.q-eingabe.q-eingabe-erkannt { border-color: var(--q-primaer); background-color: var(--q-primaer-hell); box-shadow: inset 3px 0 0 var(--q-primaer); }
.q-erkannt-tag { display: inline-block; margin-left: 5px; padding: 1px 4px; border-radius: 3px; background: var(--q-primaer); color: #fff; font-size: 8.5px; line-height: 1.2; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; vertical-align: 2px; }
.q-meldung-erkannt { background: var(--q-primaer-hell); border-color: var(--q-erkannt-rand); color: var(--q-erkannt-text); }

/* Auswahlfelder: gleiche Höhe und Optik wie Textfelder (Safari ignoriert sonst min-height) */
select.q-eingabe { -webkit-appearance: none; appearance: none; padding-right: 34px; background-image: var(--q-auswahl-pfeil); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
select.q-eingabe.q-eingabe-erkannt { background-image: var(--q-auswahl-pfeil-erkannt); }
.q-eingabe[disabled] { opacity: 1; -webkit-text-fill-color: var(--q-text2); }

/* Ort schmal, Kunde breit; auf dem Handy untereinander */
.q-raster-ort-kunde { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px 16px; }
@media (max-width: 640px) { .q-raster-ort-kunde { grid-template-columns: minmax(0, 1fr); } }

/* Datum und Uhrzeit: linksbündig und gleich hoch wie die übrigen Felder (Safari/iOS zentriert sonst) */
input[type="date"].q-eingabe, input[type="time"].q-eingabe { -webkit-appearance: none; appearance: none; display: block; text-align: left; line-height: 26px; }
input[type="date"].q-eingabe::-webkit-date-and-time-value, input[type="time"].q-eingabe::-webkit-date-and-time-value { text-align: left; margin: 0; }

/* Scanner-Animation über dem Belegbild, solange die Erkennung läuft */
.q-scanner { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden;
    background: linear-gradient(rgba(43, 46, 51, .18), rgba(43, 46, 51, .18)),
                repeating-linear-gradient(0deg, transparent 0 23px, rgba(226, 0, 26, .07) 23px 24px),
                repeating-linear-gradient(90deg, transparent 0 23px, rgba(226, 0, 26, .07) 23px 24px); }
.q-scanner-ecke { position: absolute; width: 28px; height: 28px; border: 3px solid #fff; filter: drop-shadow(0 0 3px rgba(0,0,0,.5)); animation: q-ecke 1.1s ease-in-out infinite alternate; }
.q-ecke-ol { left: 12px; top: 12px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.q-ecke-or { right: 12px; top: 12px; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.q-ecke-ul { left: 12px; bottom: 12px; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.q-ecke-ur { right: 12px; bottom: 12px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
@keyframes q-ecke { from { transform: scale(1); opacity: .75; } to { transform: scale(.88); opacity: 1; } }
.q-scanner-text { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: rgba(43, 46, 51, .88); color: #fff; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 20px; white-space: nowrap; }
.q-lesen { align-items: center; }
.q-lesen-punkt { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--q-primaer); animation: q-puls 1s ease-in-out infinite; }
@keyframes q-puls { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }
/* Laser fährt rauf und runter (Grössen relativ zur Belegfläche) */
.q-scanner { container-type: size; }
.q-scanner-laser { position: absolute; left: -20%; width: 140%; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--q-primaer) 18%, #FF4D5E 50%, var(--q-primaer) 82%, transparent);
    box-shadow: 0 0 12px 3px rgba(226, 0, 26, .55), 0 0 40px 12px rgba(226, 0, 26, .25);
    animation: q-rauf-runter 2.6s ease-in-out infinite alternate; }
@keyframes q-rauf-runter {
    from { transform: translateY(-46cqh); }
    to   { transform: translateY(46cqh); }
}

/* Leuchtende Zeichen: glühen auf und schweben nach oben weg */
.q-scanner-zeichen { position: absolute; transform: translate(-50%, -50%); font-family: "SF Mono", Menlo, Consolas, monospace; font-weight: 800; color: #fff;
    text-shadow: 0 0 4px #fff, 0 0 10px #FF4D5E, 0 0 18px #E2001A, 0 0 30px #E2001A; opacity: 0; white-space: nowrap;
    animation: q-zeichen 3.2s ease-out infinite; }
@keyframes q-zeichen {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
    6% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
    14% { transform: translate(-50%, -50%) scale(1); }
    55% { opacity: .85; transform: translate(-50%, -110%); }
    75% { opacity: 0; transform: translate(-50%, -160%); }
    100% { opacity: 0; }
}

/* Wechselnder Text: «Betrag suchen …», «Datum suchen …» usw. */
.q-scanner-wechsel { display: inline-grid; min-width: 9.5em; text-align: center; }
.q-scanner-wechsel > span { grid-area: 1 / 1; opacity: 0; animation: q-wechsel 4.4s infinite; }
.q-scanner-wechsel > span:nth-child(2) { animation-delay: 1.1s; }
.q-scanner-wechsel > span:nth-child(3) { animation-delay: 2.2s; }
.q-scanner-wechsel > span:nth-child(4) { animation-delay: 3.3s; }
@keyframes q-wechsel { 0% { opacity: 0; } 4%, 23% { opacity: 1; } 27%, 100% { opacity: 0; } }

/* Gefundene Werte fliegen vom Foto ins Formular */
.q-flug-chip { position: fixed; z-index: 70; pointer-events: none; transform: translate(-50%, -50%); background: var(--q-primaer); color: #fff;
    font-weight: 800; font-size: 13px; padding: 4px 9px; border-radius: 6px; white-space: nowrap;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .85), 0 0 18px 4px rgba(226, 0, 26, .6); }

/* Ende des Scans: «✓ Gelesen», die Linie läuft weiter, das Ganze blendet langsam aus */
.q-scanner.q-scanner-fertig { animation: q-scanner-aus 1.4s ease-in .3s forwards; }
.q-scanner-text-fertig { background: #1E7A43; }
@keyframes q-scanner-aus { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .q-scanner-laser { animation: none; transform: none; }
    .q-scanner-zeichen { animation: none; opacity: .35; }
    .q-scanner-wechsel > span { animation: none; }
    .q-scanner-wechsel > span:first-child { opacity: 1; }
    .q-scanner-ecke, .q-lesen-punkt { animation: none; }
}

/* Felder einer Zeile unten ausrichten: Eingaben bleiben auf gleicher Höhe, auch wenn eine Beschriftung umbricht */
.q-raster2 > .q-feld, .q-raster3 > .q-feld, .q-raster-ort-kunde > .q-feld { justify-content: flex-end; }
.q-label { line-height: 1.3; }
.q-erkannt-tag { white-space: nowrap; }


/* Aktionen in Tabellen: Knöpfe dürfen umbrechen statt über den Rand zu ragen */
.q-zelle-aktionen { width: 1%; min-width: 180px; }
.q-aktionen-zelle { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }
.q-aktionen-zelle .q-btn { white-space: nowrap; }

/* Ausgeblendete Elemente bleiben ausgeblendet, auch wenn eine Klasse display setzt (z. B. q-btn, q-nur-handy). */
[hidden], .q-ablage[hidden], .q-nur-computer[hidden] { display: none !important; }

/* Sofortvorschau beim Hochladen (quittura.js) */
.q-sofort { display: flex; flex-wrap: wrap; gap: 8px; }
.q-sofort:empty { display: none; }
.q-sofort figure { position: relative; margin: 0; border-radius: 8px; overflow: hidden; border: 1px solid var(--q-linie); background: var(--q-grund); }
.q-sofort img { display: block; max-height: 220px; max-width: 100%; opacity: .75; }
.q-sofort .q-sofort-name { display: block; padding: 24px 16px; font-weight: 600; }
.q-sofort figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px; font-size: 12px; font-weight: 600; background: rgba(20, 22, 26, .65); color: #fff; }
.q-sofort figcaption.q-sofort-fehler { background: var(--q-negativ); }

/* Nutzungsauswertung (Superadmin): Säulen, Wärmekarte, Legende – reines CSS, ohne Skript. */
.q-nutzung-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px 0; }
.q-nutzung-filter select { min-width: 200px; }
.q-nutzung-link { margin-left: auto; }
.q-nutzung-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
@media (max-width: 420px) { .q-nutzung-raster { grid-template-columns: minmax(0, 1fr); } }
.q-legende { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--q-text2); }
.q-legende i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.q-farbe-belege { background: var(--q-primaer); }
.q-farbe-spesen { background: var(--q-info); }
.q-farbe-eingereicht { background: var(--q-positiv); }
.q-farbe-leer { background: var(--q-rand); }
.q-saeulen { display: flex; align-items: flex-end; gap: 3px; height: 140px; border-bottom: 1px solid var(--q-rand); }
.q-saeulen-gruppe { flex: 1; min-width: 2px; height: 100%; display: flex; align-items: flex-end; gap: 1px; }
.q-saeulen-gruppe > div { flex: 1; min-width: 1px; border-radius: 2px 2px 0 0; }
.q-saeulen-stapel { flex: 1; min-width: 2px; display: flex; flex-direction: column; border-radius: 2px 2px 0 0; overflow: hidden; }
.q-saeulen-klein { height: 70px; border-bottom: 0; }
.q-achse { display: flex; justify-content: space-between; font-size: 11px; color: var(--q-text2); }
.q-waerme { display: grid; grid-template-columns: 26px repeat(24, minmax(0, 1fr)); gap: 2px; align-items: center; }
.q-waerme-tag { font-size: 11px; color: var(--q-text2); }
.q-waerme-zelle { aspect-ratio: 1; border-radius: 2px; background: var(--q-primaer); }
.q-achse-stunden { gap: 3px; justify-content: flex-start; }
.q-achse-stunden > span { flex: 1; min-width: 0; overflow: visible; white-space: nowrap; }
.q-achse-waerme { font-size: 11px; color: var(--q-text2); margin-top: -8px; }
.q-achse-waerme > span { white-space: nowrap; overflow: visible; }
.q-wochentage { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; text-align: center; }

/* Auswahlfenster (z. B. Belege aus dem Eingangskorb übernehmen). */
.q-korb-oeffnen { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; }
.q-dialog { position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center; }
.q-dialog-schleier { position: absolute; inset: 0; background: rgba(20, 22, 26, 0.55); }
.q-dialog-rahmen { position: relative; display: flex; flex-direction: column; width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); background: var(--q-flaeche); border-radius: 10px; box-shadow: 0 12px 40px rgba(20, 22, 26, 0.4); overflow: hidden; }
.q-dialog-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--q-linie); }
.q-dialog-kopf h2 { margin: 0; font-size: 17px; }
.q-dialog-inhalt { padding: 14px 18px; overflow-y: auto; }
.q-dialog-fuss { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--q-linie); }
@media (max-width: 600px) {
    .q-dialog-rahmen { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
    .q-dialog-inhalt { flex: 1; }
    .q-dialog .q-korb-raster-gross { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Firmenwahl im Menü (Person in mehreren Firmen). */
.q-firmenwahl { margin: 4px 8px 10px; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 8px; background: rgba(255, 255, 255, 0.06); }
.q-firmenwahl summary { position: relative; list-style: none; cursor: pointer; padding: 8px 28px 8px 10px; display: flex; flex-direction: column; gap: 1px; }
.q-firmenwahl summary::-webkit-details-marker { display: none; }
.q-firmenwahl summary::after { content: "⇄"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); opacity: 0.7; }
.q-firmenwahl summary .q-klein { color: inherit; opacity: 0.75; }
.q-firmenwahl-liste { display: flex; flex-direction: column; gap: 4px; padding: 0 8px 8px; }
.q-firmenwahl-liste > .q-klein { color: inherit; opacity: 0.75; padding: 0 2px; }
.q-firmenwahl-eintrag { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; font: inherit; color: inherit; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 6px; padding: 6px 8px; cursor: pointer; }
.q-firmenwahl-eintrag:hover, .q-firmenwahl-eintrag:focus-visible { background: rgba(255, 255, 255, 0.16); }
.q-firmenwahl-eintrag .q-klein { color: inherit; opacity: 0.75; }

/* Exportvorlagen (Einstellungen): verfügbare Felder links, gewählte Spalten rechts. */
.q-export-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 16px; margin: 12px 0; }
@media (max-width: 760px) { .q-export-editor { grid-template-columns: minmax(0, 1fr); } }
.q-export-liste { border: 1px dashed var(--q-rand); border-radius: var(--q-radius); padding: 10px; min-height: 140px; background: var(--q-grund); }
.q-export-liste h3 { font-size: 14px; margin: 0 0 8px 0; }
.q-export-liste ul, .q-export-liste ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.q-export-gruppe { font-size: 12px; font-weight: 700; color: var(--q-text2); margin: 10px 0 4px 0; }
.q-export-feld, .q-export-spalte { display: flex; align-items: center; gap: 8px; background: var(--q-flaeche); border: 1px solid var(--q-rand); border-radius: 8px; padding: 4px 4px 4px 10px; cursor: grab; }
.q-export-feld > span { flex: 1; }
.q-export-spalte-felder { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 4px 0; }
.q-export-griff { color: var(--q-text2); letter-spacing: -2px; }
.q-export-nr { font-weight: 700; min-width: 1.5em; text-align: right; }
.q-export-knoepfe { display: flex; gap: 2px; }
.q-export-knoepfe .q-btn { min-width: 36px; padding: 0 8px; }
.q-export-feld { padding: 2px 2px 2px 10px; font-size: 14px; }
.q-export-feld .q-btn { min-width: 32px; min-height: 30px; height: 30px; padding: 0 8px; }
.q-export-aktionen { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; align-items: center; }

/* Vorschau der Benutzerverwaltung («Ansicht als»): Menü und Startseite einer anderen Person, nur zur Ansicht. */
.q-ansicht-als { display: grid; grid-template-columns: var(--q-seite-breite) minmax(0, 1fr); gap: 20px; align-items: start; }
.q-ansicht-als-menue { background: var(--q-anthrazit); color: #E9EBEE; border-radius: 12px; padding: 14px 12px; }
.q-ansicht-als-start { min-width: 0; border: 1px dashed var(--q-anthrazit-2); border-radius: 12px; padding: 16px; }
.q-ansicht-als[inert] { cursor: not-allowed; }
@media (max-width: 899px) { .q-ansicht-als { grid-template-columns: minmax(0, 1fr); } }
