/* =========================================================
   theme-modern.css — Modern UI Overlay fuer Buero-App
   Aktiviert via html[data-theme="modern-dark"] oder "modern-light"
   Werner-Style: Lucide-Vibes, sanfte Schatten, Hover-Lift, Gradient-Akzente
   ========================================================= */

html[data-theme="modern-dark"] {
  --bg: #0a0c10;
  --bg-soft: #13161c;
  --bg-softer: #1c2028;
  --fg: #ecf0f4;
  --muted: #98a4b3;
  --border: #2d343f;
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --accent-2: #ef4444;
  --accent-soft: rgba(245, 158, 11, 0.10);
  --accent-glow: rgba(245, 158, 11, 0.40);
  --ok: #22d3a4;
  --err: #f87171;
  --info: #60a5fa;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.25);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  background:
    radial-gradient(900px 500px at 80% -5%, rgba(245,158,11,0.06), transparent 65%),
    radial-gradient(700px 400px at -5% 100%, rgba(239,68,68,0.04), transparent 65%),
    var(--bg);
  background-attachment: fixed;
}

html[data-theme="modern-light"] {
  --bg: #f7f8fa;
  --bg-soft: #ffffff;
  --bg-softer: #f1f3f6;
  --fg: #1a1d23;
  --muted: #5b6573;
  --border: #e3e7ed;
  --accent: #e07b00;
  --accent-hover: #c66a00;
  --accent-2: #d63333;
  --accent-soft: rgba(224, 123, 0, 0.08);
  --accent-glow: rgba(224, 123, 0, 0.30);
  --ok: #16a34a;
  --err: #dc2626;
  --info: #2563eb;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.06);
  --shadow-md: 0 8px 24px rgba(15,23,42,0.08), 0 2px 6px rgba(15,23,42,0.04);
  --shadow-lg: 0 12px 40px rgba(15,23,42,0.12);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  background:
    radial-gradient(900px 500px at 80% -5%, rgba(224,123,0,0.06), transparent 65%),
    radial-gradient(700px 400px at -5% 100%, rgba(214,51,51,0.03), transparent 65%),
    var(--bg);
  background-attachment: fixed;
}

/* === gemeinsame moderne Komponenten === */
html[data-theme="modern-dark"],
html[data-theme="modern-light"] {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

html[data-theme="modern-dark"] body,
html[data-theme="modern-light"] body {
  background: transparent;
}

/* Sidebar — Floating-Card-Look */
html[data-theme="modern-dark"] .sidebar,
html[data-theme="modern-light"] .sidebar {
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

html[data-theme="modern-dark"] .sidebar .brand,
html[data-theme="modern-light"] .sidebar .brand {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding: 8px 12px 18px;
}

html[data-theme="modern-dark"] .nav-btn,
html[data-theme="modern-light"] .nav-btn {
  background: transparent;
  color: var(--fg);
  padding: 9px 12px;
  border-radius: 10px;
  border: 0;
  border-left: 3px solid transparent;
  font-weight: 500;
  font-size: 13.5px;
  transition: all 0.15s var(--ease);
  cursor: pointer;
  text-align: left;
}
html[data-theme="modern-dark"] .nav-btn:hover,
html[data-theme="modern-light"] .nav-btn:hover {
  background: var(--bg-softer);
  transform: translateX(2px);
}
html[data-theme="modern-dark"] .nav-btn.active,
html[data-theme="modern-light"] .nav-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

/* Cards */
html[data-theme="modern-dark"] .card,
html[data-theme="modern-light"] .card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease);
}
html[data-theme="modern-dark"] .card:hover,
html[data-theme="modern-light"] .card:hover {
  box-shadow: var(--shadow-md);
}

/* Buttons */
html[data-theme="modern-dark"] button.primary,
html[data-theme="modern-light"] button.primary,
html[data-theme="modern-dark"] .btn-primary,
html[data-theme="modern-light"] .btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 9px 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--accent-glow);
  transition: all 0.2s var(--ease);
}
html[data-theme="modern-dark"] button.primary:hover,
html[data-theme="modern-light"] button.primary:hover,
html[data-theme="modern-dark"] .btn-primary:hover,
html[data-theme="modern-light"] .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--accent-glow);
}
html[data-theme="modern-dark"] button.primary:active,
html[data-theme="modern-light"] button.primary:active {
  transform: translateY(0);
}

