/*
 * IT-Onkel-CRM - Marken-Overrides für Tabler
 * Farben aus dem Logo (ITO_Büro_Logo.svg): Primär #0bb2ef, Dunkel #080808
 */

/*
 * Syncopate Bold - Schrift aus dem Logo-Schriftzug ("BÜRO").
 * Selbst gehostet (Apache-2.0-Lizenz, siehe assets/fonts/syncopate/LICENSE.txt),
 * kein Aufruf gegen fonts.googleapis.com/fonts.gstatic.com zur Laufzeit.
 */
@font-face {
    font-family: 'Syncopate';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/syncopate/syncopate-bold-latin-AeWdLyu.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
        U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Syncopate';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/syncopate/syncopate-bold-latin-ext-nzAXhRm.woff2") format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
        U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
        U+2113, U+2C60-2C7F, U+A720-A7FF;
}

.ito-font-brand {
    font-family: 'Syncopate', sans-serif;
    font-weight: 700;
}

:root {
    --tblr-primary: #0bb2ef;
    --tblr-primary-rgb: 11, 178, 239;
    --tblr-link-color: #0bb2ef;
    --tblr-link-color-rgb: 11, 178, 239;
}

/* Ausschließlich über das Twig-Partial bei APP_ENV=dev sichtbar. */
.ito-development-banner {
    position: sticky;
    top: 0;
    z-index: 1100;
    padding: 0.6rem 0;
    color: #1e1300;
    background: repeating-linear-gradient(-45deg, #ffd43b 0 18px, #1e1300 18px 36px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.ito-development-banner .container-xl {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 1rem;
    color: #1e1300;
    font-size: 0.875rem;
    text-align: center;
    background: #ffd43b;
    border: 2px solid #1e1300;
    border-radius: 0.375rem;
}

.ito-development-banner strong {
    font-size: 1rem;
    letter-spacing: 0.09em;
}

@media print {
    .ito-development-banner { display: none !important; }
}

.navbar-brand-image {
    height: 2rem;
}

/*
 * Mobile Kopfzeile (Nutzerauftrag): Burger-Menü links auf Höhe des Logos statt
 * hinter dem Profilavatar, Logo mittig zwischen Burger und Avatar. Echtes
 * CSS-Grid statt Flex-Reihenfolge, damit das Logo unabhängig von den
 * (unterschiedlich breiten) Burger-/Avatar-Elementen sauber zentriert bleibt.
 * Nur unterhalb von navbar-expand-lg (992px) aktiv - darüber ist der Burger
 * ohnehin ausgeblendet und das bestehende Desktop-Layout bleibt unverändert.
 */
@media (max-width: 991.98px) {
    /*
     * Bewusst "header.navbar" statt nur ".navbar": Der eingeklappte
     * Menü-Container hat selbst die Klasse "navbar" (verschachtelt in
     * .navbar-collapse) - ein reiner .navbar-Selektor würde dessen
     * .container-xl/.navbar-nav sonst versehentlich mittreffen.
     */
    header.navbar > .container-xl {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        column-gap: 0.5rem;
    }

    header.navbar > .container-xl > .navbar-toggler {
        grid-area: 1 / 1;
    }

    header.navbar > .container-xl > .navbar-brand {
        grid-area: 1 / 2;
        justify-self: center;
        margin: 0;
    }

    header.navbar > .container-xl > .navbar-nav {
        grid-area: 1 / 3;
        justify-self: end;
    }

    header.navbar > .container-xl > .navbar-collapse {
        grid-area: 2 / 1 / 3 / 4;
    }
}

.ito-auth-logo {
    width: auto !important;
    height: 3rem !important;
    max-width: min(100%, 18rem);
}

.ito-brand-dark {
    color: #080808;
}

/*
 * Einheitliches Formularsystem: dieselbe ruhige Kartenhierarchie wie in den
 * Belegansichten, aber mit klaren Eingabegruppen und einer festen Aktionszone.
 */
.ito-form-page {
    max-width: 1180px;
    margin-inline: auto;
}

.ito-form-page--narrow {
    max-width: 820px;
}

.ito-form-section {
    border: 1px solid rgba(98, 105, 118, 0.16);
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.5rem rgba(24, 36, 51, 0.04);
    overflow: hidden;
}

.ito-form-section > .card-header {
    min-height: auto;
    padding: 1rem 1.25rem;
    background: rgba(var(--tblr-primary-rgb), 0.045);
    border-bottom-color: rgba(98, 105, 118, 0.13);
}

.ito-form-section > .card-header .card-title {
    font-size: 1rem;
    font-weight: 700;
}

.ito-form-section-description {
    margin-top: 0.2rem;
    color: var(--tblr-secondary);
    font-size: 0.8125rem;
}

.ito-form-section > .card-body {
    padding: 1.25rem;
}

.ito-signature-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    padding: .5rem;
    border: 1px solid var(--tblr-border-color, #d9dce1);
    border-bottom: 0;
    border-radius: var(--tblr-border-radius, .25rem) var(--tblr-border-radius, .25rem) 0 0;
    background: var(--tblr-bg-surface-secondary, #f6f8fb);
}

.ito-signature-editor {
    min-height: 12rem;
    padding: .75rem;
    overflow: auto;
    border: 1px solid var(--tblr-border-color, #d9dce1);
    border-radius: 0 0 var(--tblr-border-radius, .25rem) var(--tblr-border-radius, .25rem);
    background: #fff;
}

.ito-signature-editor:focus { outline: 2px solid rgba(32, 107, 196, .25); outline-offset: -1px; }
.ito-signature-editor img { max-width: 100%; height: auto; }

.ito-form-page .form-label {
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--tblr-body-color);
}

.ito-form-page .form-control,
.ito-form-page .form-select {
    min-height: 2.65rem;
    border-color: rgba(98, 105, 118, 0.28);
    border-radius: 0.5rem;
}

.ito-form-page textarea.form-control {
    min-height: 6.5rem;
    resize: vertical;
}

.ito-form-page .form-control:focus,
.ito-form-page .form-select:focus {
    border-color: rgba(var(--tblr-primary-rgb), 0.75);
    box-shadow: 0 0 0 0.2rem rgba(var(--tblr-primary-rgb), 0.12);
}

.ito-form-page .form-check {
    padding-block: 0.35rem;
}

.ito-form-page .form-text {
    margin-top: 0.35rem;
}

.ito-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(98, 105, 118, 0.18);
    border-radius: 0.75rem;
    box-shadow: 0 -0.25rem 1rem rgba(24, 36, 51, 0.06);
    backdrop-filter: blur(8px);
}

.ito-form-actions-buttons {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    margin-left: auto;
}

.ito-form-note {
    padding: 1rem 1.125rem;
    background: rgba(var(--tblr-primary-rgb), 0.055);
    border-left: 3px solid var(--tblr-primary);
    border-radius: 0.5rem;
    color: var(--tblr-secondary);
}

.ito-form-subsection {
    padding: 1rem;
    background: var(--tblr-bg-surface-secondary);
    border: 1px solid rgba(98, 105, 118, 0.12);
    border-radius: 0.6rem;
}

.ito-form-subsection-title {
    margin-bottom: 0.9rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--tblr-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/*
 * Fortschrittsanzeige des Registrierungs-Setup-Assistenten (Nutzerauftrag
 * 2026-07-23) - nutzt dieselbe Primärfarbe wie der Rest des Formularsystems
 * (--tblr-primary), keine eigene Farbpalette.
 */
.ito-wizard-steps {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.ito-wizard-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.ito-wizard-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 55%;
    width: 90%;
    height: 2px;
    background: rgba(98, 105, 118, 0.2);
    z-index: 0;
}

.ito-wizard-step.ito-wizard-step-done:not(:last-child)::after {
    background: var(--tblr-primary);
}

.ito-wizard-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-weight: 700;
    font-size: 0.875rem;
    background: rgba(var(--tblr-primary-rgb), 0.12);
    color: var(--tblr-primary);
    position: relative;
    z-index: 1;
}

.ito-wizard-step-active .ito-wizard-circle,
.ito-wizard-step-done .ito-wizard-circle {
    background: var(--tblr-primary);
    color: #fff;
}

.ito-wizard-label {
    font-size: 0.8125rem;
    opacity: 0.85;
}

.ito-wizard-step-active .ito-wizard-label {
    font-weight: 700;
    opacity: 1;
}

/*
 * Verkaufsstarke Abo-/Sperrseite (Nutzerauftrag 2026-07-24) - dieselbe
 * Primärfarbe wie der Rest des Formularsystems, keine neue Palette.
 */
.ito-billing-sales {
    max-width: 640px;
    margin: 0 auto;
}

.ito-billing-product-label {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tblr-primary);
    margin-bottom: 0.6rem;
}

