/* FMS Inventar - Custom Styles */

/* =========================================================
 *  FELD-LADEN ANIMATION (entfernt - Felder werden sofort angezeigt)
 * ======================================================= */
/* HINWEIS: Felder werden jetzt sofort angezeigt, da die Werte bereits beim Rendern geladen werden.
 * AJAX wird nur als Fallback verwendet, wenn Felder leer sind oder object_id nicht übereinstimmt. */

/* =========================================================
 *  GRUNDLAYOUT
 * ======================================================= */
.fms-object-form,
.fms-options-form,
.fms-inventory-wrapper {
    max-width: 100%;
    margin: 0 auto;
}

/* =========================================================
 *  FORMULAR-FELDER
 * ======================================================= */
.fms-object-form {
    max-width: 1100px;
}

.fms-field {
    margin-bottom: 12px;
    width: 100% !important;
    display: block;
}

.fms-placeholder-empty {
    display: block;
    min-height: 1.5rem;
}

/* WICHTIG: Stelle sicher, dass fms-field-wrapper die Elementor Tab-Struktur nicht beeinträchtigt */
.fms-field-wrapper {
    display: block;
    width: 100%;
    /* Keine display: flex oder andere Layout-Eigenschaften, die Elementor Tabs beeinträchtigen könnten */
    /* WICHTIG: Keine !important-Regeln, die Elementor's Tab-Layout überschreiben könnten */
}

/*
label {
    display: block;
    width: 100%;
}
*/

.fms-field-label {
    display: inline-block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 15px;
    width: 100%;
}

.fms-field input[type="text"],
.fms-field input[type="number"],
.fms-field input[type="date"],
.fms-field textarea,
.fms-field select {
    width: 100%;
    max-width: 100%;
    padding: 2px 10px;
    border: 1px solid #c8ccd0;
    border-radius: 5px;
    font-size: 15px;
    box-sizing: border-box;
}

.fms-subcategory-format-hint {
    color: #ddd !important;
    font-size: 11px !important;
    font-weight: 300 !important;
    line-height: 1.2em !important;
    display: block;
    margin-top: 0px;
}

.fms-subcategory-category-hint {
    color: #ddd !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 1.2em !important;
    display: block;
    margin-top: 2px;
}


.fms-field textarea {
    min-height: 120px;
    resize: vertical;
    font-size: 14px;
    line-height: 1.3em;
}


.fms-field-Inventarnummer input {
    width: 250px !important;
}

.fms-field input[type="checkbox"] {
    width: auto;
    margin-right: 0.5em;
}

/* Bild-Upload */
.fms-image-upload {
    display: block;
    margin-top: 0.5em;
    padding: 0.5em;
    border: 2px dashed #ccc;
    border-radius: 4px;
    background: #f9f9f9;
    cursor: pointer;
}

.fms-image-upload:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.fms-image-hint {
    display: block;
    margin-top: 0.25em;
    color: #666;
    font-size: 0.9em;
}

/* Bild-Preview: Einheitliche Styles für alle Bild-Previews */
.fms-image-preview,
.fms-image-field .fms-image-preview,
.fms-image-upload-wrap .fms-image-preview {
    margin-top: 1em;
}

.fms-image-preview img,
.fms-image-field .fms-image-preview img,
.fms-image-upload-wrap .fms-image-preview img {
    max-width: 150px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Bildanzeige (reiner Anzeige-Shortcode) */
.fms-object-image-view img,
.fms-object-image-view__img {
    max-width: 300px !important;
    max-height: 300px !important;
    width: auto;
    height: auto;
}
.fms-object-image-view  {
    font-size: 15px;
}

.fms-object-image-delete {
    margin-top: 5px;
}

.fms-no-image {
    font-size: 15px;
}

.fms-image-field .fms-image-wrapper {
    margin-top: 0.5em;
}

/* Bild-Buttons: Einheitliche Styles für alle Bild-Upload-Buttons */
.fms-image-upload-field .fms-btn-select-image,
.fms-image-upload-field .fms-btn-change-image,
.fms-image-upload-field .fms-btn-remove-image,
.fms-image-field .fms-btn-select-image,
.fms-image-field .fms-btn-remove-image,
.fms-image-upload-wrap .fms-btn-select-image,
.fms-image-upload-wrap .fms-btn-remove-image {
    padding: 2px 10px !important;
    font-size: 15px !important;
    border: none !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
    text-decoration: none !important;
    display: inline-block !important;
    background: #384b61 !important;
    color: #fff !important;
    margin: 0 5px 0 0 !important;
    font-weight: normal !important;
    line-height: 1.5 !important;
}

.fms-image-upload-field .fms-btn-select-image:hover,
.fms-image-upload-field .fms-btn-change-image:hover,
.fms-image-upload-field .fms-btn-remove-image:hover,
.fms-image-field .fms-btn-select-image:hover,
.fms-image-field .fms-btn-remove-image:hover,
.fms-image-upload-wrap .fms-btn-select-image:hover,
.fms-image-upload-wrap .fms-btn-remove-image:hover,
.fms-image-upload-field .fms-btn-select-image:active,
.fms-image-upload-field .fms-btn-change-image:active,
.fms-image-upload-field .fms-btn-remove-image:active,
.fms-image-field .fms-btn-select-image:active,
.fms-image-field .fms-btn-remove-image:active,
.fms-image-upload-wrap .fms-btn-select-image:active,
.fms-image-upload-wrap .fms-btn-remove-image:active {
    background: #9db1c6 !important;
}

/* Frontend-Upload-Felder (fms_object_image_upload, fms_object_image_camera) */
.fms-image-upload-wrap {
    margin-bottom: 1em;
}

.fms-image-upload-wrap .fms-field-label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 500;
}