html[data-theme="modern-dark"] button:not(.primary):not(.nav-btn):not(.theme-pick):not(.send-btn),
html[data-theme="modern-light"] button:not(.primary):not(.nav-btn):not(.theme-pick):not(.send-btn) {
  background: var(--bg-soft);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
html[data-theme="modern-dark"] button:not(.primary):not(.nav-btn):hover,
html[data-theme="modern-light"] button:not(.primary):not(.nav-btn):hover {
  background: var(--bg-softer);
  border-color: var(--accent);
}

/* Inputs */
html[data-theme="modern-dark"] input[type="text"],
html[data-theme="modern-dark"] input[type="email"],
html[data-theme="modern-dark"] input[type="tel"],
html[data-theme="modern-dark"] input[type="number"],
html[data-theme="modern-dark"] input[type="date"],
html[data-theme="modern-dark"] input[type="time"],
html[data-theme="modern-dark"] input[type="search"],
html[data-theme="modern-dark"] textarea,
html[data-theme="modern-dark"] select,
html[data-theme="modern-light"] input[type="text"],
html[data-theme="modern-light"] input[type="email"],
html[data-theme="modern-light"] input[type="tel"],
html[data-theme="modern-light"] input[type="number"],
html[data-theme="modern-light"] input[type="date"],
html[data-theme="modern-light"] input[type="time"],
html[data-theme="modern-light"] input[type="search"],
html[data-theme="modern-light"] textarea,
html[data-theme="modern-light"] select {
  background: var(--bg-soft);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
html[data-theme="modern-dark"] input:focus,
html[data-theme="modern-dark"] textarea:focus,
html[data-theme="modern-dark"] select:focus,
html[data-theme="modern-light"] input:focus,
html[data-theme="modern-light"] textarea:focus,
html[data-theme="modern-light"] select:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Tabellen */
html[data-theme="modern-dark"] table,
html[data-theme="modern-light"] table {
  border-collapse: separate;
  border-spacing: 0;
}
html[data-theme="modern-dark"] th,
html[data-theme="modern-light"] th {
  background: var(--bg-softer);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
html[data-theme="modern-dark"] td,
html[data-theme="modern-light"] td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
html[data-theme="modern-dark"] tbody tr:hover,
html[data-theme="modern-light"] tbody tr:hover {
  background: var(--bg-softer);
}

/* Modals (best-effort) */
html[data-theme="modern-dark"] .modal,
html[data-theme="modern-light"] .modal,
html[data-theme="modern-dark"] dialog,
html[data-theme="modern-light"] dialog {
  background: var(--bg-soft);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}

/* Badges/Status */
html[data-theme="modern-dark"] .badge,
html[data-theme="modern-light"] .badge,
html[data-theme="modern-dark"] .status-badge,
html[data-theme="modern-light"] .status-badge {
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
}

/* Topbar (wenn vorhanden) */
html[data-theme="modern-dark"] .topbar,
html[data-theme="modern-light"] .topbar,
html[data-theme="modern-dark"] header,
html[data-theme="modern-light"] header {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

/* Scrollbars */
html[data-theme="modern-dark"] *::-webkit-scrollbar,
html[data-theme="modern-light"] *::-webkit-scrollbar {
  width: 8px; height: 8px;
}
html[data-theme="modern-dark"] *::-webkit-scrollbar-thumb,
html[data-theme="modern-light"] *::-webkit-scrollbar-thumb {
  background: var(--bg-softer);
  border-radius: 4px;
}
html[data-theme="modern-dark"] *::-webkit-scrollbar-thumb:hover,
html[data-theme="modern-light"] *::-webkit-scrollbar-thumb:hover {
  background: var(--border);
}

/* Theme-Pick-Buttons selbst (Settings) */
html[data-theme="modern-dark"] .theme-pick[data-theme="modern-dark"],
html[data-theme="modern-light"] .theme-pick[data-theme="modern-light"] {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Floating Theme-Toggle (Sonne/Mond) — rechts oben */
.modern-theme-toggle {
  position: fixed; top: 12px; right: 14px; z-index: 9000;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border, #2d343f);
  background: var(--bg-soft, #1c2028);
  color: var(--fg, #ecf0f4);
  cursor: pointer;
  display: none;
  align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: all 0.2s ease;
}
.modern-theme-toggle:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.25); }
.modern-theme-toggle svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; }
html[data-theme="modern-dark"] .modern-theme-toggle,
html[data-theme="modern-light"] .modern-theme-toggle {
  display: flex;
}

/* === Flach + 1-Farbig: kein Glow, kein Gradient === */
html[data-theme="modern-dark"] button.primary,
html[data-theme="modern-light"] button.primary,
html[data-theme="modern-dark"] .btn-primary,
html[data-theme="modern-light"] .btn-primary,
html[data-theme="modern-dark"] .view-actions button.primary,
html[data-theme="modern-light"] .view-actions button.primary {
  background: var(--accent) !important;
  color: #fff !important;
  border: 1px solid var(--accent) !important;
  box-shadow: none !important;
  background-image: none !important;
}
html[data-theme="modern-dark"] button.primary:hover,
html[data-theme="modern-light"] button.primary:hover,
html[data-theme="modern-dark"] .btn-primary:hover,
html[data-theme="modern-light"] .btn-primary:hover,
html[data-theme="modern-dark"] .view-actions button.primary:hover,
html[data-theme="modern-light"] .view-actions button.primary:hover {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
  transform: none !important;
  box-shadow: none !important;
}
html[data-theme="modern-dark"] button.primary:active,
html[data-theme="modern-light"] button.primary:active {
  transform: none !important;
}

/* Sidebar-Brand: 1-farbig statt Gradient (klares Logo-Look) */
html[data-theme="modern-dark"] .sidebar .brand,
html[data-theme="modern-light"] .sidebar .brand {
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  -webkit-text-fill-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* Avatar/Icon-Bubbles bleiben unangetastet — sind keine Buttons */

/* === Quill Rich-Text Editor in Modern-Themes integrieren === */
html[data-theme="modern-dark"] #qe-intro-editor,
html[data-theme="modern-light"] #qe-intro-editor {
  min-height: 4rem !important;
  background: var(--bg) !important;
  color: var(--fg) !important;
  border: 0;
  border-radius: 0 0 4px 4px;
  padding: 0;
  font-size: 13px;
}







/* Schrift-Picker Vorschau */

/* Editor-Area */

/* Font-Klassen anwendbar */

/* === Listen/Tabellen (Angebote, Auftraege, Rechnungen, Kunden...) === */
html[data-theme="modern-dark"] .table-wrap table,
html[data-theme="modern-light"] .table-wrap table,
html[data-theme="modern-dark"] table.sortable,
html[data-theme="modern-light"] table.sortable {
  font-size: 12.5px !important;
}
html[data-theme="modern-dark"] .table-wrap table th,
html[data-theme="modern-light"] .table-wrap table th,
html[data-theme="modern-dark"] table.sortable th,
html[data-theme="modern-light"] table.sortable th {
  padding: 6px 10px !important;
  font-size: 10.5px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  font-weight: 600 !important;
  color: var(--muted) !important;
  background: var(--bg-softer) !important;
  border-bottom: 1px solid var(--border) !important;
}
html[data-theme="modern-dark"] .table-wrap table td,
html[data-theme="modern-light"] .table-wrap table td,
html[data-theme="modern-dark"] table.sortable td,
html[data-theme="modern-light"] table.sortable td {
  padding: 6px 10px !important;
  border-bottom: 1px solid var(--border) !important;
  vertical-align: middle !important;
}
html[data-theme="modern-dark"] .table-wrap table tbody tr:hover,
html[data-theme="modern-light"] .table-wrap table tbody tr:hover {
  background: var(--bg-softer) !important;
}

/* Status-Dropdowns in Listen kleiner */
html[data-theme="modern-dark"] .table-wrap table select,
html[data-theme="modern-light"] .table-wrap table select {
  padding: 3px 8px !important;
  font-size: 11.5px !important;
  border-radius: 4px !important;
  min-height: unset !important;
  height: auto !important;
}

/* PDF-Links in Tabelle - Akzent-Farbe statt Browser-Default Lila */
html[data-theme="modern-dark"] .table-wrap table a,
html[data-theme="modern-light"] .table-wrap table a,
html[data-theme="modern-dark"] td a,
html[data-theme="modern-light"] td a {
  color: var(--accent) !important;
  text-decoration: none !important;
  font-weight: 500 !important;
}
html[data-theme="modern-dark"] .table-wrap table a:hover,
html[data-theme="modern-light"] .table-wrap table a:hover {
  text-decoration: underline !important;
}
html[data-theme="modern-dark"] .table-wrap table a:visited,
html[data-theme="modern-light"] .table-wrap table a:visited {
  color: var(--accent) !important;
}

/* + Neues Angebot Button & alle .primary-Buttons mit potenziell hardcoded Blau */
html[data-theme="modern-dark"] button.primary,
html[data-theme="modern-light"] button.primary,
html[data-theme="modern-dark"] #new-quotation-btn,
html[data-theme="modern-light"] #new-quotation-btn,
html[data-theme="modern-dark"] #new-customer-btn,
html[data-theme="modern-light"] #new-customer-btn,
html[data-theme="modern-dark"] #new-invoice-btn,
html[data-theme="modern-light"] #new-invoice-btn,
html[data-theme="modern-dark"] #new-sales-order-btn,
html[data-theme="modern-light"] #new-sales-order-btn,
html[data-theme="modern-dark"] #new-work-report-btn,
html[data-theme="modern-light"] #new-work-report-btn {
  background: var(--accent) !important;
  background-image: none !important;
  color: #fff !important;
  border: 1px solid var(--accent) !important;
  box-shadow: none !important;
  padding: 6px 12px !important;
  font-size: 12.5px !important;
  border-radius: 5px !important;
  font-weight: 500 !important;
}
html[data-theme="modern-dark"] button.primary:hover,
html[data-theme="modern-light"] button.primary:hover {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
  transform: none !important;
}

/* Ghost-Buttons (UGL importieren etc.) — flach, klein */
html[data-theme="modern-dark"] button.ghost,
html[data-theme="modern-light"] button.ghost {
  background: var(--bg-soft) !important;
  color: var(--fg) !important;
  border: 1px solid var(--border) !important;
  padding: 6px 12px !important;
  font-size: 12.5px !important;
  border-radius: 5px !important;
  font-weight: 500 !important;
}
html[data-theme="modern-dark"] button.ghost:hover,
html[data-theme="modern-light"] button.ghost:hover {
  background: var(--bg-softer) !important;
  border-color: var(--accent) !important;
}

/* === Angebots-Suche/Filter: kompakt, max 2 Zeilen === */
html[data-theme="modern-dark"] #view-quotations .view-header,
html[data-theme="modern-light"] #view-quotations .view-header,
html[data-theme="modern-dark"] #view-sales-orders .view-header,
html[data-theme="modern-light"] #view-sales-orders .view-header,
html[data-theme="modern-dark"] #view-invoices .view-header,
html[data-theme="modern-light"] #view-invoices .view-header,
html[data-theme="modern-dark"] #view-customers .view-header,
html[data-theme="modern-light"] #view-customers .view-header {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.4rem 0.6rem !important;
  padding: 0.4rem 0.6rem 0.5rem !important;
  margin-bottom: 0.6rem !important;
  border-bottom: 1px solid var(--border) !important;
}
html[data-theme="modern-dark"] #view-quotations .view-header h1,
html[data-theme="modern-light"] #view-quotations .view-header h1,
html[data-theme="modern-dark"] #view-sales-orders .view-header h1,
html[data-theme="modern-light"] #view-sales-orders .view-header h1,
html[data-theme="modern-dark"] #view-invoices .view-header h1,
html[data-theme="modern-light"] #view-invoices .view-header h1,
html[data-theme="modern-dark"] #view-customers .view-header h1,
html[data-theme="modern-light"] #view-customers .view-header h1 {
  font-size: 18px !important;
  font-weight: 600 !important;
  margin: 0 !important;
  flex-basis: 100% !important;  /* h1 nimmt 1. Zeile allein, View-Actions kommen in 2. Zeile */
  margin-bottom: 0.2rem !important;
}
html[data-theme="modern-dark"] #view-quotations .view-actions,
html[data-theme="modern-light"] #view-quotations .view-actions,
html[data-theme="modern-dark"] #view-sales-orders .view-actions,
html[data-theme="modern-light"] #view-sales-orders .view-actions,
html[data-theme="modern-dark"] #view-invoices .view-actions,
html[data-theme="modern-light"] #view-invoices .view-actions,
html[data-theme="modern-dark"] #view-customers .view-actions,
html[data-theme="modern-light"] #view-customers .view-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 0.35rem !important;
  width: 100% !important;
  flex: none !important;
}
html[data-theme="modern-dark"] #view-quotations .view-actions input[type="search"],
html[data-theme="modern-light"] #view-quotations .view-actions input[type="search"],
html[data-theme="modern-dark"] #view-sales-orders .view-actions input[type="search"],
html[data-theme="modern-light"] #view-sales-orders .view-actions input[type="search"],
html[data-theme="modern-dark"] #view-invoices .view-actions input[type="search"],
html[data-theme="modern-light"] #view-invoices .view-actions input[type="search"],
html[data-theme="modern-dark"] #view-customers .view-actions input[type="search"],
html[data-theme="modern-light"] #view-customers .view-actions input[type="search"] {
  flex: 1 1 200px !important;
  min-width: 180px !important;
  max-width: 320px !important;
  padding: 5px 10px !important;
  font-size: 12.5px !important;
  border-radius: 5px !important;
}
html[data-theme="modern-dark"] #view-quotations .view-actions select,
html[data-theme="modern-light"] #view-quotations .view-actions select,
html[data-theme="modern-dark"] #view-sales-orders .view-actions select,
html[data-theme="modern-light"] #view-sales-orders .view-actions select,
html[data-theme="modern-dark"] #view-invoices .view-actions select,
html[data-theme="modern-light"] #view-invoices .view-actions select,
html[data-theme="modern-dark"] #view-customers .view-actions select,
html[data-theme="modern-light"] #view-customers .view-actions select {
  width: auto !important;
  flex: 0 0 auto !important;
  padding: 5px 10px !important;
  font-size: 12.5px !important;
  border-radius: 5px !important;
  min-height: unset !important;
}