.ito-billing-headline {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.ito-billing-sub {
    color: var(--tblr-secondary);
    text-align: center;
    margin-bottom: 1.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.ito-billing-values {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.ito-billing-value {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
}

.ito-billing-value-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(var(--tblr-primary-rgb), 0.12);
    color: var(--tblr-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.6rem;
}

.ito-billing-value-text {
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--tblr-secondary);
}

.ito-billing-prices {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.ito-billing-price-card {
    flex: 1;
    min-width: 200px;
    border: 1px solid rgba(98, 105, 118, 0.2);
    border-radius: 0.6rem;
    padding: 1.25rem 1rem;
    text-align: center;
    position: relative;
}

.ito-billing-price-card-featured {
    border-color: var(--tblr-primary);
    box-shadow: 0 0 0 3px rgba(var(--tblr-primary-rgb), 0.12);
}

.ito-billing-price-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--tblr-primary);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
}

.ito-billing-price-amount {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0.4rem 0 0.1rem;
}

.ito-billing-price-period {
    font-size: 0.75rem;
    color: var(--tblr-secondary);
    margin-bottom: 0.9rem;
}

.ito-billing-legal {
    font-size: 0.75rem;
    color: var(--tblr-secondary);
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(98, 105, 118, 0.2);
    margin-bottom: 0;
}

.ito-billing-plain-notice {
    max-width: 560px;
    margin: 0 auto;
    text-align: left;
}

.ito-billing-plain-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.9rem;
}

