/* ==========================================================
   Vermiet-Tool Frontend – bewusst mit eigenem Reset, damit
   Theme-/Page-Builder-CSS (z.B. Divi) keine Formularelemente
   mehr verbiegen kann.
   ========================================================== */

.vwt-frontend, .vwt-frontend * {
    box-sizing: border-box;
}

.vwt-frontend {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #1d2327;
    background: #f8f9fa;
    padding: 20px;
    max-width: 1920px;
    margin: 0 auto;
}

.vwt-frontend h1 { font-size: 26px; margin: 0 0 20px; }
.vwt-frontend h2 { font-size: 18px; margin: 24px 0 8px; }

/* ---- entscheidender Fix: native Formularelemente erzwingen,
   egal was das Theme/der Builder global für select/input definiert ---- */
.vwt-frontend select,
.vwt-frontend input[type="text"],
.vwt-frontend input[type="date"],
.vwt-frontend input[type="email"],
.vwt-frontend input[type="number"],
.vwt-frontend textarea {
    -webkit-appearance: auto !important;
    appearance: auto !important;
    display: inline-block !important;
    float: none !important;
    width: auto;
    max-width: 100%;
    height: auto;
    padding: 7px 10px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
    color: #1d2327;
    line-height: normal;
    margin: 0;
    box-shadow: none;
}
.vwt-frontend select {
    padding-right: 28px;
}
.vwt-frontend textarea { width: 100%; resize: vertical; }