/* === Quill Picker: Font + Size Labels erzwingen === */
/* Default Picker-Label (geschlossen, ohne Auswahl) */

/* Size-Picker pro Whitelist-Wert */

/* Font-Picker pro Whitelist-Wert (mit !important damit Quill-Default nicht ueberstimmt) */

/* Picker-Labels sollen text-content NICHT direkt zeigen (sonst doppelt) */

/* === Quill Picker Fix: Click funktioniert wieder, Labels lesbar === */
/* Reset meiner aggressive Overrides */

/* Picker-Item-Liste nicht zu schmal, Click-Target ausreichend */

/* Size-Items zeigen das Label im jeweiligen Pt-Stil, aber max 14pt damit Liste handlich */

/* Font-Items: aktuelle Quill-Whitelist (tahoma, verdana, arial, calibri, times) */

/* Z-Index hoch damit der Picker nicht hinter dem Editor verschwindet */



/* === Quill: nur Theme-Farben, nichts an Layout/Pseudo-Content === */

/* === Quill-Picker: alle ::before leeren, data-label via attr() rendern === */

/* === Kundenkarte (openCustomerForm) === */
html[data-theme="modern-dark"] .cust-tabs,
html[data-theme="modern-light"] .cust-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border) !important;
  margin-bottom: 1rem !important;
  padding: 0 !important;
}
html[data-theme="modern-dark"] .cust-tab,
html[data-theme="modern-light"] .cust-tab {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  color: var(--muted) !important;
  display: inline-flex; align-items: center; gap: 6px;
}
html[data-theme="modern-dark"] .cust-tab:hover,
html[data-theme="modern-light"] .cust-tab:hover {
  background: var(--bg-softer) !important;
  color: var(--fg) !important;
  border-color: transparent !important;
}
html[data-theme="modern-dark"] .cust-tab.active,
html[data-theme="modern-light"] .cust-tab.active {
  background: transparent !important;
  color: var(--accent) !important;
  border-bottom-color: var(--accent) !important;
  font-weight: 600 !important;
}
html[data-theme="modern-dark"] .cust-tab .t-icon,
html[data-theme="modern-light"] .cust-tab .t-icon {
  font-size: 14px !important;
  opacity: 0.85;
}