.ito-ocr-dropzone {
    border: 2px dashed var(--tblr-border-color);
    border-radius: 0.75rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: color-mix(in srgb, var(--tblr-primary) 3%, transparent);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.ito-ocr-dropzone:hover,
.ito-ocr-dropzone:focus-visible,
.ito-ocr-dropzone.is-dragover {
    border-color: var(--tblr-primary);
    background: color-mix(in srgb, var(--tblr-primary) 9%, transparent);
    outline: none;
}

.ito-ocr-dropzone.is-dragover {
    transform: scale(1.01);
}

.ito-ocr-dropzone-icon {
    font-size: 2rem;
    line-height: 1;
    color: var(--tblr-primary);
    margin-bottom: 0.75rem;
}

.ito-ocr-dropzone-file {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: var(--tblr-bg-surface-secondary);
    font-weight: 600;
}

.ito-ocr-dropzone--compact {
    padding: 1rem 0.75rem;
    border-width: 1px;
    border-radius: 0.6rem;
}

.ito-ocr-integrated-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 42%);
    gap: 1.25rem;
    align-items: center;
}

.ito-ocr-dropzone--compact .ito-ocr-dropzone-icon {
    margin-bottom: 0.4rem;
    font-size: 1.35rem;
}

.ito-ocr-job:last-child {
    border-bottom: 0;
}

.ito-ocr-document-card {
    overflow: hidden;
}

/*
 * Wiederverwendbarer Rahmen für eingebettete Dokumente. Die Standardbreite
 * entspricht dem normalen Formularlayout; andere Ansichten können über einen
 * Modifier skalieren, ohne die Dokumentdarstellung selbst anzupassen.
 */
.ito-document-container {
    width: 100%;
    max-width: var(--ito-document-container-max-width, 1180px);
    margin-inline: auto;
}

.ito-document-container--narrow {
    --ito-document-container-max-width: 820px;
}

.ito-document-container--wide {
    --ito-document-container-max-width: 1440px;
}

.ito-document-container--full {
    max-width: none;
}

.ito-document-content {
    display: block;
    width: 100%;
    max-width: 100%;
}

.ito-ocr-document-preview {
    height: max(80vh, 900px);
    border: 0;
    background: #fff;
}

.ito-ocr-document-image {
    height: auto;
    object-fit: contain;
}

/*
 * PDF.js-Vorschau: rendert die Seiten selbst als <canvas> und benötigt daher
 * ein scrollbares Element mit fester Höhe (statt der Innen-Bildlaufleiste
 * eines <iframe>). Der Ladezustand/Fallback teilt sich denselben Rahmen.
 */
.ito-pdf-preview {
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--tblr-body-bg, #f4f6fb);
}

.ito-pdf-preview-status {
    margin: 0;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--tblr-secondary, #6c7793);
}

