/* Sales Tracker – Theme (Tagmodus etwas gedämpft, weniger „grelles Weiß“) */
:root {
  --strato-primary: #ff6600;
  --strato-primary-dark: #e25c00;
  --strato-dark: #1a1a2e;
  --strato-bg: #dfe5ef;
  --strato-card-bg: #eef1f7;
  --strato-card-border: #d0d8e6;
  --strato-muted: #5a6470;
}

[data-theme="light"],
html[data-bs-theme="light"] {
  --strato-bg: #dfe5ef;
  --strato-card-bg: #eef1f7;
  --strato-card-border: #d0d8e6;
  --strato-muted: #5a6470;
}

[data-theme="dark"] {
  --strato-bg: #0f1117;
  --strato-card-bg: #1a1d27;
  --strato-card-border: #2a2e3a;
  --strato-muted: #9aa3b2;
}

body { background: var(--strato-bg); color: #1a2230; font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }

/* Navbar */
.bg-strato { background: linear-gradient(135deg, var(--strato-dark) 0%, #232347 100%); }
.navbar .nav-link { transition: color .15s ease; }
.navbar .nav-link:hover { color: #ffd9b3 !important; }

/* Brand */
.brand-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--strato-primary); color: #fff; font-weight: 700; font-size: .9rem;
  letter-spacing: -.5px;
}
.brand-badge-lg { width: 56px; height: 56px; font-size: 1.5rem; border-radius: 14px; }

/* Footer: ein großes Global-Contact-Logo (keine Mini-Partnerleiste in der Navbar) */
.app-footer {
  border-top: 1px solid var(--strato-card-border);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, transparent 40%);
}
/* Tagmodus: Footer-Band absetzen, damit die helle Logo-Karte nicht im „Weiß auf Weiß“ verschwindet */
[data-theme="light"] .app-footer {
  margin-top: 0.5rem;
  padding-top: 1.75rem !important;
  padding-bottom: 1.75rem !important;
  border-top-color: #c5cdd8;
  background: linear-gradient(180deg, #dce3ee 0%, #cfd8e6 55%, #c5d0e0 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
[data-theme="light"] .app-footer-meta {
  color: #3d4a5c !important;
}
[data-theme="dark"] .app-footer {
  border-top-color: var(--strato-card-border);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, transparent 50%);
}
.app-footer-gc-card {
  padding: 0.85rem 1.75rem 0.95rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 12px 40px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
[data-theme="light"] .app-footer-gc-card {
  background: #f2f5fa;
  box-shadow:
    0 0 0 1px rgba(26, 26, 46, 0.14),
    0 10px 28px rgba(26, 46, 90, 0.18),
    0 2px 6px rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .app-footer-gc-card:hover {
  box-shadow:
    0 0 0 1px rgba(255, 102, 0, 0.45),
    0 14px 36px rgba(26, 46, 90, 0.22),
    0 4px 10px rgba(0, 0, 0, 0.08);
}
.app-footer-gc-card:hover {
  box-shadow:
    0 0 0 1px rgba(255, 102, 0, 0.2),
    0 16px 48px rgba(0, 0, 0, 0.14);
  transform: translateY(-1px);
}
.app-footer-gc-logo {
  display: block;
  height: clamp(52px, 14vw, 88px);
  width: auto;
  max-width: min(92vw, 400px);
  margin: 0 auto;
  object-fit: contain;
}
[data-theme="dark"] .app-footer-gc-card {
  background: rgba(250, 250, 252, 0.98);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 12px 48px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .app-footer-gc-card:hover {
  box-shadow:
    0 0 0 1px rgba(255, 102, 0, 0.35),
    0 18px 56px rgba(0, 0, 0, 0.55);
}
.app-footer-meta {
  letter-spacing: 0.03em;
}

/* Buttons */
.btn-primary { background: var(--strato-primary); border-color: var(--strato-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--strato-primary-dark); border-color: var(--strato-primary-dark); }
.btn-outline-primary { color: var(--strato-primary); border-color: var(--strato-primary); }
.btn-outline-primary:hover { background: var(--strato-primary); border-color: var(--strato-primary); color: #fff; }

/* Cards */
.card {
  border: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  background: var(--strato-card-bg);
  color: #1a2230;
}
.card-header { border-bottom: 1px solid var(--strato-card-border); border-radius: 12px 12px 0 0 !important; }
.stat-card { transition: transform .15s ease, box-shadow .15s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }

/* Dashboard: „Letzte 30 Tage“ + „Letzte Verkäufe“ — kompakt (kein h-100, feste Chart-Höhe) */
.dashboard-row-chart-recent .dashboard-card-30d-chart,
.dashboard-row-chart-recent .dashboard-card-recent-sales {
  height: auto;
}
.dashboard-chart-30d-wrap {
  position: relative;
  width: 100%;
  height: 200px;
  max-height: min(200px, 38vh);
}
@media (max-width: 991.98px) {
  .dashboard-chart-30d-wrap {
    height: 180px;
    max-height: min(180px, 42vh);
  }
}
.dashboard-recent-sales-table {
  table-layout: fixed;
  width: 100%;
  font-size: 0.8125rem;
}
.dashboard-recent-sales-table thead th {
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0;
  padding: 0.3rem 0.4rem !important;
  white-space: nowrap;
}
.dashboard-recent-sales-table tbody td {
  padding: 0.28rem 0.4rem !important;
  line-height: 1.2;
  vertical-align: middle;
}
.dashboard-recent-sales-table th:nth-child(1),
.dashboard-recent-sales-table td:nth-child(1) {
  width: 26%;
}
.dashboard-recent-sales-table th:nth-child(2),
.dashboard-recent-sales-table td:nth-child(2) {
  width: 38%;
  max-width: 0;
}
.dashboard-recent-sales-table th:nth-child(3),
.dashboard-recent-sales-table td:nth-child(3) {
  width: 22%;
}
.dashboard-recent-sales-table th:nth-child(4),
.dashboard-recent-sales-table td:nth-child(4) {
  width: 14%;
}
.dashboard-recent-ref {
  max-width: 100%;
}
.dashboard-recent-sales-scroll {
  max-height: 10.5rem;
  overflow-y: auto;
}
@media (min-width: 992px) {
  .dashboard-recent-sales-scroll {
    max-height: 11.25rem;
  }
}

/* Orderlinks: Filter — Schnellsuche kompakt, bündig zu Von/Bis, mittiger Abstand (lg+) */
.order-links-filter-grid-lg {
  display: grid;
  gap: 0.4rem 0.75rem;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    'qlabel'
    'qctrl'
    'froml'
    'fromi'
    'tol'
    'toi'
    'filbtn';
}
.order-links-filter-grid-lg .olf-q-label {
  grid-area: qlabel;
}
.order-links-filter-grid-lg .olf-q-ctrl {
  grid-area: qctrl;
}
.order-links-filter-grid-lg .olf-gutter {
  display: none;
}
.order-links-filter-grid-lg .olf-from-l {
  grid-area: froml;
}
.order-links-filter-grid-lg .olf-from-i {
  grid-area: fromi;
}
.order-links-filter-grid-lg .olf-to-l {
  grid-area: tol;
}
.order-links-filter-grid-lg .olf-to-i {
  grid-area: toi;
}
.order-links-filter-grid-lg .olf-fil-btn {
  grid-area: filbtn;
}
.order-links-filter-grid-lg .olf-q-input {
  min-width: 0;
}
@media (min-width: 992px) {
  .order-links-filter-grid-lg {
    grid-template-columns: minmax(26rem, 44rem) minmax(1.5rem, 1fr) 9.75rem 9.75rem auto;
    grid-template-rows: auto auto;
    grid-template-areas: none;
    align-items: end;
    column-gap: 1rem;
    row-gap: 0.35rem;
  }
  .order-links-filter-grid-lg .olf-q-label {
    grid-column: 1;
    grid-row: 1;
  }
  .order-links-filter-grid-lg .olf-q-ctrl {
    grid-column: 1;
    grid-row: 2;
    flex-wrap: nowrap;
  }
  .order-links-filter-grid-lg .olf-gutter {
    display: block;
    grid-column: 2;
    grid-row: 1 / span 2;
    min-width: 1rem;
  }
  .order-links-filter-grid-lg .olf-from-l {
    grid-column: 3;
    grid-row: 1;
  }
  .order-links-filter-grid-lg .olf-from-i {
    grid-column: 3;
    grid-row: 2;
  }
  .order-links-filter-grid-lg .olf-to-l {
    grid-column: 4;
    grid-row: 1;
  }
  .order-links-filter-grid-lg .olf-to-i {
    grid-column: 4;
    grid-row: 2;
  }
  .order-links-filter-grid-lg .olf-fil-btn {
    grid-column: 5;
    grid-row: 2;
    justify-self: end;
    align-self: end;
    padding-left: 0.5rem;
  }
  .order-links-filter-grid-lg .olf-q-input {
    flex: 1 1 auto;
    max-width: min(41rem, 100%);
    width: 100%;
  }
}

/* Tagmodus: Eingaben & Listen etwas weicher (kein hartes Weiß) */
[data-theme="light"] .form-control,
[data-theme="light"] .form-select,
html[data-bs-theme="light"] .form-control,
html[data-bs-theme="light"] .form-select {
  background-color: #f4f6fa;
  border-color: #c8d2e4;
  color: #1a2230;
}
[data-theme="light"] .list-group-item,
html[data-bs-theme="light"] .list-group-item {
  background-color: var(--strato-card-bg);
  border-color: var(--strato-card-border);
  color: #1a2230;
}

/* Login page — full-viewport ambient brands + glass card */
.login-bg {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 120% 90% at 50% 40%, #2a1a14 0%, #0d0d12 55%, #050508 100%);
}
.login-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.login-ambient__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
}
.login-ambient__glow--1 {
  width: min(90vw, 720px);
  height: min(90vw, 720px);
  left: -18%;
  top: -12%;
  background: radial-gradient(circle at 40% 40%, rgba(255, 102, 0, 0.55) 0%, rgba(255, 102, 0, 0) 70%);
}
.login-ambient__glow--2 {
  width: min(85vw, 640px);
  height: min(85vw, 640px);
  right: -22%;
  bottom: -18%;
  background: radial-gradient(circle at 60% 60%, rgba(124, 58, 237, 0.35) 0%, rgba(124, 58, 237, 0) 68%);
}
.login-ambient__logo {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-ambient__logo img {
  width: min(72vmin, 520px);
  max-width: none;
  height: auto;
  object-fit: contain;
  opacity: 0.14;
  filter: blur(1px) saturate(1.1);
  transform: translateZ(0);
}
.login-ambient__logo--gc {
  left: -8%;
  top: 8%;
  transform: rotate(-6deg);
}
.login-ambient__logo--gc img {
  width: min(78vmin, 560px);
}
.login-ambient__logo--st {
  right: -12%;
  bottom: 6%;
  transform: rotate(4deg);
}
.login-ambient__logo--st img {
  width: min(68vmin, 480px);
  opacity: 0.18;
}
.login-ambient__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 55% at 50% 50%, transparent 0%, rgba(0, 0, 0, 0.55) 100%);
  opacity: 0.9;
}
.login-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 4.5rem 1rem 2rem;
}
.login-wrap {
  width: 100%;
  max-width: 420px;
}
.login-card--glass {
  border-radius: 20px !important;
  background: rgba(18, 20, 28, 0.55) !important;
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 24px 80px rgba(0, 0, 0, 0.55),
    0 0 120px rgba(255, 102, 0, 0.08);
  color: #f0f2f8;
}
.login-title {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}
.login-sub {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.95rem;
}
.login-form-label {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.875rem;
}
.login-input-group .input-group-text {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
}
.login-input-group .form-control {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.login-input-group .form-control:focus {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 102, 0, 0.65);
  box-shadow: 0 0 0 0.2rem rgba(255, 102, 0, 0.2);
  color: #fff;
}
.login-input-group .form-control::placeholder {
  color: rgba(255, 255, 255, 0.35);
}
.login-pw-toggle {
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 0;
  border-radius: 0 0.375rem 0.375rem 0;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  padding: 0 0.75rem;
  line-height: 1.5;
}
.login-pw-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.login-pw-toggle:focus-visible {
  outline: 2px solid rgba(255, 102, 0, 0.65);
  outline-offset: 0;
  z-index: 3;
}
.login-submit-btn {
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 12px;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.login-alert {
  background: rgba(220, 53, 69, 0.2) !important;
  border: 1px solid rgba(220, 53, 69, 0.45);
  color: #fecaca !important;
}
.login-footer-copy {
  color: rgba(255, 255, 255, 0.38);
}
.login-toolbar {
  z-index: 20;
}
[data-theme="light"] .login-toolbar .btn-outline-light {
  color: #1a1a2e;
  border-color: rgba(26, 26, 46, 0.35);
  background: rgba(255, 255, 255, 0.35);
}
[data-theme="light"] .login-toolbar .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.55);
  color: #0d0d12;
  border-color: rgba(26, 26, 46, 0.45);
}

/* Login — light theme (Tagmodus): helle Glas-Karte */
[data-theme="light"] .login-bg {
  background:
    radial-gradient(ellipse 100% 80% at 50% 20%, #fff5ef 0%, #e8ecf5 45%, #dce3f0 100%);
}
[data-theme="light"] .login-ambient__logo img {
  opacity: 0.09;
}
[data-theme="light"] .login-ambient__vignette {
  opacity: 0.35;
  background: radial-gradient(ellipse 80% 60% at 50% 50%, transparent 40%, rgba(255, 255, 255, 0.5) 100%);
}
[data-theme="light"] .login-ambient__glow--1 {
  opacity: 0.28;
}
[data-theme="light"] .login-ambient__glow--2 {
  opacity: 0.2;
}
[data-theme="light"] .login-card--glass {
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.85) inset,
    0 20px 60px rgba(26, 26, 46, 0.12);
  color: #1a1d27;
}
[data-theme="light"] .login-title {
  color: #12141c;
}
[data-theme="light"] .login-sub {
  color: #5c6570;
}
[data-theme="light"] .login-form-label {
  color: #4a5360;
}
[data-theme="light"] .login-input-group .input-group-text {
  background: #f0f2f7;
  border-color: #dde1ea;
  color: #495057;
}
[data-theme="light"] .login-input-group .form-control {
  background: #fff;
  border-color: #dde1ea;
  color: #1a1d27;
}
[data-theme="light"] .login-input-group .form-control:focus {
  border-color: var(--strato-primary);
  box-shadow: 0 0 0 0.2rem rgba(255, 102, 0, 0.18);
}
[data-theme="light"] .login-pw-toggle {
  background: #f0f2f7;
  border-color: #dde1ea;
  border-left: 0;
  color: #495057;
}
[data-theme="light"] .login-pw-toggle:hover {
  background: #e8ebf2;
  color: #1a1d27;
}
[data-theme="light"] .login-footer-copy {
  color: rgba(26, 26, 46, 0.45);
}
[data-theme="light"] .login-alert {
  color: #842029 !important;
  background: rgba(248, 215, 218, 0.95) !important;
  border-color: #f1aeb5;
}

/* Bonus preview card */
.bonus-preview .preview-row { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px dashed #e5e7eb; }
.bonus-preview .preview-row:last-of-type { border-bottom: 0; }
.bonus-preview .preview-bonus { background: #d1fae5; border-radius: 8px; padding: .75rem; margin-top: .75rem; text-align: center; }
.bonus-preview .preview-bonus .amount { font-size: 1.75rem; font-weight: 700; color: #065f46; }
.bonus-preview .preview-bonus .label { font-size: .8rem; color: #047857; text-transform: uppercase; letter-spacing: .5px; }

/* Tables */
.table > :not(caption) > * > * { padding: .65rem .75rem; }
.text-monospace { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .9em; }

.wave { display: inline-block; animation: wave 1.6s infinite; transform-origin: 70% 70%; }
@keyframes wave { 0%,60%,100% { transform: rotate(0); } 10%,30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(14deg); } 50% { transform: rotate(-4deg); } }

/* ============== MONATSZIEL ============== */
.monthly-target-card {
  background: linear-gradient(135deg, #fff7ee 0%, #ffe6cc 100%);
  border: 1px solid #ffd1a3 !important;
}
.monthly-target-card.reached {
  background: linear-gradient(135deg, #ecfdf5 0%, #c7f5dc 100%);
  border-color: #6ee7b7 !important;
}
.monthly-target-card .target-icon-box {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--strato-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.7rem; flex-shrink: 0;
}
.monthly-target-card.reached .target-icon-box { background: #10b981; }
.monthly-progress { background: rgba(255,255,255,.6); border-radius: 999px; }
.monthly-progress .progress-bar { font-weight: 600; transition: width .6s ease; }

[data-theme="dark"] .monthly-target-card { background: linear-gradient(135deg, #2b1d10 0%, #3a2410 100%); border-color: #5a3a18 !important; }
[data-theme="dark"] .monthly-target-card.reached { background: linear-gradient(135deg, #0f2620 0%, #143b2c 100%); border-color: #1f5f3f !important; }

/* ============== GRUPPEN-TAGESZIEL (Bonus heute, ganze Gruppe) ============== */
.group-daily-target-card {
  background: linear-gradient(135deg, #f0f7ff 0%, #e0edff 100%);
  border: 1px solid #b6d4fe !important;
}
.group-daily-target-card.reached {
  background: linear-gradient(135deg, #ecfdf5 0%, #c7f5dc 100%);
  border-color: #6ee7b7 !important;
}
.group-daily-icon-box {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.35rem;
}
.group-daily-target-card.reached .group-daily-icon-box {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
}
.group-daily-progress {
  background-color: #e9ecef;
  border-radius: 6px;
  overflow: hidden;
}
.group-daily-progress--pending {
  /* Ruhiger Hintergrund: Fortschrittsfarbe kommt vom Balken (PHP, an %-Stand gekoppelt) */
  background: #e9ecef;
}
[data-theme="dark"] .group-daily-progress--pending {
  background: #2a2e3a;
}
.progress-bar-group-daily {
  /* Farbe: group_daily_target_progress_bar_color() per inline background-color */
  background-color: hsl(0, 86%, 40%);
  color: #fff;
  font-weight: 600;
  font-size: 0.75rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .group-daily-target-card {
  background: linear-gradient(135deg, #101820 0%, #152535 100%);
  border-color: #2a4a6e !important;
}
[data-theme="dark"] .group-daily-target-card.reached {
  background: linear-gradient(135deg, #0f2620 0%, #143b2c 100%);
  border-color: #1f5f3f !important;
}
[data-theme="dark"] .group-daily-progress { background-color: #2a2e3a; }
[data-theme="dark"] .monthly-progress { background: rgba(0,0,0,.35); }

/* Gruppen-Tagesziel: Aufmerksamkeit solange Ziel noch nicht erreicht (Leuchtrand + leichte Skalierung) */
@keyframes group-daily-attention-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 0 1px rgba(59, 130, 246, 0.45),
      0 2px 8px rgba(59, 130, 246, 0.08);
  }
  50% {
    transform: scale(1.02);
    box-shadow:
      0 0 0 1px rgba(147, 197, 253, 0.95),
      0 0 20px rgba(59, 130, 246, 0.45),
      0 0 40px rgba(59, 130, 246, 0.2),
      0 0 56px rgba(255, 102, 0, 0.12),
      0 8px 20px rgba(0, 0, 0, 0.12);
  }
}
@keyframes group-daily-attention-pulse-dark {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 0 1px rgba(59, 130, 246, 0.35),
      0 4px 16px rgba(0, 0, 0, 0.35);
  }
  50% {
    transform: scale(1.02);
    box-shadow:
      0 0 0 1px rgba(147, 197, 253, 0.55),
      0 0 24px rgba(59, 130, 246, 0.55),
      0 0 48px rgba(59, 130, 246, 0.25),
      0 0 64px rgba(255, 102, 0, 0.14),
      0 10px 28px rgba(0, 0, 0, 0.45);
  }
}
.group-daily-target-card:not(.reached) {
  transform-origin: center center;
  animation: group-daily-attention-pulse 2.5s ease-in-out infinite;
  will-change: transform, box-shadow;
}
[data-theme="dark"] .group-daily-target-card:not(.reached) {
  animation-name: group-daily-attention-pulse-dark;
}
.group-daily-target-card.reached {
  animation: none;
  will-change: auto;
}
@media (prefers-reduced-motion: reduce) {
  .group-daily-target-card:not(.reached) {
    animation: none;
    will-change: auto;
  }
}

/* ============== IMPERSONATION BANNER ============== */
.impersonation-banner {
  background: repeating-linear-gradient(45deg, #ff6600 0 12px, #e25c00 12px 24px);
  color: #fff;
  font-weight: 500;
  border-bottom: 2px solid #1a1a2e;
}
.impersonation-banner a { color: #1a1a2e; }

/* ============== DARK MODE ============== */
[data-theme="dark"] body { background: var(--strato-bg); color: #e6e8ee; }
[data-theme="dark"] .card { background: var(--strato-card-bg); color: #e6e8ee; box-shadow: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3); }
[data-theme="dark"] .card-header,
[data-theme="dark"] .card-footer { background: var(--strato-card-bg) !important; border-color: var(--strato-card-border); color: #e6e8ee; }
[data-theme="dark"] .card-header.bg-white { background: var(--strato-card-bg) !important; }
[data-theme="dark"] .table { color: #e6e8ee; --bs-table-bg: var(--strato-card-bg); --bs-table-color: #e6e8ee; }
[data-theme="dark"] .table > thead.table-light > tr > th,
[data-theme="dark"] .table-light { background: #232737 !important; color: #e6e8ee !important; --bs-table-bg: #232737; --bs-table-color: #e6e8ee; }
[data-theme="dark"] .table-hover > tbody > tr:hover > * { background: #232737; color: #e6e8ee; }
[data-theme="dark"] .table > :not(caption) > * > * { border-color: var(--strato-card-border); }
[data-theme="dark"] .table-secondary { --bs-table-bg: #232737; color: #b9bfca; }

[data-theme="dark"] .form-control, [data-theme="dark"] .form-select {
  background: #1a1d27; color: #e6e8ee; border-color: #2a2e3a;
}
[data-theme="dark"] .form-control:focus, [data-theme="dark"] .form-select:focus {
  background: #1f2330; color: #fff; border-color: var(--strato-primary); box-shadow: 0 0 0 .2rem rgba(255,102,0,.25);
}
[data-theme="dark"] .form-control::placeholder { color: #7c8494; }
[data-theme="dark"] .input-group-text { background: #232737; color: #e6e8ee; border-color: #2a2e3a; }

[data-theme="dark"] .text-muted { color: var(--strato-muted) !important; }
[data-theme="dark"] .text-dark { color: #e6e8ee !important; }
[data-theme="dark"] .border, [data-theme="dark"] .border-bottom, [data-theme="dark"] .border-top { border-color: var(--strato-card-border) !important; }

[data-theme="dark"] .modal-content { background: var(--strato-card-bg); color: #e6e8ee; }
[data-theme="dark"] .modal-header, [data-theme="dark"] .modal-footer { border-color: var(--strato-card-border); }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

[data-theme="dark"] .dropdown-menu { background: var(--strato-card-bg); border-color: var(--strato-card-border); }
[data-theme="dark"] .dropdown-item { color: #e6e8ee; }
[data-theme="dark"] .dropdown-item:hover, [data-theme="dark"] .dropdown-item:focus { background: #232737; color: #fff; }
[data-theme="dark"] .dropdown-divider { border-color: var(--strato-card-border); }

[data-theme="dark"] .badge.bg-light { background: #2a2e3a !important; color: #e6e8ee !important; }
[data-theme="dark"] .alert-info { background: #1f2a3a; color: #cfe2ff; border-color: #2a3a52; }
[data-theme="dark"] .alert-success { background: #142b1f; color: #b3e0c2; border-color: #1f4530; }
[data-theme="dark"] .alert-warning { background: #2e2614; color: #f5d28a; border-color: #4a3b1f; }
[data-theme="dark"] .alert-danger { background: #2e1414; color: #f0a8a8; border-color: #4a1f1f; }

[data-theme="dark"] .bonus-preview .preview-bonus { background: #14352a; }
[data-theme="dark"] .bonus-preview .preview-bonus .amount { color: #6ee7b7; }
[data-theme="dark"] .bonus-preview .preview-bonus .label { color: #34d399; }
[data-theme="dark"] .bonus-preview .preview-row { border-bottom-color: #2a2e3a; }

/* Flatpickr Dark */
[data-theme="dark"] .flatpickr-calendar { background: var(--strato-card-bg); color: #e6e8ee; box-shadow: 0 6px 24px rgba(0,0,0,.5); }
[data-theme="dark"] .flatpickr-day { color: #e6e8ee; }
[data-theme="dark"] .flatpickr-day.today { border-color: var(--strato-primary); }
[data-theme="dark"] .flatpickr-day.selected, [data-theme="dark"] .flatpickr-day.selected:hover { background: var(--strato-primary); border-color: var(--strato-primary); color: #fff; }
[data-theme="dark"] .flatpickr-day:hover { background: #232737; }
[data-theme="dark"] .flatpickr-months .flatpickr-month, [data-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months,
[data-theme="dark"] .flatpickr-weekdays, [data-theme="dark"] span.flatpickr-weekday { background: var(--strato-card-bg); color: #e6e8ee; fill: #e6e8ee; }
[data-theme="dark"] .flatpickr-months .flatpickr-prev-month, [data-theme="dark"] .flatpickr-months .flatpickr-next-month { fill: #e6e8ee; color: #e6e8ee; }
[data-theme="dark"] .numInputWrapper input { color: #e6e8ee; }

/* Admin: Gruppen-Donut (Übersicht) */
.chart-groups-body { min-height: 320px; }
.chart-groups-canvas-wrap {
  position: relative;
  width: 100%;
  min-height: 280px;
  height: 280px;
}
@media (min-width: 992px) {
  .chart-groups-canvas-wrap {
    min-height: 300px;
    height: 300px;
  }
}
.chart-groups-empty {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem 1.25rem;
  line-height: 1.45;
}
[data-bs-theme="dark"] .chart-groups-empty,
[data-theme="dark"] .chart-groups-empty {
  color: #c5cdd8 !important;
}

/* Admin: Gruppenfilter als aufklappbares Dropdown (Checkboxen), Dark/Light */
.group-filter-dropdown-toggle {
  font-size: 0.875rem;
  line-height: 1.5;
  min-height: calc(1.5em + 0.5rem + 2px);
  background-color: var(--strato-card-bg);
  color: #1a2230;
  border-color: var(--strato-card-border) !important;
}
.group-filter-dropdown-toggle:hover,
.group-filter-dropdown-toggle:focus,
.group-filter-dropdown-toggle.show {
  background-color: var(--strato-card-bg);
  color: #1a2230;
  border-color: var(--strato-card-border) !important;
}
[data-theme="dark"] .group-filter-dropdown-toggle,
[data-bs-theme="dark"] .group-filter-dropdown-toggle {
  background-color: #1a1d27;
  color: #e6e8ee;
  border-color: #2a2e3a !important;
}
[data-theme="dark"] .group-filter-dropdown-toggle:hover,
[data-theme="dark"] .group-filter-dropdown-toggle:focus,
[data-theme="dark"] .group-filter-dropdown-toggle.show,
[data-bs-theme="dark"] .group-filter-dropdown-toggle:hover,
[data-bs-theme="dark"] .group-filter-dropdown-toggle:focus,
[data-bs-theme="dark"] .group-filter-dropdown-toggle.show {
  background-color: #1f2330;
  color: #fff;
  border-color: #3d4454 !important;
}
.group-filter-dropdown-menu {
  max-height: 16rem;
  overflow-y: auto;
  font-size: 0.875rem;
}
[data-theme="dark"] .group-filter-dropdown-menu,
[data-bs-theme="dark"] .group-filter-dropdown-menu {
  background-color: #1a1d27;
  border-color: #2a2e3a;
  color: #e6e8ee;
}
[data-theme="dark"] .group-filter-dropdown-menu .dropdown-divider,
[data-bs-theme="dark"] .group-filter-dropdown-menu .dropdown-divider {
  border-color: #2f3544;
}
[data-theme="dark"] .group-filter-dropdown-menu .form-check-label,
[data-bs-theme="dark"] .group-filter-dropdown-menu .form-check-label {
  color: #e6e8ee;
}
[data-theme="dark"] .group-filter-dropdown-menu .form-check-input,
[data-bs-theme="dark"] .group-filter-dropdown-menu .form-check-input {
  border-color: #5c6574;
  background-color: #12141a;
}
[data-theme="dark"] .group-filter-dropdown-menu .form-check-input:checked,
[data-bs-theme="dark"] .group-filter-dropdown-menu .form-check-input:checked {
  background-color: var(--strato-primary);
  border-color: var(--strato-primary);
}

/* Genesys: Agent live card + CR status colors */
.genesys-agent-card .genesys-mini-tile {
  border: 1px solid var(--strato-card-border);
  border-radius: 0.5rem;
  padding: 0.65rem 0.75rem;
  background: var(--strato-card-bg);
  height: 100%;
}
.genesys-agent-card .genesys-st-prod {
  border-color: rgba(25, 135, 84, 0.35);
  background: rgba(25, 135, 84, 0.06);
}
.genesys-cr-box {
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--strato-card-border);
}
.genesys-cr-ok {
  border-color: rgba(25, 135, 84, 0.45);
  background: rgba(25, 135, 84, 0.08);
}
.genesys-cr-warn {
  border-color: rgba(255, 193, 7, 0.55);
  background: rgba(255, 193, 7, 0.12);
}
.genesys-cr-crit {
  border-color: rgba(220, 53, 69, 0.45);
  background: rgba(220, 53, 69, 0.08);
}
.genesys-cr-neutral {
  border-color: var(--strato-card-border);
  background: rgba(108, 117, 125, 0.08);
}

/* Dashboard: zwei CR-Kacheln (eigen / Gruppe) nebeneinander, optisch getrennt */
.dashboard-cr-twin {
  align-items: center;
}
.dashboard-cr-twin-sep {
  width: 1px;
  min-height: 2.75rem;
  align-self: center;
  flex-shrink: 0;
  border-radius: 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 255, 255, 0.14) 20%,
    rgba(255, 255, 255, 0.14) 80%,
    transparent 100%
  );
  opacity: 0.85;
}
[data-theme="light"] .dashboard-cr-twin-sep,
[data-bs-theme="light"] .dashboard-cr-twin-sep {
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.12) 20%,
    rgba(0, 0, 0, 0.12) 80%,
    transparent 100%
  );
}
.dashboard-cr-hero--own {
  /* leicht von Gruppen-Kachel unterscheidbar */
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
[data-theme="light"] .dashboard-cr-hero--own,
[data-bs-theme="light"] .dashboard-cr-hero--own {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

/* Dashboard: CR neben „Neuer Verkauf“ — Puls (größer/kleiner) + leuchtende Umrandung */
.dashboard-cr-hero {
  min-width: 9rem;
  border-radius: 0.85rem;
  padding: 0.55rem 1.1rem;
  text-align: center;
  border: 2px solid transparent;
  box-sizing: border-box;
  transform-origin: center center;
  backface-visibility: hidden;
}
.dashboard-cr-hero--group {
  min-width: 8.5rem;
  opacity: 0.98;
}
.dashboard-cr-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  line-height: 1.15;
}
.dashboard-cr-hero-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.dashboard-cr-hero-value {
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
@keyframes dashboard-cr-breathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.09);
  }
}
.dashboard-cr-hero.genesys-cr-ok {
  animation: dashboard-cr-breathe 2.3s ease-in-out infinite,
    dashboard-cr-glow-ok 2.3s ease-in-out infinite;
}
.dashboard-cr-hero.genesys-cr-warn {
  animation: dashboard-cr-breathe 2.3s ease-in-out infinite,
    dashboard-cr-glow-warn 2.3s ease-in-out infinite;
}
.dashboard-cr-hero.genesys-cr-crit {
  animation: dashboard-cr-breathe 2.3s ease-in-out infinite,
    dashboard-cr-glow-crit 2.3s ease-in-out infinite;
}
.dashboard-cr-hero.genesys-cr-neutral {
  animation: dashboard-cr-breathe 2.3s ease-in-out infinite,
    dashboard-cr-glow-neutral 2.3s ease-in-out infinite;
}
@keyframes dashboard-cr-glow-ok {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(25, 135, 84, 0.35), 0 0 14px 3px rgba(25, 135, 84, 0.22);
    border-color: rgba(25, 135, 84, 0.4);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.65), 0 0 36px 14px rgba(25, 135, 84, 0.5);
    border-color: rgba(25, 135, 84, 0.95);
  }
}
@keyframes dashboard-cr-glow-warn {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.4), 0 0 14px 3px rgba(255, 193, 7, 0.25);
    border-color: rgba(255, 193, 7, 0.55);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.75), 0 0 36px 14px rgba(255, 193, 7, 0.45);
    border-color: rgba(255, 193, 7, 0.95);
  }
}
@keyframes dashboard-cr-glow-crit {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(220, 53, 69, 0.35), 0 0 14px 3px rgba(220, 53, 69, 0.22);
    border-color: rgba(220, 53, 69, 0.45);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.7), 0 0 36px 14px rgba(220, 53, 69, 0.48);
    border-color: rgba(220, 53, 69, 0.95);
  }
}
@keyframes dashboard-cr-glow-neutral {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(255, 102, 0, 0.35), 0 0 12px 4px rgba(255, 102, 0, 0.2);
    border-color: rgba(255, 102, 0, 0.45);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.75), 0 0 40px 16px rgba(255, 102, 0, 0.42);
    border-color: rgba(255, 136, 51, 0.95);
  }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard-cr-hero.genesys-cr-ok,
  .dashboard-cr-hero.genesys-cr-warn,
  .dashboard-cr-hero.genesys-cr-crit,
  .dashboard-cr-hero.genesys-cr-neutral {
    animation: none;
  }
}
[data-theme="dark"] .dashboard-cr-hero .dashboard-cr-hero-label,
[data-bs-theme="dark"] .dashboard-cr-hero .dashboard-cr-hero-label {
  color: #b4bcc8 !important;
}

.genesys-cr-pill {
  font-weight: 600;
  font-size: 0.8rem;
  border: 1px solid transparent;
}

/* CR-Pills & -Boxen: Tagmodus — dunkle Schrift, kräftigere Flächen (Bootstrap-Badge sonst #fff) */
[data-theme="light"] .genesys-cr-pill.genesys-cr-ok,
html[data-bs-theme="light"] .genesys-cr-pill.genesys-cr-ok {
  --bs-badge-color: #0b5e36;
  color: #0b5e36 !important;
  background-color: #c8e6d4 !important;
  border-color: #198754;
}
[data-theme="light"] .genesys-cr-pill.genesys-cr-warn,
html[data-bs-theme="light"] .genesys-cr-pill.genesys-cr-warn {
  --bs-badge-color: #7a5a00;
  color: #7a5a00 !important;
  background-color: #fff0b3 !important;
  border-color: #e6a800;
}
[data-theme="light"] .genesys-cr-pill.genesys-cr-crit,
html[data-bs-theme="light"] .genesys-cr-pill.genesys-cr-crit {
  --bs-badge-color: #8b1a1a;
  color: #8b1a1a !important;
  background-color: #f8d4d8 !important;
  border-color: #dc3545;
}
[data-theme="light"] .genesys-cr-pill.genesys-cr-neutral,
html[data-bs-theme="light"] .genesys-cr-pill.genesys-cr-neutral {
  --bs-badge-color: #3d4a5c;
  color: #3d4a5c !important;
  background-color: #e2e6ed !important;
  border-color: #9aa8b8;
}
[data-theme="light"] .genesys-cr-box.genesys-cr-ok,
html[data-bs-theme="light"] .genesys-cr-box.genesys-cr-ok {
  background: #e8f5ec;
  border-color: #198754;
  color: #0b5e36;
}
[data-theme="light"] .genesys-cr-box.genesys-cr-warn,
html[data-bs-theme="light"] .genesys-cr-box.genesys-cr-warn {
  background: #fff8e1;
  border-color: #e6a800;
  color: #7a5a00;
}
[data-theme="light"] .genesys-cr-box.genesys-cr-crit,
html[data-bs-theme="light"] .genesys-cr-box.genesys-cr-crit {
  background: #fdecef;
  border-color: #dc3545;
  color: #8b1a1a;
}
[data-theme="light"] .genesys-cr-box.genesys-cr-neutral,
html[data-bs-theme="light"] .genesys-cr-box.genesys-cr-neutral {
  background: #eef1f7;
  border-color: var(--strato-card-border);
  color: #3d4a5c;
}

/* Nachtmodus: Pills explizit (helle Schrift auf gedämpften Flächen) */
[data-theme="dark"] .genesys-cr-pill.genesys-cr-ok,
[data-bs-theme="dark"] .genesys-cr-pill.genesys-cr-ok {
  --bs-badge-color: #b8f0d0;
  color: #b8f0d0 !important;
  background-color: rgba(25, 135, 84, 0.38) !important;
  border-color: rgba(72, 187, 120, 0.65);
}
[data-theme="dark"] .genesys-cr-pill.genesys-cr-warn,
[data-bs-theme="dark"] .genesys-cr-pill.genesys-cr-warn {
  --bs-badge-color: #ffe08a;
  color: #ffe08a !important;
  background-color: rgba(255, 193, 7, 0.28) !important;
  border-color: rgba(255, 193, 7, 0.55);
}
[data-theme="dark"] .genesys-cr-pill.genesys-cr-crit,
[data-bs-theme="dark"] .genesys-cr-pill.genesys-cr-crit {
  --bs-badge-color: #ffb3b3;
  color: #ffb3b3 !important;
  background-color: rgba(220, 53, 69, 0.32) !important;
  border-color: rgba(220, 53, 69, 0.6);
}
[data-theme="dark"] .genesys-cr-pill.genesys-cr-neutral,
[data-bs-theme="dark"] .genesys-cr-pill.genesys-cr-neutral {
  --bs-badge-color: #c8cdd6;
  color: #c8cdd6 !important;
  background-color: rgba(108, 117, 125, 0.35) !important;
  border-color: rgba(154, 163, 178, 0.5);
}

.genesys-kv .text-muted {
  font-size: 0.8rem;
}
.genesys-admin-tabs .nav-link {
  font-weight: 500;
  border-radius: 2rem;
}
.genesys-admin-tabs .nav-link.active {
  background: linear-gradient(135deg, var(--strato-primary) 0%, var(--strato-primary-dark) 100%);
  color: #fff !important;
}

/* Genesys Admin: Formulare & Listen im Hell- / Dunkelmodus lesbar */
.genesys-admin-panel .card-body {
  color: inherit;
}
.genesys-inner-form {
  background: var(--strato-bg);
  border: 1px solid var(--strato-card-border);
  border-radius: 0.5rem;
}
[data-theme="dark"] .genesys-inner-form,
[data-bs-theme="dark"] .genesys-inner-form {
  background: #12151c;
  border-color: #2a2e3a;
  color: #e6e8ee;
}
[data-theme="dark"] .genesys-admin-panel .form-label,
[data-bs-theme="dark"] .genesys-admin-panel .form-label {
  color: #e6e8ee;
}
[data-theme="dark"] .genesys-admin-panel .form-check-label,
[data-bs-theme="dark"] .genesys-admin-panel .form-check-label {
  color: #dce0e8;
}
[data-theme="dark"] .genesys-admin-panel .text-muted,
[data-bs-theme="dark"] .genesys-admin-panel .text-muted {
  color: #9aa3b2 !important;
}
[data-theme="dark"] .genesys-admin-panel .bg-light,
[data-bs-theme="dark"] .genesys-admin-panel .bg-light {
  background-color: #1a1d27 !important;
  color: #e6e8ee !important;
}
[data-theme="dark"] .genesys-admin-panel .list-group-item,
[data-bs-theme="dark"] .genesys-admin-panel .list-group-item {
  background: var(--strato-card-bg);
  color: #e6e8ee;
  border-color: var(--strato-card-border);
}
[data-theme="dark"] .genesys-admin-panel .list-group-item.active,
[data-bs-theme="dark"] .genesys-admin-panel .list-group-item.active {
  background: var(--strato-primary);
  border-color: var(--strato-primary);
  color: #fff;
}
[data-theme="dark"] .genesys-admin-panel .list-group-item-action:hover,
[data-bs-theme="dark"] .genesys-admin-panel .list-group-item-action:hover {
  background: #232737;
  color: #fff;
}

@media (max-width: 576px) {
  .genesys-agent-card .genesys-mini-tile {
    min-height: 4.5rem;
  }
}

/* Dashboard: Team-Sales-Donut — dezente Umrandung / Licht, ohne Skalierung */
.team-sales-donut-card {
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 102, 0, 0.12);
  box-shadow:
    0 0 0 1px rgba(255, 102, 0, 0.06),
    0 1px 3px rgba(0, 0, 0, 0.06);
}
[data-bs-theme="dark"] .team-sales-donut-card {
  border-color: rgba(255, 136, 51, 0.22);
  box-shadow:
    0 0 0 1px rgba(255, 136, 51, 0.1),
    0 1px 3px rgba(0, 0, 0, 0.35);
}
.team-sales-donut-chart-wrap {
  position: relative;
  width: 100%;
  max-width: 280px;
  height: 220px;
}
.team-sales-donut-empty {
  min-height: 200px;
  border-radius: 0.75rem;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  padding: 1rem;
  text-align: center;
}
.team-sales-donut-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 102, 0, 0.22);
  padding: 0.45rem 0.55rem;
  animation: team-donut-legend-glow 3.2s ease-in-out infinite;
}
.team-sales-donut-legend-main {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-width: 0;
}
[data-bs-theme="dark"] .team-sales-donut-legend-item {
  border-color: rgba(255, 136, 51, 0.28);
}
.team-sales-donut-legend-item--muted {
  border-color: rgba(148, 163, 184, 0.35);
  animation-name: team-donut-legend-glow-muted;
}
[data-bs-theme="dark"] .team-sales-donut-legend-item--muted {
  border-color: rgba(100, 116, 139, 0.45);
}
.team-sales-donut-swatch {
  flex-shrink: 0;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  margin-top: 0.35rem;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}
[data-bs-theme="dark"] .team-sales-donut-swatch {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.team-sales-donut-legend-item--muted .team-sales-donut-swatch {
  background-color: #cbd5e1 !important;
}
[data-bs-theme="dark"] .team-sales-donut-legend-item--muted .team-sales-donut-swatch {
  background-color: #64748b !important;
}
.team-sales-donut-legend-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.25;
  min-width: 0;
}
.team-sales-donut-legend-name {
  font-weight: 600;
  font-size: 0.92rem;
}
.team-sales-donut-legend-meta {
  font-size: 0.78rem;
}
.team-sales-donut-legend-ki {
  flex: 0 0 auto;
  margin-left: 0.35rem;
  padding: 0.2rem 0.15rem 0.2rem 0.35rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
  white-space: nowrap;
  color: #9333ea;
  text-shadow:
    0 0 6px rgba(168, 85, 247, 0.85),
    0 0 14px rgba(168, 85, 247, 0.55),
    0 0 22px rgba(6, 182, 212, 0.35);
  animation: team-donut-legend-ki-text-glow 2.2s ease-in-out infinite;
}
[data-bs-theme="dark"] .team-sales-donut-legend-ki {
  color: #d8b4fe;
  text-shadow:
    0 0 8px rgba(192, 132, 252, 0.95),
    0 0 18px rgba(168, 85, 247, 0.7),
    0 0 28px rgba(6, 182, 212, 0.45);
}
.team-sales-donut-legend-item--ki {
  border-color: rgba(168, 85, 247, 0.7);
  animation-name: team-donut-legend-glow-ki;
}
[data-bs-theme="dark"] .team-sales-donut-legend-item--ki {
  border-color: rgba(192, 132, 252, 0.65);
}
.team-sales-donut-legend-item--ki.team-sales-donut-legend-item--muted {
  animation-name: team-donut-legend-glow-ki;
}
@keyframes team-donut-legend-glow {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(255, 102, 0, 0.12), 0 0 10px rgba(255, 102, 0, 0.08);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(255, 102, 0, 0.38), 0 0 16px rgba(255, 102, 0, 0.14);
  }
}
@keyframes team-donut-legend-glow-muted {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.12), 0 0 6px rgba(148, 163, 184, 0.06);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.28), 0 0 12px rgba(148, 163, 184, 0.1);
  }
}
@keyframes team-donut-legend-glow-ki {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(168, 85, 247, 0.5),
      0 0 18px rgba(168, 85, 247, 0.35),
      0 0 32px rgba(168, 85, 247, 0.22),
      0 0 44px rgba(6, 182, 212, 0.18);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(168, 85, 247, 0.9),
      0 0 28px rgba(168, 85, 247, 0.55),
      0 0 48px rgba(168, 85, 247, 0.38),
      0 0 64px rgba(6, 182, 212, 0.28);
  }
}
@keyframes team-donut-legend-ki-text-glow {
  0%,
  100% {
    text-shadow:
      0 0 6px rgba(168, 85, 247, 0.75),
      0 0 14px rgba(168, 85, 247, 0.45),
      0 0 20px rgba(6, 182, 212, 0.28);
    filter: brightness(1);
  }
  50% {
    text-shadow:
      0 0 10px rgba(168, 85, 247, 1),
      0 0 22px rgba(168, 85, 247, 0.75),
      0 0 34px rgba(6, 182, 212, 0.5);
    filter: brightness(1.15);
  }
}
@media (prefers-reduced-motion: reduce) {
  .team-sales-donut-legend-item {
    animation: none;
  }
  .team-sales-donut-legend-ki {
    animation: none;
  }
}

/* Team-Sales-Donut: Podium Top 3 (Ranking folgt Monats-Sales, ohne Text „Platz“) */
.team-sales-donut-podium {
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}
.team-sales-donut-podium-slot {
  flex: 1 1 5.5rem;
  min-width: 5rem;
  max-width: 8.5rem;
  text-align: center;
  padding: 0.45rem 0.35rem 0.5rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.35);
}
[data-bs-theme="dark"] .team-sales-donut-podium-slot {
  background: rgba(30, 32, 42, 0.55);
  border-color: rgba(100, 116, 139, 0.4);
}
.team-sales-donut-podium-icon {
  display: block;
  margin: 0 auto 0.2rem;
  font-size: 1.35rem;
  line-height: 1;
}
.team-sales-donut-podium-name {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
}
.team-sales-donut-podium-sales {
  font-size: 0.72rem;
  margin-top: 0.1rem;
}
.team-sales-donut-podium-slot--gold {
  border-color: rgba(202, 138, 4, 0.55);
  box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.2), 0 0 14px rgba(234, 179, 8, 0.18);
}
.team-sales-donut-podium-slot--gold .team-sales-donut-podium-icon {
  color: #ca8a04;
  filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.85));
  animation: team-podium-trophy-gold 2.6s ease-in-out infinite;
}
.team-sales-donut-podium-slot--silver {
  border-color: rgba(148, 163, 184, 0.65);
  box-shadow: 0 0 0 1px rgba(226, 232, 240, 0.25), 0 0 12px rgba(148, 163, 184, 0.22);
}
.team-sales-donut-podium-slot--silver .team-sales-donut-podium-icon {
  color: #94a3b8;
  filter: drop-shadow(0 0 4px rgba(226, 232, 240, 0.65));
  animation: team-podium-trophy-silver 2.8s ease-in-out infinite;
}
.team-sales-donut-podium-slot--bronze {
  border-color: rgba(180, 83, 9, 0.45);
  box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.2), 0 0 12px rgba(180, 83, 9, 0.2);
}
.team-sales-donut-podium-slot--bronze .team-sales-donut-podium-icon {
  color: #b45309;
  filter: drop-shadow(0 0 4px rgba(251, 146, 60, 0.55));
  animation: team-podium-trophy-bronze 3s ease-in-out infinite;
}
@keyframes team-podium-trophy-gold {
  0%,
  100% {
    filter: drop-shadow(0 0 4px rgba(250, 204, 21, 0.65));
  }
  50% {
    filter: drop-shadow(0 0 10px rgba(250, 204, 21, 0.95));
  }
}
@keyframes team-podium-trophy-silver {
  0%,
  100% {
    filter: drop-shadow(0 0 3px rgba(226, 232, 240, 0.45));
  }
  50% {
    filter: drop-shadow(0 0 8px rgba(241, 245, 249, 0.85));
  }
}
@keyframes team-podium-trophy-bronze {
  0%,
  100% {
    filter: drop-shadow(0 0 3px rgba(251, 146, 60, 0.45));
  }
  50% {
    filter: drop-shadow(0 0 8px rgba(234, 88, 12, 0.65));
  }
}
@media (prefers-reduced-motion: reduce) {
  .team-sales-donut-podium-slot--gold .team-sales-donut-podium-icon,
  .team-sales-donut-podium-slot--silver .team-sales-donut-podium-icon,
  .team-sales-donut-podium-slot--bronze .team-sales-donut-podium-icon {
    animation: none;
  }
}

/* Team-Verkaufs-Rückblick (team_sales_rankings.php) */
.team-sales-ranking-block summary {
  cursor: pointer;
  list-style: none;
}
.team-sales-ranking-block summary::-webkit-details-marker {
  display: none;
}
.team-sales-ranking-block summary .bi-chevron-down {
  transition: transform 0.2s ease;
}
.team-sales-ranking-block[open] summary .bi-chevron-down {
  transform: rotate(180deg);
}
.team-sales-ranking-table th {
  font-weight: 600;
  font-size: 0.8rem;
}

/* KI-Telefonassistent: Monats-Badge + Celebration (Agenten-Dashboard) */
.dashboard-ki-phone-badge {
  flex: 0 0 auto;
  min-width: 7.5rem;
  max-width: 11rem;
  border-radius: 1rem;
  padding: 2px;
  background: linear-gradient(135deg, #a855f7 0%, #06b6d4 45%, #f59e0b 100%);
  box-shadow:
    0 0 20px rgba(168, 85, 247, 0.55),
    0 0 40px rgba(6, 182, 212, 0.25);
  animation: ki-badge-glow 2.4s ease-in-out infinite;
}
.dashboard-ki-phone-badge-inner {
  background: linear-gradient(145deg, #1e1b4b 0%, #312e81 55%, #0f172a 100%);
  border-radius: calc(1rem - 2px);
  padding: 0.55rem 0.75rem;
  text-align: center;
  color: #f8fafc;
}
.dashboard-ki-phone-badge-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: #c4b5fd;
}
.dashboard-ki-phone-badge-value {
  display: block;
  font-size: 1.65rem;
  line-height: 1.1;
  font-weight: 800;
  text-shadow: 0 0 18px rgba(251, 191, 36, 0.75);
  color: #fde047;
}
.dashboard-ki-phone-badge-suffix {
  display: block;
  font-size: 0.62rem;
  color: #94a3b8;
  margin-top: 0.1rem;
}
@keyframes ki-badge-glow {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.12); transform: scale(1.02); }
}

.ki-celebrate-root {
  position: fixed;
  inset: 0;
  z-index: 1080;
  pointer-events: none;
}
.ki-celebrate-root.is-active {
  pointer-events: auto;
}
.ki-celebrate-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
  animation: ki-fade-in 0.35s ease-out forwards;
}
.ki-celebrate-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.4);
  opacity: 0;
  min-width: min(92vw, 22rem);
  padding: 2rem 1.75rem 1.5rem;
  border-radius: 1.25rem;
  text-align: center;
  color: #fff;
  animation: ki-pop-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.08s forwards;
}
.ki-celebrate-card--v0 {
  background: linear-gradient(145deg, #ea580c 0%, #dc2626 50%, #7c2d12 100%);
  box-shadow: 0 0 80px rgba(234, 88, 12, 0.65);
}
.ki-celebrate-card--v1 {
  background: linear-gradient(145deg, #2563eb 0%, #4f46e5 50%, #1e3a8a 100%);
  box-shadow: 0 0 80px rgba(59, 130, 246, 0.65);
}
.ki-celebrate-card--v2 {
  background: linear-gradient(145deg, #ca8a04 0%, #eab308 45%, #713f12 100%);
  box-shadow: 0 0 80px rgba(234, 179, 8, 0.65);
}
.ki-celebrate-icon {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 0.35rem;
  display: block;
}
.ki-celebrate-title {
  font-size: 2.35rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  margin: 0 0 0.35rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.ki-celebrate-sub {
  font-size: 1rem;
  margin: 0 0 1rem;
  opacity: 0.95;
}
.ki-celebrate-month {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-bottom: 1rem;
}
.ki-celebrate-close {
  pointer-events: auto;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 2rem;
  padding: 0.35rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
}
.ki-celebrate-close:hover {
  background: rgba(255, 255, 255, 0.28);
}
.ki-celebrate-particle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  opacity: 0;
  animation: ki-confetti-fall 2.2s ease-out forwards;
}
.ki-celebrate-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border: 3px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: ki-ring-pulse 1.1s ease-out 3;
}
@keyframes ki-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes ki-pop-in {
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes ki-confetti-fall {
  0% { opacity: 1; transform: translateY(-20vh) rotate(0deg); }
  100% { opacity: 0; transform: translateY(110vh) rotate(720deg); }
}
@keyframes ki-ring-pulse {
  0% { transform: scale(0.3); opacity: 0.9; }
  100% { transform: scale(2.8); opacity: 0; }
}
.ki-celebrate-card--v0 { animation: ki-pop-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.08s forwards, ki-shake 0.5s ease-in-out 0.5s 2; }
@keyframes ki-shake {
  0%, 100% { transform: translate(-50%, -50%) scale(1) rotate(0); }
  25% { transform: translate(-50%, -50%) scale(1.03) rotate(-2deg); }
  75% { transform: translate(-50%, -50%) scale(1.03) rotate(2deg); }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard-ki-phone-badge { animation: none; }
  .ki-celebrate-particle,
  .ki-celebrate-ring,
  .ki-celebrate-card--v0 { animation: ki-pop-in 0.3s ease forwards; }
}