/* Action-Bar oben: Anrufen / WhatsApp / Mail / Karte */
html[data-theme="modern-dark"] .cust-action-bar,
html[data-theme="modern-light"] .cust-action-bar {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 1rem;
  padding: 8px !important;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}
html[data-theme="modern-dark"] .cust-action,
html[data-theme="modern-light"] .cust-action {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 8px 14px !important;
  font-size: 13px !important;
  color: var(--fg) !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: all 0.15s var(--ease);
}
html[data-theme="modern-dark"] .cust-action:hover,
html[data-theme="modern-light"] .cust-action:hover {
  background: var(--bg-softer) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}
html[data-theme="modern-dark"] .cust-icon,
html[data-theme="modern-light"] .cust-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  font-size: 14px;
}
html[data-theme="modern-dark"] .cust-at,
html[data-theme="modern-light"] .cust-at {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 11px;
}
html[data-theme="modern-dark"] .cust-tab-pane,
html[data-theme="modern-light"] .cust-tab-pane {
  padding: 8px 0;
}


/* === Listen NUR fuer Hauptlisten (NICHT für Editor!) === */
html[data-theme="modern-dark"] #quotations-table,
html[data-theme="modern-light"] #quotations-table,
html[data-theme="modern-dark"] #sales-orders-table,
html[data-theme="modern-light"] #sales-orders-table,
html[data-theme="modern-dark"] #invoices-table,
html[data-theme="modern-light"] #invoices-table,
html[data-theme="modern-dark"] #customers-table,
html[data-theme="modern-light"] #customers-table,
html[data-theme="modern-dark"] #suppliers-table,
html[data-theme="modern-light"] #suppliers-table {
  width: 100% !important;
}
html[data-theme="modern-dark"] #quotations-table th,
html[data-theme="modern-dark"] #quotations-table td,
html[data-theme="modern-dark"] #sales-orders-table th,
html[data-theme="modern-dark"] #sales-orders-table td,
html[data-theme="modern-dark"] #invoices-table th,
html[data-theme="modern-dark"] #invoices-table td,
html[data-theme="modern-light"] #quotations-table th,
html[data-theme="modern-light"] #quotations-table td,
html[data-theme="modern-light"] #sales-orders-table th,
html[data-theme="modern-light"] #sales-orders-table td,
html[data-theme="modern-light"] #invoices-table th,
html[data-theme="modern-light"] #invoices-table td {
  vertical-align: middle !important;
  padding: 8px 10px !important;
}
/* Kunde-Spalte: nicht zu eng */
html[data-theme="modern-dark"] #quotations-table tbody td:first-child,
html[data-theme="modern-dark"] #sales-orders-table tbody td:first-child,
html[data-theme="modern-dark"] #invoices-table tbody td:first-child,
html[data-theme="modern-light"] #quotations-table tbody td:first-child,
html[data-theme="modern-light"] #sales-orders-table tbody td:first-child,
html[data-theme="modern-light"] #invoices-table tbody td:first-child {
  white-space: nowrap !important;
  min-width: 170px;
}
/* Nummer + Datum + Beträge nowrap */
html[data-theme="modern-dark"] #quotations-table tbody td:nth-child(2),
html[data-theme="modern-dark"] #sales-orders-table tbody td:nth-child(2),
html[data-theme="modern-dark"] #invoices-table tbody td:nth-child(2),
html[data-theme="modern-light"] #quotations-table tbody td:nth-child(2),
html[data-theme="modern-light"] #sales-orders-table tbody td:nth-child(2),
html[data-theme="modern-light"] #invoices-table tbody td:nth-child(2),
html[data-theme="modern-dark"] #quotations-table tbody td:nth-child(n+5),
html[data-theme="modern-dark"] #sales-orders-table tbody td:nth-child(n+5),
html[data-theme="modern-dark"] #invoices-table tbody td:nth-child(n+5),
html[data-theme="modern-light"] #quotations-table tbody td:nth-child(n+5),
html[data-theme="modern-light"] #sales-orders-table tbody td:nth-child(n+5),
html[data-theme="modern-light"] #invoices-table tbody td:nth-child(n+5) {
  white-space: nowrap !important;
}
/* Titel: max 2 Zeilen */
html[data-theme="modern-dark"] #quotations-table tbody td:nth-child(3),
html[data-theme="modern-dark"] #sales-orders-table tbody td:nth-child(3),
html[data-theme="modern-dark"] #invoices-table tbody td:nth-child(3),
html[data-theme="modern-light"] #quotations-table tbody td:nth-child(3),
html[data-theme="modern-light"] #sales-orders-table tbody td:nth-child(3),
html[data-theme="modern-light"] #invoices-table tbody td:nth-child(3) {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  max-width: 420px;
}
/* Status-Select breit */
html[data-theme="modern-dark"] #quotations-table select,
html[data-theme="modern-dark"] #sales-orders-table select,
html[data-theme="modern-dark"] #invoices-table select,
html[data-theme="modern-light"] #quotations-table select,
html[data-theme="modern-light"] #sales-orders-table select,
html[data-theme="modern-light"] #invoices-table select {
  min-width: 130px !important;
  width: auto !important;
}