.fms-image-upload-wrap .fms-image-upload-container {
    margin-top: 0.5em;
}

.fms-image-upload-wrap .fms-image-file-input {
    display: none; /* Versteckt, wird über Button getriggert */
}

.fms-image-upload-wrap .fms-btn-select-image:disabled {
    background: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
}

.fms-image-upload-wrap .fms-upload-status,
.fms-object-image-view__status {
    margin-top: 5px;
    color: #d9822b;
    font-size: 15px;
    font-weight: 500;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.fms-image-upload-wrap .fms-upload-error {
    margin-top: 5px;
    color: #cc0000;
    font-size: 15px;
    font-weight: 500;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}



textarea[name="fms_options[Kategorie]"] {
    height: 248px;
}


/* Buttons */
.fms-object-buttons,
.fms-options-buttons {
    display: flex !important;
    gap: 1em;
    flex-wrap: wrap;
    visibility: visible !important;
    opacity: 1 !important;
}

.fms-options-buttons {
    margin-top: 0em;
}


.fms-abmelden {
    padding: 5px 10px;
    font-size: 14px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    background: #384b61;
    color: #fff !important;
    margin: 0;
}

.fms-abmelden:hover {
    background: #9db1c6;
    color: #fff !important;
}

/* Einheitliches Button-Design für ALLE Buttons */
.fms-btn,
.fms-object-buttons button,
.fms-options-buttons button,
.fms-btn-save,
.fms-btn-save-new,
.fms-btn-nav,
.fms-nav-prev,
.fms-nav-next,
.fms-btn-delete,
.fms-btn-template,
.fms-btn-search,
.fms-btn-export,
.fms-btn-options-save,
.fms-inventory-search-button,
.fms-inventory-export-button,
.fms-btn-table-controls-search,
.fms-btn-table-controls-export,
.fms-csv-export-btn,
.fms-btn.fms-btn-search.fms-inventory-search-button,
.fms-btn-select-image,
.fms-btn-remove-image,
.fms-btn-edit,
a.fms-btn,
a.fms-btn-nav,
.fms-bulk-delete-button,
.fms-btn-filter,
a.fms-btn-filter,
.fms-assign-images-btn,
button.fms-assign-images-btn,
.fms-object-search button,
.fms-btn-pagination {
    padding: 2px 10px;
    font-size: 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
    background: #384b61;
    color: #fff !important;
    margin: 0;
}

/* Button-Parität: [fms_list_switch] ("Liste" / "Bildbrowser") und
 * [fms_inventory_incomplete] sollen visuell IDENTISCH sein, obwohl das eine
 * <button>- und das andere <a>-Elemente sind. Beide Button-Klassen erzwingen
 * deshalb gemeinsam:
 *   - dieselbe Schriftgrösse (12pt)
 *   - dieselbe Zeilenhöhe (line-height: normal) – verhindert, dass Anchor-
 *     Elemente wegen geerbter Theme-line-height höher wirken als <button>
 *   - dieselbe vertikale Ausrichtung, dasselbe Box-Model, dasselbe Font-Family-
 *     Inheritance
 * Restliche Optik (Padding, Border, Farben, Hover/Active) stammt weiterhin
 * aus der bestehenden .fms-btn-Basisregel und wird nicht verändert. */
.fms-list-switch-btn,
.fms-inventory-incomplete-btn,
a.fms-list-switch-btn,
a.fms-inventory-incomplete-btn,
button.fms-list-switch-btn,
button.fms-inventory-incomplete-btn {
    font-size: 12pt;
    line-height: normal;
    vertical-align: middle;
    font-family: inherit;
    box-sizing: border-box;
    opacity: 0.75;
}

/* Rotationsbuttons im Image-View: quadratisch, zentriert */
.fms-btn-rotate-image {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    padding: 0 !important;
    font-size: 22px !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    text-align: center !important;
}


/* Zusätzliche Styles für Buttons in Button-Containern */
.fms-object-buttons button,
.fms-options-buttons button {
    margin-right: 10px;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Hover- und Active-Effekt für alle Buttons (identisch) */
.fms-btn:hover,
.fms-object-buttons button:hover,
.fms-options-buttons button:hover,
.fms-btn-save:hover,
.fms-btn-save-new:hover,
.fms-btn-nav:hover,
.fms-nav-prev:hover,
.fms-nav-next:hover,
.fms-btn-template:hover,
.fms-btn-search:hover,
.fms-btn-export:hover,
.fms-btn-options-save:hover,
.fms-inventory-search-button:hover,
.fms-inventory-export-button:hover,
.fms-btn-table-controls-search:hover,
.fms-btn-table-controls-export:hover,
.fms-csv-export-btn:hover,
.fms-btn.fms-btn-search.fms-inventory-search-button:hover,
.fms-btn-select-image:hover,
.fms-btn-remove-image:hover,
.fms-btn-edit:hover,
a.fms-btn:hover,
a.fms-btn-nav:hover,
.fms-bulk-delete-button:hover,
.fms-btn-filter:hover,
a.fms-btn-filter:hover,
.fms-assign-images-btn:hover,
button.fms-assign-images-btn:hover,
.fms-object-search button:hover,
.fms-btn-pagination:hover,
.fms-btn:active,
.fms-object-buttons button:active,
.fms-options-buttons button:active,
.fms-btn-save:active,
.fms-btn-save-new:active,
.fms-btn-nav:active,
.fms-nav-prev:active,
.fms-nav-next:active,
.fms-btn-template:active,
.fms-btn-search:active,
.fms-btn-export:active,
.fms-btn-options-save:active,
.fms-inventory-search-button:active,
.fms-inventory-export-button:active,
.fms-btn-table-controls-search:active,
.fms-btn-table-controls-export:active,
.fms-csv-export-btn:active,
.fms-btn.fms-btn-search.fms-inventory-search-button:active,
.fms-btn-select-image:active,
.fms-btn-remove-image:active,
.fms-btn-edit:active,
a.fms-btn:active,
a.fms-btn-nav:active,
.fms-bulk-delete-button:active,
.fms-btn-filter:active,
a.fms-btn-filter:active,
.fms-assign-images-btn:active,
button.fms-assign-images-btn:active,
.fms-object-search button:active,
.fms-btn-pagination:active {
    background: #9db1c6;
    color: #fff !important;
}

/* Frontend Search & Replace Trefferliste */
.fms-search-replace-table {
    font-size: 14px;
}

.fms-search-replace__analysis-title {
    font-size: 24px !important;
    font-weight: 500 !important;
    padding-top: 15px !important;
    margin-top: 10px !important;
    margin-bottom: 2px !important;
    border-top: 1px solid darkgray;
}

.fms-search-replace__summary {
    font-size: 16px;
}

td.fms-search-replace__field-control.fms-search-replace__field-control--search,
td.fms-search-replace__field-control.fms-search-replace__field-control--replace,
td.fms-bulk-category__td.fms-bulk-category__td--control {
    border: none !important;
}

th.fms-search-replace__field-group.fms-search-replace__field-group--search,
th.fms-search-replace__field-group.fms-search-replace__field-group--replace {
    text-align: right !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    vertical-align: middle;
    padding-bottom: 9px;
    color: #ddd !important;
}

th.fms-bulk-category__th.fms-bulk-category__th--label {
    text-align: right !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    vertical-align: middle;
    padding-bottom: 12px;
    color: #ddd !important;
}

th.fms-bulk-category__th.fms-bulk-category__th--label {
    width: 300px !important;
}

.fms-bulk-category__summary-label {
    color: #ddd !important;
}

/* Search & Replace - strukturierte CSS-Hooks (Layout unverändert) */
.fms-search-replace__analysis-spacer {
    height: 20px;
}
.fms-search-replace__confirm-form {
    margin-top: 15px;
}
.fms-search-replace__th--select,
.fms-search-replace__td--select {
    width: 52px;
    text-align: center;
}
.fms-search-replace__hit-checkbox {
    cursor: pointer;
}

/* Frontend: Bulk Kategorie/Unterkategorie — nur unter .fms-bulk-category--frontend; Buttons: .fms-btn (global) */
.fms-bulk-category.fms-bulk-category--frontend {
    margin: 0 0 24px;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.4;
    color: #ddd;
}

/* Bulk-Kategorie Ergebnis: Tabellentext wie Search-&-Replace-Frontend (S&R ohne eigene Farbregel → erbt Theme;
 * hier gezielt gleiche Lesefarben wie .fms-inventory-table th/td, nicht #1d2327 vom Bulk-Wrapper) */
.fms-bulk-category--frontend .fms-bulk-category__results {
    color: #d0d8e0;
}
.fms-bulk-category--frontend .fms-bulk-category__results .fms-search-replace__analysis-title {
    color: #e0e8f0;
}
.fms-bulk-category--frontend .fms-bulk-category__results .fms-search-replace__table thead th,
.fms-bulk-category--frontend .fms-bulk-category__results table.fms-search-replace-table thead th {
    color: #e0e8f0;
}
.fms-bulk-category--frontend .fms-bulk-category__results .fms-search-replace__table tbody td,
.fms-bulk-category--frontend .fms-bulk-category__results table.fms-search-replace-table tbody td {
    color: #d0d8e0;
}

.fms-bulk-category--frontend .fms-bulk-category__form {
    margin: 0;
}

.fms-bulk-category--frontend .fms-bulk-category__table--fields {
    border-collapse: collapse;
    margin-top: 8px;
    width: 100%;
    max-width: 100%;
}

.fms-bulk-category--frontend .fms-bulk-category__table--fields .fms-bulk-category__th--label {
    width: 200px;
    padding: 12px 10px 12px 0;
    vertical-align: top;
    text-align: left;
    font-weight: 400;
    color: #1d2327;
}

.fms-bulk-category--frontend .fms-bulk-category__table--fields .fms-bulk-category__td--control {
    padding: 12px 10px 12px 0;
    vertical-align: top;
}

.fms-bulk-category--frontend .fms-bulk-category__select {
    max-width: 100%;
    min-width: 200px;
    padding: 3px 8px;
    font-size: 14px;
    line-height: 2;
    color: #2c3338;
    border: 1px solid #8c8f94;
    border-radius: 3px;
    background: #fff;
    box-sizing: border-box;
}

.fms-bulk-category--frontend .fms-bulk-category__summary,
.fms-bulk-category--frontend .fms-bulk-category__summary--count,
.fms-bulk-category--frontend .fms-bulk-category__summary--zero {
    margin: 8px 0 12px;
}

.fms-bulk-category--frontend .fms-bulk-category__actions {
    margin: 12px 0 0;
}

.fms-bulk-category--frontend .fms-bulk-category__notice {
    border: 1px solid #c3c4c7;
    border-left-width: 4px;
    padding: 1px 12px;
    margin: 12px 0;
    background: #fff;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.fms-bulk-category--frontend .fms-bulk-category__notice-text {
    margin: 0.5em 0;
    padding: 2px;
    font-size: 13px;
}

.fms-bulk-category--frontend .fms-bulk-category__notice--updated {
    border-left-color: #00a32a;
}

/* Disabled-Status für alle Buttons */
.fms-btn-disabled,
.fms-btn:disabled,
.fms-btn-nav.fms-btn-disabled,
.fms-btn-nav:disabled,
.fms-btn-template.fms-btn-disabled,
.fms-btn-template:disabled,
.fms-btn-delete.fms-btn-disabled,
.fms-btn-delete:disabled {
    background: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
}

.fms-btn-disabled:hover,
.fms-btn:disabled:hover,
.fms-btn-nav.fms-btn-disabled:hover,
.fms-btn-nav:disabled:hover,
.fms-btn-template.fms-btn-disabled:hover,
.fms-btn-template:disabled:hover,
.fms-btn-delete.fms-btn-disabled:hover,
.fms-btn-delete:disabled:hover {
    background: #ccc !important;
}

/* Delete-Button bleibt rot */
.fms-btn-delete {
    background: #dc3232;
}

.fms-btn-delete:hover {
    background: #a00;
}

/* Delete-Button disabled wird bereits von .fms-btn:disabled abgedeckt */

.fms-save-message {
    margin-top: 5px;
    color: #46d846;
    font-size: 15px;
    font-weight: 500;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Bulk Kategorie Frontend: Fehler wie Erfolgszeile (Search & Replace), Farbe hellorange — nur unter .fms-bulk-category--frontend */
.fms-bulk-category--frontend .fms-save-message.fms-bulk-category__feedback--error {
    margin-top: 5px;
    font-size: 15px;
    font-weight: 500;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #8a4a0a !important;
    background-color: #fff5e8;
    border: 1px solid #f0c880;
    padding: 8px 12px;
    border-radius: 4px;
    box-sizing: border-box;
}

/* =========================================================
 *  INVENTARLISTE / TABELLE
 * ======================================================= */
.fms-inventory-wrapper {
    overflow: visible;
}

.fms-inventory-controls {
    margin-bottom: 1.5em;
    padding: 1em;
    background: #2a4a66;
    border: 1px solid #3a5a7a;
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5em;
    align-items: center;
    color: #d0d8e0;
}

.fms-per-page-form {
    display: inline-block;
}

.fms-per-page-select label {
    font-weight: 600;
    margin-right: 0.5em;
    color: #d0d8e0;
}

.fms-per-page {
    padding: 8px 10px;
    border: 1px solid #3a5a7a;
    border-radius: 5px;
    background: #1f354b;
    color: #d0d8e0;
    font-size: 15px;
    margin-top: 10px;
}
.fms-inventory-per-page-field, 
.fms-inventory-search-field {
    margin-top: 0px;
    padding: 2px 10px !important;
}

.fms-inventory-search-field {
    max-width: 65% !important;
    margin-right: 10px !important;
}

.fms-inventory-search-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Such-Button-Styles werden von der zentralen Button-Definition übernommen */

.fms-inventory-search-clear {
    margin-left: 10px !important;
}

/* Such-Input-Felder in Tabellen-Controls */
.fms-search-input-field {
    padding: 5px 10px;
    margin-left: 5px;
}

.fms-search-clear-link {
    margin-left: 10px;
    text-decoration: none;
}

.fms-inventory-export-wrapper,
.fms-inventory-import-wrapper {
    display: inline-block;
}

/* Export/Import/Filter-Button-Styles werden von der zentralen Button-Definition übernommen */

.fms-inventory-import-button:disabled,
.fms-btn-import:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
}

/* Spaltenauswahl - Label und Checkboxen auf einer Zeile */
.fms-inventory-column-toggle-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.fms-inventory-column-toggle-item {
    margin-right: 25px !important;
}

.fms-inventory-column-toggle-checkbox {
    margin-right: 3px !important;
}

.fms-inventory-column-toggle-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

.fms-inventory-column-toggle-group label {
    width: auto !important;
}

/* Labels im Inventarliste-Header - gleiches Layout wie .fms-field-label */
.fms-inventory-per-page-label,
.fms-inventory-search-label {
    display: inline-block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 15px;
    width: 100%;
}

.fms-inventory-count-label {
    display: inline-block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 15px;
    width: auto;
}

.fms-inventory-count-wrapper {
    margin-bottom: 1px;
}

.fms-inventory-column-toggle-label {
    display: inline-block;
    font-weight: 600;
    margin-bottom: 0;
    font-size: 15px;
    width: auto;
    margin-right: 10px;
}
.elementor-widget-shortcode {
    margin-bottom: 0 !important;
}

/* Wert für "Anzahl Objekte" - gleiches Layout wie Label */
.fms-inventory-count-value {
    font-weight: 600;
    font-size: 15px;
}

.fms-inventory-count-filtered {
    color: #D9A827;
}

/* Spaltennamen in der Spaltenauswahl - ähnliches Layout */
.fms-inventory-column-toggle-text {
    font-weight: 400;
    font-size: 15px;
}

.fms-column-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    align-items: center;
    margin-bottom: 15px;
}

.fms-column-toggle strong {
    margin-right: 0.5em;
    color: #d0d8e0;
}

.fms-column-toggle label {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    cursor: pointer;
    padding: 0.25em 0.5em;
    border-radius: 4px;
    transition: background 0.2s;
    margin-right: 12px;
    color: #d0d8e0;
}

.fms-column-toggle label:hover {
    background: #315a7a;
}

.fms-column-toggle input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

/* Tabelle - Dark Mode Design für #1f354b Hintergrund */
.fms-inventory-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 25px;
    background: #2a4a66;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    overflow: visible;
}

