:root{--bg:#f5f7fb;--card:#fff;--ink:#1f2937;--muted:#6b7280;--accent:#174a7e;--accent2:#0f355a;--border:#dbe2ea;--danger:#b42318;--ok:#157347;--warn:#9a6700}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.45 system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif}.wrap{width:min(1180px,94%);margin:auto}.topbar{background:var(--accent2);color:#fff;box-shadow:0 1px 4px #0002}.nav{display:flex;justify-content:space-between;align-items:center;min-height:62px;gap:20px}.brand{font-weight:700;color:#fff;text-decoration:none;font-size:18px}.nav nav{display:flex;gap:18px;flex-wrap:wrap}.nav nav a{color:#eaf2fb;text-decoration:none}.nav nav a:hover{color:#fff}main{padding:28px 0 40px}.grid{display:grid;gap:18px}.cards{grid-template-columns:repeat(3,1fr)}.card{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:18px;box-shadow:0 2px 8px #00000008}.metric{font-size:34px;font-weight:700;color:var(--accent)}h1,h2,h3{margin-top:0}h1{font-size:28px}.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:0 0 18px}.btn,button{display:inline-block;background:var(--accent);color:white;border:0;border-radius:8px;padding:10px 14px;text-decoration:none;cursor:pointer}.btn.secondary{background:#64748b}.btn.danger{background:var(--danger)}input,select,textarea{width:100%;border:1px solid var(--border);border-radius:8px;padding:10px 11px;background:#fff;font:inherit}textarea{min-height:130px;resize:vertical}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.span-2{grid-column:1/-1}label{font-weight:600;display:block;margin-bottom:5px}.table-wrap{overflow:auto;background:#fff;border:1px solid var(--border);border-radius:12px}table{width:100%;border-collapse:collapse}th,td{padding:11px 12px;text-align:left;border-bottom:1px solid #edf0f3;vertical-align:top}th{background:#f8fafc}.badge{display:inline-block;border-radius:999px;padding:3px 9px;font-size:12px;background:#e8eef5}.badge.offen{background:#fff2cc}.badge.erledigt{background:#dff3e7;color:#14532d}.badge.rueckruf{background:#fde2e2;color:#7f1d1d}.flash{padding:12px 14px;border-radius:8px;margin-bottom:16px}.flash.success{background:#def7e8}.flash.error{background:#fde5e5}.search-results{position:absolute;background:white;border:1px solid var(--border);border-radius:8px;box-shadow:0 8px 24px #0002;z-index:10;max-height:300px;overflow:auto;width:100%}.searchbox{position:relative}.search-results a{display:block;padding:10px 12px;text-decoration:none;color:var(--ink);border-bottom:1px solid #eee}.muted{color:var(--muted)}.footer{padding:20px 0 35px;color:var(--muted);font-size:13px}@media(max-width:800px){.cards,.form-grid{grid-template-columns:1fr}.span-2{grid-column:auto}.nav{align-items:flex-start;padding:12px 0;flex-direction:column}.nav nav{gap:12px}}
.quick-call{margin-bottom:18px;border-top:4px solid var(--accent);padding:22px}.quick-call h2{margin-bottom:4px}.quick-call .searchbox input{font-size:17px;padding:14px}.quick-actions{display:flex;align-items:center;gap:14px;margin-top:14px}.text-link{color:var(--accent);text-decoration:none;font-weight:600}.search-empty{padding:12px}.history-filter{display:flex;gap:8px;margin-bottom:12px}.history-filter input{flex:1}.history-filter button,.history-filter .btn{white-space:nowrap}@media(max-width:650px){.quick-actions,.history-filter{align-items:stretch;flex-direction:column}}

/* Version 1.2 */
.call-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,.9fr);gap:18px;align-items:start}.call-form-card{border-top:4px solid var(--accent)}.call-form-card textarea{min-height:190px}.customer-head{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.customer-head .grow{flex:1}.status-quick{display:flex;gap:8px;flex-wrap:wrap}.status-chip{background:#eef2f7;color:#334155;border:1px solid #d8e0e9;border-radius:999px;padding:8px 12px;font-weight:700}.status-chip.active{background:var(--accent);color:#fff;border-color:var(--accent)}.status-chip[data-set-status="erledigt"].active{background:var(--ok);border-color:var(--ok)}.status-chip[data-set-status="rueckruf"].active{background:var(--danger);border-color:var(--danger)}.is-muted{opacity:.5}.form-actions{display:flex;gap:9px;flex-wrap:wrap;align-items:center}.btn.light,button.light{background:#e8eef5;color:#243244}.history-list{display:grid;gap:10px}.history-item{background:#fff;border:1px solid var(--border);border-radius:10px;padding:13px}.history-item-top{display:flex;gap:8px;justify-content:space-between;align-items:flex-start}.history-item p{margin:7px 0 0}.history-meta{font-size:12px;color:var(--muted);margin-top:8px}.mini-stat{font-size:13px;color:var(--muted)}.section-head{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:12px}.section-head h2{margin:0}.filter-grid{display:grid;grid-template-columns:1.3fr repeat(4,minmax(120px,.65fr));gap:10px;align-items:end}.filter-grid .actions{display:flex;gap:8px}.empty-state{text-align:center;padding:28px;color:var(--muted)}.subtle-box{background:#f8fafc;border:1px solid var(--border);border-radius:10px;padding:12px}.nowrap{white-space:nowrap}@media(max-width:980px){.call-workspace{grid-template-columns:1fr}.filter-grid{grid-template-columns:1fr 1fr}}@media(max-width:650px){.filter-grid{grid-template-columns:1fr}.form-actions>*{width:100%;text-align:center}.customer-head{align-items:stretch}.customer-head .btn{width:100%;text-align:center}}
button.secondary{background:#64748b}.filter-grid .actions{grid-column:1/-1}
/* Version 2.0 / 3CX */
.pbx-hint{background:#eef7ff;border:1px solid #bdd9f3;border-radius:10px;padding:12px 14px;margin-bottom:14px}.pbx-hint strong{color:var(--accent2)}
.cards.four{grid-template-columns:repeat(4,1fr)}
@media(max-width:900px){.cards.four{grid-template-columns:repeat(2,1fr)}}@media(max-width:600px){.cards.four{grid-template-columns:1fr}}

/* =========================================================
   OTEDV / OTWin Corporate Design
   ========================================================= */
:root{
  --otedv-green:#7eb812;
  --otedv-green-dark:#65940e;
  --otedv-green-soft:#f2f8e7;
  --otedv-charcoal:#1b1b20;
  --otedv-charcoal-2:#2d2f33;
  --otedv-gray:#6b7076;
  --otedv-line:#d9dde1;
  --bg:#f3f4f5;
  --card:#ffffff;
  --ink:#25282b;
  --muted:#6f7479;
  --accent:var(--otedv-green);
  --accent2:var(--otedv-charcoal);
  --border:#dce0e3;
  --danger:#b3261e;
  --ok:#5f8e0d;
  --warn:#a16900;
}

body{
  background:linear-gradient(180deg,#f7f8f8 0,#f1f2f3 260px,#f3f4f5 100%);
  color:var(--ink);
}

/* Kopfbereich */
.topbar{
  background:#fff;
  color:var(--otedv-charcoal);
  border-top:5px solid var(--otedv-green);
  border-bottom:1px solid #d7dade;
  box-shadow:0 2px 10px rgba(0,0,0,.06);
  position:relative;
  z-index:20;
}
.nav{min-height:78px;gap:24px}
.brand-otedv{
  display:flex;
  align-items:center;
  gap:13px;
  color:var(--otedv-charcoal);
  min-width:max-content;
}
.brand-otedv img{
  display:block;
  width:auto;
  height:50px;
  max-width:132px;
  object-fit:contain;
}
.brand-divider{
  width:1px;
  height:38px;
  background:#d6d8da;
}
.brand-app{
  display:flex;
  flex-direction:column;
  line-height:1.05;
  font-size:16px;
  font-weight:500;
  letter-spacing:.01em;
}
.brand-app strong{color:var(--otedv-green-dark);font-size:19px}
.brand-app span{color:#555a5f}
.nav nav{gap:4px;align-items:center}
.nav nav a{
  color:#3d4145;
  padding:9px 10px;
  border-radius:6px;
  font-weight:600;
  font-size:14px;
  transition:background .15s ease,color .15s ease;
}
.nav nav a:hover{
  background:var(--otedv-green-soft);
  color:var(--otedv-green-dark);
}
.nav nav a.nav-logout{
  margin-left:5px;
  color:#666b70;
  border-left:1px solid #ddd;
  border-radius:0;
  padding-left:15px;
}

main{padding-top:30px}
h1{font-size:29px;color:var(--otedv-charcoal);letter-spacing:-.02em}
h2,h3{color:#292c2f}

/* Karten und Arbeitsbereiche */
.card,.table-wrap{
  border-color:#d9dde0;
  box-shadow:0 2px 7px rgba(24,28,31,.045);
}
.card{border-radius:9px}
.quick-call,.call-form-card{border-top-color:var(--otedv-green)}
.metric{color:var(--otedv-green-dark)}

/* Buttons */
.btn,button{
  background:var(--otedv-green-dark);
  border-radius:5px;
  font-weight:650;
  box-shadow:none;
  transition:background .15s ease,transform .05s ease;
}
.btn:hover,button:hover{background:#567f0b}
.btn:active,button:active{transform:translateY(1px)}
.btn.secondary,button.secondary{background:#646a70}
.btn.secondary:hover,button.secondary:hover{background:#51565b}
.btn.light,button.light{background:#edf0f1;color:#34383c;border:1px solid #d9dde0}
.btn.light:hover,button.light:hover{background:#e4e7e9}
.btn.danger,.btn.danger:hover{background:var(--danger)}
.text-link,a{accent-color:var(--otedv-green)}
.text-link{color:var(--otedv-green-dark)}

/* Formulare */
input,select,textarea{
  border-color:#cfd4d8;
  border-radius:5px;
  transition:border-color .15s ease,box-shadow .15s ease;
}
input:focus,select:focus,textarea:focus{
  outline:none;
  border-color:var(--otedv-green);
  box-shadow:0 0 0 3px rgba(126,184,18,.16);
}
label{color:#34383c}

/* Tabellen */
th{
  background:#f0f2f2;
  color:#34383c;
  border-bottom:2px solid #d4d8da;
}
tbody tr:hover td{background:#f8faF4}
table a{color:#4d760b;font-weight:600}

/* Status */
.badge{background:#edf0f1;color:#444a4f}
.badge.offen{background:#fff2c9;color:#755300}
.badge.erledigt{background:#eaf5d9;color:#476e09}
.badge.rueckruf{background:#fbe5e3;color:#91231b}
.status-chip.active{background:var(--otedv-charcoal);border-color:var(--otedv-charcoal)}
.status-chip[data-set-status="erledigt"].active{background:var(--otedv-green-dark);border-color:var(--otedv-green-dark)}

/* Suche / 3CX Hinweise */
.search-results{
  border-radius:6px;
  border-color:#cfd4d8;
  box-shadow:0 10px 28px rgba(20,24,27,.15);
}
.search-results a:hover{background:var(--otedv-green-soft)}
.pbx-hint{
  background:var(--otedv-green-soft);
  border-color:#cfe3a7;
}
.pbx-hint strong{color:var(--otedv-green-dark)}

.flash.success{background:#edf7df;border:1px solid #d0e7a9;color:#405f0b}
.flash.error{background:#fce7e5;border:1px solid #efc1bd;color:#8f2119}
.subtle-box{background:#f7f8f8}

/* Fußbereich */
.footer{border-top:1px solid #e0e2e4;margin-top:18px;color:#777c80}

@media(max-width:980px){
  .nav{align-items:flex-start;padding:12px 0;flex-direction:column}
  .nav nav{width:100%;gap:3px}
  .nav nav a{padding:8px 9px}
}
@media(max-width:600px){
  .brand-otedv img{height:42px;max-width:112px}
  .brand-divider{height:31px}
  .brand-app{font-size:13px}.brand-app strong{font-size:16px}
}

/* =========================================================
   OTWin Compact UI layer
   ========================================================= */
body{font-size:14px}
.wrap{width:min(1320px,96%)}
.topbar{border-top-width:4px}
.nav{min-height:58px;gap:18px}
.brand-otedv{gap:10px}
.brand-otedv img{height:39px;max-width:108px}
.brand-divider{height:30px}
.brand-app{font-size:12px;line-height:1.05}
.brand-app strong{font-size:15px}
main{padding:18px 0 28px}
h1{font-size:24px;margin-bottom:4px}
h2{font-size:19px}h3{font-size:16px}

.main-nav{gap:1px!important;flex-wrap:nowrap!important}
.main-nav a{display:flex!important;align-items:center;gap:6px;padding:7px 9px!important;border-radius:4px!important;font-size:13px!important;white-space:nowrap;position:relative}
.main-nav a svg{width:16px;height:16px;fill:currentColor;flex:0 0 auto;opacity:.88}
.main-nav a:hover{background:#f0f6e6!important}
.main-nav a.active{background:var(--otedv-green-soft)!important;color:var(--otedv-green-dark)!important}
.main-nav a.active:after{content:"";position:absolute;left:8px;right:8px;bottom:-8px;height:3px;background:var(--otedv-green)}
.main-nav .nav-logout{margin-left:8px!important;padding-left:12px!important}

.card{padding:13px 14px;border-radius:5px;box-shadow:0 1px 3px rgba(24,28,31,.05)}
.grid{gap:12px}.cards{gap:12px}.cards.four{gap:12px}
.metric{font-size:27px;line-height:1.1}
.quick-call{padding:15px 16px;margin-bottom:12px;border-top-width:3px}
.quick-call h2{font-size:18px;margin-bottom:2px}.quick-call .searchbox input{font-size:15px;padding:10px}
.quick-actions{margin-top:9px}
.call-workspace{gap:12px}.call-form-card{border-top-width:3px}.call-form-card textarea{min-height:135px}

.btn,button{padding:7px 11px;font-size:13px;border-radius:4px}
input,select,textarea{padding:7px 8px;border-radius:3px;font-size:14px}
textarea{min-height:95px}.form-grid{gap:10px}.toolbar{gap:7px;margin-bottom:12px}
label{font-size:13px;margin-bottom:3px}
.status-chip{padding:6px 9px;font-size:12px}
.form-actions{gap:6px}

.table-wrap{border-radius:5px;box-shadow:0 1px 3px rgba(24,28,31,.04)}
th,td{padding:8px 9px}th{font-size:12px;text-transform:uppercase;letter-spacing:.02em;background:#eef0f0}
tbody tr:nth-child(even) td{background:#fbfcfc}tbody tr:hover td{background:#f5f9ee}
.badge{font-size:11px;padding:2px 7px;border-radius:10px}

.section-head{margin-bottom:8px}.history-list{gap:7px}.history-item{padding:9px 10px;border-radius:5px}
.history-item p{margin-top:5px}.history-meta{margin-top:5px}
.subtle-box,.pbx-hint{padding:9px 10px;border-radius:5px}
.flash{padding:9px 11px;border-radius:4px;margin-bottom:10px}
.search-results{border-radius:3px;max-height:260px}.search-results a{padding:7px 9px}

.filter-grid{gap:7px}.filter-grid .actions{gap:6px}
.footer{padding:14px 0 24px;margin-top:12px}

/* Desktop-artige Bereichsüberschriften */
.card>h2:first-child,.card>h3:first-child,.section-head h2{border-bottom:1px solid #dfe2e3;padding-bottom:7px;margin-bottom:9px}

@media(max-width:1120px){
  .main-nav{flex-wrap:wrap!important}
  .main-nav a.active:after{display:none}
}
@media(max-width:800px){
  .nav{min-height:auto}
  .main-nav{width:100%;display:grid!important;grid-template-columns:repeat(3,1fr);gap:4px!important}
  .main-nav a{justify-content:center;border:1px solid #e0e3e4}
  .main-nav .nav-logout{margin-left:0!important;border-left:1px solid #e0e3e4!important;padding-left:9px!important}
}
@media(max-width:520px){
  .main-nav{grid-template-columns:repeat(2,1fr)}
  .brand-app{display:none}.brand-divider{display:none}
}

/* OTEDV Footer */
.app-footer{
  margin-top:18px;
  border-top:3px solid var(--otedv-green);
  background:#f2f3f3;
  color:#5b6063;
  font-size:12px;
}
.app-footer-inner{
  min-height:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:9px 0;
  text-align:center;
}
.app-footer strong{color:#34383a;font-weight:600}
.app-footer-year{color:#73787b}
@media(max-width:520px){
  .app-footer-inner{flex-direction:column;gap:1px;padding:8px 0}
}

/* =========================================================
   Dashboard Welcome / WebSupport-inspired hero
   ========================================================= */
.dashboard-welcome{
  background:#fff;
  border:1px solid #d9dde0;
  border-top:3px solid var(--otedv-green);
  border-radius:6px;
  box-shadow:0 2px 7px rgba(24,28,31,.055);
  margin-bottom:12px;
  overflow:hidden;
}
.dashboard-welcome-content{
  min-height:164px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:28px;
  padding:25px 32px;
}
.dashboard-welcome-copy{min-width:0;flex:1}
.dashboard-welcome h1{
  margin:0 0 7px;
  color:#2c74d8;
  font-size:32px;
  font-weight:450;
  letter-spacing:-.02em;
}
.dashboard-welcome p{
  margin:0;
  max-width:820px;
  color:#60676d;
  font-size:16px;
  line-height:1.45;
}
.dashboard-welcome-meta{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:12px;
  margin-top:20px;
  color:#697078;
  font-size:13px;
}
.dashboard-meta-item{display:flex;align-items:center;gap:7px}
.dashboard-meta-item svg{width:17px;height:17px;fill:#727980}
.dashboard-meta-separator{width:1px;height:18px;background:#d6dade}
.dashboard-welcome-visual{
  flex:0 0 220px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.dashboard-service-mark{
  width:150px;
  height:104px;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  color:var(--otedv-green-dark);
  transform:rotate(-4deg);
}
.dashboard-service-mark:before{
  content:"";
  position:absolute;
  width:94px;
  height:94px;
  border:13px solid #dfe6e9;
  border-top-color:var(--otedv-green);
  border-right-color:#9ecb48;
  border-radius:50%;
  opacity:.95;
}
.dashboard-service-mark svg{
  width:76px;
  height:76px;
  fill:#5e666c;
  position:relative;
  z-index:1;
}
.dashboard-service-mark span{
  position:absolute;
  z-index:2;
  bottom:1px;
  background:var(--otedv-green-dark);
  color:#fff;
  padding:3px 13px;
  border-radius:999px;
  font-size:14px;
  font-style:italic;
  font-weight:700;
  box-shadow:0 1px 3px #0002;
}
.dashboard-quick-call{margin-bottom:12px}
.dashboard-metric-card{position:relative;overflow:hidden}
.dashboard-metric-card:after{
  content:"";
  position:absolute;
  top:0;right:0;
  width:4px;height:100%;
  background:var(--otedv-green);
  opacity:.7;
}
.dashboard-lists .card{min-height:210px}

@media(max-width:900px){
  .dashboard-welcome-content{padding:22px 24px;min-height:0}
  .dashboard-welcome-visual{flex-basis:160px}
  .dashboard-service-mark{transform:none;scale:.88}
  .dashboard-lists{grid-template-columns:1fr!important}
}
@media(max-width:680px){
  .dashboard-welcome-content{padding:18px 18px}
  .dashboard-welcome h1{font-size:26px}
  .dashboard-welcome p{font-size:14px}
  .dashboard-welcome-visual{display:none}
  .dashboard-meta-separator{display:none}
  .dashboard-welcome-meta{align-items:flex-start;flex-direction:column;gap:7px;margin-top:14px}
}

/* =========================================================
   Hell / Dunkel / Auto Umschalter
   ========================================================= */
.theme-switcher{position:relative;display:flex;align-items:center;margin-left:3px}
.theme-toggle{display:flex;align-items:center;gap:5px;background:transparent!important;color:#4b5054!important;padding:7px 8px!important;border:0!important;box-shadow:none!important;white-space:nowrap}
.theme-toggle:hover{background:var(--otedv-green-soft)!important;color:var(--otedv-green-dark)!important}
.theme-toggle svg{width:17px;height:17px;fill:currentColor}
.theme-caret{font-size:11px;line-height:1}
.theme-menu{display:none;position:absolute;right:0;top:calc(100% + 10px);min-width:170px;background:#fff;border:1px solid #d7dade;box-shadow:0 8px 24px rgba(0,0,0,.16);border-radius:6px;padding:5px;z-index:200}
.theme-menu:before{content:"";position:absolute;right:18px;top:-7px;width:12px;height:12px;background:#fff;border-left:1px solid #d7dade;border-top:1px solid #d7dade;transform:rotate(45deg)}
.theme-switcher.open .theme-menu{display:block}
.theme-menu button{position:relative;z-index:1;width:100%;display:grid;grid-template-columns:24px 1fr 20px;gap:6px;align-items:center;text-align:left;background:transparent!important;color:#303438!important;border:0!important;padding:8px 9px!important;border-radius:4px!important;font-weight:500!important}
.theme-menu button:hover{background:#f0f6e6!important;color:var(--otedv-green-dark)!important}
.theme-choice-icon{font-size:17px;text-align:center}.theme-check{opacity:0;color:var(--otedv-green-dark);font-weight:800}.theme-menu button.selected .theme-check{opacity:1}

/* Dark Theme */
html[data-theme="dark"]{
  --bg:#181a1d;
  --card:#23262a;
  --ink:#eef1f3;
  --muted:#aeb4b9;
  --border:#3a3f44;
  --otedv-line:#3a3f44;
  --otedv-green-soft:#29331c;
  --otedv-charcoal:#f1f3f4;
  --otedv-charcoal-2:#d8dbde;
}
html[data-theme="dark"] body{background:linear-gradient(180deg,#1d2023 0,#17191c 260px,#181a1d 100%);color:var(--ink)}
html[data-theme="dark"] .topbar{background:#202327;color:#f1f3f4;border-bottom-color:#363a3e;box-shadow:0 2px 10px rgba(0,0,0,.35)}
html[data-theme="dark"] .brand-otedv{color:#f4f5f6}
html[data-theme="dark"] .brand-divider{background:#484d52}
html[data-theme="dark"] .brand-app span{color:#c5c9cc}
html[data-theme="dark"] .main-nav a{color:#d5d9dc}
html[data-theme="dark"] .main-nav a:hover,html[data-theme="dark"] .main-nav a.active{background:#29331c!important;color:#a9d84f!important}
html[data-theme="dark"] .main-nav .nav-logout{color:#c1c6ca;border-left-color:#44494e}
html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3{color:#f1f3f4}
html[data-theme="dark"] .card,html[data-theme="dark"] .table-wrap,html[data-theme="dark"] .history-item{background:#23262a;border-color:#3a3f44;box-shadow:0 2px 8px rgba(0,0,0,.22)}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{background:#191c1f;color:#edf0f2;border-color:#484d52;color-scheme:dark}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#858b91}
html[data-theme="dark"] th{background:#2a2e32;color:#e7eaec;border-bottom-color:#454a4f}
html[data-theme="dark"] td{border-bottom-color:#34383c}
html[data-theme="dark"] tbody tr:nth-child(even) td{background:#202327}
html[data-theme="dark"] tbody tr:hover td{background:#2a321f}
html[data-theme="dark"] .search-results{background:#25282c;border-color:#44494e;box-shadow:0 10px 28px rgba(0,0,0,.45)}
html[data-theme="dark"] .search-results a{color:#eef1f3;border-bottom-color:#363a3e}
html[data-theme="dark"] .search-results a:hover{background:#2c351f}
html[data-theme="dark"] .subtle-box{background:#1d2023;border-color:#393e43}
html[data-theme="dark"] .pbx-hint{background:#28311d;border-color:#495d27;color:#e6eccf}
html[data-theme="dark"] .btn.light,html[data-theme="dark"] button.light{background:#34383c;color:#eceff1;border-color:#474c51}
html[data-theme="dark"] .btn.light:hover,html[data-theme="dark"] button.light:hover{background:#40454a}
html[data-theme="dark"] .status-chip{background:#30353a;color:#dce0e3;border-color:#484d52}
html[data-theme="dark"] .badge{background:#35393d;color:#e2e5e7}
html[data-theme="dark"] .app-footer{background:#202327;color:#aeb4b9;border-top-color:var(--otedv-green)}
html[data-theme="dark"] .theme-toggle{color:#d6dadd!important}
html[data-theme="dark"] .theme-toggle:hover{background:#29331c!important;color:#a9d84f!important}
html[data-theme="dark"] .theme-menu{background:#282b2f;border-color:#44494e;box-shadow:0 9px 28px rgba(0,0,0,.45)}
html[data-theme="dark"] .theme-menu:before{background:#282b2f;border-color:#44494e}
html[data-theme="dark"] .theme-menu button{color:#eceff1!important}
html[data-theme="dark"] .theme-menu button:hover{background:#343c28!important;color:#b0db5c!important}
html[data-theme="dark"] .theme-check{color:#a9d84f}
html[data-theme="dark"] .dashboard-welcome,html[data-theme="dark"] .hero-card{background:#23262a!important;border-color:#3a3f44!important;color:#eef1f3}

@media(max-width:1120px){.theme-toggle-label{display:none}.theme-menu{right:auto;left:0}.theme-menu:before{right:auto;left:18px}}

/* Benutzerprofil */
.nav-profile{max-width:190px}
.nav-profile span{max-width:145px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.profile-head{display:flex;align-items:center;gap:14px;margin:4px 0 16px}
.profile-head h1{margin:0 0 2px}
.profile-avatar{width:52px;height:52px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--otedv-green-soft);color:var(--otedv-green-dark);border:2px solid var(--otedv-green);font-size:23px;font-weight:800;flex:0 0 auto}
.profile-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(300px,.8fr);gap:14px;align-items:start}
.profile-grid .card h2{margin-top:0;padding-bottom:9px;border-bottom:1px solid var(--border)}
.profile-password-form{display:grid;gap:8px}
.profile-password-form button{margin-top:8px;justify-self:start}
.form-hint{font-size:12px;color:var(--muted);margin-top:4px}
.tf-call-last-editor{margin-left:auto;color:var(--muted);font-size:13px}.tf-call-last-editor strong{color:var(--text)}input.tf-call-date-locked[readonly]{background:#eef1f4;color:var(--text);cursor:not-allowed}html[data-theme="dark"] input.tf-call-date-locked[readonly]{background:#303438;color:#dfe4e8}.tf-call-date-editor{position:relative}.tf-call-date-display{pointer-events:none}.tf-call-date-native{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.tf-call-date-editor:focus-within .tf-call-date-display{outline:2px solid var(--accent);outline-offset:1px}
html[data-theme="dark"] .profile-avatar{background:#2d3820;color:#b6df66;border-color:#7fad2d}
@media(max-width:900px){.profile-grid{grid-template-columns:1fr}.nav-profile span{display:none}.nav-profile{max-width:none}}

/* Datenbank-Backup */
.danger-card { border-top: 3px solid #b52d2d; }
.profile-facts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.profile-facts > div { padding:10px 12px; border:1px solid var(--border, #d6dce3); background:var(--panel-soft, #f7f9fb); display:flex; flex-direction:column; gap:3px; }
.profile-facts span { font-size:.78rem; color:var(--muted, #667085); }
.profile-facts strong { overflow-wrap:anywhere; }
button.danger, .btn.danger { background:#a72d2d; border-color:#a72d2d; color:#fff; }
button.danger:hover, .btn.danger:hover { background:#8f2424; border-color:#8f2424; }
@media (max-width:800px){ .backup-grid { grid-template-columns:1fr !important; } .profile-facts { grid-template-columns:1fr; } }

/* Admin settings dropdown */
.settings-switcher{position:relative;display:flex;align-items:center;margin-left:2px}
.settings-toggle{display:flex!important;align-items:center;gap:6px;background:transparent!important;color:#4b5054!important;padding:7px 9px!important;border:0!important;box-shadow:none!important;white-space:nowrap;font:inherit!important}
.settings-toggle:hover,.settings-switcher.active .settings-toggle{background:var(--otedv-green-soft)!important;color:var(--otedv-green-dark)!important}
.settings-toggle svg{width:16px;height:16px;fill:currentColor;flex:0 0 auto}
.settings-caret{font-size:11px;line-height:1}
.settings-menu{display:none;position:absolute;right:0;top:calc(100% + 10px);min-width:270px;background:#fff;border:1px solid #d7dade;box-shadow:0 8px 24px rgba(0,0,0,.16);border-radius:6px;padding:5px;z-index:220}
.settings-menu:before{content:"";position:absolute;right:20px;top:-7px;width:12px;height:12px;background:#fff;border-left:1px solid #d7dade;border-top:1px solid #d7dade;transform:rotate(45deg)}
.settings-switcher.open .settings-menu{display:block}
.settings-menu a{position:relative;z-index:1;display:grid!important;grid-template-columns:24px 1fr;gap:9px;align-items:center;padding:9px 10px!important;border-radius:4px!important;color:#303438!important;text-decoration:none!important;white-space:normal!important}
.settings-menu a:after{display:none!important}
.settings-menu a:hover,.settings-menu a.selected{background:#f0f6e6!important;color:var(--otedv-green-dark)!important}
.settings-menu a svg{width:18px!important;height:18px!important;fill:currentColor;opacity:.9}
.settings-menu a span{display:flex;flex-direction:column;min-width:0}
.settings-menu a strong{font-size:13px;line-height:1.25}
.settings-menu a small{font-size:11px;line-height:1.25;color:#7a7f83;font-weight:400;margin-top:2px}
html[data-theme="dark"] .settings-toggle{color:#d6dadd!important}
html[data-theme="dark"] .settings-toggle:hover,html[data-theme="dark"] .settings-switcher.active .settings-toggle{background:#29331c!important;color:#a9d84f!important}
html[data-theme="dark"] .settings-menu{background:#282b2f;border-color:#44494e;box-shadow:0 9px 28px rgba(0,0,0,.45)}
html[data-theme="dark"] .settings-menu:before{background:#282b2f;border-color:#44494e}
html[data-theme="dark"] .settings-menu a{color:#eceff1!important}
html[data-theme="dark"] .settings-menu a:hover,html[data-theme="dark"] .settings-menu a.selected{background:#343c28!important;color:#b0db5c!important}
html[data-theme="dark"] .settings-menu a small{color:#aeb4b9}
@media(max-width:1120px){.settings-toggle span:not(.settings-caret){display:none}.settings-menu{right:auto;left:0}.settings-menu:before{right:auto;left:18px}}
@media(max-width:720px){.settings-switcher{display:block}.settings-toggle{width:100%!important;justify-content:center}.settings-menu{left:0;right:0;min-width:min(290px,90vw)}}

/* Sticky Header 3.3 */
.topbar{
  position:sticky;
  top:0;
  z-index:1000;
  transition:box-shadow .18s ease;
}
.topbar.is-scrolled{
  box-shadow:0 5px 18px rgba(0,0,0,.14);
}
html[data-theme="dark"] .topbar.is-scrolled{
  box-shadow:0 5px 20px rgba(0,0,0,.48);
}

/* Dark mode readability fix 3.4 */
html[data-theme="dark"]{
  --muted:#b7bdc3;
}
html[data-theme="dark"] .muted,
html[data-theme="dark"] .mini-stat,
html[data-theme="dark"] .history-meta,
html[data-theme="dark"] .form-hint,
html[data-theme="dark"] .empty-state{
  color:#b7bdc3!important;
}
html[data-theme="dark"] .dashboard-welcome p{
  color:#c5cbd0!important;
}
html[data-theme="dark"] .dashboard-welcome-meta,
html[data-theme="dark"] .dashboard-meta-item{
  color:#aeb5bb!important;
}
html[data-theme="dark"] .dashboard-meta-item svg{
  fill:#9fa7ad!important;
}
html[data-theme="dark"] .dashboard-meta-separator{
  background:#4a5055!important;
}
html[data-theme="dark"] .text-link,
html[data-theme="dark"] .card a:not(.btn),
html[data-theme="dark"] .table-wrap a:not(.btn){
  color:#94c93d!important;
}
html[data-theme="dark"] .text-link:hover,
html[data-theme="dark"] .card a:not(.btn):hover,
html[data-theme="dark"] .table-wrap a:not(.btn):hover{
  color:#b6df66!important;
}
html[data-theme="dark"] .text-link:visited,
html[data-theme="dark"] .card a:not(.btn):visited,
html[data-theme="dark"] .table-wrap a:not(.btn):visited{
  color:#94c93d!important;
}
html[data-theme="dark"] label,
html[data-theme="dark"] .section-head,
html[data-theme="dark"] .quick-call p,
html[data-theme="dark"] .card p{
  color:#d0d5d9;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{
  color:#9aa2a9!important;
  opacity:1;
}
html[data-theme="dark"] .profile-facts span,
html[data-theme="dark"] .settings-menu a small{
  color:#b0b7bd!important;
}

/* 3CX Agent in Telefonat-Historien */
.history-agent-badge{display:inline-block;margin-left:6px;padding:1px 5px;border-radius:999px;background:rgba(126,184,18,.14);color:var(--otedv-green,#6d9f00);font-size:.72em;font-weight:700;vertical-align:1px}
html[data-theme="dark"] .history-agent-badge{background:rgba(145,199,35,.18);color:#a7d94b}


/* Dashboard Aktualisierung + Statistik 3.7 */
.dashboard-refreshbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px;padding:8px 10px;border:1px solid var(--border);background:var(--card);border-radius:5px}
.dashboard-refresh-label{display:flex;align-items:baseline;gap:10px;min-width:0}.dashboard-refresh-label strong{font-size:13px}.dashboard-refresh-label span{font-size:12px}.dashboard-refreshbar select{width:auto;min-width:175px;padding:6px 8px}
.statistics-head{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;margin-bottom:10px}.statistics-head h1{margin-bottom:2px}.statistics-head p{margin:0}
.statistics-filter{display:grid;grid-template-columns:auto minmax(360px,1fr) auto;align-items:end;gap:16px;margin-bottom:12px}.statistics-periods{display:flex;gap:5px;flex-wrap:wrap}.statistics-date-form label{margin-bottom:4px}.statistics-date-controls{display:flex;gap:5px;align-items:center}.statistics-date-controls input{max-width:180px}.statistics-range{text-align:right;display:flex;flex-direction:column;gap:2px;white-space:nowrap}.statistics-range span{font-size:12px}
.statistics-metrics{margin-bottom:12px}.statistics-grid{grid-template-columns:1fr 1fr;align-items:start}.statistics-card{min-width:0}.statistics-ranking{display:grid}.statistics-rank-row{display:grid;grid-template-columns:28px minmax(0,1fr) 44px;gap:9px;align-items:center;padding:8px 2px;border-bottom:1px solid var(--border);color:inherit!important;text-decoration:none!important}.statistics-rank-row:last-child{border-bottom:0}.statistics-rank-row:hover{background:rgba(126,184,18,.055)}.statistics-rank-no{font-weight:800;color:var(--muted);text-align:center}.statistics-rank-main{display:grid;min-width:0}.statistics-rank-main strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.statistics-rank-main small{color:var(--muted);font-size:11px;min-height:16px}.statistics-rank-value{text-align:right;font-size:18px;color:var(--otedv-green-dark)}.statistics-bar{display:block;height:4px;background:#e6e9eb;margin-top:4px;overflow:hidden;border-radius:99px}.statistics-bar i{display:block;height:100%;background:var(--otedv-green);border-radius:99px}.statistics-note{font-size:12px;margin-top:10px}
html[data-theme="dark"] .dashboard-refreshbar{background:#23262a;border-color:#3a3f44}html[data-theme="dark"] .statistics-rank-row{border-color:#373c40}html[data-theme="dark"] .statistics-rank-row:hover{background:#29311f}html[data-theme="dark"] .statistics-bar{background:#3a3f44}html[data-theme="dark"] .statistics-rank-value{color:#a7d94b}
@media(max-width:1050px){.statistics-filter{grid-template-columns:1fr 1fr}.statistics-range{grid-column:1/-1;text-align:left}.statistics-grid{grid-template-columns:1fr}}
@media(max-width:700px){.dashboard-refreshbar{align-items:stretch;flex-direction:column}.dashboard-refresh-label{flex-direction:column;gap:1px}.dashboard-refreshbar select{width:100%}.statistics-filter{grid-template-columns:1fr}.statistics-date-controls{flex-wrap:wrap}.statistics-date-controls input{max-width:none;flex:1 1 180px}.statistics-grid{grid-template-columns:1fr}.statistics-range{grid-column:auto}}


/* Profilbilder 4.0 */
.profile-avatar{overflow:hidden}
.profile-avatar img{width:100%;height:100%;display:block;object-fit:cover;object-position:center}
.profile-avatar-large{width:58px;height:58px}
.profile-avatar-xl{width:96px;height:96px;font-size:36px}
.profile-avatar-sm{width:30px;height:30px;font-size:12px;border-width:1px}
.nav-profile-avatar{width:24px!important;height:24px!important;flex:0 0 24px;display:block!important;border-radius:50%;overflow:hidden;border:1px solid rgba(126,184,18,.7)}
.nav-profile-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.profile-avatar-card,.admin-avatar-card{margin-top:14px}
.profile-avatar-preview{display:flex;align-items:center;gap:16px;margin:8px 0 14px}
.profile-avatar-form{display:grid;gap:8px}
.profile-avatar-form input[type=file]{padding:8px;background:var(--card,#fff)}
.profile-avatar-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px}
.user-list-person{display:flex;align-items:center;gap:8px;min-width:0}.user-list-person span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html[data-theme="dark"] .nav-profile-avatar{border-color:#86b930}
html[data-theme="dark"] .profile-avatar-form input[type=file]{background:#25282c;color:#e8ecef;border-color:#44494e}

/* Statistik 4.3: Profilbilder der 3CX-Agenten */
.statistics-agent-row{grid-template-columns:28px 42px minmax(0,1fr) 46px}
.statistics-agent-avatar{width:38px;height:38px;flex:0 0 38px;font-size:15px;border-width:1px;align-self:center}
.statistics-agent-avatar img{width:100%;height:100%;display:block;object-fit:cover;object-position:center}
@media (max-width:640px){.statistics-agent-row{grid-template-columns:24px 36px minmax(0,1fr) 38px}.statistics-agent-avatar{width:32px;height:32px;flex-basis:32px;font-size:13px}}

/* 4.4: Profilbilder in der Telefonatliste */
.call-agent-cell{display:flex;align-items:center;gap:9px;min-width:150px}
.call-agent-avatar{width:34px;height:34px;flex:0 0 34px;font-size:13px;border-width:1px}
.call-agent-avatar img{width:100%;height:100%;display:block;object-fit:cover;object-position:center}
.call-agent-cell strong{display:inline-block;line-height:1.2}
@media(max-width:700px){.call-agent-cell{min-width:130px;gap:7px}.call-agent-avatar{width:30px;height:30px;flex-basis:30px;font-size:12px}}

/* 4.6 - Agentenbild in Telefonatliste */
.call-agent-avatar.avatar-only{
  display:inline-flex;
  vertical-align:middle;
  cursor:default;
  transition:transform .16s ease, box-shadow .16s ease;
  transform-origin:center;
}
.call-agent-avatar.avatar-only:hover{
  transform:scale(1.18);
  box-shadow:0 4px 12px rgba(0,0,0,.24);
  z-index:5;
}

/* 4.7 - Profilbild bei "Letzte Telefonate" im Dashboard */
.dashboard-recent-meta{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:2px}
.dashboard-recent-avatar{width:24px;height:24px;flex:0 0 24px;font-size:10px;border-width:1px;display:inline-flex;vertical-align:middle;cursor:default;transition:transform .16s ease,box-shadow .16s ease;transform-origin:center}
.dashboard-recent-avatar img{width:100%;height:100%;display:block;object-fit:cover;object-position:center}
.dashboard-recent-avatar:hover{transform:scale(1.2);box-shadow:0 3px 10px rgba(0,0,0,.24);z-index:5}

/* 4.9 - Dashboard-Aktivitaeten: kompakte Karten */
.dashboard-activity-grid{
  display:grid!important;
  grid-template-columns:minmax(300px,.78fr) minmax(520px,1.52fr)!important;
  gap:14px;
  margin-top:12px;
  align-items:start;
}
.dashboard-activity-card{
  padding:0!important;
  overflow:hidden;
  min-width:0;
  border-radius:6px;
}
.dashboard-activity-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:14px 16px 12px;
  margin:0;
  border-bottom:1px solid var(--border);
}
.dashboard-activity-head>div{display:flex;flex-direction:column;gap:3px;min-width:0}
.dashboard-activity-head h2{margin:0!important;font-size:17px;line-height:1.2}
.dashboard-activity-head .muted{font-size:11px;line-height:1.3}
.dashboard-view-all{
  flex:0 0 auto;
  font-size:11px;
  font-weight:700;
  text-decoration:none!important;
  white-space:nowrap;
  padding:5px 8px;
  border-radius:4px;
}
.dashboard-view-all:hover{background:rgba(126,184,18,.10)}
.dashboard-activity-list{display:block}
.dashboard-activity-row{
  display:grid;
  grid-template-columns:58px minmax(0,1fr) auto 16px;
  gap:11px;
  align-items:center;
  min-height:58px;
  padding:9px 14px;
  border-bottom:1px solid var(--border);
  text-decoration:none!important;
  color:inherit!important;
  transition:background .14s ease,box-shadow .14s ease;
}
.dashboard-activity-row:last-child{border-bottom:0}
.dashboard-activity-row:hover{background:rgba(126,184,18,.06)}
.dashboard-time-block{display:flex;flex-direction:column;align-items:flex-start;line-height:1.05;min-width:0}
.dashboard-time-block strong{font-size:14px;color:var(--text);font-variant-numeric:tabular-nums}
.dashboard-time-block small{font-size:10px;color:var(--muted);margin-top:4px}
.dashboard-activity-main{display:flex;flex-direction:column;min-width:0;gap:3px}
.dashboard-activity-title{
  display:block;
  font-size:13px;
  font-weight:700;
  line-height:1.25;
  color:var(--otedv-green-dark);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.dashboard-activity-subtitle{
  display:block;
  font-size:11px;
  line-height:1.25;
  color:var(--muted);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.dashboard-row-arrow{font-size:20px;line-height:1;color:#a0a6aa;transition:transform .14s ease,color .14s ease}
.dashboard-activity-row:hover .dashboard-row-arrow{transform:translateX(2px);color:var(--otedv-green)}
.dashboard-callback-state{
  font-size:10px;
  font-weight:800;
  padding:4px 7px;
  border-radius:999px;
  background:#eef4e3;
  color:#5f8700;
  white-space:nowrap;
}
.dashboard-callback-state.overdue{background:#fff0ed;color:#b9342e}
.dashboard-callback-row.is-overdue{box-shadow:inset 3px 0 0 #c74339}
.dashboard-agent-slot{display:flex;align-items:center;justify-content:flex-end;min-width:34px}
.dashboard-agent-name{max-width:120px;font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right}
.dashboard-recent-avatar{
  width:30px;
  height:30px;
  flex:0 0 30px;
  font-size:11px;
  border-width:1px;
  display:inline-flex;
  vertical-align:middle;
  cursor:default;
  transition:transform .16s ease,box-shadow .16s ease;
  transform-origin:center;
}
.dashboard-recent-avatar img{width:100%;height:100%;display:block;object-fit:cover;object-position:center}
.dashboard-recent-avatar:hover{transform:scale(1.14);box-shadow:0 4px 12px rgba(0,0,0,.24);z-index:5}
.dashboard-empty-state{
  min-height:118px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:22px 18px;
  color:var(--muted);
  gap:5px;
}
.dashboard-empty-state strong{color:var(--text);font-size:13px}
.dashboard-empty-state span{font-size:11px}
html[data-theme="dark"] .dashboard-activity-head{border-color:#3b4045}
html[data-theme="dark"] .dashboard-activity-row{border-color:#353a3f}
html[data-theme="dark"] .dashboard-activity-row:hover{background:#29311f}
html[data-theme="dark"] .dashboard-activity-title{color:#a8d958}
html[data-theme="dark"] .dashboard-callback-state{background:#2d3a1f;color:#b0dc5a}
html[data-theme="dark"] .dashboard-callback-state.overdue{background:#452824;color:#ff9f96}
html[data-theme="dark"] .dashboard-row-arrow{color:#747c82}
@media(max-width:1050px){
  .dashboard-activity-grid{grid-template-columns:1fr!important}
}
@media(max-width:620px){
  .dashboard-activity-head{padding:12px}
  .dashboard-activity-row{grid-template-columns:48px minmax(0,1fr) auto 14px;padding:9px 10px;gap:8px}
  .dashboard-callback-state{display:none}
  .dashboard-agent-name{display:none}
  .dashboard-time-block strong{font-size:13px}
  .dashboard-activity-title{font-size:12px}
}

.dashboard-activity-meta{display:flex;flex-wrap:wrap;gap:3px 10px;font-size:10px;line-height:1.25;color:var(--muted);min-width:0}
.dashboard-activity-meta span{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.dashboard-activity-meta strong{font-weight:700;color:inherit}


/* 5.1 - Agentenstatus kompakt und sauber */
.dashboard-presence-card{
  margin-top:12px;
  padding:0!important;
  overflow:hidden;
}
.dashboard-presence-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:13px 16px 11px;
  margin:0;
  border-bottom:1px solid var(--border);
}
.dashboard-presence-head>div{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.dashboard-presence-head h2{
  margin:0!important;
  font-size:16px;
}
.dashboard-presence-head .muted{font-size:11px}
.presence-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:64px;
  font-size:10px;
  font-weight:800;
  padding:5px 9px;
  border-radius:999px;
  background:#eef4e3;
  color:#5f8700;
  white-space:nowrap;
}
.presence-list{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  width:100%;
}
.presence-agent{
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  grid-template-rows:auto auto;
  column-gap:11px;
  row-gap:2px;
  align-items:center;
  padding:12px 15px;
  min-width:0;
  border-right:1px solid var(--border);
  position:relative;
}
.presence-agent:last-child{border-right:0}
.presence-avatar{
  grid-column:1;
  grid-row:1 / span 2;
  width:40px;
  height:40px;
  flex:none;
  font-size:14px;
  border-width:1px;
}
.presence-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  display:block;
}
.presence-initial{font-weight:800}
.presence-agent-main{
  grid-column:2;
  grid-row:1;
  display:flex;
  align-items:baseline;
  gap:7px;
  min-width:0;
}
.presence-agent-main strong{
  font-size:12px;
  line-height:1.25;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.presence-agent-main small{
  font-size:10px;
  line-height:1.25;
  color:var(--muted);
  white-space:nowrap;
}
.presence-state{
  grid-column:2;
  grid-row:2;
  display:inline-flex;
  align-items:center;
  justify-self:start;
  gap:6px;
  font-size:10px;
  line-height:1.2;
  font-weight:800;
  white-space:nowrap;
}
.presence-state i{
  display:block;
  width:7px;
  height:7px;
  flex:0 0 7px;
  border-radius:50%;
  background:#9ba1a5;
  box-shadow:0 0 0 3px rgba(155,161,165,.12);
}
.presence-agent.online .presence-state{color:#5f8700}
.presence-agent.online .presence-state i{
  background:#7eb812;
  box-shadow:0 0 0 3px rgba(126,184,18,.16);
}
.presence-agent.inactive .presence-state{color:#a26c00}
.presence-agent.inactive .presence-state i{
  background:#e4a11b;
  box-shadow:0 0 0 3px rgba(228,161,27,.15);
}
.presence-agent.offline{opacity:.70}
.presence-agent.offline .presence-state{color:var(--muted)}
html[data-theme="dark"] .presence-count{
  background:#2d3a1f;
  color:#b0dc5a;
}
html[data-theme="dark"] .dashboard-presence-head,
html[data-theme="dark"] .presence-agent{border-color:#353a3f}
html[data-theme="dark"] .presence-agent.online .presence-state{color:#b0dc5a}
html[data-theme="dark"] .presence-agent.inactive .presence-state{color:#f0bd56}
html[data-theme="dark"] .presence-agent:hover{background:#252a2e}
@media(max-width:900px){
  .presence-list{grid-template-columns:repeat(2,minmax(0,1fr))}
  .presence-agent:nth-child(2n){border-right:0}
  .presence-agent:nth-child(n+3){border-top:1px solid var(--border)}
}
@media(max-width:560px){
  .presence-list{grid-template-columns:1fr}
  .presence-agent{border-right:0!important;border-top:1px solid var(--border)}
  .presence-agent:first-child{border-top:0}
}

/* 5.2 - Dashboard Gesamtoptimierung */
.dashboard-top-grid{
  display:grid;
  grid-template-columns:minmax(0,.92fr) minmax(480px,1.28fr);
  gap:12px;
  align-items:stretch;
  margin-bottom:12px;
}
.dashboard-top-grid .dashboard-welcome,
.dashboard-top-grid .dashboard-quick-call{margin:0;min-width:0;height:100%}
.dashboard-top-grid .dashboard-welcome-content{min-height:0;height:100%;padding:20px 22px;gap:18px}
.dashboard-top-grid .dashboard-welcome h1{font-size:27px;margin-bottom:6px}
.dashboard-top-grid .dashboard-welcome p{font-size:13px;line-height:1.45;max-width:650px}
.dashboard-top-grid .dashboard-welcome-meta{margin-top:14px;gap:9px;font-size:11px}
.dashboard-top-grid .dashboard-meta-item svg{width:14px;height:14px}
.dashboard-top-grid .dashboard-welcome-visual{flex-basis:125px}
.dashboard-top-grid .dashboard-service-mark{width:106px;height:82px;transform:none}
.dashboard-top-grid .dashboard-service-mark:before{width:70px;height:70px;border-width:9px}
.dashboard-top-grid .dashboard-service-mark svg{width:54px;height:54px}
.dashboard-top-grid .dashboard-service-mark span{bottom:0;padding:2px 10px;font-size:11px}
.dashboard-top-grid .dashboard-quick-call{display:flex;flex-direction:column;justify-content:center;padding:18px 20px;border-top-width:3px}
.dashboard-top-grid .dashboard-quick-call h2{font-size:17px;margin:0 0 4px;padding-bottom:8px}
.dashboard-top-grid .dashboard-quick-call .muted{font-size:11px;margin-bottom:9px}
.dashboard-top-grid .dashboard-quick-call .searchbox input{height:44px;font-size:14px;padding:10px 12px}
.dashboard-top-grid .quick-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:9px}

.dashboard-refreshbar{
  min-height:30px;
  margin:0 0 10px;
  padding:5px 9px;
  background:transparent!important;
  border-color:transparent!important;
  border-radius:4px;
}
.dashboard-refresh-label{display:flex;align-items:center;gap:7px}
.dashboard-refresh-label strong{font-size:10px;text-transform:uppercase;letter-spacing:.035em;color:var(--muted)}
.dashboard-refresh-label span.muted{font-size:10px}
.dashboard-refreshbar .text-link{font-size:10px;font-weight:600;opacity:.85}
.dashboard-live-dot{width:7px;height:7px;border-radius:50%;background:var(--otedv-green);box-shadow:0 0 0 3px rgba(126,184,18,.13);flex:0 0 7px}

.dashboard-metrics{gap:10px!important;margin-bottom:10px}
.dashboard-metric-card{
  min-height:74px;
  display:flex!important;
  align-items:center;
  gap:11px;
  padding:12px 14px!important;
  text-decoration:none!important;
  color:inherit!important;
  border-left:3px solid transparent;
  transition:transform .14s ease,box-shadow .14s ease,border-color .14s ease,background .14s ease;
}
.dashboard-metric-card:after{display:none!important}
a.dashboard-metric-card:hover{transform:translateY(-1px);border-left-color:var(--otedv-green);box-shadow:0 4px 14px rgba(20,24,27,.10)}
.dashboard-metric-icon{
  width:36px;height:36px;flex:0 0 36px;border-radius:9px;
  display:flex;align-items:center;justify-content:center;
  background:var(--otedv-green-soft);color:var(--otedv-green-dark)
}
.dashboard-metric-icon svg{width:19px;height:19px;fill:currentColor}
.dashboard-metric-copy{display:flex;flex-direction:column;gap:2px;min-width:0}
.dashboard-metric-copy .muted{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dashboard-metric-copy .metric{font-size:25px;font-weight:750;color:var(--otedv-green-dark)}

.dashboard-presence-card{margin-top:0!important;margin-bottom:12px}
.dashboard-presence-head{padding:11px 14px 9px}
.dashboard-presence-head h2{font-size:15px}
.dashboard-presence-head .muted{font-size:10px}
.presence-list{grid-template-columns:repeat(auto-fit,minmax(205px,1fr))}
.presence-agent{padding:10px 13px;grid-template-columns:36px minmax(0,1fr);column-gap:9px}
.presence-avatar{width:34px;height:34px;flex-basis:34px;font-size:12px}
.presence-agent-main strong{font-size:11px}
.presence-agent-main small,.presence-state{font-size:9px}
.presence-state i{width:6px;height:6px;flex-basis:6px}

.dashboard-activity-grid{margin-top:0!important;gap:12px!important;grid-template-columns:minmax(290px,.74fr) minmax(540px,1.56fr)!important}
.dashboard-activity-card{box-shadow:0 1px 4px rgba(24,28,31,.06)}
.dashboard-activity-head{padding:12px 14px 10px}
.dashboard-activity-head h2{font-size:15px}
.dashboard-activity-head .muted{font-size:10px}
.dashboard-activity-row{min-height:54px;padding:8px 12px;grid-template-columns:52px minmax(0,1fr) auto 14px;gap:9px}
.dashboard-time-block strong{font-size:13px}.dashboard-time-block small{font-size:9px}
.dashboard-activity-title{font-size:12px}.dashboard-activity-subtitle{font-size:10px}.dashboard-activity-meta{font-size:9px}
.dashboard-recent-avatar{width:28px;height:28px;flex-basis:28px}

html[data-theme="dark"] .dashboard-metric-icon{background:#2d3a1f;color:#b0dc5a}
html[data-theme="dark"] .dashboard-metric-copy .metric{color:#8fc629}
html[data-theme="dark"] a.dashboard-metric-card:hover{background:#252a2e;box-shadow:0 4px 14px rgba(0,0,0,.16)}

@media(max-width:1080px){
  .dashboard-top-grid{grid-template-columns:1fr}
  .dashboard-top-grid .dashboard-welcome-content{min-height:130px}
  .dashboard-top-grid .dashboard-quick-call{min-height:150px}
  .dashboard-activity-grid{grid-template-columns:1fr!important}
}
@media(max-width:760px){
  .dashboard-metrics{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .dashboard-refreshbar{align-items:flex-start;flex-direction:column;gap:3px}
}
@media(max-width:520px){
  .dashboard-metrics{grid-template-columns:1fr!important}
  .dashboard-top-grid .dashboard-welcome-content{padding:17px}
  .dashboard-top-grid .dashboard-welcome h1{font-size:23px}
  .dashboard-top-grid .dashboard-welcome-visual{display:none}
  .dashboard-top-grid .dashboard-quick-call{padding:15px}
}


/* 5.4 - Gesprächszeiten je Agent */
.statistics-agent-times{display:flex;flex-wrap:wrap;gap:2px 10px;margin-top:2px;color:var(--muted);font-size:10px;line-height:1.35}
.statistics-agent-times span{white-space:nowrap}
.statistics-agent-times b{color:var(--text);font-weight:700}
html[data-theme="dark"] .statistics-agent-times b{color:#f1f4f5}
@media(max-width:640px){.statistics-agent-times{gap:2px 7px;font-size:9px}.statistics-agent-times span:last-child{flex-basis:100%}}