/* === Editor modern OHNE Layout-Trickserei (nur Farben + Typo + Padding) === */

/* Header-Fieldset */
html[data-theme="modern-dark"] .qe-header,
html[data-theme="modern-light"] .qe-header {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.2rem;
}
html[data-theme="modern-dark"] .qe-header legend,
html[data-theme="modern-light"] .qe-header legend {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 6px;
}
html[data-theme="modern-dark"] .qe-header label,
html[data-theme="modern-light"] .qe-header label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-transform: uppercase;
}

/* Position-Gruppe (das fieldset um die Tabelle) */
html[data-theme="modern-dark"] .qe-group,
html[data-theme="modern-light"] .qe-group {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 1rem;
}
html[data-theme="modern-dark"] .qe-group legend,
html[data-theme="modern-light"] .qe-group legend {
  font-weight: 600;
  font-size: 13px;
  color: var(--fg);
  padding: 0 6px;
}

/* Tabellen-Header */
html[data-theme="modern-dark"] table.qe-items th,
html[data-theme="modern-light"] table.qe-items th {
  background: var(--bg-softer);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
/* Tabellen-Cells: nur Padding, KEIN nowrap, KEIN height */
html[data-theme="modern-dark"] table.qe-items td,
html[data-theme="modern-light"] table.qe-items td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
}