.fms-inventory-table thead {
    background: #1f354b;
    position: relative;
}

.fms-inventory-table th {
    padding-top: 10px;
    bottom: 5px;
    padding-left: 12px;
    padding-right: 12px;
    text-align: left;
    font-weight: 500;
    font-size: 15px;
    border: 1px solid #3a5a7a;
    border-bottom: 2px solid #4a6a8a;
    position: relative;
    color: #e0e8f0;
    background: #1f354b;
}

.fms-inventory-table th.fms-sortable {
    cursor: pointer;
    user-select: none;
}

.fms-inventory-table th.fms-sortable:hover {
    background: #2a4a66;
}

.fms-inventory-table th.fms-sort-asc::after,
.fms-inventory-table th.fms-sort-desc::after {
    content: '';
    position: absolute;
    right: 0.5em;
    top: 50%;
    transform: translateY(-50%);
}

/* Bändermuster für Standort-Tabelle (Inventar-Liste) - verwendet PHP-generierte Klassen */
.fms-inventory-table tbody tr.fms-category-odd {
    background: #2a4a66 !important;
}

.fms-inventory-table tbody tr.fms-category-even {
    background: #253d55 !important;
}

.fms-inventory-table tbody tr:hover {
    background: #315a7a !important;
}

/* Unvollständige Objekte: Textfarbe markieren */
.fms-inventory-table tbody tr.fms-row-missing-required,
.fms-inventory-table tbody tr.fms-row-missing-required td,
.fms-inventory-table tbody tr.fms-row-missing-required a,
.fms-inventory-table tbody tr.fms-row-missing-required span {
    color: #f4d467 !important;
}

