/* ==================================================================
   Agentur-Ebene: Kunden, Pakete, Aufgaben, Budget, KI, Reporting.
   Nutzt die Farb- und Typo-Variablen aus styles.css, damit die neue
   Oberfläche sich nicht wie ein zweites Produkt anfühlt.
   ================================================================== */

:root {
  --violet: #6b4fbb;
  --blue: #2b6ca8;
  --grey-tone: #8a938c;
  --lock: #9aa39c;
}

/* Gruppentitel in der Seitennavigation */
.nav-group {
  margin: 14px 0 4px;
  padding: 0 4px;
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.side-nav > .nav-group:first-child { margin-top: 0; }

/* ------------------------------------------------------------------ */
/* Grundbausteine                                                      */
/* ------------------------------------------------------------------ */

.ag-grid {
  display: grid;
  gap: 16px;
}

.ag-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.ag-grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.ag-grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.ag-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.ag-card.flush { padding: 0; overflow: hidden; }

.ag-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ag-card-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.ag-card-head p {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.ag-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
  font-weight: 600;
}

.ag-muted { color: var(--muted); font-size: 0.88rem; }
.ag-empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 22px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.ag-stack { display: flex; flex-direction: column; gap: 10px; }
.ag-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ag-row.between { justify-content: space-between; }
.ag-spacer { flex: 1 1 auto; }

/* ------------------------------------------------------------------ */
/* Kennzahlen                                                          */
/* ------------------------------------------------------------------ */

.ag-kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.ag-kpi .label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.ag-kpi .value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 4px;
  display: block;
}

.ag-kpi .sub { font-size: 0.8rem; color: var(--muted); }

/* ------------------------------------------------------------------ */
/* Badges, Pillen, Ampeln                                              */
/* ------------------------------------------------------------------ */