/* Totals */
html[data-theme="modern-dark"] .qe-totals,
html[data-theme="modern-light"] .qe-totals {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem 1.1rem;
}

/* Add-Position-Buttons (+Position / +Alternative ...) */
html[data-theme="modern-dark"] .qe-add button,
html[data-theme="modern-light"] .qe-add button {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
}

/* Sub-Action-Buttons in qe-actions (Stift/Trash für Gruppe) */
html[data-theme="modern-dark"] .qe-actions button,
html[data-theme="modern-light"] .qe-actions button {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 5px;
}

/* === qe-Editor kompakter (nur innerhalb qe-Elemente, keine globalen Selektoren) === */
html[data-theme="modern-dark"] .qe-header,
html[data-theme="modern-light"] .qe-header {
  padding: 0.7rem 1rem !important;
  position: relative;
}
html[data-theme="modern-dark"] .qe-header legend,
html[data-theme="modern-light"] .qe-header legend {
  cursor: pointer;
  user-select: none;
  padding: 4px 6px !important;
}
html[data-theme="modern-dark"] .qe-header legend:hover,
html[data-theme="modern-light"] .qe-header legend:hover {
  color: var(--accent);
}
html[data-theme="modern-dark"] .qe-header legend::after,
html[data-theme="modern-light"] .qe-header legend::after {
  content: " ▼";
  font-size: 9px;
  opacity: 0.6;
  margin-left: 4px;
}
html[data-theme="modern-dark"] .qe-header.collapsed legend::after,
html[data-theme="modern-light"] .qe-header.collapsed legend::after {
  content: " ▶";
}
html[data-theme="modern-dark"] .qe-header.collapsed > label,
html[data-theme="modern-light"] .qe-header.collapsed > label {
  display: none !important;
}
html[data-theme="modern-dark"] .qe-header label,
html[data-theme="modern-light"] .qe-header label {
  font-size: 10.5px !important;
  font-weight: 600 !important;
  margin-bottom: 0.5rem !important;
  display: block;
}
html[data-theme="modern-dark"] .qe-header input,
html[data-theme="modern-dark"] .qe-header select,
html[data-theme="modern-dark"] .qe-header textarea,
html[data-theme="modern-light"] .qe-header input,
html[data-theme="modern-light"] .qe-header select,
html[data-theme="modern-light"] .qe-header textarea {
  padding: 5px 9px !important;
  font-size: 13px !important;
  border-radius: 5px !important;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
/* Tabellenzeilen kompakter (nur qe-items, keine td-Höhe!) */
html[data-theme="modern-dark"] table.qe-items td,
html[data-theme="modern-light"] table.qe-items td {
  padding: 3px 6px !important;
  font-size: 12.5px;
}
html[data-theme="modern-dark"] table.qe-items input.cell-edit,
html[data-theme="modern-dark"] table.qe-items select.cell-edit,
html[data-theme="modern-light"] table.qe-items input.cell-edit,
html[data-theme="modern-light"] table.qe-items select.cell-edit {
  padding: 1px 4px !important;
  font-size: 12.5px !important;
  border-radius: 3px;
}
html[data-theme="modern-dark"] table.qe-items input.hl,
html[data-theme="modern-light"] table.qe-items input.hl {
  font-size: 13px !important;
  font-weight: 600 !important;
}
html[data-theme="modern-dark"] table.qe-items input.desc,
html[data-theme="modern-light"] table.qe-items input.desc {
  font-size: 11.5px !important;
  color: var(--muted) !important;
}

/* Kopf-View-Header (Angebot AN-XXX + Kunde) kompakter */
html[data-theme="modern-dark"] #view-quotation-editor .view-header,
html[data-theme="modern-light"] #view-quotation-editor .view-header,
html[data-theme="modern-dark"] #view-sales-order-editor .view-header,
html[data-theme="modern-light"] #view-sales-order-editor .view-header,
html[data-theme="modern-dark"] #view-invoice-editor .view-header,
html[data-theme="modern-light"] #view-invoice-editor .view-header {
  padding: 8px 12px !important;
}
html[data-theme="modern-dark"] #view-quotation-editor .view-header h1,
html[data-theme="modern-light"] #view-quotation-editor .view-header h1,
html[data-theme="modern-dark"] #view-sales-order-editor .view-header h1,
html[data-theme="modern-light"] #view-sales-order-editor .view-header h1,
html[data-theme="modern-dark"] #view-invoice-editor .view-header h1,
html[data-theme="modern-light"] #view-invoice-editor .view-header h1 {
  font-size: 16px !important;
  margin: 0 !important;
}