/* ---- Navigation ---- */
.vwt-fe-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 24px;
}
.vwt-fe-nav-link {
    padding: 8px 14px;
    border-radius: 4px;
    text-decoration: none;
    color: #1d2327;
    font-weight: 500;
}
.vwt-fe-nav-link:hover { background: #f0f0f1; }
.vwt-fe-nav-link.is-active { background: #2271b1; color: #fff; }
.vwt-fe-nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.vwt-fe-nav-user { font-size: 13px; color: #666; }
.vwt-fe-nav-user a { color: #2271b1; }

.vwt-fe-hilfe-menu { position: relative; }
.vwt-fe-hilfe-toggle {
    background: none;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #1d2327;
    cursor: pointer;
}
.vwt-fe-hilfe-toggle:hover { background: #f0f0f1; }
.vwt-fe-hilfe-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    z-index: 50;
    min-width: 160px;
}
.vwt-fe-hilfe-menu.is-open .vwt-fe-hilfe-dropdown { display: block; }
.vwt-fe-hilfe-dropdown a { display: block; padding: 9px 16px; font-size: 13px; color: #1d2327; text-decoration: none; white-space: nowrap; }
.vwt-fe-hilfe-dropdown a:hover, .vwt-fe-hilfe-dropdown a.is-active { background: #f0f0f1; }

/* ---- Handbuch ---- */
/* ---- Handbuch (Akzentfarbe ok-digital) ---- */
:root {
    --vwt-ok-lila: #310052;
    --vwt-ok-lila-hell: #f4edf8;
}
.vwt-hilfe-toc {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 30px;
}
.vwt-hilfe-toc a { color: var(--vwt-ok-lila); text-decoration: none; font-size: 14px; }
.vwt-hilfe-toc a:hover { text-decoration: underline; }
.vwt-hilfe-kapitel { margin-bottom: 36px; padding-bottom: 6px; border-bottom: 1px solid #eee; }
.vwt-hilfe-kapitel h2 { scroll-margin-top: 20px; color: var(--vwt-ok-lila); }
.vwt-hilfe-liste { margin: 0 0 16px; padding-left: 22px; }
.vwt-hilfe-liste li { margin-bottom: 6px; }
.vwt-hilfe-tipp { background: var(--vwt-ok-lila-hell); border-color: var(--vwt-ok-lila); max-width: none; }
.vwt-hilfe-tipp strong { color: var(--vwt-ok-lila); }
.vwt-hilfe-sprung { margin: -6px 0 16px; }
.vwt-btn-lila {
    border-color: var(--vwt-ok-lila);
    color: var(--vwt-ok-lila);
}
.vwt-btn-lila:hover { background: var(--vwt-ok-lila); color: #fff; }

/* ---- Fußzeile "Software von ok-digital" ---- */
.vwt-fe-footer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #999;
    font-size: 12px;
}
.vwt-fe-footer img { height: 14px; width: auto; opacity: .75; }

.vwt-fe-content {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 24px 28px;
}

/* ---- Buttons ---- */
.vwt-btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #f6f7f7;
    color: #1d2327;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    line-height: 1.4;
}
.vwt-btn:hover { background: #f0f0f1; }
.vwt-btn-primary { background: #2271b1; border-color: #2271b1; color: #fff; }
.vwt-btn-primary:hover { background: #135e96; color: #fff; }
.vwt-btn-large { padding: 12px 24px; font-size: 15px; }
.vwt-btn-small { padding: 5px 10px; font-size: 12px; }
.vwt-btn-disabled { opacity: .5; cursor: not-allowed; }

/* ---- Lieferorte/Ansprechpartner: enger zusammen statt weiter Luecken ---- */
.vwt-repeat-row { margin-bottom: 6px; }
.vwt-lieferort-row { display: flex; align-items: flex-start; gap: 8px; background: #fff; border: 1px solid #e2e2e2; border-radius: 6px; padding: 10px; }
.vwt-lieferort-row .vwt-drag-handle { padding-top: 8px; }
.vwt-lieferort-felder { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.vwt-lieferort-felder textarea, .vwt-lieferort-felder input[type="text"] { width: 100%; }
.vwt-lieferort-row.ui-sortable-helper { box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.vwt-lieferort-row.ui-sortable-placeholder { visibility: visible !important; background: #f0f6fc; border: 1px dashed #8c8f94; }
#vwt-lieferorte-liste, #vwt-kontakte-liste { margin-bottom: 4px; }

.vwt-fe-subheading { margin: 22px 0 4px; }
.vwt-kategorien-box { margin-top: 24px; padding-top: 16px; border-top: 1px solid #e2e2e2; }
.vwt-kategorien-box h3 { margin: 0 0 8px; }
.vwt-kat-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.vwt-kat-row input[type="text"] { flex: 1; }
.vwt-kat-btn { padding: 5px 10px; border: 1px solid #8c8f94; border-radius: 4px; background: #f6f7f7; cursor: pointer; font-size: 12px; }
.vwt-kat-btn:hover { background: #eee; }
.vwt-kat-delete { color: #b32d2e; text-decoration: none; padding: 4px 6px; flex-shrink: 0; }
.vwt-kat-row-neu { margin-top: 10px; }
.vwt-kat-notice { padding: 8px 10px; border-radius: 4px; margin-bottom: 10px; font-size: 13px; }
.vwt-kat-notice-ok { background: #eafaf0; color: #1c6b3a; }
.vwt-kat-notice-fehler { background: #fdecea; color: #a02622; }
.vwt-lieferblock-titel-wahl { display: flex; gap: 8px; align-items: center; margin: -6px 0 10px; max-width: 420px; }
.vwt-lieferblock-titel-wahl select, .vwt-lieferblock-titel-wahl input[type="text"] { flex: 1; }
.vwt-logo-galerie { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.vwt-logo-galerie-item { position: relative; border: 1px solid #e2e2e2; border-radius: 6px; padding: 8px; text-align: center; width: 130px; background: #fff; }
.vwt-logo-galerie-item img { max-width: 100%; max-height: 50px; display: block; margin: 0 auto 4px; }
.vwt-logo-galerie-item span { display: block; font-size: 11px; color: #666; word-break: break-all; }
.vwt-logo-galerie-item .vwt-kat-delete { position: absolute; top: 2px; right: 4px; }
.vwt-ab-row .vwt-ab-label { flex: 2; }
.vwt-ab-row .vwt-ab-menge, .vwt-ab-row .vwt-ab-suffix { flex: 1; min-width: 0; }
@media (max-width: 700px) { .vwt-ab-row { flex-wrap: wrap; } .vwt-ab-row .vwt-ab-label, .vwt-ab-row .vwt-ab-menge, .vwt-ab-row .vwt-ab-suffix { flex: 1 1 100%; } }
.vwt-leistungstag-row { display: flex; align-items: flex-start; gap: 8px; background: #fff; border: 1px solid #e2e2e2; border-radius: 6px; padding: 10px; }
.vwt-leistungstag-row .vwt-drag-handle { padding-top: 8px; }
.vwt-leistungstag-felder { flex: 1; display: grid; grid-template-columns: 150px 110px 110px 1fr; gap: 8px; }
.vwt-leistungstag-felder input { width: 100%; box-sizing: border-box; }
.vwt-leistungstag-row.ui-sortable-helper { box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.vwt-leistungstag-row.ui-sortable-placeholder { visibility: visible !important; background: #f0f6fc; border: 1px dashed #8c8f94; }
#vwt-leistungstage-liste { margin-bottom: 4px; }
@media (max-width: 700px) { .vwt-leistungstag-felder { grid-template-columns: 1fr 1fr; } }
#vwt-add-lieferort { margin-bottom: 2px; }

/* ---- Formulare ---- */
.vwt-fe-form label {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px;
    margin-bottom: 22px;
    font-weight: 600;
    font-size: 13px;
    color: #333;
}
.vwt-fe-form label input,
.vwt-fe-form label select,
.vwt-fe-form label textarea {
    width: 100%;
    font-weight: 400;
}
/* Ausnahme: das kleine Radio-Label bei "Hauptkontakt" soll NICHT die
   allgemeine Block-Label-Regel bekommen (sonst bricht die Ansprechpartner-Zeile um) */
.vwt-fe-form .vwt-ap-radio {
    display: flex !important;
    flex-direction: row !important;
    margin: 0 !important;
    gap: 0 !important;
}
.vwt-fe-form .vwt-ap-radio input {
    width: auto !important;
}
.vwt-fe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; align-items: start; }
.vwt-fe-grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 900px) { .vwt-fe-grid, .vwt-fe-grid-5 { grid-template-columns: 1fr; } }

.vwt-datetime-row { display: flex; gap: 6px; margin-top: 8px; }
.vwt-datetime-row input[type="date"] { flex: 1.3; }
.vwt-datetime-row input[type="time"] { flex: 1; }
.vwt-fe-form label .vwt-datetime-row input { margin-top: 0; }

.vwt-fe-hint { color: #666; font-size: 13px; margin: 6px 0 14px; }
.vwt-fe-notice { background: #edfaef; border: 1px solid #68de7c; border-radius: 4px; padding: 10px 14px; margin-bottom: 16px; }
.vwt-fe-notice-fehler { background: #fdecea; border-color: #e5a19a; color: #842029; }
.vwt-fe-submit { margin-top: 20px; }
.vwt-fe-inline-form { display: flex; align-items: center; gap: 10px; margin: 15px 0; flex-wrap: wrap; }
.vwt-fe-inline-form label { font-size: 14px; }

.vwt-fe-two-col { display: flex; gap: 30px; align-items: flex-start; }
.vwt-fe-col-form { flex: 1 1 380px; max-width: 380px; min-width: 300px; }
.vwt-fe-col-list { flex: 2 1 480px; min-width: 0; max-width: 100%; }
@media (max-width: 1100px) { .vwt-fe-two-col { flex-direction: column; } .vwt-fe-col-form { flex: none; max-width: none; width: 100%; } .vwt-fe-col-list { width: 100%; } }

/* ---- Panel-Muster: Kopfzeile mit Buttons, die darunter wahlweise ein
   Formular/eine Verwaltung einblenden (z.B. "Eigene Produkte") ---- */
.vwt-fe-panel-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 20px; }
.vwt-fe-panel-buttons .vwt-btn.is-active { background: #2271b1; border-color: #2271b1; color: #fff; }
.vwt-fe-panel {
    position: relative;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 28px;
    max-width: 640px;
}
.vwt-fe-panel-close {
    position: absolute;
    top: 14px;
    right: 16px;
    color: #999;
    text-decoration: none;
    font-size: 16px;
    line-height: 1;
}
.vwt-fe-panel-close:hover { color: #b32d2e; }
.vwt-fe-panel h2 { margin-top: 0; }
.vwt-fe-panel .vwt-kategorien-box { margin-top: 0; padding-top: 0; border-top: none; max-width: none; }

/* ---- Tabellen: nie den Seiteninhalt aufsprengen, bei Bedarf lieber
   die Tabelle selbst horizontal scrollen lassen ---- */
.vwt-fe-table-scroll { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.vwt-fe-table-scroll .vwt-fe-table { min-width: 480px; }

/* ---- Tabelle ---- */
.vwt-fe-table { width: 100%; border-collapse: collapse; margin: 10px 0 20px; }
.vwt-fe-table th, .vwt-fe-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid #eee; font-size: 14px; vertical-align: top; }
.vwt-fe-table th { background: #f6f7f7; font-weight: 600; }
.vwt-fe-table tbody tr:hover { background: #fafafa; }

/* ---- "Eigenes Produkt"-Position: Artikelzeile + Beschreibungszeile bilden
   optisch eine zusammengehörige Karte (dezenter Hintergrund + linker
   Akzentbalken über beide Zeilen hinweg), damit auch bei mehreren
   Positionen eindeutig ist, zu welchem Artikel eine Beschreibung gehört. ---- */
.vwt-item-row-eigen td,
.vwt-item-desc-row td { background: #f6f8fb; border-bottom: none; box-shadow: inset 3px 0 0 #2a5a8c; }
.vwt-item-desc-row td { padding-top: 0; padding-bottom: 10px; border-bottom: 1px solid #e2e6ec; }
.vwt-item-row-eigen:hover td,
.vwt-item-desc-row:hover td { background: #f0f3f8; }
.vwt-beschreibung-label { display: block; font-size: 11px; color: #5a6a7a; margin-bottom: 3px; }
.vwt-item-desc-row .vwt-beschreibung { width: 100%; box-sizing: border-box; margin-top: 0; }
.vwt-menge { width: 70px; box-sizing: border-box; }
.vwt-fe-table tbody tr.vwt-fe-row-hidden { display: none; }

/* Aktionen-Spalte: primäre Aktion(en) + kompaktes Dropdown statt vieler
   umbrechender Links - das war der eigentliche Grund für die hohen Zeilen. */
.vwt-fe-actions { position: relative; white-space: nowrap; }
.vwt-fe-actions-primary { display: flex; align-items: center; gap: 8px; }
.vwt-fe-actions-primary a { font-size: 13px; }
.vwt-fe-actions-toggle {
    background: none; border: 1px solid #ccc; border-radius: 4px;
    width: 26px; height: 26px; line-height: 1; cursor: pointer;
    font-size: 15px; color: #555; padding: 0;
}
.vwt-fe-actions-toggle:hover { background: #f0f0f1; }
.vwt-fe-actions-menu {
    display: none; position: absolute; right: 0; top: 100%; z-index: 20;
    background: #fff; border: 1px solid #ddd; border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,.12); padding: 6px 0; min-width: 170px;
}
.vwt-fe-actions-menu.is-open { display: block; }
.vwt-fe-actions-menu a { display: block; padding: 7px 14px; font-size: 13px; white-space: nowrap; }
.vwt-fe-actions-menu a:hover { background: #f6f7f7; }
.vwt-fe-actions .vwt-fe-delete-link { color: #b32d2e; }

.vwt-fe-suche { display: flex; align-items: center; gap: 10px; margin: 4px 0 6px; }
.vwt-fe-suche input[type="text"] { min-width: 280px; }
.vwt-fe-suche-treffer { font-size: 13px; color: #666; }

.vwt-fe-filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.vwt-fe-filter-tabs a {
    padding: 6px 12px;
    border-radius: 4px;
    background: #f6f7f7;
    color: #444;
    text-decoration: none;
    font-size: 13px;
    border: 1px solid #e2e2e2;
}
.vwt-fe-filter-tabs a:hover { background: #eef3f8; }
.vwt-fe-filter-tabs a.is-active { background: #2271b1; border-color: #2271b1; color: #fff; }

/* ---- Login-Box ---- */
.vwt-fe-login-box { max-width: 360px; margin: 60px auto; text-align: center; }
.vwt-fe-login-box form p { text-align: left; }
.vwt-fe-login-box input[type="text"],
.vwt-fe-login-box input[type="password"] { width: 100%; }
.vwt-fe-login-box input[type="submit"] {
    background: #2271b1; color: #fff; border: none; border-radius: 4px;
    padding: 10px 18px; cursor: pointer; font-size: 14px;
}

/* ---- Digitale Pickliste ---- */
.vwt-pick-kopf {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 5;
    padding: 10px 0 14px;
    margin-bottom: 10px;
}
.vwt-pick-fortschritt-text { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.vwt-pick-balken { background: #eee; border-radius: 20px; height: 14px; overflow: hidden; }
.vwt-pick-balken-fill { background: #2e9e4f; height: 100%; border-radius: 20px; transition: width .2s ease; }

.vwt-pick-gruppe { margin-bottom: 22px; }
.vwt-pick-gruppe-titel {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #666;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
    margin: 20px 0 8px;
}

.vwt-pick-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 14px;
    border-radius: 8px;
    border: 1px solid #e2e2e2;
    margin-bottom: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.vwt-pick-row:active { background: #f0f0f1; }
.vwt-pick-row .vwt-pick-check {
    width: 26px; height: 26px; flex: 0 0 26px;
    border: 2px solid #8c8f94;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    color: transparent;
    font-weight: 700;
}
.vwt-pick-row.is-gepickt {
    background: #edfaef;
    border-color: #68de7c;
}
.vwt-pick-row.is-gepickt .vwt-pick-check {
    background: #2e9e4f;
    border-color: #2e9e4f;
    color: #fff;
}
.vwt-pick-row.is-gepickt .vwt-pick-name { text-decoration: line-through; color: #666; }
.vwt-pick-row.is-teilweise { background: #fff8e1; border-color: #f0c14b; }
.vwt-pick-name { flex: 1; font-size: 16px; font-weight: 500; }
.vwt-pick-menge { font-size: 14px; color: #555; font-weight: 600; white-space: nowrap; }

.vwt-pick-counter {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}
.vwt-pick-zahl { min-width: 14px; text-align: right; }
.vwt-pick-minus {
    width: 32px; height: 32px; flex: 0 0 32px;
    border-radius: 50%;
    border: 1px solid #b0b0b0;
    background: #fff;
    font-size: 18px;
    line-height: 1;
    color: #555;
    cursor: pointer;
}
.vwt-pick-minus:active { background: #f0f0f1; }

.vwt-pick-row-rueck { cursor: default; flex-wrap: wrap; }
.vwt-pick-rueck-btns { display: flex; gap: 6px; flex: 0 0 100%; margin-top: 4px; }
@media (min-width: 560px) { .vwt-pick-rueck-btns { flex: 0 0 auto; margin-top: 0; } }
.vwt-pick-rueck-btn {
    padding: 9px 14px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.vwt-pick-rueck-ok.is-aktiv { background: #2e9e4f; border-color: #2e9e4f; color: #fff; }
.vwt-pick-rueck-beschaedigt.is-aktiv { background: #d98c00; border-color: #d98c00; color: #fff; }
.vwt-pick-rueck-fehlt.is-aktiv { background: #c0392b; border-color: #c0392b; color: #fff; }

@media print {
    .vwt-fe-nav, .vwt-fe-inline-form button, .vwt-fe-actions { display: none !important; }
    .vwt-fe-content { border: none; padding: 0; }
}

/* ---- Produktquellen-Tabs (WooCommerce / Eigene Produkte) im Angebots-Editor ---- */
.vwt-source-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.vwt-source-tab {
    padding: 7px 14px;
    border-radius: 4px;
    background: #f6f7f7;
    color: #444;
    border: 1px solid #e2e2e2;
    font-size: 13px;
    cursor: pointer;
}
.vwt-source-tab:hover { background: #eef3f8; }
.vwt-source-tab.is-active { background: #2271b1; border-color: #2271b1; color: #fff; }

/* ---- Eigene Produkte: Abrechnungsart-Select in der Positionszeile ---- */
.vwt-einheit-select { display: block; margin-top: 4px; font-size: 12px; padding: 2px 4px; }
.vwt-einheit-suffix { font-size: 12px; color: #666; margin-left: 4px; }

.vwt-beschreibung { width: 100%; margin-top: 6px; font-size: 12px; color: #444; resize: vertical; }

.vwt-gesamtsumme { text-align: right; margin-top: 10px; line-height: 1.8; font-size: 14px; }
.vwt-gesamtsumme strong { font-size: 17px; }
