/* Ebene 3 (start): Startseiten und Kennzahlen der Arbeitsbereiche, Bankabstimmung. Gleiche Bausteine wie „Heute“ (boring_ui.css). */

/* Eigene Ansicht statt des Standard-Inhalts; die Standardansicht bleibt über den Knopf unten einblendbar */
/* Ausgeblendet wird ohne display:none: die Standard-Diagramme messen ihre Breite und meldeten sonst SVG-Fehler (Breite 0) */
.e3-an{position:relative}
.e3-an:not(.e3-standard) > :not(.e3-wurzel){position:absolute!important;left:-30000px!important;top:0!important;width:1000px!important;height:1px!important;overflow:hidden!important;visibility:hidden!important;pointer-events:none}
.e3-an.e3-standard > .page-form.hide{display:none!important}
.e3-an.e3-standard > .e3-wurzel{margin-bottom:16px}
.e3-an.e3-standard .e3-standard-knopf svg{transform:rotate(180deg)}
.e3-wurzel{padding:8px 0 24px;text-align:left}
.page-content.e3-an > .e3-wurzel{max-width:1180px;margin:0 auto;padding:16px 24px 32px}
.e3-wurzel .e3-ic,.e3-bank .e3-ic{margin:0!important}
.e3-start .e3-ic{width:16px;height:16px;flex:none;stroke:currentColor}
.e3-start .btn-b .e3-ic{width:15px;height:15px}