.ito-pdf-preview-status[hidden] {
    display: none;
}

.ito-pdf-preview-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

.ito-pdf-preview-page {
    max-width: 100%;
    height: auto;
    box-shadow: 0 0 0 1px rgba(98, 105, 118, 0.18);
    background: #fff;
}

.ito-pdf-preview--fallback {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ito-pdf-preview-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
}

.ito-action-icon {
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 auto;
}

.btn.btn-icon .ito-action-icon {
    margin: 0;
}

.ito-maps-link {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 0.35rem;
}

.ito-maps-link .ito-action-icon {
    width: 1rem;
    height: 1rem;
}

.ito-permission-hint {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 0.25rem;
    color: var(--tblr-secondary-color, #6c7a91);
    cursor: help;
}

.ito-permission-hint .ito-action-icon {
    width: 0.9rem;
    height: 0.9rem;
}

.btn.btn-icon {
    width: 2.25rem;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    aspect-ratio: 1;
}

.btn.btn-sm.btn-icon {
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
}

.ito-table-actions {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-wrap: nowrap;
}

.ito-form-tabs {
    gap: 0.3rem;
    padding: 0.75rem;
    background: var(--tblr-bg-surface-secondary);
    border-radius: 0.65rem;
}

.ito-form-tabs .nav-link {
    border-radius: 0.45rem;
    color: var(--tblr-secondary);
    font-weight: 600;
}

.ito-form-tabs .nav-link.active {
    color: var(--tblr-primary);
    background: #fff;
    box-shadow: 0 0.125rem 0.4rem rgba(24, 36, 51, 0.08);
}

.ito-position-card {
    border: 1px solid rgba(98, 105, 118, 0.16);
    border-left: 3px solid rgba(var(--tblr-primary-rgb), 0.65);
    border-radius: 0.65rem;
    box-shadow: none;
}

.ito-position-total {
    min-height: 100%;
    padding: 0.75rem;
    background: var(--tblr-bg-surface-secondary);
    border-radius: 0.5rem;
}

.ito-document-totals {
    width: min(100%, 390px);
    margin-left: auto;
    padding: 1rem 1.125rem;
    background: var(--tblr-bg-surface-secondary);
    border-radius: 0.65rem;
}

.ito-document-totals > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.ito-document-totals .ito-document-total {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(98, 105, 118, 0.18);
    font-size: 1.1rem;
    font-weight: 700;
}

.ito-collection-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--tblr-bg-surface-secondary);
    border: 1px solid rgba(98, 105, 118, 0.13);
    border-radius: 0.6rem;
}

.ito-filter-card {
    border: 1px solid rgba(98, 105, 118, 0.14);
    border-radius: 0.65rem;
    box-shadow: 0 0.125rem 0.4rem rgba(24, 36, 51, 0.035);
}

.ito-filter-card > .card-body {
    padding: 1rem 1.125rem;
}

.ito-filter-card .form-label,
.ito-form-subsection .form-label {
    font-weight: 600;
}

.ito-form-subsection .form-control,
.ito-form-subsection .form-select {
    border-color: rgba(98, 105, 118, 0.28);
    border-radius: 0.5rem;
}