/* Overlay entfernen für Standort-Tabelle (falls von Theme oder anderen Quellen) */
.fms-inventory-table tbody > tr:nth-child(2n+1) > td,
.fms-inventory-table tbody > tr:nth-child(2n+1) > th {
    background-color: transparent !important;
}

.fms-inventory-table td {
    padding-top: 3px;
    bottom: 3px;
    padding-left: 12px;
    padding-right: 12px;
    border: 1px solid #3a5a7a;
    text-align: left;
    color: #d0d8e0;
    font-size: 13px;
    background: transparent !important; /* Damit tr-Hintergrund sichtbar ist */
}

/* Inventarnummer-Spalte: Keine Zeilenumbrüche */
.fms-inventory-table td.col-inventarnummer,
.fms-inventory-table th.col-inventarnummer {
    white-space: nowrap;
}

/* =========================================================
 *  SPALTENFILTER (Excel-ähnlich)
 * ======================================================= */
.fms-filterable-header {
    position: relative;
    overflow: visible;
}

.fms-th-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.fms-sort-link {
    flex: 1;
    text-decoration: none;
    color: #e0e8f0;
    display: block;
    width: 100%;
}

.fms-sort-link:hover {
    color: #9db1c6;
}

.fms-filter-btn {
    background: none !important;
    border: 1px solid #3a5a7a;
    border-radius: 3px;
    color: #d0d8e0;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 11px;
    line-height: 1;
    transition: background 0.2s;
    flex-shrink: 0;
}

