/*
 * 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;
}

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

.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-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;
}

.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;
}

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

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

.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;
}

@media (max-width: 767.98px) {
    .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;
    }
}
