/* ════════════════════════════════════════════════════════════════
   style.css — Alle Styles für den Manager
   ════════════════════════════════════════════════════════════════ */

/* ── TYPOGRAFIE-SYSTEM ──────────────────────────────────────────
   --text-micro : 14px  → Versionsnummer, Metainfos, Badges
   --text-sm    : 16px  → Buttons, Nav-Links, Labels, Hints
   --text-base  : 18px  → Inputs, Textarea, Fließtext, Listen
   --text-md    : 22px  → Section-Titel, Abschnittsüberschriften
   --text-lg    : 28px  → Tool-Name, Seitentitel
   ──────────────────────────────────────────────────────────────── */
:root {
  /* ── Typografie ── */
  --text-micro : 14px;
  --text-sm    : 16px;
  --text-base  : 18px;
  --text-md    : 22px;
  --text-lg    : 28px;

  /* ── Farben (Dashboard + Tools) ── */
  --bg:           #f0f2f5;
  --surface:      #e5e7eb;
  --border:       #e2e4e9;
  --text:         #1a1d23;
  --text-muted:   #6b7280;
  --nav-bg:       #1e2129;
  --nav-text:     #f0f1f3;
  --nav-muted:    #9ca3af;

  /* ── Schatten ── */
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.07);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.09);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.13);

  /* ── Radien ── */
  --radius-sm:    6px;
  --radius-md:    12px;
  --radius-lg:    20px;

  /* ── Transition ── */
  --transition:   0.18s ease;

  /* ── Dashboard Layout-Dimensionen ──────────────────────
     Nur --col-card-width ändern – alles andere berechnet sich:
     Content = col-card-width − 40px Padding − 4px Border
     subcol  = (Content − 2 × subcol-gap) / 3
  ──────────────────────────────────────────────────────── */
  --header-height:     56px;
  --col-card-width:     900px;
  --col-margin:          20px;
  --column-width:      calc(var(--col-card-width) + var(--col-margin));
  --subcol-gap:          20px;
  --subcol-width:      calc((var(--col-card-width) - 50px - 2 * var(--subcol-gap)) / 3);
  --col-content-pad:     20px;
  --tile-height:        60px;
  --tile-gap:            10px;
  --col-header-height:   60px;
}

/* ── BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: var(--text-base); background: #f4f5f7; color: #1a1d23; height: 100vh; overflow: hidden; display: flex; }

/* ── VERWALTUNGSBEREICH (geteilt) ── */
#verwaltung { width: 280px; min-width: 280px; background: #1e2129; display: flex; flex-direction: column; height: 100vh; overflow-y: auto; overflow-x: hidden; flex-shrink: 0; transition: width 0.25s ease, min-width 0.25s ease; }
.vw-dash { padding: 20px 18px 16px; border-bottom: 1px solid #aaa; display: flex; align-items: center; justify-content: space-between; }
.vw-back { display: flex; align-items: center; gap: 5px; color: #aaaaaa; text-decoration: none; font-size: var(--text-sm); transition: color 0.15s; flex: 1; }
.vw-back:hover { color: #9ca3af; }

/* ── COLLAPSE TOGGLE ── */
.vw-collapse-btn { background: none; border: none; color: #6b7280; cursor: pointer; padding: 4px; border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: color 0.15s, background 0.15s; flex-shrink: 0; }
.vw-collapse-btn:hover { background: #2d3340; color: #f0f1f3; }
.vw-collapse-btn svg { transition: transform 0.25s; }
#verwaltung.collapsed .vw-collapse-btn svg { transform: rotate(180deg); }

/* Dashboard-Icon (nur im collapsed state sichtbar) */
.vw-back-icon { display: none; }
/* Section-Icon-Buttons (nur im collapsed state sichtbar) */
.vw-section-icon-btn { display: none; }

/* ── COLLAPSED STATE ── */
#verwaltung.collapsed { width: 40px; min-width: 40px; overflow-y: hidden; }
#verwaltung.collapsed .vw-dash { flex-direction: column; padding: 10px 0 4px; border-bottom: none; gap: 4px; align-items: center; }
#verwaltung.collapsed .vw-back { display: none; }
#verwaltung.collapsed .vw-back-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: #9ca3af; text-decoration: none; transition: all 0.15s; }
#verwaltung.collapsed .vw-back-icon:hover { background: #2d3340; color: #f0f1f3; }
#verwaltung.collapsed .vw-info { display: none; }
#verwaltung.collapsed .vw-status { display: none; }
#verwaltung.collapsed .vw-add-section { padding: 4px 0; border-bottom: none; display: flex; flex-direction: column; align-items: center; gap: 4px; }
#verwaltung.collapsed .btn-add { width: 32px; height: 32px; padding: 0; font-size: 0; gap: 0; border-radius: 8px; }
#verwaltung.collapsed .add-col-btn { width: 32px; height: 32px; padding: 0; font-size: 0; gap: 0; border-radius: 8px; margin-top: 0; }
#verwaltung.collapsed .vw-section { padding: 2px 0; border-bottom: none; display: flex; justify-content: center; }
#verwaltung.collapsed .vw-section-title { display: none !important; }
#verwaltung.collapsed .vw-termin-scroll { display: none !important; }
#verwaltung.collapsed .vw-section-icon-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: #9ca3af; text-decoration: none; transition: all 0.15s; }
#verwaltung.collapsed .vw-section-icon-btn:hover { background: #2d3340; color: #f0f1f3; }
.nebenkosten .vw-info {    padding-bottom: 15px;
    border-bottom: 1px solid #bbb;}
.vw-info { padding: 20px 18px 5px; }
.gewicht .vw-info { padding-bottom: 20px; border-bottom:1px solid #bbb; }
.vw-tool-name { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.vw-tool-label { color: #f0f1f3; font-size: var(--text-lg); font-weight: 600; }
#vw-date { font-size: var(--text-sm); color: #aaaaaa; line-height: 1.6; }
.vw-status { display: none; padding: 14px 18px; border-bottom: 1px solid #2d3340; min-height: 52px; }
#vw-status-text { font-size: var(--text-sm); color: #9ca3af; line-height: 1.5; }

.vw-add-section { padding: 9px 15px 20px; border-bottom: 1px solid #aaa; }
.btn-add { display: flex; align-items: center; gap: 6px; background: goldenrod; color: #fff; border: none; padding: 8px 14px; border-radius: 4px; font-size: var(--text-sm); font-weight: 500; cursor: pointer; white-space: nowrap; transition: background 0.15s; width: 100%; justify-content: center; }
.btn-add:hover { background: #d97706; }
.btn-add.open { background: goldenrod; }
#edit-mode-toggle.active { background: #92640a; }

.vw-section { padding: 20px 18px; border-bottom: 1px solid #aaa; }
.vw-section-title { font-size: var(--text-md); font-weight: 600; color: #aaaaaa; text-transform: uppercase; letter-spacing: 0.08em; }
.vw-tool-link { display: flex; align-items: center; gap: 8px; color: #9ca3af; text-decoration: none; font-size: var(--text-sm); padding: 6px 8px; border-radius: 6px; transition: all 0.15s; margin-bottom: 2px; }
.vw-tool-link:hover { background: #2d3340; color: #f0f1f3; }
.vw-placeholder { font-size: var(--text-sm); color: #aaaaaa; font-style: italic; padding: 0; }

/* VW: Termin-Liste */
.vw-termin-scroll { max-height: 270px; overflow-y: auto; }
.vw-termin-scroll::-webkit-scrollbar { width: 3px; }
.vw-termin-scroll::-webkit-scrollbar-track { background: transparent; }
.vw-termin-scroll::-webkit-scrollbar-thumb { background: #3d4455; border-radius: 3px; }
.vw-termin-item { padding: 10px 0 0 0; border-radius: 6px; cursor: pointer; transition: background 0.15s; }
.vw-termin-item:hover { background: #2d3340; }
.vw-termin-item.active { background: rgba(139,92,246,0.2); }
.vw-termin-date { font-size: var(--text-sm); color: #aaaaaa; font-weight: 500; }
.vw-termin-title { font-size: var(--text-sm); color: #9ca3af; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vw-termin-item.active .vw-termin-title { color: #c4b5fd; }
.vw-termin-empty { font-size: var(--text-sm); color: #aaaaaa; font-style: italic; padding: 4px 8px; }

/* ── TOOL-BEREICH (geteilt) ── */
#tool-bereich { flex: 1; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
#funktionszeile { flex: 0 0 56px;background: #fff; border-bottom: 1px solid #e2e4e9; padding: 0 20px; display: flex; align-items: center; gap: 8px; }
.fz-left  { display: flex; align-items: center; gap: 6px; flex: 1; }
.fz-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.fz-divider { width: 1px; height: 20px; background: #e2e4e9; flex-shrink: 0; margin: 0 2px; }
.fz-title { font-size: var(--text-base); font-weight: 600; color: #1a1d23; }
.fz-count { font-size: var(--text-sm); color: #9ca3af; }
.btn-mini { background: goldenrod; border: 1px solid #aaa; color: #fff; padding: 4px 10px; border-radius: 6px; font-size: var(--text-sm); cursor: pointer; white-space: nowrap; transition: all 0.15s; }
.btn-mini:hover { border-color: #9ca3af; color: #374151; }

/* ── Scrollbars (geteilt) ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e2e4e9; border-radius: 3px; }

/* ── Toast (geteilt) ── */
.toast { position: fixed; bottom: 20px; right: 20px; padding: 9px 16px; border-radius: 8px; background: #1e2129; color: #f0f1f3; font-size: var(--text-sm); font-weight: 500; opacity: 0; transform: translateY(6px); transition: all 0.2s; z-index: 999; pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: #065f46; }
.toast.error   { background: #991b1b; }


/* ════════════════════════════════════════════════════════════════
   GEWICHT-TRACKER
   ════════════════════════════════════════════════════════════════ */

:root {
  --gew:       #0891b2;
  --gew-light: #ecfeff;
  --gew-dark:  #0e7490;
}

/* ── Editor-Zeile (Eingabe + Felder nebeneinander) ── */
#gew-editor-row { display: flex; flex-shrink: 0; border-bottom: 2px solid #e2e4e9; min-height: 0; }

/* ── Eingabebereich ── */
#gew-input-section { flex: 1; min-width: 0; padding: 14px 16px; border-right: 1px solid #e2e4e9; background: #f9fafb; display: flex; flex-direction: column; gap: 8px; }

/* ── Felder-Bereich ── */
#gew-fields-section { flex: 1; min-width: 0; padding: 14px 16px; background: var(--gew-light); display: flex; flex-direction: column; gap: 8px; }
.gew-fields-header { font-size: var(--text-micro); font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.07em; display: flex; align-items: center; gap: 6px; min-height: 18px; }
.gew-fields-header.active { color: var(--gew-dark); }
.gew-fields-grid { display: flex; gap: 8px; flex: 1; align-items: stretch; }
.gew-fields-col-left { display: flex; flex-direction: column; gap: 8px; flex: 0 0 160px; }
.gew-fields-col-mid, .gew-fields-col-right { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.gew-fields-col-mid .gew-preview-textarea, .gew-fields-col-right .gew-preview-textarea { flex: 1; height: auto; }
#gew-fields-section.empty .gew-preview-input,
#gew-fields-section.empty .gew-preview-textarea { background: #f3f4f6; color: #d1d5db; border-color: #e5e7eb; }
.gew-textarea { width: 100%; border: 1px solid #e2e4e9; border-radius: 8px; padding: 10px 14px; font-size: var(--text-base); font-family: inherit; resize: none; min-height: 90px; color: #1a1d23; background: #fff; transition: border-color 0.15s, box-shadow 0.15s; line-height: 1.5; margin-bottom: 8px; }
.gew-textarea::placeholder { color: #ddd; }
.gew-textarea:focus { outline: none; border-color: var(--gew); box-shadow: 0 0 0 3px rgba(8,145,178,0.1); }
.gew-input-row { display: flex; gap: 8px; align-items: center; }

.btn-gew-ki { display: flex; align-items: center; gap: 6px; background: var(--gew); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font-size: var(--text-sm); font-weight: 500; cursor: pointer; transition: background 0.15s; font-family: inherit; }
.btn-gew-ki:hover { background: var(--gew-dark); }
.btn-gew-ki:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-gew-clear { display: flex; align-items: center; gap: 6px; background: none; border: 1px solid #e2e4e9; color: #9ca3af; border-radius: 8px; padding: 8px 12px; font-size: var(--text-sm); cursor: pointer; font-family: inherit; transition: all 0.15s; }
.btn-gew-clear:hover { border-color: #9ca3af; color: #374151; }

.gew-hint { font-size: var(--text-micro); color: #9ca3af; margin-left: 6px; }
.gew-hint.loading { color: var(--gew); }
.gew-hint.error   { color: #b91c1c; }
.gew-hint.ok      { color: #059669; }

/* ── Vorschau-Bereich ── */
#gew-preview-section { background: var(--gew-light); border-bottom: 2px solid var(--gew); padding: 14px 20px; flex-shrink: 0; display: none; }
#gew-preview-section.visible { display: block; }

.gew-preview-title { font-size: var(--text-sm); font-weight: 600; color: var(--gew-dark); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.gew-preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 12px; }
.gew-preview-field { display: flex; flex-direction: column; gap: 3px; }
.gew-preview-label { font-size: var(--text-micro); font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.06em; }
.gew-preview-input { border: 1px solid #a5f3fc; border-radius: 6px; padding: 6px 10px; font-size: var(--text-sm); font-family: inherit; color: #1a1d23; background: #fff; outline: none; transition: border-color 0.15s; }
.gew-preview-input:focus { border-color: var(--gew); }
.gew-preview-input::placeholder { color: #ddd; }
.gew-preview-textarea { border: 1px solid #a5f3fc; border-radius: 6px; padding: 6px 10px; font-size: var(--text-sm); font-family: inherit; color: #1a1d23; background: #fff; resize: none; height: 58px; outline: none; transition: border-color 0.15s; line-height: 1.5; }
.gew-preview-textarea:focus { border-color: var(--gew); }
.gew-preview-actions { display: flex; gap: 8px; }

.btn-gew-save { display: flex; align-items: center; gap: 6px; background: var(--gew); color: #fff; border: none; border-radius: 7px; padding: 8px 18px; font-size: var(--text-sm); font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.15s; }
.btn-gew-save:hover { background: var(--gew-dark); }
.btn-gew-discard { display: flex; align-items: center; gap: 6px; background: none; border: 1px solid #e2e4e9; color: #9ca3af; border-radius: 7px; padding: 8px 14px; font-size: var(--text-sm); cursor: pointer; font-family: inherit; transition: all 0.15s; }
.btn-gew-discard:hover { border-color: #9ca3af; color: #374151; }

/* ── Hauptbereich: Liste + Chart ── */
#gew-main-content { flex: 1; display: flex; overflow: hidden; min-height: 0; }

#gew-liste { width: 300px; min-width: 300px; border-right: 1px solid #e2e4e9; overflow-y: auto; background: #fff; flex-shrink: 0; }
.gew-liste-header { padding: 12px 16px 10px; border-bottom: 1px solid #e2e4e9; font-size: var(--text-sm); font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.07em; position: sticky; top: 0; background: #fff; z-index: 1; }

.gew-karte { padding: 12px 16px; border-bottom: 1px solid #f3f4f6; transition: background 0.12s; border-left: 3px solid transparent; cursor: pointer; }
.gew-karte:hover { background: #f9fafb; border-left-color: var(--gew); }
.gew-karte.selected { background: #ecfeff; border-left-color: var(--gew); }
.gew-karte-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.gew-karte-datum { font-size: var(--text-micro); color: #9ca3af; font-weight: 500; }
.gew-karte-row { display: flex; align-items: baseline; gap: 4px; margin-bottom: 5px; }
.gew-karte-gewicht { font-size: var(--text-md); font-weight: 700; color: var(--gew); line-height: 1; }
.gew-karte-kg { font-size: var(--text-sm); color: #9ca3af; }
.gew-karte-kal { font-size: var(--text-micro); color: #6b7280; background: #f3f4f6; padding: 1px 6px; border-radius: 10px; margin-left: auto; }
.gew-karte-kommentar { font-size: var(--text-sm); color: #6b7280; line-height: 1.45; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gew-karte-essen { font-size: var(--text-micro); color: #9ca3af; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gew-delete-btn { background: none; border: none; color: #d1d5db; cursor: pointer; padding: 3px; border-radius: 4px; display: flex; align-items: center; transition: color 0.12s, background 0.12s; opacity: 0; flex-shrink: 0; }
.gew-karte:hover .gew-delete-btn { opacity: 1; }
.gew-delete-btn:hover { color: #b91c1c; background: #fee2e2; }

.gew-liste-empty { padding: 32px 16px; text-align: center; color: #9ca3af; font-size: var(--text-sm); font-style: italic; }

/* ── Chart-Bereich ── */
#gew-chart-bereich { flex: 1; padding: 20px; overflow: hidden; display: flex; flex-direction: column; }
.gew-chart-title { font-size: var(--text-sm); font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 16px; }
.gew-chart-wrap { flex: 1; position: relative; min-height: 0; }
.gew-chart-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: #d1d5db; font-size: var(--text-sm); font-style: italic; }

/* ════════════════════════════════════════════════════════════════
   NEBENKOSTEN
   ════════════════════════════════════════════════════════════════ */

#nk-sparten { display: flex; gap: 20px; padding: 20px; height: calc(100vh - 52px); overflow: auto; box-sizing: border-box; }

.nk-sparte { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; overflow-y: auto; }

/* Sparten-Header */
.nk-sparte-header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 10px; font-size: var(--text-md); font-weight: 600; color: #fff; flex-shrink: 0; }
.nk-sparte-header svg { width: 22px; height: 22px; }
.nk-wasser .nk-sparte-header { background: #06b6d4; }
.nk-gas    .nk-sparte-header { background: #f59e0b; }
.nk-strom  .nk-sparte-header { background: #3b82f6; }

/* Karten */
.nk-karte { background: #fff; border: 1px solid #e2e4e9; border-radius: 10px; padding: 14px 16px; flex-shrink: 0; }
.nk-karte-titel { font-size: var(--text-sm); font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }

/* Stammdaten */
.nk-stammdaten-row { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--text-sm); color: #6b7280; padding: 3px 0; }
.nk-stammdaten-row span:last-child { font-weight: 600; color: #1a1d23; }
.nk-stammdaten-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }

/* Eingabe */
.nk-eingabe-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.nk-eingabe-row label { font-size: var(--text-sm); color: #6b7280; }
.nk-eingabe-row input { padding: 8px 10px; border: 1px solid #e2e4e9; border-radius: 7px; font-size: var(--text-sm); font-family: inherit; color: #1a1d23; background: #f9fafb; width: 100%; box-sizing: border-box; }
.nk-eingabe-row input:focus { outline: none; border-color: #06b6d4; background: #fff; }
.nk-gas   .nk-eingabe-row input:focus { border-color: #f59e0b; }
.nk-strom .nk-eingabe-row input:focus { border-color: #3b82f6; }

/* Speichern-Button */
.btn-nk-save { display: flex; align-items: center; gap: 7px; padding: 9px 14px; border: none; border-radius: 7px; font-size: var(--text-sm); font-weight: 600; cursor: pointer; width: 100%; justify-content: center; transition: opacity 0.15s; color: #fff; }
.btn-nk-save:hover { opacity: 0.85; }
.btn-nk-save svg { width: 16px; height: 16px; }
.nk-wasser {min-width:400px;}
.nk-wasser .btn-nk-save { background: #06b6d4; }
.nk-gas {min-width:620px;}
.nk-gas    .btn-nk-save { background: #f59e0b; }
.nk-strom {min-width:620px;}
.nk-strom  .btn-nk-save { background: #3b82f6; }

/* Summary-Chips */
.nk-summary { display: flex; gap: 10px; flex-shrink: 0; }
.nk-summary-chip { flex: 1; background: #f4f5f7; border-radius: 8px; padding: 10px 12px; text-align: center; }
.nk-summary-chip .chip-label { font-size: 13px; color: #6b7280; margin-bottom: 4px; }
.nk-summary-chip .chip-wert { font-size: var(--text-md); font-weight: 700; color: #1a1d23; }
.nk-summary-chip.positiv .chip-wert { color: #10b981; }
.nk-summary-chip.negativ .chip-wert { color: #ef4444; }

/* Historientabelle */
.nk-tabelle-wrap { overflow-y: auto; flex: 1; border: 1px solid #e2e4e9; border-radius: 10px; background: #fff; }
.nk-tabelle { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.nk-tabelle thead th { border-right:1px solid #eee; position: sticky; top: 0; background: #f4f5f7; padding: 9px 12px; text-align: center; font-weight: 600; color: #6b7280; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid #e2e4e9; white-space: nowrap; }
.nk-tabelle td { border-right:1px solid #eee;padding: 9px 12px; border-bottom: 1px solid #f0f1f3; color: #1a1d23; white-space: nowrap; text-align: center; }
.nk-tabelle tbody tr:last-child td { border-bottom: none; }
.nk-tabelle tbody tr:hover { background: #f9fafb; }
.nk-tabelle th.nk-td-monat, .nk-tabelle td.nk-td-monat { text-align: left; }
.nk-tabelle td.abw-positiv { color: #10b981; font-weight: 600; }
.nk-tabelle td.abw-negativ { color: #ef4444; font-weight: 600; }
.nk-tabelle td.nk-leer { text-align: center; color: #9ca3af; padding: 28px; }

/* Platzhalter "Kommt bald" */
.nk-bald { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #f9fafb; border: 2px dashed #e2e4e9; border-radius: 10px; color: #9ca3af; font-size: var(--text-sm); margin-top: 12px; }
.nk-bald svg { width: 32px; height: 32px; color: #d1d5db; }

/* Löschen-Button in Tabellenzeile */
.btn-row-del { background: none; border: none; cursor: pointer; color: #d1d5db; padding: 2px 4px; border-radius: 4px; transition: color 0.15s; }
.btn-row-del:hover { color: #b91c1c; }
.btn-row-del svg { width: 14px; height: 14px; }

/* Abschluss-Button (Strom/Gas) */
.nk-abschluss-btn { background: none; border: 1px solid #d1d5db; color: #d1d5db; border-radius: 4px; padding: 1px 6px; cursor: pointer; font-size: 13px; transition: all 0.15s; }
.nk-abschluss-btn:hover { border-color: #3b82f6; color: #3b82f6; }
.nk-abschluss-aktiv { background: #dbeafe; border: 1px solid #3b82f6; color: #1d4ed8; border-radius: 4px; padding: 1px 6px; cursor: pointer; font-size: 13px; font-weight: 700; transition: all 0.15s; }
.nk-abschluss-aktiv:hover { background: #fee2e2; border-color: #b91c1c; color: #b91c1c; }

/* Abschluss-Zeile in der Tabelle */
.nk-row-abschluss td { background: #eff6ff; }
.nk-row-abschluss td:first-child { border-top: 2px solid #3b82f6; }
.nk-row-abschluss td { border-top: 2px solid #3b82f6; }


/* ════════════════════════════════════════════════════════════════
   DASHBOARD  (index.html)
   Scope: body.dashboard überschreibt die Tool-Body-Defaults
   ════════════════════════════════════════════════════════════════ */

body.dashboard {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  overflow: hidden;
  display: flex;
}
html { scroll-behavior: smooth; }

/* ── App Header ── */
.app-header {
  height: var(--header-height);
  background: var(--nav-bg);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04);
}
.header-brand {
  font-family: 'DM Sans', sans-serif;
  font-size: 27px;
  font-weight: 600;
  color: var(--nav-text);
  letter-spacing: -0.3px;
  flex-shrink: 0;
}
.header-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.10);
  flex-shrink: 0;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 17px;
  font-weight: 500;
  color: var(--nav-muted);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border: none;
  background: none;
  font-family: 'DM Sans', sans-serif;
}
.nav-link:hover  { background: rgba(255,255,255,0.07); color: var(--nav-text); }
.nav-link.active { background: rgba(255,255,255,0.10); color: var(--nav-text); }
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.header-date {
  font-size: 16px;
  color: var(--nav-muted);
  font-weight: 300;
}

/* ── Horizontaler Scroll-Container ── */
.columns-scroll-container {
  overflow-x: scroll;
  scrollbar-width: none;
  flex: 1;
  height: 100vh;
}
.columns-scroll-container::-webkit-scrollbar { display: none; }
.columns-track {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
  padding-right: 20px;
}

/* ── Hauptspalte ── */
.main-column {
  width: var(--column-width);
  min-width: var(--column-width);
  flex-shrink: 0;
  padding: 20px 0 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Karten-Wrapper ── */
.col-card {
  width: 100%;
  background: var(--surface);
  border: 5px solid var(--col-color, #3b82f6);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

/* ── Spalten-Header ── */
.col-header {
  background: var(--col-color, #3b82f6);
  height: var(--col-header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--col-content-pad);
  gap: 12px;
}
.col-header-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.col-header-icon svg { color: rgba(255,255,255,0.92); }
.col-header-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 25px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.3px;
}
.col-header-badge {
display:none;
  font-size: 15px;
  color: rgba(255,255,255,0.65);
  background: rgba(0,0,0,0.14);
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: auto;
  font-weight: 500;
}
.col-content {
  display: flex;
  gap: var(--subcol-gap);
  padding: 16px var(--col-content-pad) var(--col-content-pad);
  align-items: flex-start;
  background: color-mix(in srgb, var(--col-color, #3b82f6) 30%, transparent);
}

/* ── Unterspalten (je 372px) ── */
.sub-column {
  width: var(--subcol-width);
  min-width: var(--subcol-width);
  max-width: var(--subcol-width);
  display: flex;
  flex-direction: column;
  gap: var(--tile-gap);
padding:10px;border-radius:10px;background-color:#454545;
}

/* ── Kachel Basis ──────────────────────────────────────────────
   Klassen-Konvention:
     .tile                          → immer
     .tile-link | .tile-folder-modal | .tile-folder-accordion
     .col-[column-id]               → welche Hauptspalte
     .subcol-[1|2|3]               → welche Unterspalte
     .tile-[unique-id]             → individuelle Ansprache
   ─────────────────────────────────────────────────────────── */
.tile {
  height: var(--tile-height);
  min-height: var(--tile-height);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content:center;
  gap: 7px;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
  user-select: none;
  animation: dashFadeInUp 0.32s ease both;
}
.tile:hover  { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tile:active { transform: translateY(0); }

.tile-title {
  font-size: 18px;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.tile-desc {
  font-size: 16px;
  line-height: 1.45;
  font-weight: 300;
  flex: 1;
}
.tile-footer {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

/* ── Kachel-Typ: Link ── */
.tile-link { background: var(--surface); }
.tile-link .tile-title { color: var(--text); }
.tile-link .tile-desc  { color: var(--text-muted); }
.tile-link:hover { border-color: var(--col-color, #3b82f6); }
.tile-arrow {
  color: var(--text-muted);
  transition: transform var(--transition), color var(--transition);
  margin-left: auto;
}
.tile-link:hover .tile-arrow {
  transform: translateX(3px);
  color: var(--col-color, #3b82f6);
}

/* ── Kachel-Typ: Folder-Modal (dunkel, öffnet Modal) ── */
.tile-folder-modal {
  background: var(--nav-bg);
  border: 2.5px solid rgba(255,255,255,0.07);
}
.tile-folder-modal .tile-title { color: var(--nav-text); }
.tile-folder-modal .tile-desc  { color: var(--nav-muted); }
.tile-folder-modal:hover {
  border-color: rgba(255,255,255,0.20);
  box-shadow: 0 4px 20px rgba(0,0,0,0.28);
}
.tile-folder-badge {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(255,255,255,0.09);
  color: rgba(255,255,255,0.45);
}
.tile-folder-arrow {
  color: rgba(255,255,255,0.28);
  transition: transform var(--transition), color var(--transition);
}
.tile-folder-modal:hover .tile-folder-arrow {
  transform: translateX(3px);
  color: rgba(255,255,255,0.65);
}

/* ── Kachel-Typ: Folder-Accordion (klappt auf, nur in Modals) ── */
.tile-folder-accordion {
  background: #2a3040;
  border: 2px solid rgba(255,255,255,0.06);
}
.tile-folder-accordion .tile-title { color: var(--nav-text); }
.tile-folder-accordion .tile-desc  { color: var(--nav-muted); }
.tile-folder-accordion:hover       { border-color: rgba(255,255,255,0.16); }
.tile-folder-accordion.open {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}
.accordion-chevron {
  color: rgba(255,255,255,0.32);
  transition: transform var(--transition), color var(--transition);
}
.tile-folder-accordion.open .accordion-chevron {
  transform: rotate(180deg);
  color: rgba(255,255,255,0.60);
}
.accordion-wrapper { display: flex; flex-direction: column; }
.accordion-children {
  display: none;
  flex-direction: column;
  gap: var(--tile-gap);
  padding: 8px;
  background: rgba(20,24,32,0.35);
  border: 2px solid rgba(255,255,255,0.06);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.accordion-children.open { display: flex; }
.accordion-children .tile { animation: none; }

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,10,15,0.62);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.modal-overlay.open { display: flex; }
.dashboard .modal-container {margin-bottom:300px;}
.modal-container {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: var(--col-card-width);
  max-width: 96vw;
  max-height: 86vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: dashFadeInUp 0.2s ease;
}
.modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 10;
  flex-shrink: 0;
}
.modal-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--nav-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.modal-icon-wrap svg { color: var(--nav-text); }
.modal-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 27px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
  flex: 1;
}
.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  color: var(--text-muted);
  flex-shrink: 0;
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body {
  padding: 16px 20px 20px;
  background: var(--bg);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.modal-columns {
  display: flex;
  gap: var(--subcol-gap);
  align-items: flex-start;
}
.modal-sub-column {
  width: var(--subcol-width);
  min-width: var(--subcol-width);
  max-width: var(--subcol-width);
  display: flex;
  flex-direction: column;
  gap: var(--tile-gap);
}

/* ── Dashboard Animation (eigener Name, kein Konflikt) ── */
@keyframes dashFadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Dashboard Footer ── */
.app-footer {
  text-align: center;
  padding: 16px 20px;
  font-size: 15px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  opacity: 0.7;
}


/* ════════════════════════════════════════════════════════════════
   EDIT-MODUS
   ════════════════════════════════════════════════════════════════ */

/* ── Seed-Button im Header (nur sichtbar im Edit-Mode) ── */
.seed-btn {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'DM Sans', sans-serif;
  flex-shrink: 0;
}
.seed-btn:hover { background: rgba(255,255,255,0.07); color: var(--nav-text); }
.seed-btn:disabled { opacity: 0.5; cursor: not-allowed; }
body.edit-mode .seed-btn { display: flex; }

/* ── Toggle-Button im Header ── */
.edit-mode-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--nav-muted);
  background: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'DM Sans', sans-serif;
  flex-shrink: 0;
}
.edit-mode-toggle:hover { background: rgba(255,255,255,0.07); color: var(--nav-text); }
.edit-mode-toggle.active {
  background: rgba(251,191,36,0.12);
  border-color: rgba(251,191,36,0.35);
  color: #fbbf24;
}

/* ── Subcol-Add-Button (oben in jeder Unterspalte) ── */
.subcol-add-btn {
  display: none;
  width: 100%;
  padding: 9px 0;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  transition: all var(--transition);
}
body.edit-mode .subcol-add-btn { display: flex; }
.subcol-add-btn:hover {
  border-color: var(--col-color, #3b82f6);
  color: var(--col-color, #3b82f6);
  background: rgba(0,0,0,0.02);
}

/* ── Drag & Drop ── */
body.edit-mode .tile[draggable="true"] { cursor: grab; }
body.edit-mode .tile[draggable="true"]:active { cursor: grabbing; }
.tile-dragging { opacity: 0.35; }
.drop-indicator {
  height: 3px;
  background: rgba(255,255,255,0.45);
  border-radius: 2px;
  margin: 3px 0;
  pointer-events: none;
  flex-shrink: 0;
}

/* ── Tile-Edit-Controls (erscheinen beim Hover im Edit-Mode) ── */
.tile-edit-controls {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  gap: 5px;
  z-index: 10;
}
body.edit-mode .tile:hover .tile-edit-controls { display: flex; }
.tile-edit-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(0,0,0,0.18);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.75);
  transition: background var(--transition);
}
.tile-link .tile-edit-btn {
  background: rgba(0,0,0,0.08);
  color: var(--text-muted);
}
.tile-edit-btn:hover { background: rgba(0,0,0,0.32); color: #fff; }
.tile-edit-btn.delete:hover { background: #ef4444; color: #fff; }

/* ── Col-Header-Controls (Edit/Delete der Hauptspalte) ── */
.col-header-controls {
  display: none;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
body.edit-mode .col-header-controls { display: flex; }
/* Badge bekommt kein margin-left: auto mehr wenn Controls sichtbar */
body.edit-mode .col-header-badge { margin-left: 0; }
.col-header-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: rgba(255,255,255,0.12);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.75);
  transition: background var(--transition);
}
.col-header-btn:hover { background: rgba(255,255,255,0.28); color: #fff; }
.col-header-btn.delete:hover { background: rgba(239,68,68,0.65); color: #fff; }

/* ── Karte-hinzufügen-Button (unter jeder col-card im Edit-Mode) ── */
.col-card-add-btn {
  display: none;
  width: 100%;
  padding: 7px 12px;
  background: #ddd;
  border: 2px dashed #bbb;
  border-radius: var(--radius-md);
  color: #000;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-family: 'DM Sans', sans-serif;
  transition: all var(--transition);
  flex-shrink: 0;
}
body.edit-mode .col-card-add-btn { display: flex; }
.col-card-add-btn:hover {
  border-color: #aaa;
  background: #ccc;
}

/* ── + Spalte Header-Button ── */
.add-col-btn {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'DM Sans', sans-serif;
  flex-shrink: 0;
}
.add-col-btn:hover { background: rgba(255,255,255,0.07); color: var(--nav-text); }
body.edit-mode .add-col-btn { display: flex; }

/* ── Add-Column-Card (am Ende des Tracks) ── */
.col-add-card {
  display: none;
  width: 260px;
  min-width: 260px;
  margin: 20px 20px 40px 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 16px;
  font-family: 'DM Sans', sans-serif;
  transition: all var(--transition);
  min-height: 220px;
  flex-shrink: 0;
}
body.edit-mode .col-add-card { display: flex; }
.col-add-card:hover { border-color: #3b82f6; color: #3b82f6; }

/* ── Edit-Dialoge ── */
.edit-dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.52);
  z-index: 600;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.edit-dialog-overlay.open { display: flex; }
.edit-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  width: 420px;
  max-width: 94vw;
  box-shadow: 0 24px 64px rgba(0,0,0,0.36);
}
.edit-dialog h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 22px;
  letter-spacing: -0.3px;
  font-family: 'DM Sans', sans-serif;
}
.edit-dialog label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  margin-top: 16px;
}
.edit-dialog label:first-of-type { margin-top: 0; }
.edit-dialog input[type="text"],
.edit-dialog input[type="url"],
.edit-dialog input[type="number"],
.edit-dialog select {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition);
  box-sizing: border-box;
}
.edit-dialog input:focus,
.edit-dialog select:focus { outline: none; border-color: #3b82f6; }
.edit-dialog .color-row {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.color-swatch {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: transform 0.12s, border-color 0.12s;
}
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--text); }
/* ── Position-Felder (Spalte + Vertical) im Bearbeitungsdialog ── */
.col-position-row {
  display: flex;
  gap: 14px;
  margin-top: 16px;
}
.col-position-field {
  flex: 1;
}
.col-position-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  margin-top: 0;
}
.col-position-field input[type="number"] {
  width: 100%;
}

.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 26px;
}
.btn-dialog-cancel {
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: none;
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-dialog-cancel:hover { background: var(--bg); color: var(--text); }
.btn-dialog-save {
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: #3b82f6;
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
}
.btn-dialog-save:hover { opacity: 0.85; }

/* ════════════════════════════════════════
   SMART THINGS
   ════════════════════════════════════════ */

/* ── Tab-Leiste ── */
#tab-leiste {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  border-bottom: 1px solid #e2e4e9;
  background: #fff;
  flex-shrink: 0;
}

.tab-btn {
  padding: 10px 18px;
  border: none;
  background: none;
  font-size: 18px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.tab-btn:hover { color: #374151; }

.tab-btn.active {
  color: #1d1d1f;
  border-bottom-color: #b45309;
  font-weight: 600;
}

/* ── Tab-Inhalt ── */
#tab-inhalt {
  flex: 1;
  overflow: auto;
  padding: 24px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.tab-placeholder {
  color: #9ca3af;
  font-size: 14px;
  padding: 40px 0;
  text-align: center;
}

/* ── Listen-Manager ── */
.lm-options {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  background: #f9fafb;
  border: 1px solid #e2e4e9;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #374151;
}

.lm-options input[type="checkbox"] {
  transform: scale(1.1);
  cursor: pointer;
  accent-color: #b45309;
}

.lm-options label { cursor: pointer; margin: 0; }

.lm-flex-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.lm-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lm-column label {
  font-size: 16px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lm-column textarea {
  height: 320px;
  padding: 10px;
  border: 1px solid #e2e4e9;
  border-radius: 6px;
  font-family: monospace;
  font-size: 12px;
  resize: vertical;
  color: #1d1d1f;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.15s;
}

.lm-column textarea:focus { border-color: #b45309; }

.lm-stats { font-size: 11px; color: #9ca3af; }

.lm-strip-btn {
  font-size: 14px;
  padding: 2px 7px;
  background: #f3f4f6;
  border: 1px solid #e2e4e9;
  border-radius: 4px;
  cursor: pointer;
  color: #6b7280;
  font-weight: 500;
}

.lm-strip-btn:hover { background: #e5e7eb; }

.lm-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.lm-actions button {
  flex: 1;
  min-width: 180px;
  padding: 11px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  transition: opacity 0.15s;
}

.lm-actions button:hover { opacity: 0.88; }
.lm-btn-filter { background: #2980b9; }
.lm-btn-add    { background: #1d1d1f; }
.lm-btn-remove { background: #c0392b; }

.lm-log {
  display: none;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}

.lm-log-add    { border-left: 3px solid #27ae60; background: #f0fdf4; color: #166534; }
.lm-log-filter { border-left: 3px solid #2980b9; background: #eff6ff; color: #1e3a5f; }
.lm-log-remove { border-left: 3px solid #c0392b; background: #fef2f2; color: #991b1b; }

/* ── PFragen-Maker ── */
.pfm-mode-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  max-width: 680px;
}

.pfm-mode-btn {
  padding: 7px 16px;
  border: 1px solid #e2e4e9;
  border-radius: 6px;
  background: #f9fafb;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.pfm-mode-btn.active {
  background: #1d1d1f;
  color: #fff;
  border-color: #1d1d1f;
}

.pfm-mode-btn:not(.active):hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #374151;
}

.pfm-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 680px;
}

.pfm-form label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 4px;
}

.pfm-form input[type="password"],
.pfm-form input[type="file"] {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid #e2e4e9;
  border-radius: 6px;
  font-size: 13px;
  color: #1d1d1f;
  outline: none;
  transition: border-color 0.15s;
}

.pfm-form input[type="password"]:focus { border-color: #b45309; }

.pfm-btn {
  padding: 11px 20px;
  background: #1d1d1f;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  align-self: flex-start;
}

.pfm-btn:hover { opacity: 0.85; }
.pfm-btn:disabled { background: #d1d5db; cursor: not-allowed; opacity: 1; }

.pfm-log {
  margin-top: 16px;
  font-size: 13px;
  color: #374151;
  line-height: 1.7;
}

.pfm-log-entry {
  padding: 4px 0;
  border-bottom: 1px solid #f3f4f6;
}

/* ════════════════════════════════════════
   TILE SEPARATOR (Dashboard)
════════════════════════════════════════ */
.tile-separator {
border:3px solid skyblue;
  position: relative;
padding: 0px;
min-height: 25px;
  height: 25px;
  margin: 2px 0;
  display: flex;
  align-items: center;
background:blue;
}
.tile-separator::after {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  background: rgba(0,0,0,0.12);
  border-radius: 1px;
}
.edit-mode .tile-separator {
  border: 1px dashed rgba(0,0,0,0.18);
  border-radius: 4px;
  background:blue;
}
.edit-mode .tile-separator::after { display: none; }

/* ════════════════════════════════════════
   PROTOKOLL-VIEWER (Smart Things Tab)
════════════════════════════════════════ */

/* ── Zwei-Spalten-Layout ── */
.pv-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  min-height: 0;
}
.pv-left {
  width: 600px;
  flex-shrink: 0;
}
.pv-right {
  flex: 1;
  min-width: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
}
.pv-preview-frame {
  display: block; width: 100%;
  height: calc(100vh - 155px);
  min-height: 500px;
  border: 1px solid #e2e4e9; border-radius: 12px;
  background: #fff;
}
.pv-textarea-main {
  width: 100%;
  height: calc(100vh - 360px);
  min-height: 200px;
  padding: 10px 12px;
  border: 1px solid #e2e4e9; border-radius: 6px;
  font-size: 13px; color: #1d1d1f; background: #fff;
  resize: vertical; font-family: inherit; line-height: 1.5;
  transition: border-color 0.15s;
}
.pv-textarea-main:focus { outline: none; border-color: #b45309; }

/* ── Formular ── */
.pv-form {
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}
.pv-form-row { display: flex; gap: 14px; }
.pv-form-field { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pv-form-field label {
  font-size: 12px; font-weight: 600; color: #6b7280;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.pv-form-field input[type="password"],
.pv-form-field input[type="text"] {
  width: 100%; padding: 9px 12px;
  border: 1px solid #e2e4e9; border-radius: 6px;
  font-size: 16px; color: #1d1d1f; background: #fff;
  transition: border-color 0.15s;
}
.pv-form-field input:focus { outline: none; border-color: #b45309; }
.pv-form-field textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid #e2e4e9; border-radius: 6px;
  font-size: 16px; color: #1d1d1f; background: #fff;
  resize: vertical; font-family: inherit; line-height: 1.5;
  transition: border-color 0.15s;
}
.pv-form-field textarea:focus { outline: none; border-color: #b45309; }

/* ── Buttons ── */
.pv-btn {
  padding: 9px 20px; border: none; border-radius: 6px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: opacity 0.15s; white-space: nowrap;
}
.pv-btn:hover { opacity: 0.88; }
.pv-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pv-btn-primary  { background: #1d1d1f; color: #fff; }
.pv-btn-download { background: #166534; color: #fff; }

/* ── Log/Status ── */
.pv-log {
  max-width: 700px; padding: 10px 14px;
  border-radius: 6px; font-size: 13px; margin-bottom: 16px;
}
.pv-log-info    { background: #f9fafb; border-left: 3px solid #9ca3af; color: #374151; }
.pv-log-success { background: #f0fdf4; border-left: 3px solid #22c55e; color: #166534; }
.pv-log-error   { background: #fef2f2; border-left: 3px solid #ef4444; color: #991b1b; }

/* ── Vorschau ── */
.pv-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.pv-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: #6b7280;
}

/* ── Accordion-Knoten (Vorschau) ── */
.pv-node { margin-bottom: 8px; }

.pv-node-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 10px;
  padding: 12px 16px; cursor: pointer; user-select: none;
  border: 1px solid #e2e4e9; border-radius: 10px;
  transition: background 0.15s;
}
.pv-node-header:hover { background: #f3f4f6; }
.pv-depth-0 > .pv-node-header { background: #fff; }
.pv-depth-1 > .pv-node-header { background: #f8fafc; border-radius: 8px; }
.pv-depth-2 > .pv-node-header { background: #fff;    border-radius: 6px; border-color: #ececec; }

.pv-node.open > .pv-node-header { border-radius: 10px 10px 0 0; border-bottom: none; background: #f8fafc; }
.pv-depth-1.open > .pv-node-header { border-radius: 8px 8px 0 0; }
.pv-depth-2.open > .pv-node-header { border-radius: 6px 6px 0 0; }

.pv-node-left { display: flex; align-items: flex-start; gap: 8px; flex: 1; }
.pv-pruefer-badge {
  font-size: 10px; font-weight: 700;
  background: #dbeafe; color: #1d4ed8;
  padding: 2px 8px; border-radius: 5px;
  white-space: nowrap; flex-shrink: 0; margin-top: 2px;
}
.pv-node-title-wrap { flex: 1; }
.pv-thema-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: #9ca3af; margin-bottom: 2px;
}
.pv-frage-text { font-size: 14px; font-weight: 600; color: #1a1d23; line-height: 1.4; }
.pv-depth-1 .pv-frage-text { font-weight: 500; font-size: 13px; color: #374151; }
.pv-depth-2 .pv-frage-text { font-size: 12px;  font-weight: 500; color: #4b5563; }

.pv-chevron {
  color: #9ca3af; flex-shrink: 0; font-size: 18px; line-height: 1;
  transition: transform 0.2s; margin-top: 0;
}
.pv-node.open > .pv-node-header .pv-chevron { transform: rotate(90deg); color: #6b7280; }

.pv-node-content {
  display: none;
  border: 1px solid #e2e4e9; border-top: none;
  border-radius: 0 0 10px 10px; overflow: hidden;
}
.pv-depth-1 > .pv-node-content { border-radius: 0 0 8px 8px; }
.pv-depth-2 > .pv-node-content { border-radius: 0 0 6px 6px; }
.pv-node.open > .pv-node-content { display: block; }

.pv-antwort {
  padding: 12px 16px;
  background: #eff6ff; border-left: 3px solid #3b82f6;
  font-style: italic; color: #1e40af;
  font-size: 13px; line-height: 1.65;
}
.pv-depth-1 .pv-antwort { background: #fff7ed; border-left-color: #f97316; color: #92400e; }
.pv-depth-2 .pv-antwort { background: #f0fdf4; border-left-color: #22c55e; color: #14532d; }

.pv-children {
  padding: 10px 14px 12px;
  background: #f9fafb; border-top: 1px solid #e2e4e9;
  display: flex; flex-direction: column; gap: 6px;
}

.pv-result {
  margin-top: 14px; padding: 10px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600; text-align: center;
}
.pv-result-pass { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.pv-result-fail { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }

/* ── Chat ── */
.pv-chat-wrapper { max-width: 700px; padding-top: 8px; border-top: 1px solid #e2e4e9; }
.pv-chat-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: #6b7280; margin-bottom: 10px;
}
.pv-chat-log {
  background: #f9fafb; border: 1px solid #e2e4e9; border-radius: 8px;
  padding: 10px; min-height: 50px; max-height: 150px;
  overflow-y: auto; margin-bottom: 10px;
  display: flex; flex-direction: column; gap: 7px;
}
.pv-chat-msg {
  padding: 7px 11px; border-radius: 6px;
  font-size: 13px; line-height: 1.5; max-width: 88%;
}
.pv-chat-user      { background: #1d1d1f; color: #fff; align-self: flex-end; }
.pv-chat-assistant { background: #fff; border: 1px solid #e2e4e9; color: #374151; align-self: flex-start; }
.pv-chat-input-row { display: flex; gap: 10px; align-items: flex-start; }
.pv-chat-input {
  flex: 1; padding: 9px 12px;
  border: 1px solid #e2e4e9; border-radius: 6px;
  font-size: 16px; font-family: inherit;
  color: #1d1d1f; resize: none;
  transition: border-color 0.15s;
}
.pv-chat-input:focus { outline: none; border-color: #b45309; }
.pv-quick-prompts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; align-items: center; }
.pv-quick-label { font-size: 11px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: .05em; margin-right: 2px; white-space: nowrap; }
.pv-quick-btn { font-size: 12px; padding: 4px 10px; border-radius: 20px; border: 1px solid #d1d5db; background: #f9fafb; color: #374151; cursor: pointer; transition: background .15s, border-color .15s; }
.pv-quick-btn:hover { background: #fef3c7; border-color: #b45309; color: #92400e; }