/*.fms-filter-btn:hover {
    background: #9db1c6;
}*/

.fms-filter-btn.fms-filter-active {
    font-weight: bold !important;
    font-size: 17px !important;
    color: #D9A827 !important;
}

.fms-filter-icon {
    display: inline-block;
    font-size: 12px !important;
}

.fms-filter-btn.fms-filter-active .fms-filter-icon {
    font-size: 16px !important;
}

.fms-filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #1f354b;
    border: 1px solid #3a5a7a;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    margin-top: 2px;
    min-width: 250px;
    width: max-content;
    max-width: 400px;
}

.fms-filter-search {
    padding: 8px;
    border-bottom: 1px solid #3a5a7a;
}

.fms-filter-search-input {
    width: 100%;
    background: #2a4a66;
    border: 1px solid #3a5a7a;
    padding: 2px 4px !important;
    border-radius: 3px;
    color: #eee;
    font-size: 13px;
    box-sizing: border-box;
}

.fms-filter-search-input:focus {
    outline: none;
    border-color: #9db1c6;
}

.fms-filter-options {
    max-height: 300px;
    overflow-y: auto;
}

.fms-filter-loading {
    padding: 10px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: #D9A827;
}

.fms-filter-options label {
    display: block;
    padding: 5px 10px;
    cursor: pointer;
    color: #d0d8e0;
    font-size: 13px;
    transition: background 0.2s;
    margin: 0;
    white-space: nowrap;
}

.fms-filter-options label:hover {
    background: #315a7a;
}

.fms-filter-options input[type="checkbox"] {
    margin-right: 6px;
    cursor: pointer;
}