/* === Quill-Picker: ::before pseudo komplett aus, dann JS relabelt textContent === */

/* === Quill-Picker: ::before content komplett aus (JS füllt textContent einmalig) === */
.ql-picker.ql-font .ql-picker-label::before,
.ql-picker.ql-font .ql-picker-item::before,
.ql-picker.ql-size .ql-picker-label::before,
.ql-picker.ql-size .ql-picker-item::before {
  content: none !important;
}
.ql-picker.ql-font .ql-picker-item,
.ql-picker.ql-size .ql-picker-item {
  padding: 6px 12px !important;
  cursor: pointer !important;
}

/* === Sidebar Modern: schmäler + klappbar === */
html[data-theme*="modern"] .sidebar {
  width: 200px !important;
  min-width: 200px !important;
  padding: 12px 8px !important;
  transition: width 0.2s ease, min-width 0.2s ease, padding 0.2s ease;
}
html[data-theme*="modern"] .sidebar .nav-btn {
  font-size: 13px !important;
  padding: 7px 10px !important;
  gap: 6px;
  display: flex !important;
  align-items: center !important;
}
html[data-theme*="modern"] .sidebar .brand {
  font-size: 14px !important;
  padding: 6px 10px 14px !important;
}

/* Collapse-Button */
.sidebar-collapse-btn {
  position: fixed; top: 14px; left: 14px; z-index: 60;
  width: 32px; height: 32px; border-radius: 6px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--fg, #ecf0f4);
  cursor: pointer; display: none;
  align-items: center; justify-content: center;
}
.sidebar-collapse-btn:hover { background: rgba(0,0,0,0.6); }
html[data-theme="modern-dark"] .sidebar-collapse-btn,
html[data-theme="modern-light"] .sidebar-collapse-btn {
  display: flex;
}
html[data-theme="modern-light"] .sidebar-collapse-btn {
  background: rgba(255,255,255,0.7);
  border-color: rgba(0,0,0,0.1);
  color: #1a1d23;
}