.ag-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.ag-badge.green  { background: rgba(31, 138, 76, 0.12);  color: #146034; border-color: rgba(31, 138, 76, 0.25); }
.ag-badge.yellow { background: rgba(196, 137, 22, 0.14); color: #8a5f08; border-color: rgba(196, 137, 22, 0.3); }
.ag-badge.red    { background: rgba(194, 59, 46, 0.12);  color: #942a20; border-color: rgba(194, 59, 46, 0.25); }
.ag-badge.blue   { background: rgba(43, 108, 168, 0.12); color: #1d4e7a; border-color: rgba(43, 108, 168, 0.25); }
.ag-badge.violet { background: rgba(107, 79, 187, 0.12); color: #4d3690; border-color: rgba(107, 79, 187, 0.25); }
.ag-badge.grey   { background: var(--paper-2); color: var(--ink-soft); border-color: var(--line); }

.ag-pkg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Die Kennungen müssen zu lib/agency/social-packages.js passen -
   sonst bleibt das Abzeichen farblos. */
.ag-pkg.sichtbarkeit { background: rgba(43, 108, 168, 0.13); color: #1d4e7a; }
.ag-pkg.vorort       { background: rgba(31, 111, 91, 0.14);  color: #175646; }
.ag-pkg.praesent     { background: rgba(107, 79, 187, 0.14); color: #4d3690; }
.ag-pkg.omnipraesent { background: rgba(196, 137, 22, 0.16); color: #8a5f08; }
.ag-pkg.none         { background: rgba(194, 59, 46, 0.1);   color: #942a20; }

/* ------------------------------------------------------------------ */
/* Fortschrittsbalken                                                  */
/* ------------------------------------------------------------------ */

.ag-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
  border: 1px solid var(--line);
}

.ag-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.ag-bar span.planned {
  background: repeating-linear-gradient(
    45deg,
    rgba(31, 111, 91, 0.35),
    rgba(31, 111, 91, 0.35) 5px,
    rgba(31, 111, 91, 0.15) 5px,
    rgba(31, 111, 91, 0.15) 10px
  );
}

.ag-bar.warn span { background: var(--yellow); }
.ag-bar.over span { background: var(--red); }

.ag-bar-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
}

/* ------------------------------------------------------------------ */
/* Kundenliste                                                         */
/* ------------------------------------------------------------------ */

.ag-customer-list { display: grid; gap: 12px; }

.ag-customer {
  display: grid;
  grid-template-columns: minmax(220px, 2.4fr) minmax(150px, 1fr) minmax(120px, 1fr) minmax(150px, auto);
  gap: 16px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.ag-customer:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.ag-customer:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ag-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
}

.ag-ring::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--panel);
}

.ag-ring strong {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.ag-customer h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
}

.ag-customer .url {
  margin: 2px 0 6px;
  font-size: 0.82rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.ag-cell .cap {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.ag-cell .val { font-size: 0.95rem; font-weight: 600; }
.ag-cell .val.up { color: var(--green); }
.ag-cell .val.down { color: var(--red); }

@media (max-width: 900px) {
  .ag-customer { grid-template-columns: 1fr; }
  .ag-customer .ag-cell { grid-column: 1; }
}

/* ------------------------------------------------------------------ */
/* Kundenkopf                                                          */
/* ------------------------------------------------------------------ */

.ag-customer-head {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.ag-customer-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}

.ag-customer-head .head-top {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.ag-head-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.ag-head-metric .cap {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.ag-head-metric .val {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Reiter                                                              */
/* ------------------------------------------------------------------ */

.ag-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.ag-tab {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  padding: 7px 15px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  min-height: 38px;
  transition: background 0.15s ease, color 0.15s ease;
}

.ag-tab:hover { color: var(--ink); background: var(--paper-2); }

.ag-tab.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.ag-tab .count {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  font-size: 0.75rem;
}

.ag-tab.is-active .count { background: rgba(255, 255, 255, 0.25); }

.ag-panel { display: none; }
.ag-panel.is-active { display: block; }

/* ------------------------------------------------------------------ */
/* Signale                                                             */
/* ------------------------------------------------------------------ */

.ag-signal {
  display: flex;
  gap: 12px;
  padding: 13px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  border-left-width: 4px;
}

.ag-signal.critical    { border-left-color: var(--red); }
.ag-signal.warning     { border-left-color: var(--yellow); }
.ag-signal.opportunity { border-left-color: var(--accent-2); }
.ag-signal.info        { border-left-color: var(--line); }

.ag-signal .dot { font-size: 1.05rem; line-height: 1.4; }
.ag-signal strong { display: block; font-size: 0.95rem; }
.ag-signal p { margin: 3px 0 0; font-size: 0.86rem; color: var(--ink-soft); }
.ag-signal .todo {
  margin-top: 7px;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Aufgaben                                                            */
/* ------------------------------------------------------------------ */

.ag-task {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px 16px;
}

.ag-task.is-locked { opacity: 0.72; background: var(--paper-2); }
.ag-task.is-done { opacity: 0.6; }
.ag-task.is-done .ag-task-title { text-decoration: line-through; }

.ag-task-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.ag-task-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  font-family: var(--font-display);
}

.ag-task-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 0.79rem;
  color: var(--muted);
}

.ag-task-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ag-task-body { margin-top: 10px; font-size: 0.88rem; color: var(--ink-soft); }

.ag-task-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.ag-stars { color: var(--yellow); letter-spacing: 1px; font-size: 0.85rem; }

/* Wirkung/Aufwand-Matrix */
.ag-matrix {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.ag-quadrant {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel);
}

.ag-quadrant.quick-win { border-color: rgba(31, 138, 76, 0.4); background: rgba(31, 138, 76, 0.05); }
.ag-quadrant.project   { border-color: rgba(43, 108, 168, 0.4); background: rgba(43, 108, 168, 0.05); }
.ag-quadrant.filler    { border-color: var(--line); }
.ag-quadrant.avoid     { border-color: rgba(194, 59, 46, 0.3); background: rgba(194, 59, 46, 0.04); }

.ag-quadrant h4 {
  margin: 0 0 2px;
  font-size: 0.9rem;
  font-family: var(--font-display);
}

.ag-quadrant .hint { font-size: 0.78rem; color: var(--muted); margin: 0 0 10px; }
.ag-quadrant ul { margin: 0; padding-left: 18px; font-size: 0.85rem; }
.ag-quadrant li { margin-bottom: 4px; }

@media (max-width: 760px) {
  .ag-matrix { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ */
/* Sperre und Upgrade                                                  */
/* ------------------------------------------------------------------ */

.ag-locked {
  border: 1px dashed var(--lock);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--paper-2);
  text-align: center;
}

.ag-locked .icon { font-size: 1.6rem; }

.ag-locked h4 {
  margin: 8px 0 4px;
  font-family: var(--font-display);
  font-size: 1rem;
}

.ag-locked p { margin: 0 0 12px; font-size: 0.88rem; color: var(--ink-soft); }

.ag-feature {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.ag-feature.locked { background: var(--paper-2); color: var(--muted); }
.ag-feature .mark { font-size: 0.95rem; line-height: 1.5; }
.ag-feature strong { font-size: 0.9rem; display: block; }
.ag-feature small { font-size: 0.8rem; color: var(--muted); display: block; margin-top: 2px; }

/* ------------------------------------------------------------------ */
/* Monatsplan                                                          */
/* ------------------------------------------------------------------ */

.ag-weeks { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }

.ag-week {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px;
}

.ag-week header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.ag-week h4 { margin: 0; font-family: var(--font-display); font-size: 0.95rem; }
.ag-week .range { font-size: 0.76rem; color: var(--muted); }
.ag-week ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.ag-week li {
  display: flex;
  gap: 8px;
  font-size: 0.86rem;
  align-items: flex-start;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--paper-2);
}

.ag-week li:last-child { border-bottom: 0; padding-bottom: 0; }
.ag-week li .mark { flex: 0 0 auto; }
.ag-week li.done { color: var(--muted); }
.ag-week li .min { margin-left: auto; font-size: 0.76rem; color: var(--muted); white-space: nowrap; }

/* ------------------------------------------------------------------ */
/* Score-Aufschlüsselung                                               */
/* ------------------------------------------------------------------ */

.ag-dim {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.ag-dim > summary {
  list-style: none;
  cursor: pointer;
  padding: 13px 15px;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 90px 52px;
  gap: 12px;
  align-items: center;
}

.ag-dim > summary::-webkit-details-marker { display: none; }
.ag-dim > summary:hover { background: var(--paper-2); }
.ag-dim[open] > summary { border-bottom: 1px solid var(--line); }
.ag-dim .dim-name { font-weight: 600; font-size: 0.92rem; display: flex; align-items: center; gap: 4px; }
.ag-dim .dim-score { font-family: var(--font-display); font-weight: 700; text-align: right; }
.ag-dim .dim-body { padding: 14px 15px; font-size: 0.87rem; }
.ag-dim .dim-body h5 { margin: 12px 0 5px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.ag-dim .dim-body h5:first-child { margin-top: 0; }
.ag-dim .dim-body ul { margin: 0; padding-left: 18px; }
.ag-dim .dim-body li { margin-bottom: 4px; }
.ag-dim.unavailable { opacity: 0.8; }

/* ------------------------------------------------------------------ */
/* KI                                                                  */
/* ------------------------------------------------------------------ */

.ag-agents { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }

.ag-agent {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.ag-agent:hover:not(:disabled) { border-color: var(--violet); transform: translateY(-1px); }
.ag-agent:disabled { cursor: not-allowed; background: var(--paper-2); color: var(--muted); }
.ag-agent .icon { font-size: 1.3rem; }
.ag-agent strong { display: block; margin-top: 6px; font-size: 0.92rem; font-family: var(--font-display); }
.ag-agent small { display: block; margin-top: 3px; font-size: 0.79rem; color: var(--muted); }

.ag-ai-result {
  border: 1px solid rgba(107, 79, 187, 0.35);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: rgba(107, 79, 187, 0.04);
  padding: 18px;
}

.ag-ai-result h4 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.ag-ai-block { margin-top: 14px; }
.ag-ai-block > .cap {
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.ag-ai-block p { margin: 0; font-size: 0.9rem; }
.ag-ai-block ul { margin: 0; padding-left: 18px; font-size: 0.88rem; }

.ag-rec {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 13px 15px;
  margin-bottom: 10px;
}

.ag-rec.locked { background: var(--paper-2); border-style: dashed; }
.ag-rec h5 { margin: 0 0 5px; font-size: 0.93rem; font-family: var(--font-display); }
.ag-rec .why { font-size: 0.86rem; color: var(--ink-soft); margin: 0 0 6px; }
.ag-rec .how { font-size: 0.85rem; color: var(--muted); margin: 0; white-space: pre-wrap; }

.ag-provenance {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ------------------------------------------------------------------ */
/* Quelltext: Upload und Änderungen                                    */
/* ------------------------------------------------------------------ */

.ag-upload {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  background: var(--paper-2);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.ag-upload.is-over {
  border-color: var(--accent);
  background: rgba(31, 111, 91, 0.06);
}

.ag-upload .icon { font-size: 1.9rem; }

.ag-upload h4 {
  margin: 8px 0 4px;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.ag-upload p { margin: 0 0 14px; font-size: 0.88rem; color: var(--ink-soft); }

.ag-steps {
  margin: 20px 0 0;
  padding-left: 20px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.ag-steps li { margin-bottom: 6px; }

.ag-task.is-changed { border-left: 3px solid var(--green); }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--paper-2);
  border-radius: 4px;
  padding: 1px 5px;
}

/* Vorher/Nachher einer einzelnen Meta-Änderung */
.ag-diff-old,
.ag-diff-new {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  padding: 4px 8px;
  border-radius: 5px;
  margin-top: 4px;
  word-break: break-word;
}

.ag-diff-old {
  background: rgba(194, 59, 46, 0.09);
  color: #942a20;
  text-decoration: line-through;
  text-decoration-color: rgba(148, 42, 32, 0.4);
}

.ag-diff-new {
  background: rgba(31, 138, 76, 0.1);
  color: #146034;
  font-weight: 600;
}

.ag-change {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex: 0 0 auto;
  margin-top: 4px;
}

/* ------------------------------------------------------------------ */
/* Historie                                                            */
/* ------------------------------------------------------------------ */

.ag-timeline-day { margin-bottom: 20px; }

.ag-timeline-day > .date {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.ag-event {
  display: flex;
  gap: 12px;
  padding: 10px 0 10px 4px;
  border-left: 2px solid var(--line);
  padding-left: 16px;
  position: relative;
}

.ag-event::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}

.ag-event.green::before  { background: var(--green); }
.ag-event.blue::before   { background: var(--blue); }
.ag-event.violet::before { background: var(--violet); }

.ag-event .icon { font-size: 1rem; }
.ag-event strong { display: block; font-size: 0.92rem; }
.ag-event p { margin: 2px 0 0; font-size: 0.84rem; color: var(--muted); }
.ag-event time { font-size: 0.76rem; color: var(--muted); white-space: nowrap; }

/* ------------------------------------------------------------------ */
/* Formulare                                                           */
/* ------------------------------------------------------------------ */

.ag-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ag-form .full { grid-column: 1 / -1; }

.ag-form label { display: flex; flex-direction: column; gap: 5px; font-size: 0.85rem; }

.ag-form label > span:first-child {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ag-form input,
.ag-form select,
.ag-form textarea {
  font: inherit;
  font-size: 0.92rem;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  min-height: 44px;
  width: 100%;
}

.ag-form textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.ag-form input:focus, .ag-form select:focus, .ag-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.ag-package-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }

.ag-package-option {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  background: var(--panel);
  display: block;
  transition: border-color 0.16s ease;
}

.ag-package-option:hover { border-color: var(--accent-2); }
.ag-package-option.is-selected { border-color: var(--accent); background: rgba(31, 111, 91, 0.05); }
.ag-package-option input { position: absolute; opacity: 0; pointer-events: none; }
.ag-package-option .name { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.ag-package-option .price { font-size: 1.25rem; font-weight: 700; margin-top: 4px; }
.ag-package-option .hours { font-size: 0.82rem; color: var(--muted); }
.ag-package-option .tagline { font-size: 0.82rem; color: var(--ink-soft); margin-top: 8px; }

/* ------------------------------------------------------------------ */
/* Glossar-Erklärung im Tooltip                                        */
/* ------------------------------------------------------------------ */

.ag-glossary-box { text-align: left; }
.ag-glossary-box .term { font-weight: 700; display: block; margin-bottom: 6px; }

.ag-glossary-box dt {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.72;
  margin-top: 8px;
  font-weight: 700;
}

.ag-glossary-box dd { margin: 2px 0 0; font-size: 0.85rem; }
.ag-glossary-box dl { margin: 0; }

/* ------------------------------------------------------------------ */
/* Tabellen (Admin)                                                    */
/* ------------------------------------------------------------------ */

.ag-table-wrap { overflow-x: auto; }

.ag-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; min-width: 560px; }
.ag-table th, .ag-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }

.ag-table th {
  font-size: 0.73rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.ag-table td.center, .ag-table th.center { text-align: center; }
.ag-table tbody tr:last-child td { border-bottom: 0; }
.ag-table .yes { color: var(--green); font-weight: 700; }
.ag-table .no { color: var(--lock); }

/* ------------------------------------------------------------------ */
/* Bericht                                                             */
/* ------------------------------------------------------------------ */

.ag-report h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 22px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.ag-report h3:first-child { margin-top: 0; }

.ag-delta.up { color: var(--green); font-weight: 700; }
.ag-delta.down { color: var(--red); font-weight: 700; }
.ag-delta.flat { color: var(--muted); }

.ag-gap {
  background: rgba(196, 137, 22, 0.09);
  border: 1px solid rgba(196, 137, 22, 0.28);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 0.86rem;
}

/* ------------------------------------------------------------------ */
/* Ladezustand                                                         */
/* ------------------------------------------------------------------ */

.ag-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 20px;
}

.ag-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ag-spin 0.7s linear infinite;
}

@keyframes ag-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .ag-spinner { animation-duration: 2s; }
  .ag-customer, .ag-agent, .ag-bar span { transition: none; }
}

/* Druck: Bericht ohne Bedienelemente */
@media print {
  .ag-tabs, .ag-task-actions, .detail-toolbar, .sidebar, .topbar { display: none !important; }
  .ag-card, .ag-customer-head { box-shadow: none; border-color: #ccc; }
}

/* ------------------------------------------------------------------ */
/* Social Media: Redaktionskalender                                    */
/* ------------------------------------------------------------------ */

.ag-calendar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

.ag-cal-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.ag-cal-head > div {
  padding: 8px 6px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ag-cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.ag-cal-cell {
  min-height: 92px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  transition: background 0.14s ease;
}

.ag-cal-cell:nth-child(7n) { border-right: 0; }
.ag-cal-cell:hover:not(.is-empty) { background: rgba(31, 111, 91, 0.05); }
.ag-cal-cell.is-empty { background: var(--paper-2); cursor: default; }
.ag-cal-cell.is-weekend { background: rgba(0, 0, 0, 0.015); }
.ag-cal-cell.is-past .day { opacity: 0.45; }

.ag-cal-cell.is-today {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.ag-cal-cell .day {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
}

.ag-cal-cell.is-today .day { color: var(--accent); }

/* Ein Beitrag im Kalender */
.ag-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 5px;
  background: var(--panel);
  padding: 3px 5px;
  font: inherit;
  font-size: 0.72rem;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.ag-chip .txt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-chip:hover { border-color: var(--accent); }

.ag-chip.status-idee            { border-left-color: var(--grey-tone); opacity: 0.75; }
.ag-chip.status-geplant         { border-left-color: var(--blue); }
.ag-chip.status-produktion      { border-left-color: var(--yellow); }
.ag-chip.status-freigabe        { border-left-color: var(--violet); }
.ag-chip.status-freigegeben     { border-left-color: var(--green); }
.ag-chip.status-veroeffentlicht { border-left-color: var(--green); background: rgba(31, 138, 76, 0.09); }
.ag-chip.status-verworfen       { border-left-color: var(--line); opacity: 0.5; text-decoration: line-through; }

@media (max-width: 760px) {
  /* Auf dem Smartphone wird aus dem Raster eine Liste. */
  .ag-cal-head { display: none; }
  .ag-cal-week { grid-template-columns: 1fr; }
  .ag-cal-cell { min-height: 0; border-right: 0; }
  .ag-cal-cell.is-empty { display: none; }
  .ag-cal-cell .day::after {
    content: '.';
    margin-right: 4px;
  }
}

/* ------------------------------------------------------------------ */
/* Modal                                                               */
/* ------------------------------------------------------------------ */

.ag-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 31, 28, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 200;
}

.ag-modal {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 70px rgba(26, 31, 28, 0.25);
  padding: 22px;
  width: 100%;
  max-width: 680px;
}

.ag-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.ag-modal-close:hover { background: var(--paper-2); color: var(--ink); }

.ag-inline-select {
  font: inherit;
  font-size: 0.9rem;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  min-height: 44px;
}

@media (prefers-reduced-motion: reduce) {
  .ag-cal-cell { transition: none; }
}

/* ------------------------------------------------------------------ */
/* SEO-Dokumente                                                       */
/* ------------------------------------------------------------------ */

.ag-seo-h {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink);
}

/* Kästchen mit Beschriftung daneben – auch als Touch-Fläche gross genug. */
.ag-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--ink-soft);
  min-height: 44px;
  cursor: pointer;
}

.ag-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.ag-seo-numbers input {
  font: inherit;
  font-size: 0.9rem;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  min-height: 44px;
  width: 100%;
  max-width: 130px;
  text-align: right;
}

.ag-seo-numbers input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.ag-seo-keywords {
  display: grid;
  gap: 8px;
  /* Die Spalten müssen auf schmalen Geräten scrollen dürfen, statt zu quetschen. */
  overflow-x: auto;
}

.ag-seo-kwrow {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) 84px 100px 84px 56px 48px;
  gap: 8px;
  align-items: center;
  min-width: 600px;
}

.ag-seo-kwrow.head {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}

.ag-seo-kwrow.head span:not(:first-child) { text-align: center; }

.ag-seo-kwrow input {
  font: inherit;
  font-size: 0.9rem;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  min-height: 44px;
  width: 100%;
}

.ag-seo-kwrow input:not([data-k='term']) { text-align: right; }

.ag-seo-kwrow input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.ag-seo-kwrow .trend {
  text-align: center;
  font-size: 1.05rem;
  color: var(--muted);
}

.ag-seo-kwrow .trend.up { color: var(--green); }
.ag-seo-kwrow .trend.down { color: var(--red); }
.ag-seo-kwrow .trend.flat { color: var(--ink-soft); }

/* Der fertige Text ist der Kern dieser Ansicht – er bekommt Ruhe und Platz. */
.ag-seo-result textarea {
  font-family: var(--font-mono, ui-monospace, 'SFMono-Regular', Menlo, monospace);
  font-size: 0.86rem;
  line-height: 1.6;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}

.ag-seo-hint {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--yellow);
  background: rgba(196, 137, 22, 0.08);
  border-radius: 0 8px 8px 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.ag-seo-send {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.ag-seo-doc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
  flex-wrap: wrap;
}

.ag-seo-doc strong { font-size: 0.92rem; }
.ag-seo-doc p { margin: 3px 0 0; font-size: 0.82rem; }

@media (max-width: 620px) {
  .ag-seo-doc { align-items: flex-start; flex-direction: column; }
}

/* Gedruckt wird der Text, nicht die Bedienung. */
@media print {
  .ag-seo-send,
  .ag-seo-result .ag-row { display: none; }
}

/* ------------------------------------------------------------------ */
/* Heute: Tagesplan                                                    */
/* ------------------------------------------------------------------ */

.ag-today-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.ag-today-phase {
  margin: 8px 0 0;
  font-size: 0.84rem;
}

.ag-today-tasks {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.ag-today-task {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--paper-2);
}

.ag-today-task-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

/* Die Nummer macht auf einen Blick klar: höchstens drei Aufgaben am Tag. */
.ag-today-num {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ag-today-task-head strong { font-size: 0.98rem; }
.ag-today-task-head p { margin: 3px 0 0; font-size: 0.84rem; }

.ag-today-prompt {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 12px 14px;
}

.ag-today-prompt .cap {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}

.ag-today-prompt pre {
  margin: 0;
  font-family: var(--font-mono, ui-monospace, 'SFMono-Regular', Menlo, monospace);
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  max-height: 300px;
  overflow-y: auto;
}

.ag-today-inapp {
  margin: 12px 0 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
  padding: 10px 12px;
  border-left: 3px solid var(--blue);
  background: rgba(43, 108, 168, 0.06);
  border-radius: 0 8px 8px 0;
}

.ag-today-foot { margin-top: 12px; gap: 10px; }
.ag-today-team { margin: 0; font-size: 0.83rem; color: var(--ink-soft); flex: 1 1 260px; }

.ag-today-next {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.ag-today-done {
  margin: 14px 0 0;
  font-size: 0.83rem;
  color: var(--green);
}

.ag-today-quiet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
}

.ag-today-quiet p { margin: 3px 0 0; font-size: 0.82rem; }
.ag-today-quiet .ag-today-settings.full { flex: 1 1 100%; }

.ag-today-settings {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--panel);
}

@media (max-width: 620px) {
  .ag-today-foot { flex-direction: column; align-items: stretch; }
  .ag-today-foot .btn { width: 100%; }
}

/* Gedruckt wird der Plan, nicht die Bedienung. */
@media print {
  .ag-today-foot .btn,
  .ag-today-prompt .btn { display: none; }
}

/* ------------------------------------------------------------------ */
/* SEO: Unternehmensliste                                              */
/* ------------------------------------------------------------------ */

/* Wie eine Kundenzeile, aber ohne Kontingent-Ring: hier zählt der Zustand. */
.ag-seo-row {
  grid-template-columns: minmax(200px, 2fr) 1.2fr 0.8fr 1fr;
}

.ag-seo-row-main h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.ag-seo-row-main .url {
  margin: 3px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

@media (max-width: 820px) {
  .ag-seo-row { grid-template-columns: 1fr 1fr; }
}

/* Hilfe direkt am Keyword-Feld: die Begriffe kennt man beim Anlegen noch nicht. */
.ag-keyword-help {
  margin-top: -4px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--paper-2);
}

.ag-keyword-help p {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* Welche Aufgabe in welches Claude gehört – die Legende dazu. */
.ag-tool-legend {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
  font-size: 0.83rem;
  line-height: 1.9;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------ */
/* wowobot: eigener Social-Media-Plan                                  */
/* ------------------------------------------------------------------ */

/* Die Säulenfarbe steht als Balken links – so ist die Art des Postings
   auf einen Blick erkennbar, ohne dass Farbe die einzige Information ist. */
.wsoc-today {
  border-left: 5px solid var(--saeule, var(--line));
}

.wsoc-title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.wsoc-replaces {
  margin: 6px 0 0;
  font-size: 0.84rem;
  color: var(--violet);
  font-weight: 600;
}

.wsoc-meta { margin-top: 14px; }

.wsoc-chips { display: flex; gap: 6px; flex-wrap: wrap; }

.wsoc-chip {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 0.76rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.wsoc-brief {
  margin: 14px 0 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.wsoc-theme-line { margin: 10px 0 0; font-size: 0.84rem; }

.wsoc-theme {
  margin: 0 0 12px;
  padding: 9px 13px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-size: 0.83rem;
  color: var(--ink-soft);
}

.wsoc-fields {
  margin-top: 18px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.wsoc-field {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--paper-2);
}

.wsoc-field .cap {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}

.wsoc-field p { margin: 6px 0 0; font-size: 0.88rem; line-height: 1.55; }

.wsoc-status-row { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }

.wsoc-empty {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  font-size: 0.87rem;
  color: var(--muted);
}

/* Sieben Spalten nebeneinander, auf schmalen Geräten untereinander. */
.wsoc-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.wsoc-day {
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--saeule, var(--line));
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  font: inherit;
  color: inherit;
  min-height: 44px;
}

.wsoc-day:hover { border-color: var(--accent-2); }
.wsoc-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wsoc-day.is-today { background: rgba(31, 111, 91, 0.06); box-shadow: inset 0 0 0 1px var(--accent); }

.wsoc-day-head { display: flex; justify-content: space-between; align-items: baseline; }
.wsoc-day-head strong { font-family: var(--font-display); font-size: 0.9rem; }
.wsoc-date { font-size: 0.75rem; color: var(--muted); }

.wsoc-day-title { font-size: 0.85rem; font-weight: 600; line-height: 1.35; }

.wsoc-monthly {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--violet);
  font-weight: 700;
}

.wsoc-idea { font-size: 0.79rem; color: var(--ink-soft); line-height: 1.45; }
.wsoc-idea em { color: var(--muted); }

.wsoc-sonntag { box-shadow: 0 0 0 3px rgba(31, 111, 91, 0.2); }

.wsoc-rules { margin-top: 22px; }
.wsoc-rules ol { margin: 0; padding-left: 20px; font-size: 0.86rem; line-height: 1.7; color: var(--ink-soft); }

@media (max-width: 1100px) {
  .wsoc-week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .wsoc-week { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .wsoc-day { transition: none; }
}

/* Liegengebliebenes: sichtbar, aber nicht dominant – der Rhythmus zählt. */
.ag-overdue {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--yellow);
  border-radius: 12px;
  background: rgba(196, 137, 22, 0.06);
  padding: 10px 14px;
}

.ag-overdue > summary {
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: 0.9rem;
  min-height: 24px;
}

.ag-overdue > summary::-webkit-details-marker { display: none; }
.ag-overdue > summary::before { content: '▸'; color: var(--muted); }
.ag-overdue[open] > summary::before { content: '▾'; }

.ag-overdue ul { margin: 10px 0 0; padding-left: 18px; font-size: 0.86rem; line-height: 1.7; }
.ag-overdue .tag { color: var(--muted); font-variant-numeric: tabular-nums; }
.ag-overdue p { margin: 10px 0 0; font-size: 0.82rem; }

/* ------------------------------------------------------------------ */
/* Admin: Start und Dokumente                                          */
/* ------------------------------------------------------------------ */

/* Was heute ansteht, steht ganz oben und ist anklickbar. */
.ag-admin-heute {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--panel);
  cursor: pointer;
}

.ag-admin-heute:hover { border-color: var(--accent-2); }
.ag-admin-heute:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ag-admin-heute strong { font-family: var(--font-display); font-size: 1rem; }
.ag-admin-heute p { margin: 3px 0 0; font-size: 0.83rem; }

.ag-admin-heute ul {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 0.87rem;
  line-height: 1.7;
}

.ag-admin-table { min-width: 900px; }
.ag-admin-row { cursor: pointer; }
.ag-admin-row:hover td { background: var(--paper-2); }

.ag-open-points {
  margin: 0;
  padding-left: 16px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* Bereiche beim Anlegen wählen – wie die Paketauswahl, nur mit Haken. */
.ag-track-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.ag-track-picker .ag-package-option { cursor: pointer; }

/* Kleine Knöpfe, um ein Unternehmen einem Bereich zuzuordnen. */
.ag-track-toggle {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.ag-track-toggle:empty { display: none; }

/* Erklärt, warum an mehreren Tagen dasselbe steht. */
.ag-phase-hinweis {
  margin: 14px 0 0;
  padding: 10px 13px;
  border-left: 3px solid var(--blue);
  background: rgba(43, 108, 168, 0.06);
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* Stand im Einstieg – macht sichtbar, dass ein Abhaken gewirkt hat. */
.ag-fortschritt {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
  font-size: 0.86rem;
}

.ag-fortschritt .ag-bar { margin: 10px 0 0; }
.ag-fortschritt p { margin: 8px 0 0; font-size: 0.82rem; }

/* Standarddokumente: zugeklappt, damit sie das Archiv nicht erschlagen. */
.ag-vorlage {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--paper-2);
}

.ag-vorlage > summary {
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  min-height: 24px;
}

.ag-vorlage > summary::-webkit-details-marker { display: none; }
.ag-vorlage > summary::before { content: '▸'; color: var(--muted); }
.ag-vorlage[open] > summary::before { content: '▾'; }
.ag-vorlage > summary strong { font-size: 0.95rem; }
.ag-vorlage > p { margin: 10px 0 0; font-size: 0.84rem; line-height: 1.6; }
.ag-vorlage .ag-today-prompt { margin-top: 12px; }

/* Versand direkt aus der Vorlage. */
.ag-vorlage-versand {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------------ */
/* Wochenplan der Beratung                                             */
/* ------------------------------------------------------------------ */

/* Die Lagebeschreibung: der Absatz, der den Kunden in einem Blick erklärt. */
.ag-plan-lage {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent, #2f6f4f);
  background: var(--paper-2, #f6f5f2);
  border-radius: 0 6px 6px 0;
  line-height: 1.55;
}

/* Die genaue Anleitung. Vorformatiert, weil dort Überschriften und
   Textbausteine stehen, deren Zeilenumbrüche zählen. */
.ag-plan-how {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: var(--paper-2, #f6f5f2);
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  font: 400 0.86rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  max-height: 22rem;
  overflow-y: auto;
}

.ag-plan-how::-webkit-scrollbar { width: 8px; }
.ag-plan-how::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .18); border-radius: 4px; }

@media print {
  .ag-plan-how { max-height: none; overflow: visible; }
}

/* ------------------------------------------------------------------ */
/* Wachstum                                                            */
/* ------------------------------------------------------------------ */

.ag-growth {
  /* Diagrammfarben: eine Hue (Akzentgrün), für Platz 1–3 / 4–10 geprüft
     als ordinale Stufen gegen --panel (helle Stufe 2,3:1). */
  --gr-series: var(--accent);
  --gr-light: #78b3a0;
  --gr-work: #8b948e;
  --gr-milestone: #1f3f6f;
}

.ag-growth-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 6px 0 22px;
}

.ag-growth-tile {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.ag-growth-tile .cap {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.ag-growth-tile .val {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--ink);
  margin: 2px 0;
}

.ag-growth-tile .val small {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
}

.ag-growth-tile .sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.ag-growth-charts {
  position: relative;
  display: grid;
  gap: 10px;
}

.ag-growth-chart {
  margin: 0;
}

.ag-growth-chart figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  font-size: 0.88rem;
  color: var(--ink);
  margin-bottom: 2px;
}

.ag-growth-chart .legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.ag-growth-chart .legend.muted { color: var(--muted); }

.ag-growth-chart .sw {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.ag-growth-chart .sw.top3 { background: var(--gr-series); }
.ag-growth-chart .sw.top10 { background: var(--gr-light); }
.ag-growth-chart .sw.milestone { background: var(--gr-milestone); transform: rotate(45deg) scale(0.8); border-radius: 1px; }

.ag-growth-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.ag-growth-chart .grid { stroke: var(--line); stroke-width: 1; opacity: 0.7; }
.ag-growth-chart .grid.base { stroke: var(--muted); opacity: 0.5; }
.ag-growth-chart .ytick { font-size: 11px; fill: var(--muted); text-anchor: end; font-variant-numeric: tabular-nums; }
.ag-growth-chart .xtick { font-size: 11px; fill: var(--muted); text-anchor: middle; }
.ag-growth-chart .xtick.year { font-weight: 600; fill: var(--ink-soft); }
.ag-growth-chart .before { fill: var(--paper); opacity: 0.8; }
.ag-growth-chart .start { stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 3 3; }
.ag-growth-chart .start-label { font-size: 11px; fill: var(--ink-soft); font-weight: 600; }
.ag-growth-chart .hl { fill: var(--ink); opacity: 0.05; pointer-events: none; }
.ag-growth-chart .hit { fill: transparent; cursor: crosshair; }

.ag-growth-chart .line { fill: none; stroke: var(--gr-series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ag-growth-chart .line.partial { stroke-dasharray: 4 4; }
.ag-growth-chart .area { fill: var(--gr-series); opacity: 0.1; }
.ag-growth-chart .dot { fill: var(--gr-series); stroke: var(--panel); stroke-width: 2; }
.ag-growth-chart .dot.open { fill: var(--panel); stroke: var(--gr-series); }
.ag-growth-chart .value { font-size: 12px; font-weight: 700; fill: var(--ink); text-anchor: middle; }
.ag-growth-chart .note { font-size: 11px; fill: var(--muted); text-anchor: middle; }
.ag-growth-chart .milestone { fill: var(--gr-milestone); stroke: var(--panel); stroke-width: 2; }

.ag-growth-chart .seg.top3 { fill: var(--gr-series); }
.ag-growth-chart .seg.top10 { fill: var(--gr-light); }
.ag-growth-chart .seg.work { fill: var(--gr-work); }
.ag-growth-chart .seg.partial { opacity: 0.55; }

.ag-growth-tip {
  position: absolute;
  z-index: 5;
  min-width: 210px;
  max-width: 300px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  color: var(--ink-soft);
  pointer-events: none;
}

.ag-growth-tip .title { font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.ag-growth-tip .row { display: flex; justify-content: space-between; gap: 14px; }
.ag-growth-tip .row strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.ag-growth-tip .ms { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--ink-soft); }

.ag-growth-table { margin-top: 18px; }
.ag-growth-table summary { cursor: pointer; font-size: 0.86rem; color: var(--accent); font-weight: 600; margin-bottom: 10px; }

/* Auf schmalen Bildschirmen würde die Beschriftung mitschrumpfen - dann
   lieber seitlich wischen. */
.ag-growth-charts,
.ag-growth-chart,
.ag-growth-chart .scroll { min-width: 0; max-width: 100%; }
.ag-growth-chart .scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) {
  .ag-growth-chart svg { min-width: 600px; }
}


/* ------------------------------------------------------------------ */
/* Kunden-Websites                                                     */
/* ------------------------------------------------------------------ */

.kw-tabelle { min-width: 980px; }
.kw-tabelle th.num, .kw-tabelle td.num, .ag-table th.num, .ag-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kw-zeile { cursor: pointer; transition: background 0.15s; }
.kw-zeile:hover, .kw-zeile:focus-visible { background: var(--paper-2); outline: none; }
.kw-diff { font-size: 0.72rem; font-weight: 700; margin-left: 4px; }
.kw-diff.plus { color: #146034; }
.kw-diff.minus { color: #942a20; }
.kw-diff.null { color: var(--muted); }
.kw-spark-zelle { color: #2b6ca8; }
.kw-spark { display: block; }
.kw-hinweis { padding: 10px 14px; border-radius: 10px; background: rgba(43, 108, 168, 0.08); border: 1px solid rgba(43, 108, 168, 0.22);
              color: #1d4e7a; font-size: 0.86rem; margin-bottom: 14px; }
.kw-chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; height: 170px; align-items: end; }
.kw-chart-spalte { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.kw-chart-spalte span { font-size: 0.7rem; color: var(--muted); white-space: nowrap; }
.kw-chart-balken { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.kw-chart-balken i { display: block; width: 42%; max-width: 22px; min-height: 2px; border-radius: 4px 4px 1px 1px; }
.kw-chart-balken i.t10, .kw-legende i.t10 { background: #2b6ca8; }
.kw-chart-balken i.gsc, .kw-legende i.gsc { background: #1f8a4c; }
.kw-legende { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 0.78rem; color: var(--muted); }
.kw-legende span { display: inline-flex; align-items: center; gap: 6px; }
.kw-legende i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