.fms-filter-actions {
    padding: 5px 8px;
    border-top: 1px solid #3a5a7a;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fms-filter-apply,
.fms-filter-clear {
    width: 100%;
    padding: 2px 4px !important;
    background: #384b61;
    border: 1px solid #3a5a7a;
    border-radius: 3px;
    color: #fff;
    cursor: pointer;
    font-size: 13px !important;
    transition: background 0.2s;
}

.fms-filter-apply:hover {
    background: #9db1c6;
}

.fms-filter-clear {
    background: #2a4a66;
}

.fms-filter-clear:hover {
    background: #315a7a;
}

/* =========================================================
 *  STATISTIKEN
 * ======================================================= */
.fms-inventory-statistics {
    margin: 10px 0;
}

.fms-statistics-section {
    margin-bottom: 2.5em;
}

.fms-statistics-title {
    font-size: 22px !important;
    font-weight: 500 !important;
    color: #e0e8f0;
    margin-bottom: 10px;
    padding-bottom: 0px;
    border-bottom: none;
}

.fms-statistics-table {
    width: 100%;
    border-collapse: collapse;
    background: #2a4a66;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1em;
}

.fms-statistics-table thead {
    background: #1f354b;
}

.fms-statistics-table th {
    padding: 8px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 15px;
    color: #e0e8f0;
    border-bottom: 2px solid #4a6a8a;
}

.fms-statistics-table td {
    padding: 3px 15px;
    color: #d0d8e0;
    font-size: 14px;
    border-bottom: 1px solid #3a5a7a;
}

/* Overlay entfernen (falls von Theme oder anderen Quellen) */
.fms-statistics-table tbody > tr:nth-child(2n+1) > td,
.fms-statistics-table tbody > tr:nth-child(2n+1) > th {
    background-color: transparent !important;
}

/* Bändermuster für Statistik-Tabelle - Kategorien */
.fms-statistics-table tbody tr.fms-statistics-category-row.fms-category-odd {
    background: #2a4a66 !important;
}

.fms-statistics-table tbody tr.fms-statistics-category-row.fms-category-odd td {
    background: transparent !important;
}

.fms-statistics-table tbody tr.fms-statistics-category-row.fms-category-even {
    background: #253d55 !important;
}

.fms-statistics-table tbody tr.fms-statistics-category-row.fms-category-even td {
    background: transparent !important;
}

/* Hover-Effekt für Kategorien */
.fms-statistics-table tbody tr.fms-statistics-category-row:hover {
    background: #315a7a !important;
}

.fms-statistics-table tbody tr.fms-statistics-category-row:hover td {
    background: transparent !important;
}

/* Bändermuster für Statistik-Tabelle - Standorte */
.fms-statistics-table tbody tr.fms-statistics-location-row.fms-category-odd {
    background: #2a4a66 !important;
}

.fms-statistics-table tbody tr.fms-statistics-location-row.fms-category-odd td {
    background: transparent !important;
}

.fms-statistics-table tbody tr.fms-statistics-location-row.fms-category-even {
    background: #253d55 !important;
}

.fms-statistics-table tbody tr.fms-statistics-location-row.fms-category-even td {
    background: transparent !important;
}

/* Hover-Effekt für Standorte */
.fms-statistics-table tbody tr.fms-statistics-location-row:hover {
    background: #315a7a !important;
}

.fms-statistics-table tbody tr.fms-statistics-location-row:hover td {
    background: transparent !important;
}

.fms-statistics-total {
    background: #1f354b !important;
    font-weight: 600;
}

.fms-statistics-total td {
    color: #e0e8f0;
    font-weight: 600;
    border-top: 2px solid #4a6a8a;
    border-bottom: none;
}

.fms-total-label,
.fms-total-amount,
.fms-total-percent {
    font-weight: 600;
}

.fms-statistics-summary {
    margin-top: 0px;
    padding: 0px;
    background: #1f354b;
    border-radius: 6px;
    text-align: left;
}

.fms-statistics-summary p {
    margin: 0;
    color: #e0e8f0;
    font-size: 18px;
}

/* Gruppierte Statistiken: Kategorien und Unterkategorien */
.fms-inventory-statistics-grouped {
    margin: 10px 0;
}

/* Kategorie-Zeilen erben Bändermuster von .fms-statistics-table tbody tr */
.fms-statistics-category-row {
    font-weight: 400 !important;
    /* Hintergrund wird von .fms-statistics-category-row.fms-category-odd/even gesetzt */
}

.fms-statistics-category-row.fms-category-clickable {
    cursor: pointer;
}

.fms-statistics-category-row td {
    color: #e0e8f0;
    border-bottom: 2px solid #4a6a8a;
}

.fms-category-name {
    font-weight: 600;
}

.fms-category-amount,
.fms-category-percent {
    font-weight: 600;
}

/* Unterkategorie-Zeilen: Etwas dunkler als ihre übergeordnete Kategorie, mit eigener Bänderung */
/* Unterkategorien unter odd-Kategorien (#2a4a66) */
.fms-statistics-subcategory-row.fms-category-odd.fms-subcategory-odd {
    background: #1f2d3d !important; /* Dunkler als #2a4a66 */
}

.fms-statistics-subcategory-row.fms-category-odd.fms-subcategory-even {
    background: #1a2533 !important; /* Noch dunkler für even Unterkategorien */
}

/* Unterkategorien unter even-Kategorien (#253d55) */
.fms-statistics-subcategory-row.fms-category-even.fms-subcategory-odd {
    background: #1a2533 !important; /* Dunkler als #253d55 */
}

.fms-statistics-subcategory-row.fms-category-even.fms-subcategory-even {
    background: #151f2a !important; /* Noch dunkler für even Unterkategorien */
}

.fms-statistics-subcategory-row:hover {
    background: #2a4a66 !important; /* Etwas heller beim Hover */
}

.fms-category-toggle-icon {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
    margin-left: 1px;
    vertical-align: middle;
    position: relative;
    border-style: solid;
    /* Geschlossen (collapsed): Rechtsweisendes Dreieck */
    border-width: 5px 0 5px 8px;
    border-color: transparent transparent transparent #d0d8e0;
    transition: border-width 0.2s ease, border-color 0.2s ease;
    background: none !important;
    box-sizing: border-box;
    flex-shrink: 0;
}

.fms-statistics-category-row:not(.fms-category-collapsed) .fms-category-toggle-icon {
    /* Offen (nicht collapsed): Nach unten zeigendes Dreieck */
    border-width: 8px 5px 0px 5px;
    border-color: #d0d8e0 transparent transparent transparent;
    transform: rotate(0deg);
}

.fms-subcategory-bullet {
    display: inline-block;
    margin-right: 8px;
    color: #d0d8e0;
}

/* Bändermuster für Unterkategorien */
.fms-statistics-subcategory-row.fms-category-odd.fms-subcategory-odd {
    background: #1f2d3d !important; /* Hell für odd-Unterkategorien unter odd-Kategorien */
}

.fms-statistics-subcategory-row.fms-category-odd.fms-subcategory-even {
    background: #1a2533 !important; /* Dunkel für even-Unterkategorien unter odd-Kategorien */
}

.fms-statistics-subcategory-row.fms-category-even.fms-subcategory-odd {
    background: #1f2d3d !important; /* Hell für odd-Unterkategorien unter even-Kategorien */
}

.fms-statistics-subcategory-row.fms-category-even.fms-subcategory-even {
    background: #1a2533 !important; /* Dunkel für even-Unterkategorien unter even-Kategorien */
}

/* Hover-Effekt für Unterkategorien */
.fms-statistics-subcategory-row:hover {
    background: #315a7a !important;
}

.fms-statistics-subcategory-row.fms-subcategory-hidden {
    display: none;
}

.fms-statistics-col-subcategory-percent {
    text-align: right;
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    border-left: none !important;
    font-size: 12px;
}

/* Entferne rechte Border der Kategorie/Unterkategorie-Spalte, damit linke Border der neuen Spalte verschwindet */
.fms-category-name-cell {
    border-right: none !important;
}

.fms-subcategory-cell {
    border-right: none !important;
    padding-left: 39px !important;
}

/* Entferne rechte Border der Gesamt-Spalte */
.fms-total-label {
    border-right: none !important;
}

/* Subcategory-Prozent-Spalte: Sichtbar für alle Zeilen, erbt Hintergrundfarbe von Zeile */
.fms-statistics-category-row .fms-statistics-col-subcategory-percent,
.fms-statistics-total .fms-statistics-col-subcategory-percent,
.fms-statistics-subcategory-row .fms-statistics-col-subcategory-percent {
    visibility: visible;
}

/* Font-size für Unterkategorien */
.fms-statistics-subcategory-row .fms-statistics-col-subcategory-percent {
    font-size: 12px;
}

.fms-statistics-col-amount {
    text-align: right !important;
}

.fms-statistics-col-percent {
    text-align: right !important;
}

/* =========================================================
 *  BILD-ZUORDNUNG (fms-assign-images)
 * ======================================================= */
.fms-assign-images-wrapper {
    margin-bottom: 10px;
}

.fms-assign-images-options {
    margin-bottom: 10px;
}

.fms-assign-images-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #d0d8e0;
    font-size: 14px;
}