/* Collapsed: nur Icons sichtbar */
html[data-theme*="modern"][data-sidebar="collapsed"] .sidebar {
  width: 58px !important;
  min-width: 58px !important;
  padding: 12px 4px !important;
  overflow: hidden !important;
}
html[data-theme*="modern"][data-sidebar="collapsed"] .sidebar .brand {
  font-size: 0 !important;
  padding: 8px 0 16px !important;
  text-align: center !important;
  height: 40px;
}
html[data-theme*="modern"][data-sidebar="collapsed"] .sidebar .brand::after {
  content: "K";
  font-size: 18px !important;
  font-weight: 800 !important;
  color: var(--accent) !important;
}
html[data-theme*="modern"][data-sidebar="collapsed"] .nav-btn {
  font-size: 0 !important;
  justify-content: center !important;
  padding: 8px 0 !important;
  text-align: center !important;
  border-left: 0 !important;
  border-radius: 8px !important;
  position: relative;
}
html[data-theme*="modern"][data-sidebar="collapsed"] .nav-btn svg {
  margin: 0 !important;
  width: 18px !important;
  height: 18px !important;
}
html[data-theme*="modern"][data-sidebar="collapsed"] .nav-btn:hover::after {
  content: attr(data-label);
  position: absolute; left: 64px; top: 50%;
  transform: translateY(-50%);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--fg);
  white-space: nowrap;
  z-index: 9000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
html[data-theme*="modern"][data-sidebar="collapsed"] .sidebar .badge {
  display: none !important;
}
html[data-theme*="modern"][data-sidebar="collapsed"] .sidebar details > summary {
  font-size: 0 !important;
  padding: 6px 0 !important;
}
html[data-theme*="modern"][data-sidebar="collapsed"] .sidebar details > summary::before {
  content: "•••";
  font-size: 10px !important;
  color: var(--muted) !important;
  letter-spacing: 1px;
  display: block;
  text-align: center;
}
html[data-theme*="modern"][data-sidebar="collapsed"] .sidebar [class*="version"],
html[data-theme*="modern"][data-sidebar="collapsed"] .sidebar [class*="version-pill"] {
  display: none !important;
}

/* Labels für nav-btn aus data-label attribute (durch JS gesetzt) — Quill skipped */