/* Kennzahlen: zweite Reihe mit drei Karten */
.bui .kpis.e3-kpis3{grid-template-columns:repeat(3,minmax(0,1fr))}
.bui .kpi .v{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bui .kpi .v .txt{white-space:normal}
.bui .kpi.warn .s{color:var(--bui-warn)}

/* Einstiege: Belege und Stammdaten als Kacheln mit Symbol */
.e3-start .e3-zwei{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
.e3-start .e3-kacheln{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:8px;margin-top:10px}
.e3-start .e3-kachel{display:flex;align-items:stretch;border:1px solid var(--bui-line);border-radius:8px;background:var(--bui-card);min-height:46px}
.e3-start .e3-kachel:hover{border-color:var(--bui-muted)}
.e3-start .e3-k-haupt{flex:1;min-width:0;display:flex;align-items:center;gap:10px;padding:10px 12px;color:var(--bui-text);font-weight:600;text-decoration:none}
.e3-start .e3-k-haupt span{min-width:0;overflow-wrap:break-word;hyphens:manual;line-height:1.3}
.e3-start .e3-k-haupt .e3-ic{color:var(--bui-orange);width:18px;height:18px}
.e3-start .e3-k-haupt:hover{text-decoration:none;color:var(--bui-text)}
.e3-start .e3-k-neu{flex:none;width:40px;display:grid;place-items:center;border-left:1px solid var(--bui-line);color:var(--bui-muted);text-decoration:none;border-radius:0 8px 8px 0}
.e3-start .e3-k-neu:hover{background:var(--bui-soft);color:var(--bui-text)}

/* Berichte und Werkzeuge: alle Links des Arbeitsbereichs */
.e3-start .e3-abschnitt{margin:4px 0 10px}
.e3-start .e3-gruppen{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;align-items:start}
.e3-start .e3-gruppe{padding:14px 16px}
.e3-start .e3-links{display:grid;margin-top:6px}
.e3-start .e3-links a{display:flex;align-items:flex-start;gap:9px;padding:7px 4px;border-bottom:1px solid var(--bui-line);color:var(--bui-text);text-decoration:none;line-height:1.35}
.e3-start .e3-links a:last-child{border-bottom:0}
.e3-start .e3-links a:hover{background:var(--bui-soft);text-decoration:none;color:var(--bui-text)}
.e3-start .e3-links .e3-ic{width:14px;height:14px;margin-top:2px;color:var(--bui-muted)}
.e3-start .e3-links span{min-width:0;overflow-wrap:anywhere}

/* Knopf „Standardansicht einblenden“ */
.e3-start .e3-standard-knopf{width:100%;text-align:left;cursor:pointer;font:inherit;color:var(--bui-text)}
.e3-start .e3-standard-knopf b{display:block;font-weight:600}
.e3-start .e3-standard-knopf:hover{border-color:var(--bui-muted)}

/* Handy: Aktionen unten (wie die Neu-Erfassung) */
.e3-start .e3-unten{display:none}

/* Diagramme */
.e3-start .e3-diagramme{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start}
.e3-start .e3-dk{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.e3-start .e3-dk .btn-b{height:30px;padding:0 10px;font-size:12.5px;flex:none}
.e3-start .e3-leer{display:flex;align-items:center;gap:10px;color:var(--bui-muted);padding:28px 4px 12px}
.e3-start .e3-leer .e3-ic{width:20px;height:20px}
.e3-start .e3-legende{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:10px;font-size:12.5px;color:var(--bui-muted)}
.e3-start .e3-legende span{display:inline-flex;align-items:center;gap:6px}
.e3-start .e3-legende i{width:10px;height:10px;border-radius:2px;display:inline-block}
.e3-start .a{background:var(--bui-orange)}
.e3-start .b{background:var(--bui-steel)}
.e3-start .e3-skala{display:flex;flex-direction:column;justify-content:space-between;margin-top:12px;font:500 11px var(--bui-mono);color:var(--bui-muted);font-variant-numeric:tabular-nums}
.e3-start .e3-saeulen{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:6px;height:180px;margin-top:6px;border-bottom:1px solid var(--bui-line);padding-bottom:22px;position:relative}
.e3-start .e3-monat{display:flex;flex-direction:column;height:100%;position:relative;min-width:0}
.e3-start .e3-plus{height:var(--oben);display:flex;align-items:flex-end;justify-content:center;gap:2px}
.e3-start .e3-minus{flex:1;display:flex;align-items:flex-start;justify-content:center;gap:2px;border-top:1px solid var(--bui-line)}
.e3-start .e3-plus b,.e3-start .e3-minus b{display:block;flex:1;max-width:22px;border-radius:2px 2px 0 0;min-height:0}
.e3-start .e3-minus b{border-radius:0 0 2px 2px}
.e3-start .e3-mn{position:absolute;bottom:-20px;left:0;right:0;text-align:center;font-size:11px;color:var(--bui-muted);white-space:nowrap;overflow:hidden}
.e3-start .e3-werte{margin-top:10px;display:grid}
.e3-start .e3-werte div{display:flex;justify-content:space-between;gap:12px;padding:6px 0;border-bottom:1px solid var(--bui-line);font-size:13px}
.e3-start .e3-werte div:last-child{border-bottom:0}
.e3-start .amt{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.e3-start .e3-balken{display:grid;margin-top:10px}
.e3-start .e3-bz{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;padding:9px 0;border-bottom:1px solid var(--bui-line);color:var(--bui-text);text-decoration:none}
.e3-start .e3-bz:last-child{border-bottom:0}
.e3-start a.e3-bz:hover{background:var(--bui-soft);text-decoration:none;color:var(--bui-text)}
.e3-start .e3-bn{min-width:0;overflow-wrap:anywhere;font-weight:600}
.e3-start .e3-bn .sub{display:block;margin:0;font-weight:400;font-size:12px}
.e3-start .e3-bz .bar{grid-column:1 / -1}
.e3-start .e3-bz .bar b{background:var(--bui-orange)}
.e3-start .e3-bz .bar.low b{background:var(--bui-warn)}
html[data-theme="dark"] .e3-start .e3-bz .bar b{background:var(--bui-orange)}
html[data-theme="dark"] .e3-start .e3-bz .bar.low b{background:var(--bui-warn)}
html[data-theme="dark"] .e3-start .b{background:var(--bui-muted)}

/* Bankabstimmung: Kopf über der Standardmaske */
.e3-bank{padding:16px 15px 4px}
.e3-bank .e3-ic{width:16px;height:16px;flex:none}
.e3-bank .e3-leer-karte{display:flex;flex-direction:row;gap:12px;align-items:flex-start}
.e3-bank .e3-leer-karte .e3-ic{width:20px;height:20px;color:var(--bui-muted);margin-top:2px}
.e3-bank .kpi .v{white-space:normal}

@media (max-width:1100px){
  .e3-start .e3-gruppen{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:900px){
  .e3-start .e3-zwei,.e3-start .e3-diagramme{grid-template-columns:minmax(0,1fr)}
  .bui .kpis.e3-kpis3{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:640px){
  .e3-wurzel{padding:4px 0 84px}
  .page-content.e3-an > .e3-wurzel{padding:8px 12px 84px}
  .e3-start .e3-oben{display:none}
  .e3-start .e3-unten{display:flex;gap:8px;position:fixed;left:0;right:0;bottom:0;z-index:1020;background:var(--bui-card);border-top:1px solid var(--bui-line);padding:10px 12px calc(12px + env(safe-area-inset-bottom))}
  .e3-start .e3-unten .btn-b{flex:1;height:46px;border-radius:10px;font-size:14px;padding:0 8px;min-width:0}
  .e3-start .e3-gruppen{grid-template-columns:minmax(0,1fr)}
  .e3-start .e3-kacheln{grid-template-columns:minmax(0,1fr)}
  .e3-start .e3-k-haupt{padding:10px;gap:8px;font-size:13.5px}
  .e3-start .e3-k-neu{width:44px}
  .e3-start .e3-kachel{min-height:48px}
  .e3-start .e3-dk .btn-b{height:44px;min-width:72px;padding:0 12px}
  .e3-start .e3-links a{min-height:44px;align-items:center;padding:8px 4px}
  .e3-start .e3-links .e3-ic{margin-top:0!important}
  .e3-start .e3-standard-knopf{min-height:56px}
  .bui.e3-start .kpi{padding:12px}
  .bui.e3-start .kpi .v{font-size:19px}
  .e3-start .e3-saeulen{gap:3px;height:150px}
  .e3-start .e3-mn{font-size:10px}
  .e3-start .card{padding:14px}
  .e3-bank{padding:12px 12px 4px}
  .e3-bank .actions{display:none}
}

/* Bankwesen (/banking) am Handy: eigene Übersicht statt der Sperre der ERPNext-Seite (ebene3_start.js, handyBank) */
#e3-bank-handy{display:none;padding:16px 16px 24px;background:var(--bui-paper);min-height:100vh}
#e3-bank-handy .e3-bic{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#e3-bank-handy .e3-leer-karte{display:flex;flex-direction:row;gap:12px;align-items:flex-start}
#e3-bank-handy .e3-leer-karte .e3-bic{width:22px;height:22px;color:var(--bui-muted);margin-top:2px}
#e3-bank-handy .e3-bank-knoepfe{display:grid;gap:8px}
#e3-bank-handy .e3-bank-knoepfe .btn-b{height:48px;justify-content:flex-start;padding:0 14px}
#e3-bank-handy .e3-bank-knoepfe .btn-b:first-child{background:var(--bui-orange);border-color:var(--bui-orange);color:#fff}
#e3-bank-handy .e3-bz{min-height:48px}
#e3-bank-handy .amt .sub{display:block;margin:0;font-size:12px}
@media (max-width:767px){
  #e3-bank-handy{display:block}
  #root.e3-banking:has(~ #e3-bank-handy){display:none}
}