.fms-assign-images-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}

.fms-assign-images-checkbox-text {
    user-select: none;
}


.fms-assign-images-status {
    margin-top: 0px;
    padding: 10px;
    background: none;
    border-radius: 4px;
    color: #d0d8e0;
}

/*
.fms-assign-images-status-content {
    display: inline-block;
    align-items: flex-start;
    gap: 8px;
}*/

.fms-assign-images-icon {
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

.fms-assign-images-message {
    flex: 1;
    line-height: 1.3;
    font-size: 16px;
}

.fms-assign-images-loading .fms-assign-images-message {
    color: #d0d8e0;
}

.fms-assign-images-success,
.fms-assign-images-success .fms-assign-images-icon,
.fms-assign-images-success .fms-assign-images-message {
    color: #46d846;
}

.fms-assign-images-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 600;
}

.fms-assign-images-title-text {
    color: #46d846;
}

.fms-assign-images-stats {
    margin-top: 10px;
}

.fms-assign-images-stats-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    color: #46d846;
}

.fms-assign-images-stats-list li {
    margin: 0 0 0 16px !important;
    padding: 0 !important;
}

.fms-assign-images-error,
.fms-assign-images-error .fms-assign-images-icon,
.fms-assign-images-error .fms-assign-images-message {
    color: #dc3232;
}

.fms-table-row-clickable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.fms-table-row-clickable:hover {
    background-color: #3a6a8a !important;
}

/* Pagination */
.fms-inventory-pagination {
    margin: 5px 0 5px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5em;
}

/* Pagination-Buttons erben von zentraler Button-Definition, aber mit !important für Überschreibung */
.fms-btn-pagination {
    padding: 2px 10px !important;
    font-size: 15px !important;
    color: #fff !important;
}

.fms-btn-pagination:hover {
    background: #9db1c6 !important;
}

.fms-btn-pagination.fms-pagination-current {
    background: #9db1c6 !important;
    color: #fff !important;
    font-weight: 600 !important;
    cursor: default !important;
}

.fms-btn-pagination.fms-pagination-current:hover {
    background: #9db1c6 !important;
}

.fms-pagination-dots {
    padding: 0.5em;
    color: #9db1c6;
}

.fms-inventory-info {
    margin-top: 0;
    padding: 0;
    background: none;
    font-size: 16px;
    text-align: center;
    color: #9db1c6;
    border: none;
}

