.content{flex:1;padding:18px;overflow-y:auto;display:flex;flex-direction:column;gap:14px;}
#content,#rightPanel{transition:opacity .18s ease, transform .18s ease;}
#content.dash-switching,#rightPanel.dash-switching{opacity:0;transform:translateY(5px);}
@media (prefers-reduced-motion: reduce){#content,#rightPanel{transition:none;}}
.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;}
.stat-card{background:var(--bg);border:1px solid var(--bdr);border-radius:var(--rl);padding:15px 17px;}
.stat-label{font-size:12px;color:var(--txt2);margin-bottom:5px;}
.stat-value{font-size:24px;font-weight:700;line-height:1;}
.stat-sub{font-size:11px;color:var(--txt3);margin-top:4px;}
.stat-sub.up{color:var(--grn);}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:14px;}
.card{background:var(--bg);border:1px solid var(--bdr);border-radius:var(--rl);padding:14px 16px;}
.card-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;}
.card-title{font-size:13px;font-weight:600;display:flex;align-items:center;gap:7px;}
.card-title i{font-size:15px;color:var(--txt2);}
.card-link{font-size:12px;color:var(--acc);cursor:pointer;text-decoration:none;}
.card-link:hover{text-decoration:underline;}
.co-item{display:flex;align-items:center;gap:9px;padding:7px 0;border-bottom:1px solid var(--bdr);cursor:pointer;text-decoration:none;color:inherit;}
.co-item:last-child{border-bottom:none;}
.co-item:hover{background:var(--bg2);border-radius:var(--r);padding-left:4px;margin-left:-4px;}
.co-info{flex:1;min-width:0;}
.co-name{font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.co-meta{font-size:11px;color:var(--txt3);margin-top:1px;}
.notif-item{display:flex;align-items:flex-start;gap:9px;padding:7px 0;border-bottom:1px solid var(--bdr);}
.notif-item:last-child{border-bottom:none;}
.notif-dot{width:8px;height:8px;border-radius:50%;margin-top:4px;flex-shrink:0;}
.notif-body{flex:1;}
.notif-text{font-size:12px;line-height:1.5;}
.notif-time{font-size:10px;color:var(--txt3);}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;}
.cal-lbl{font-size:10px;color:var(--txt3);text-align:center;padding:2px;}
.cal-cell{height:28px;border-radius:var(--r);display:flex;align-items:center;justify-content:center;font-size:12px;color:var(--txt2);cursor:pointer;position:relative;transition:background .1s;text-decoration:none;}
.cal-cell:hover{background:var(--bg2);}
.cal-cell.today{background:var(--acc);color:#fff;font-weight:700;}
.cal-cell.has-ev::after{content:'';position:absolute;bottom:2px;left:50%;transform:translateX(-50%);width:3px;height:3px;border-radius:50%;background:currentColor;}
.cal-cell.today.has-ev::after{background:#fff;}
.cal-cell.dim{opacity:.3;pointer-events:none;}
.ev-item{display:flex;align-items:center;gap:9px;padding:7px 0;border-bottom:1px solid var(--bdr);}
.ev-item:last-child{border-bottom:none;}
.ev-time{font-size:11px;color:var(--txt3);min-width:38px;flex-shrink:0;}
.ev-item>.ev-bar{width:3px;border-radius:2px;height:30px;flex-shrink:0;}
.ev-name{font-size:12px;font-weight:500;}
.ev-sub{font-size:11px;color:var(--txt3);}
/* Right panel */
.right-panel{width:232px;background:var(--bg);border-left:1px solid var(--bdr);padding:16px 13px;display:flex;flex-direction:column;gap:22px;overflow-y:auto;flex-shrink:0;}
.rp-title{font-size:10px;font-weight:700;color:var(--txt2);text-transform:uppercase;letter-spacing:.7px;margin-bottom:8px;}
.map-box{height:88px;background:linear-gradient(135deg,var(--acc-l),#dbeafe);border-radius:var(--rm);border:1px solid #bfdbfe;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden;margin-bottom:6px;}
.map-sub{font-size:11px;color:var(--txt3);}
.pipe-row{display:flex;align-items:center;justify-content:space-between;padding:5px 0;border-bottom:1px solid var(--bdr);font-size:12px;}
.pipe-row:last-child{border-bottom:none;}
.pipe-l{display:flex;align-items:center;gap:7px;color:var(--txt2);}
.pipe-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0;}
.pipe-cnt{font-weight:700;}
.qa-btn{display:flex;align-items:center;gap:8px;padding:8px 9px;border:1px solid var(--bdr);border-radius:var(--rm);cursor:pointer;background:var(--bg);font-size:12px;font-weight:500;color:var(--txt);margin-bottom:5px;transition:background-color .12s,color .12s,border-color .12s,box-shadow .12s,opacity .12s,transform .12s;text-decoration:none;}
.qa-btn:hover{background:var(--acc-l);border-color:var(--acc);color:var(--acc);}
.qa-btn i{font-size:15px;color:var(--txt2);}
.qa-btn:hover i{color:var(--acc);}

/* MODERN SKIN v4 -- reine Stil-Politur der bestehenden Kacheln, KEINE neue
   Anordnung. Kartenflaeche/radius kommt jetzt aus shared.css (.stat-card,
   Porsche-Tonwert-Prinzip); hier nur noch die Typografie/Abstaende innerhalb
   der Kachel. Funktioniert automatisch in Hell UND Dunkel (nur
   var(--txt)/var(--txt2)/var(--txt3), bereits theme-abhaengig). */
.dash-greeting-block{display:none;}
[data-skin="modern"] .stats-grid{gap:16px;}
[data-skin="modern"] .stat-card{padding:20px 22px;}
[data-skin="modern"] .stat-label{color:var(--txt3);font-size:12px;}
[data-skin="modern"] .stat-value{font-size:28px;font-weight:600;letter-spacing:-.01em;margin-top:6px;}
[data-skin="modern"] .stat-sub{margin-top:7px;}
/* Ruhiger Farbschein hinter der Begruessung -- die einzige "Bild"-artige
   Flaeche der Seite (Vorbild: der grosszuegige, atmosphaerische Look von
   porsche.com), rein dekorativ, sehr niedrige Deckkraft. */
[data-skin="modern"] .dash-greeting-block{
  display:block; margin:-8px -8px 6px; padding:8px;
  position:relative;
}
[data-skin="modern"] .dash-greeting-block::before{
  content:''; position:absolute; top:-40px; left:-60px; width:280px; height:200px;
  background:radial-gradient(circle, var(--brand) 0%, transparent 70%);
  opacity:.16; pointer-events:none; z-index:-1;
}
/* Bewusst deutlicher abgesetzt von .stat-value (28px/600) -- vorher lagen
   beide fast auf gleicher Stufe, dadurch wirkte nichts erkennbar "das
   Wichtigste auf der Seite". Groesse/Gewicht/Tracking ziehen jetzt
   sichtbar staerker an als alles andere im Dashboard. */
[data-skin="modern"] .dash-greeting{font-size:32px;font-weight:700;letter-spacing:-.02em;color:var(--txt);}
/* Rechte Spalte bestand bisher aus lose auf der Seite schwebenden Modulen
   (kein eigener Kartenrahmen) -- wirkte inkonsistent neben den echten
   Karten im Hauptbereich. Jedes Modul (Map Scraper, Pipeline,
   Schnellaktionen, Auto-Feed) bekommt jetzt dieselbe Tonwert-Flaeche,
   nur etwas kompakter skaliert fuer die schmalere Spalte. */
[data-skin="modern"] .rp-card{
  background:var(--p-surface); border-radius:18px; padding:14px 15px;
}
[data-skin="modern"]:not([data-theme="dark"]) .rp-card{
  box-shadow:0 1px 2px rgba(20,20,25,.04), 0 4px 14px rgba(20,20,25,.05);
}
[data-skin="modern"] .dash-greeting-sub{color:var(--txt3);font-size:13px;margin-top:4px;}

/* Umschalter „Mein Tag | Übersicht“ */
.dash-view-toggle{display:inline-flex;gap:2px;padding:3px;border-radius:999px;background:var(--bg2);border:1px solid var(--bdr);margin:0 0 16px;}
.dash-view-toggle button{border:none;background:transparent;color:var(--txt2);font:inherit;font-size:12px;font-weight:600;padding:5px 14px;border-radius:999px;cursor:pointer;transition:background .15s,color .15s;}
.dash-view-toggle button:hover{color:var(--txt);}
.dash-view-toggle button.on{background:var(--sel-bg-strong,var(--bg3));color:var(--txt);}
.dash-view-toggle button:focus-visible{outline:2px solid var(--txt2);outline-offset:1px;}
/* Der Umschalter soll nicht die ganze Breite einnehmen (die Inhaltsspalte streckt ihre Kinder): klein, rechts, dicht an der Begrüßung */
.dash-view-toggle{align-self:flex-end;width:fit-content;margin:0 0 -4px;padding:2px;}
.dash-view-toggle button{padding:4px 12px;font-size:11.5px;}
/* Dichtes Layout (wird von fit-screen.js nur bei Platzmangel eingeschaltet): 12 Spalten, Karten nebeneinander statt untereinander */
#content.dash-dense{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));align-items:start;gap:12px 14px;grid-auto-flow:row;}
#content.dash-dense > *{grid-column:1/-1;margin:0;}
#content.dash-dense > .card{margin-bottom:0!important;grid-column:span 4;}
#content.dash-dense > .card.fx-wide{grid-column:1/-1;}
#content.dash-dense > .dash-greeting-block{grid-column:span 9;}
#content.dash-dense > .dash-view-toggle{grid-column:span 3;justify-self:end;align-self:center;}
#content.dash-dense > .fx-grid1,#content.dash-dense > .fx-grid2{display:contents;}
#content.dash-dense > .fx-grid1 > .card{grid-column:span 4;}
#content.dash-dense > .fx-grid2 > .card{grid-column:span 6;}
.fx-hide{display:none!important;}

/* Finanzübersicht auf dem Dashboard */
.fin-grid{grid-template-columns:repeat(3,1fr);margin-bottom:12px;}
.fin-grid a.stat-card{text-decoration:none;color:inherit;}
.fin-grid a.stat-card:hover{border-color:var(--acc);}
.fin-bars{display:flex;align-items:flex-end;gap:6px;height:150px;padding-top:6px;}
.fin-bar{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;height:100%;}
.fin-col{flex:1;width:100%;display:flex;align-items:flex-end;}
.fin-col i{display:block;width:100%;min-height:2px;background:var(--acc);border-radius:5px 5px 0 0;opacity:.85;}
.fin-bar span{font-size:10.5px;color:var(--txt3);}
@media(max-width:700px){.fin-grid{grid-template-columns:1fr 1fr;}}

/* ═══ Dashboard nach Logik: Kopf, Kennzahlen in einer Zeile, „Jetzt“ und „Überblick“ – so angelegt, dass nichts gescrollt werden muss ═══ */
.dx{display:flex;flex-direction:column;gap:12px;width:100%;min-width:0;}
.dx-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;flex-wrap:wrap;}
.dx-hello{font-size:22px;font-weight:700;letter-spacing:-.01em;line-height:1.15;}
.dx-sub{font-size:12.5px;color:var(--txt3);margin-top:3px;}
.dx-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;}
.dx-kpi{display:block;min-width:0;background:var(--bg);border:1px solid var(--bdr);border-radius:var(--rl);padding:10px 14px;text-decoration:none;color:inherit;}
a.dx-kpi:hover{border-color:var(--acc);}
.dx-kpi .l{font-size:11px;font-weight:600;color:var(--txt3);text-transform:uppercase;letter-spacing:.04em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.dx-kpi .v{font-size:21px;font-weight:700;line-height:1.2;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.dx-kpi .s{font-size:11px;color:var(--txt3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.dx-kpi.bad .v{color:var(--red);}
.dx-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:stretch;}
.dx-grid.dx-grid-2{grid-template-columns:repeat(2,minmax(0,1fr));}
.dx-grid>.card{margin:0;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;}
.dx-list{min-height:0;overflow:hidden;}
.dx-row{padding-top:7px;padding-bottom:7px;}
.dx-empty{color:var(--txt3);font-size:12px;padding:10px 0;font-style:italic;}
.dx-more{font-size:11.5px;color:var(--txt3);padding:6px 0 0;}
.dx-bars{height:104px;}
.dx-top{font-size:11.5px;color:var(--txt3);margin-top:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
@media(max-width:1100px){.dx-grid,.dx-grid.dx-grid-2{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:700px){.dx-grid,.dx-grid.dx-grid-2{grid-template-columns:1fr;}.dx-kpis{grid-template-columns:1fr 1fr;}}

/* Schrift auf dem Dashboard: Gesamtgröße wie überall (kein zusätzliches Verkleinern); bei wenig Höhe zeigen die Karten weniger Zeilen */
.dx-hello{font-size:24px;}
.dx-sub{font-size:13px;}
.dx-kpi{padding:11px 15px;}
.dx-kpi .l{font-size:12.5px;text-transform:none;letter-spacing:0;}
.dx-kpi .v{font-size:23px;}
.dx-kpi .s{font-size:12px;}
.dx-grid .co-name,.dx-grid .ev-name,.dx-grid .notif-text{font-size:13.5px;}
.dx-grid .co-meta,.dx-grid .ev-sub,.dx-grid .ev-time,.dx-grid .notif-time{font-size:12px;}
.dx-empty{font-size:13px;}
.dx-top,.dx-more{font-size:12px;}
.dx-bars{height:110px;}
@media(max-height:860px){.dx-list>*:nth-child(n+5){display:none;}.dx-bars{height:90px;}}
@media(max-height:760px){.dx-list>*:nth-child(n+4){display:none;}.dx-kpi .s{display:none;}.dx-bars{height:70px;}}
@media(max-height:660px){.dx-list>*:nth-child(n+3){display:none;}.dx-top{display:none;}}
/* Keine abgeschnittenen Texte mit „…“ auf dem Dashboard: lange Namen und Zeilen brechen um */
.dx .dx-kpi .l,.dx .dx-kpi .v,.dx .dx-kpi .s,.dx .dx-top{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;}
.dx .dx-grid .co-name,.dx .dx-grid .co-meta,.dx .dx-grid .ev-name,.dx .dx-grid .ev-sub,.dx .dx-grid .notif-text,.dx .dx-grid .notif-time{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;}
.dx .dx-grid .co-info,.dx .dx-grid .notif-body{min-width:0;flex:1;}
.dx .dx-grid .pill{flex:none;white-space:nowrap;}
/* Schnellaktionen: alle Knöpfe gleich breit (der Urlaub-Knopf ist ein <button> und war schmaler) */
.rp-card .qa-btn{width:100%;box-sizing:border-box;min-height:34px;margin:0;text-align:left;font-family:inherit;color:inherit;}
.rp-card .qa-btn + .qa-btn{margin-top:6px;}
/* Farbe in den Unterzeilen der Kennzahlen: grün = gut, orange = Aufmerksamkeit, rot = dringend */
.dx-kpi .s.g{color:var(--grn);font-weight:600;}
.dx-kpi .s.a{color:var(--amb);font-weight:600;}
.dx-kpi .s.r{color:var(--red);font-weight:600;}
.rp-card .qa-pair .qa-btn,.rp-card .qa-pair .qa-btn + .qa-btn{margin:0;justify-content:center;}
/* Rechte Spalte ohne Scrollen: kompakter Abstand, kleinere Kalenderzeilen bei wenig Höhe */
.right-panel{gap:14px;padding-top:14px;padding-bottom:14px;}
.right-panel .rp-card .qa-btn{min-height:32px;}
@media(max-height:900px){.right-panel{gap:12px;}.right-panel .cal-cell{height:24px;}.right-panel .pipe-row{padding:3px 0;}}
@media(max-height:780px){.right-panel{gap:10px;padding-top:10px;padding-bottom:10px;}.right-panel .cal-cell{height:20px;font-size:11px;}.right-panel .rp-card .qa-btn{min-height:28px;padding-top:5px;padding-bottom:5px;}}
@media(max-height:660px){.right-panel .rp-card:has(.cal-grid){display:none;}}
/* Dashboard: kein Scrollen – weder im Inhalt noch in der rechten Spalte */
html:root:root:root #content, html:root:root:root #rightPanel{ overflow:hidden; scrollbar-gutter:auto; }
/* Kacheln füllen die Höhe bis zur Unterkante der Seitenleiste; unter der Begrüßung bleibt etwas mehr Platz */
html:root:root:root #content{ padding-bottom:0; }
html:root:root:root #rightPanel{ padding-bottom:0; }
html:root:root:root .dx{ height:100%; gap:14px; }
html:root:root:root .dx-head{ margin-bottom:8px; }
html:root:root:root .dx-grid{ flex:1; min-height:0; grid-template-rows:repeat(2,minmax(0,1fr)); gap:14px; }
html:root:root:root .dx-grid.dx-grid-2{ grid-template-rows:repeat(2,minmax(0,1fr)); }
html:root:root:root .dx-grid > .card{ padding-bottom:16px; }

/* Rechte Spalte: Kacheln füllen die Höhe bis zur Unterkante der Kachelreihe */
html:root:root:root #rightPanel{ gap:14px; }
html:root:root:root #rightPanel > .rp-card{ flex:1 1 auto; display:flex; flex-direction:column; min-height:0; }

/* Handy und kleine Fenster: das Dashboard scrollt ganz normal, Kacheln untereinander */
@media (max-width:768px){
  html:root:root:root #content{ overflow-y:auto; padding-bottom:90px; }
  html:root:root:root .dx{ height:auto; }
  html:root:root:root .dx-grid, html:root:root:root .dx-grid.dx-grid-2{ flex:none; grid-template-columns:1fr; grid-template-rows:none; }
  html:root:root:root .dx-grid > .card{ min-height:0; overflow:visible; }
  html:root:root:root .dx-list > *{ display:flex !important; }
  html:root:root:root .dx-kpis{ grid-template-columns:1fr 1fr; }
}

/* Begrüßung deutlich sichtbar */
.dx-hello{font-size:32px;font-weight:700;letter-spacing:-.015em;line-height:1.12;}
.dx-sub{font-size:16px;line-height:1.4;color:var(--txt2);margin-top:5px;max-width:62ch;}
@media(max-width:700px){.dx-hello{font-size:25px;}.dx-sub{font-size:14.5px;}}
/* Schnellaktionen: zwei Spalten, jeder Knopf klein (halbe Breite) oder groß (ganze Breite) */
.qa-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px;}
.rp-card .qa-grid .qa-btn{margin:0;width:100%;box-sizing:border-box;}
.qa-grid .qa-full{grid-column:1/-1;}
.qa-grid .qa-half{justify-content:center;}
.qa-grid .qa-btn span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
/* Pipeline: Stufen sind anklickbar */
.pipe-click{cursor:pointer;border-radius:8px;margin:0 -6px;padding-left:6px;padding-right:6px;transition:background-color .12s;}
.pipe-click:hover,.pipe-click:focus-visible{background:var(--acc-l);outline:none;}

/* Schmale Fenster mit rechter Spalte: Karten untereinander und Kennzahlen zu zweit, damit nichts unter die Spalte läuft */
@media (min-width:701px) and (max-width:1100px){
  .grid-2.grid-2{ grid-template-columns:minmax(0,1fr); }
  .stats-grid.stats-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); }
}
/* Handy: Begrüßung zuerst, darunter eine schlanke Schnellaktionen-Leiste; die rechte Spalte (Pipeline, Minikalender, große Kacheln) entfällt */
@media (max-width:700px){
  html:root:root:root .workspace .right-panel.right-panel{ display:none; }
  .dash-greeting-block{ padding-top:4px; }
  .m-quick{ display:flex; gap:10px; overflow-x:auto; scroll-snap-type:x proximity; scroll-padding:0 16px; margin:4px -16px 14px; padding:2px 16px 6px; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
  .m-quick::-webkit-scrollbar{ display:none; }
  .m-q{ flex:0 0 auto; scroll-snap-align:start; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; width:76px; min-height:76px; border-radius:18px; background:var(--bg); border:1px solid var(--bdr); color:var(--txt); text-decoration:none; font-size:12px; font-weight:600; }
  .m-q i{ font-size:24px; color:var(--acc); }
  .m-q:active{ background:var(--bg2); }
}
/* Einführung: schmaler, sanft pulsierender Balken über den Kacheln */
.fd-nextsteps{display:flex;align-items:center;gap:14px;width:100%;box-sizing:border-box;margin:0 0 14px;padding:11px 18px;min-height:56px;border-radius:14px;border:1px solid var(--acc);background:color-mix(in srgb,var(--acc) 12%,var(--bg));color:var(--txt);font-family:inherit;text-align:left;cursor:pointer;animation:fdNextSteps 2.8s ease-in-out infinite;}
.fd-nextsteps>i{font-size:22px;color:var(--acc);flex:none;}
.fd-nextsteps span{display:flex;flex-direction:column;flex:1;min-width:0;}
.fd-nextsteps strong{font-size:17px;line-height:1.25;}
.fd-nextsteps em{font-style:normal;font-size:12.5px;color:var(--txt2);}
.fd-nextsteps:hover,.fd-nextsteps:focus-visible{background:color-mix(in srgb,var(--acc) 20%,var(--bg));outline:2px solid var(--acc);outline-offset:2px;}
@keyframes fdNextSteps{0%,100%{box-shadow:0 0 0 0 color-mix(in srgb,var(--acc) 35%,transparent);}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--acc) 0%,transparent);}}
@media (prefers-reduced-motion:reduce){.fd-nextsteps{animation:none;}}
