/* ============================================================================
   FiBu-Konto-Auswahl (Searchable Dropdown) in den Rechnungs-Editor-Zeilen.
   - Erkennbar als FiBu-Feld durch Buch-Icon + Mini-Label
   - Dezenter Rahmen, damit Stamm-Default und User-Override visuell auffallen
   - Wird KOMPAKT innerhalb der bestehenden Preis-/MwSt-Zelle gerendert,
     damit das Invoice-Grid nicht breiter wird.
   ========================================================================== */

.fibu-account-field {
    display: block;
    /* WICHTIG: keine min-width, sonst wird die Editor-Zeile breiter.
       Wir leben innerhalb von .invoiceCol.col-1 (MwSt / Preis). */
    min-width: 0;
    margin-top: 4px;
    /* etwas Abstand nach oben, damit es nicht direkt an MwSt klebt */
}

.fibu-account-label {
    font-size: 9px;
    line-height: 11px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 1px 0;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.fibu-account-icon {
    font-size: 11px;
    line-height: 11px;
    color: #6c757d;
}

/* Select2-Wrapper an unsere Container-Breite anpassen */
.fibu-account-field .select2-container {
    width: 100% !important;
    max-width: 100%;
}

/* Selektierte Kontonummer leicht hervorheben (Monospace + Pill-Look) */
.fibu-account-field .select2-selection--single {
    border: 1px solid #ced4da;
    border-radius: 3px;
    min-height: 22px;
    height: 22px;
    background-color: #fbfbfd;
}

.fibu-account-field .select2-selection--single .select2-selection__rendered {
    font-family: "Consolas", "Menlo", "Monaco", monospace;
    font-size: 11px;
    line-height: 20px;
    padding-left: 6px;
    padding-right: 18px;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fibu-account-field .select2-selection--single .select2-selection__arrow {
    height: 20px;
}

/* Fallback, solange Select2 noch NICHT initialisiert ist (rohes <select>): */
.fibu-account-field > select.fibu-account-select {
    width: 100%;
    max-width: 100%;
    height: 22px;
    line-height: 20px;
    font-family: "Consolas", "Menlo", "Monaco", monospace;
    font-size: 11px;
    padding: 0 4px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    background-color: #fbfbfd;
    color: #212529;
}

/* "Default geladen" – wenn der Wert exakt dem data-default entspricht,
   markiert das JS in FastInvoiceForm.cshtml den Container mit .is-default. */
.fibu-account-field.is-default .select2-selection--single,
.fibu-account-field.is-default > select.fibu-account-select {
    background-color: #f6f8fb;
    border-style: dashed;
    color: #6c757d;
}

/* "User-Override" – Wert weicht vom Default ab. */
.fibu-account-field.is-override .select2-selection--single,
.fibu-account-field.is-override > select.fibu-account-select {
    background-color: #fff8e1;
    border-color: #f5b342;
}

.fibu-account-field.is-override .fibu-account-label {
    color: #b07a16;
}

/* Hidden-Variante (Provider nicht aktiv) – nichts anzeigen. */
.fibu-account-field input[type="hidden"] + .fibu-account-label {
    display: none;
}