/* Mobile Optimierung */
@media (max-width: 768px) {
    .fms-mobile-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .fms-inventory-table {
        min-width: 600px;
    }
    
    .fms-inventory-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .fms-column-toggle {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .fms-object-buttons {
        flex-direction: column;
    }
    
    .fms-btn-save,
    .fms-btn-save-new {
        width: 100%;
    }
}

/* =========================================================
 *  OBJEKT-NAVIGATION
 * ======================================================= */
.fms-object-nav {
    display: flex;
    justify-content: space-between;
    margin: 2em 0;
    padding: 1em;
    background: #2a4a66;
    border-radius: 4px;
    border: 1px solid #3a5a7a;
}

/* Navigation-Buttons erben von zentraler Button-Definition */

/* =========================================================
 *  SUCHFUNKTION
 * ======================================================= */
.fms-object-search {
    margin: 1.5em 0;
    display: flex;
    gap: 0.5em;
    max-width: 600px;
}

.fms-object-search input[type="text"] {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #c8ccd0;
    border-radius: 5px;
    font-size: 15px;
}

/* Such-Button erbt von zentraler Button-Definition */

/* =========================================================
 *  AUSWAHLLISTEN-FORMULAR
 * ======================================================= */
.fms-options-form {
    max-width: 1100px;
}

.fms-options-field {
    margin-bottom: 18px;
}

.fms-options-field label,
.fms-field label  {
    width: 100%;
}

.fms-field-Bezeichnung label  {
    width: 92% !important;
}

.fms-options-field textarea {
    width: 100%;
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid #c8ccd0;
    border-radius: 5px;
    font-family: 'Roboto Condensed', sans-serif;
    line-height: 1.3;
    font-size: 15px;
    box-sizing: border-box;
}

/* =========================================================
 *  PREVIEW-SEITE
 * ======================================================= */
.fms-view-field {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 10px;  
    font-size: 14px;
    line-height: 1.4em;
}

.fms-view-Beschreibung {
    font-size: 14px;
    line-height: 1.4em;
} 

.fms-view-Inventarnummer {
    font-size: 16px;
    line-height: 1em;
}

.fms-view-Bezeichnung {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2em;
  margin-bottom: 8px;
}

@media (max-width: 768px) {
    .fms-view-Bezeichnung {
    font-size: 22px;
    font-weight: 500;
    line-height: 1.2em;
    margin-bottom: 8px;
    }
}  

/* .fms-view-label und .fms-view-value werden weiter unten definiert */

.fms-view-label {
    font-weight: 600;
    display: block;
}
.fms-view-field.fms-view-Erfasst_am,
.fms-view-field.fms-view-Geändert {
    font-size: 14px;
}

.fms-view-value {
    font-weight: 400;
    hyphens: auto;
}

.fms-view-image {
    height: 210px !important;
    width: auto !important;
    display: block;
}

.fms-username {
    font-size: 14px !important;
}


/* ========================================
   CSV Import Message
   ======================================== */

/* File Input (versteckt) */
.fms-import-file-input {
    display: none;
}

/* =========================================================
 *  BULK-LÖSCHFUNKTION
 * ======================================================= */
.fms-bulk-delete-col {
    width: 40px !important;
    min-width: 40px !important;
    text-align: center !important;
    vertical-align: middle !important;
    cursor: pointer;
}

.fms-bulk-delete-col input[type="checkbox"] {
    cursor: pointer;
    margin: 0;
}

.fms-bulk-delete-col:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.fms-bulk-delete-col i.fa-trash {
    cursor: pointer;
}

.fms-bulk-delete-button:disabled {
    background: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

.fms-bulk-delete-button {
    display: none;
}

.fms-bulk-delete-button.show {
    display: inline-block !important;
}

/* =========================================================
 *  KONVOLUT LINK PREVIEW (Detailansicht)
 * ======================================================= */
.fms-konvolut-link {
    text-decoration: none !important;
}
.fms-konvolut-link:hover {
    color: #F4D467 !important;
}

.fms-konvolut-preview {
    position: fixed;
    z-index: 99999;
    pointer-events: none;
    background: #fff;
    border: 1px solid #d8d8d8;
    border-radius: 4px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
    padding: 4px;
    max-width: 180px;
}

.fms-konvolut-preview-image {
    display: block;
    width: 160px;
    height: auto;
    max-height: 160px;
    object-fit: contain;
}

/* =========================================================
 *  INVENTAR GRID BROWSER (additiv)
 * ======================================================= */
.fms-list-switch {
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.fms-list-switch-btn.is-active {
    filter: brightness(0.9);
}

.fms-list-switch-btn.is-inactive {
    opacity: 0.75;
}

.fms-grid-browser-wrapper {
    margin-bottom: 16px;
}

.fms-grid-toolbar {
    margin-bottom: 10px;
}

.fms-grid-zoom-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.fms-grid-zoom-slider {
    width: 140px;
}

.fms-grid {
    --fms-grid-columns: 5;
    display: grid;
    grid-template-columns: repeat(var(--fms-grid-columns), minmax(0, 1fr));
    gap: 10px;
}

.fms-grid-item {
    display: block;
    text-decoration: none;
    color: inherit;
}

.fms-grid-image-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f2f2f2;
    border: 1px solid #dcdcdc;
    border-radius: 3px;
    overflow: hidden;
}

.fms-grid-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.fms-grid-empty {
    width: 100%;
    height: 100%;
    background: #f6f6f6;
}

.fms-grid-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    font-size: 12px;
    line-height: 1.3;
    padding: 6px 7px;
    opacity: 0;
    transition: opacity 0.14s ease;
}

.fms-grid-item:hover .fms-grid-overlay,
.fms-grid-item:focus .fms-grid-overlay,
.fms-grid-item:focus-visible .fms-grid-overlay {
    opacity: 1;
}

.fms-grid-overlay span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fms-grid-no-results {
    grid-column: 1 / -1;
    padding: 10px;
}