.ito-product-search-results {
    position: fixed;
    z-index: 9999;
    max-height: 16rem;
    overflow-y: auto;
    background: var(--tblr-bg-surface, #fff);
    box-shadow: 0 0.35rem 0.8rem rgba(24, 36, 51, 0.2);
}

.ito-product-search-results .list-group-item {
    background: var(--tblr-bg-surface, #fff);
}

.ito-product-search {
    position: relative;
}

/* Das Overlay bleibt innerhalb der Formularsektion sichtbar und die aktive
   Positionskarte wird über die anderen Karten gehoben. Die Klassen setzt der
   Produkt-Suchcontroller nur, solange Treffer angezeigt werden. */
.ito-form-section.ito-product-search-active {
    overflow: visible;
}

.ito-position-card.ito-product-search-open {
    position: relative;
    z-index: 10;
}

/* Detailseiten: Der Status gehört als zweite Zeile direkt zum Titel. */
.ito-document-page-title {
    display: block;
}

.ito-document-status {
    display: inline-block;
    margin-top: 0.4rem;
}

/* Dokument- und Kundenansichten nutzen bewusst drei getrennte Ebenen im
   Seitenkopf: Titel, Status und Aktionen. Das gilt auch oberhalb des
   mobilen Breakpoints, damit Status niemals neben die Buttonleiste rutscht. */
.page-header .row:has(.ito-document-view-actions) .ito-page-title-column,
.page-header .row:has(.ito-document-view-actions) .ito-page-actions-column {
    flex: 0 0 100%;
    width: 100%;
}

.page-header .ito-page-actions-column:has(.ito-document-view-actions) {
    margin-top: 0.75rem;
    margin-left: 0 !important;
}

.ito-document-view-actions {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ito-document-view-actions form {
    display: flex;
}

.ito-document-view-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/*
 * Kalenderübersicht (FullCalendar, siehe assets/controllers/calendar_controller.js).
 * FullCalendars Standard-Toolbar ist eine einzeilige Flexbox ohne
 * flex-wrap - auf schmalen Bildschirmen wird die Ansichts-Umschaltergruppe
 * dadurch abgeschnitten statt umzubrechen. flex-wrap sorgt dafür, dass die
 * drei Toolbar-Abschnitte (Navigation/Titel/Ansichten) bei Bedarf auf
 * mehrere Zeilen umbrechen, statt über den Container hinauszulaufen.
 */
.fc .fc-toolbar.fc-header-toolbar {
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

.fc .fc-toolbar-chunk {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-width: 100%;
}

/*
 * Kalenderkopf (Navigation, Titel, Ansichts-Umschalter) in unserem CI statt
 * FullCalendars dunklem Standard-Knopfstil (Nutzerauftrag) - angelehnt an
 * Tablers eigene Button-Optik (outline, wird bei Hover/aktiver Ansicht zur
 * gefüllten Tabler-Primärfarbe).
 */
.fc .fc-toolbar-title {
    color: var(--tblr-body-color);
    font-weight: 600;
}

.fc .fc-button.fc-button-primary {
    background-color: #fff;
    border-color: var(--tblr-border-color);
    color: var(--tblr-body-color);
    box-shadow: none;
    text-transform: none;
    font-weight: 500;
    transition: background-color .15s ease-in-out, border-color .15s ease-in-out, color .15s ease-in-out;
}

.fc .fc-button.fc-button-primary:hover:not(:disabled) {
    background-color: rgba(var(--tblr-primary-rgb), 0.06);
    border-color: var(--tblr-primary);
    color: var(--tblr-primary);
}

.fc .fc-button.fc-button-primary:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(var(--tblr-primary-rgb), 0.25);
}

.fc .fc-button.fc-button-primary:disabled {
    background-color: #fff;
    border-color: var(--tblr-border-color);
    opacity: 0.45;
}

/* Aktuell gewählte Ansicht (Monat/Woche/Tag/Liste) sowie gedrückter Zustand. */
.fc .fc-button.fc-button-primary.fc-button-active,
.fc .fc-button.fc-button-primary:not(:disabled):active {
    background-color: var(--tblr-primary);
    border-color: var(--tblr-primary);
    color: #fff;
}

/*
 * Leere Tage sollen komplett als Klickzone für "Neuer Termin an diesem Tag"
 * dienen, nicht nur die Datumszahl - eine spürbare Mindesthöhe plus
 * Hover-/Cursor-Feedback macht das ganze Tagesfeld erkennbar klickbar.
 */
.fc .fc-daygrid-day-frame {
    min-height: 4rem;
    cursor: pointer;
}

.fc .fc-daygrid-day-frame:hover {
    background-color: rgba(98, 105, 118, 0.06);
}

/*
 * Termin-Chips im Stil der Google-Kalender-App (Nutzerauftrag), an unser CI
 * angepasst (Tabler-Primärfarbe statt Googles Kategorienfarben, weiterhin
 * Light Mode): vollflächige, abgerundete Balken statt des schrumpfenden
 * "Punkt"-Standardstils. Die Uhrzeit bleibt darin IMMER lesbar
 * (flex-shrink: 0, kein Umbruch) - das war ausdrücklicher Nutzerauftrag,
 * anders als im Google-Vorbild, das in der Monatsansicht gar keine Uhrzeit
 * zeigt. Der Titel darf dafür mit "…" abgeschnitten werden (min-width: 0
 * lässt den Titel-Container unter seine Inhaltsbreite schrumpfen, erst
 * dadurch greift text-overflow: ellipsis statt der Titel die Uhrzeit aus
 * der Zeile zu drängen).
 */
.fc .fc-daygrid-event {
    border-radius: 4px;
    background-color: var(--tblr-primary);
    border-color: var(--tblr-primary);
    padding: 1px 6px;
}

.fc .fc-daygrid-event .fc-event-time,
.fc .fc-daygrid-event .fc-event-title {
    color: #fff;
}

/*
 * Termine anderer Mitarbeiter (Nutzerauftrag): nur relevant, wenn ein
 * Administrator "Alle Mitarbeiter" oder einen anderen Mitarbeiter
 * ausgewählt hat (siehe CalendarController::events() `classNames`) -
 * müssen sich dezent von den eigenen Terminen abgrenzen, die weiterhin die
 * volltonfarbene Standarddarstellung behalten. Derselbe schwach gefüllte
 * Umriss-Stil wie der "+x"-Link, damit "das ist nicht meins" auf einen
 * Blick erkennbar ist, ohne unleserlich zu werden.
 */
.fc .fc-daygrid-event.ito-event-other-user {
    background-color: rgba(98, 105, 118, 0.08);
    border-color: rgba(98, 105, 118, 0.22);
}

.fc .fc-daygrid-event.ito-event-other-user .fc-event-time,
.fc .fc-daygrid-event.ito-event-other-user .fc-event-title {
    color: var(--tblr-secondary);
    font-weight: 500;
}

.fc .fc-event-main-frame {
    flex-wrap: nowrap;
    gap: 0.3rem;
}

.fc .fc-event-time {
    flex-shrink: 0;
    overflow: visible;
    white-space: nowrap;
    font-weight: 600;
}

.fc .fc-event-title-container {
    min-width: 0;
}

.fc .fc-event-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/*
 * "+x"-Link (moreLinkContent im Calendar-Controller) für Tage mit mehr
 * Terminen, als in die Zelle passen - wechselt per Klick zur Tagesansicht
 * (moreLinkClick: 'day'), zeigt also absichtlich keine Popover-Liste.
 * Gleiche Breite/Form wie ein Termin-Chip (Nutzerauftrag: "optisch genauso
 * breit wie ein Termin"), aber als schwach gefüllter Umriss statt
 * Volltonfarbe klar von einem echten Termin unterscheidbar.
 */
.fc .fc-daygrid-more-link {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    margin-top: 2px;
    padding: 1px 6px;
    border-radius: 4px;
    background-color: rgba(var(--tblr-primary-rgb), 0.12);
    border: 1px solid rgba(var(--tblr-primary-rgb), 0.35);
    color: var(--tblr-primary);
    font-weight: 700;
}

@media (max-width: 767.98px) {
    .fc .fc-toolbar-title {
        font-size: 1.1rem;
    }

    .fc .fc-toolbar .fc-button {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .fc .fc-daygrid-day-frame {
        min-height: 2.75rem;
    }

    .fc .fc-daygrid-event .fc-event-time,
    .fc .fc-daygrid-event .fc-event-title {
        font-size: 0.65rem;
    }

    .fc .fc-daygrid-event {
        padding: 1px 4px;
    }

    .fc .fc-daygrid-day-number {
        font-size: 0.75rem;
        padding: 0.15rem;
    }

    .fc .fc-daygrid-more-link {
        font-size: 0.65rem;
        padding: 1px 4px;
    }
}

@media (max-width: 767.98px) {
    .page-body > .container-xl,
    .page-header > .container-xl,
    .footer > .container-xl {
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }

    .page-body {
        padding-bottom: 1.5rem;
    }

    .page-header .row {
        align-items: stretch;
    }

    .page-header .ito-page-title-column,
    .page-header .ito-page-actions-column {
        flex: 0 0 100%;
        width: 100%;
    }

    .page-header .col-auto.ms-auto {
        margin-top: 0.75rem;
        margin-left: 0 !important;
    }

    .page-header .col-auto.ms-auto > * {
        margin-right: 0.35rem;
        margin-bottom: 0.35rem;
    }

    /* Übersichtsseiten haben nur eine primäre Anlage-Aktion. Diese darf
       platzsparend rechts neben dem Titel stehen; umfangreiche Aktionsleisten
       bleiben dagegen bewusst in ihrer eigenen Zeile. */
    .page-header .row:has(.ito-page-actions-column > .btn:only-child) .ito-page-title-column {
        flex: 1 1 0;
        width: auto;
    }

    .page-header .ito-page-actions-column:has(> .btn:only-child) {
        flex: 0 0 auto;
        width: auto;
        margin-top: 0;
        margin-left: auto !important;
    }

    .ito-document-page-title {
        display: block;
    }

    .ito-document-status {
        display: inline-block;
        margin-top: 0.4rem;
    }

    .page-header .ito-page-actions-column:has(.ito-document-view-actions) {
        margin-top: 0.75rem;
    }

    .ito-document-view-actions {
        display: flex;
        align-items: stretch;
        justify-content: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .ito-document-view-actions form {
        display: flex;
    }

    .ito-document-view-actions .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn.btn-icon,
    .ito-table-actions .btn {
        width: 2.75rem;
        min-width: 2.75rem;
        height: 2.75rem;
    }

    .page-body .card {
        border-color: rgba(98, 105, 118, 0.23);
        box-shadow: 0 0.2rem 0.65rem rgba(24, 36, 51, 0.08);
    }

    /* Listen haben je Datensatz eine eigene Karte. Der bisherige
       Tabellen-Container bleibt für die Struktur bestehen, wird mobil aber
       nicht zusätzlich als sichtbare Karte gerendert. */
    .page-body .card:has(> .table-responsive > .ito-mobile-card-table) {
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .page-body .card:has(> .table-responsive > .ito-mobile-card-table) > .table-responsive {
        overflow: visible;
    }

    .ito-mobile-card-table {
        display: block;
        border: 0;
    }

    .ito-mobile-card-table thead {
        display: none;
    }

    .ito-mobile-card-table tbody,
    .ito-mobile-card-table tr,
    .ito-mobile-card-table td {
        display: block;
        width: 100%;
    }

    .ito-mobile-card-table tbody tr {
        margin: 0.875rem 0 1.125rem;
        padding: 0.35rem 0.875rem 0.5rem;
        border: 1px solid rgba(98, 105, 118, 0.28);
        border-radius: 0.7rem;
        background: var(--tblr-bg-surface, #fff);
        box-shadow: 0 0.3rem 0.8rem rgba(24, 36, 51, 0.1);
    }

    .ito-mobile-card-table tbody td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.45rem 0;
        border: 0;
        text-align: right !important;
    }

    .ito-mobile-card-table tbody td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        color: var(--tblr-secondary);
        font-weight: 600;
        text-align: left;
    }

    .ito-mobile-card-table tbody td[data-empty-row="true"] {
        display: block;
        text-align: center !important;
    }

    .ito-mobile-card-table tbody td[data-empty-row="true"]::before {
        display: none;
    }

    .ito-mobile-card-table tbody td.ito-mobile-card-title {
        display: block;
        padding: 0.65rem 0 0.8rem;
        border-bottom: 1px solid rgba(98, 105, 118, 0.18);
        color: var(--tblr-primary);
        font-size: 1.1rem;
        font-weight: 700;
        text-align: center !important;
    }

    .ito-mobile-card-table tbody td.ito-mobile-card-title::before {
        display: none;
    }

    .ito-mobile-card-table tbody td[data-actions="true"] {
        display: block;
        margin-top: 0.35rem;
        padding-top: 0.85rem;
        border-top: 1px solid rgba(98, 105, 118, 0.18);
        text-align: center !important;
    }

    .ito-mobile-card-table tbody td[data-actions="true"]::before {
        display: none;
    }

    .ito-mobile-card-table tbody td[data-actions="true"] .ito-table-actions {
        justify-content: center;
        gap: 0.65rem;
    }

    .ito-ocr-document-preview {
        height: 75vh;
        min-height: 620px;
    }

    .ito-ocr-integrated-body {
        grid-template-columns: 1fr;
    }

    .ito-form-actions {
        position: static;
        align-items: stretch;
        flex-direction: column;
    }

    .ito-form-actions-buttons {
        width: 100%;
        margin-left: 0;
    }

    .ito-form-actions-buttons .btn {
        flex: 1;
    }
}

/*
 * App-Shell-Version im Footer: nur relevant, wenn die Seite installiert
 * (PWA/Android-TWA) läuft - für normale Browser-Besucher ausgeblendet.
 */
.ito-pwa-shell-version {
    display: none;
}

@media (display-mode: standalone) {
    .ito-pwa-shell-version {
        display: inline;
    }
}
