/* ==========================================================================
   Mail_API — Oberfläche

   Farben, Abstände und Bauteile stammen unverändert aus DropCore
   (static/css/dg-core.css). Bewusst keine eigene Palette: die beiden
   Oberflächen gehören zusammen und sollen nicht nach zwei Häusern aussehen.

   Übernommen ist nur, was Login und Übersicht brauchen — die Tabellen-,
   Produkt- und Nexus-Blöcke des Core fehlen hier. Ändert sich drüben die
   Palette, gehört sie hier nachgezogen.
   ========================================================================== */


@font-face {
  font-family: 'DropGrinderDisplay';
  src: url('/static/img/logo/DropGrinder_font.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --dg-bg: #050505;
  --dg-fg: #ffffff;
  --dg-fg-soft: rgba(255, 255, 255, 0.55);
  --dg-fg-dim: rgba(255, 255, 255, 0.3);
  --dg-card-bg: rgba(255, 255, 255, 0.05);
  --dg-card-bd: rgba(255, 255, 255, 0.08);
  --dg-card-icon: rgba(255, 255, 255, 0.08);
  --dg-btn-bg: #ffffff;
  --dg-btn-fg: #050505;
  --dg-btn-hover: #e0e0e0;
  --dg-accent: #f0a500;
  --dg-accent-dim: rgba(240, 165, 0, 0.15);
  --dg-accent-bd: rgba(240, 165, 0, 0.35);
  --dg-danger: rgba(220, 38, 38, 0.85);
  --dg-danger-bd: rgba(220, 38, 38, 0.35);
  --dg-success: #16a34a;
  --dg-warn: #d97706;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; scroll-behavior: smooth; }

body {
  min-height: 100%;
  background: var(--dg-bg);
  color: var(--dg-fg);
  font-family: 'Space Grotesk', sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

@keyframes dg-fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes dg-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.dg-fade-in { animation: dg-fade-up 0.45s ease both; }

/* ── Kopfzeile ─────────────────────────────────────────────────────────── */

.dg-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--dg-card-bd);
  animation: dg-fade 0.4s ease both;
}

.dg-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.dg-brand img { height: 30px; width: auto; display: block; }

.dg-brand-name {
  font-family: 'DropGrinderDisplay', 'Archivo', sans-serif;
  font-size: 1.28rem;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.dg-brand-sub {
  font-family: 'Archivo', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dg-fg-dim);
  display: block;
  margin-top: 2px;
}

.dg-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dg-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  background: var(--dg-card-bg);
  border: 1px solid var(--dg-card-bd);
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--dg-fg-soft);
}

.dg-user-chip i { color: var(--dg-fg-dim); }

/* ── Zahnrad ───────────────────────────────────────────────────────────── */

@keyframes dg-gear-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.dg-gear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--dg-card-bg);
  border: 1px solid var(--dg-card-bd);
  border-radius: 12px;
  color: var(--dg-fg-soft);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.dg-gear i {
  font-size: 1.05rem;
  animation: dg-gear-spin 9s linear infinite;
  will-change: transform;
}

.dg-gear:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--dg-fg);
}

.dg-gear:hover i { animation-duration: 2.2s; }

.dg-gear.is-active {
  border-color: var(--dg-accent-bd);
  color: var(--dg-accent);
}

@media (prefers-reduced-motion: reduce) {
  .dg-gear i { animation: none; }
  .dg-fade-in, .dg-panel, .dg-topbar { animation: none; }
}

/* ── Layout ────────────────────────────────────────────────────────────── */

.dg-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 34px 20px 80px;
}

/* Die Produktübersicht ist eine Datentabelle mit zehn Spalten. In 1080 px
   passt sie nicht: sie lief nach rechts aus dem Container heraus, und die
   Seite wirkte dadurch nach links verrutscht, obwohl der Container mittig
   stand. Mehr Breite für diese eine Seite — weiterhin zentriert, und auf
   schmalen Fenstern greift dieselbe Begrenzung wie zuvor. */
.dg-wrap-wide {
  max-width: 1800px;
}

.dg-page-head {
  margin-bottom: 26px;
  animation: dg-fade-up 0.45s 0.06s ease both;
}

.dg-page-title {
  font-family: 'Archivo', sans-serif;
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.dg-page-sub {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--dg-fg-soft);
}

.dg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.dg-stack { display: grid; gap: 16px; }

/* ── Panels ────────────────────────────────────────────────────────────── */

.dg-panel {
  background: var(--dg-card-bg);
  border: 1px solid var(--dg-card-bd);
  border-radius: 18px;
  padding: 26px 28px;
  color: var(--dg-fg);
  animation: dg-fade-up 0.45s 0.22s ease both;
}

.dg-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.dg-panel-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Archivo', sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.dg-panel-title i { color: var(--dg-fg-dim); font-size: 0.95rem; }

/* Der Inhalt unterhalb des Kopfes. Stand an drei Stellen in der Vorlage,
   ohne dass es die Regel gab -- die Abstaende kamen zufaellig von den
   Kindern. Reicht ein Container, der seine Kinder untereinander stellt. */
.dg-panel-body { display: grid; gap: 10px; }

.dg-panel-hint {
  font-size: 0.82rem;
  color: var(--dg-fg-soft);
  line-height: 1.55;
}

.dg-panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--dg-card-icon);
  border: 1px solid var(--dg-card-bd);
  border-radius: 12px;
  color: var(--dg-fg-soft);
}

/* ── Kennzahlen ────────────────────────────────────────────────────────── */

.dg-stat-value {
  font-family: 'Archivo', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
}

.dg-stat-label {
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dg-fg-dim);
}

/* ── Buttons ───────────────────────────────────────────────────────────── */

.dg-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: none;
  border-radius: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.dg-btn-primary { background: var(--dg-btn-bg); color: var(--dg-btn-fg); }
.dg-btn-primary:hover { background: var(--dg-btn-hover); }

.dg-btn-secondary {
  background: var(--dg-card-icon);
  border: 1px solid var(--dg-card-bd);
  color: var(--dg-fg-soft);
}
.dg-btn-secondary:hover { background: rgba(255, 255, 255, 0.12); color: var(--dg-fg); }

.dg-btn-danger {
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid var(--dg-danger-bd);
  color: #f87171;
}
.dg-btn-danger:hover { background: rgba(220, 38, 38, 0.22); }

.dg-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.dg-btn-sm { padding: 7px 13px; font-size: 0.78rem; border-radius: 9px; }
.dg-btn-block { width: 100%; justify-content: center; }

.dg-btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
/* Ohne diese Zeile bleibt eine Knopfreihe sichtbar, obwohl das
   hidden-Attribut gesetzt ist: display:flex schlaegt das display:none,
   das der Browser fuer [hidden] mitbringt. Fuer .dg-note, .dg-pager und
   .dg-collapse steht dieselbe Regel weiter unten. */
.dg-btn-row[hidden] { display: none; }

/* ── Formulare ─────────────────────────────────────────────────────────── */

.dg-field { display: grid; gap: 8px; }

.dg-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dg-fg-dim);
}

.dg-input,
.dg-select,
.dg-textarea {
  width: 100%;
  padding: 11px 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--dg-card-bd);
  border-radius: 10px;
  color: var(--dg-fg);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.88rem;
  transition: border-color 0.15s, background 0.15s;
}

.dg-input::placeholder,
.dg-textarea::placeholder { color: var(--dg-fg-dim); }

.dg-input:focus,
.dg-select:focus,
.dg-textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.07);
}

.dg-input-mono { font-family: 'Consolas', 'SF Mono', monospace; letter-spacing: 0.02em; }

.dg-input-wrap { position: relative; }

.dg-input-wrap .dg-input { padding-right: 44px; }

.dg-input-action {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--dg-fg-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dg-input-action:hover { background: rgba(255, 255, 255, 0.08); color: var(--dg-fg); }

/* Checkbox im DG-Look */

.dg-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--dg-fg-soft);
  cursor: pointer;
  user-select: none;
}

.dg-check input { position: absolute; opacity: 0; pointer-events: none; }

.dg-check-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--dg-card-bd);
  border-radius: 6px;
  color: transparent;
  font-size: 0.62rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.dg-check input:checked + .dg-check-box {
  background: var(--dg-accent-dim);
  border-color: var(--dg-accent-bd);
  color: var(--dg-accent);
}

.dg-check input:focus-visible + .dg-check-box { border-color: rgba(255, 255, 255, 0.3); }

/* ── Aufklappen ────────────────────────────────────────────────────────── */

.dg-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--dg-card-bd);
  border-radius: 12px;
  color: var(--dg-fg-soft);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

/* ── Login ─────────────────────────────────────────────────────────────── */

/* Kein Panel, keine Rahmen: Marke, zwei Zeilen, ein Knopf. Das Impressum
   sitzt in der zweiten Rasterzeile und wird dadurch immer unten gehalten. */

.dg-login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  padding: 48px 24px 28px;
}

.dg-login-core {
  align-self: center;
  width: 100%;
  max-width: 300px;
  display: grid;
  justify-items: center;
  gap: 40px;
}

.dg-login-mark {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  animation: dg-fade-up 0.5s ease both;
}

.dg-login-mark img { height: 44px; width: auto; }

.dg-login-title {
  font-family: 'DropGrinderDisplay', 'Archivo', sans-serif;
  font-size: 1.9rem;
  letter-spacing: -0.01em;
  line-height: 1;
}

.dg-login-kicker {
  font-family: 'Archivo', sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--dg-fg-dim);
  padding-left: 0.3em; /* gleicht die Laufweite rechts aus */
}

#dg-login-form {
  width: 100%;
  animation: dg-fade-up 0.5s 0.12s ease both;
}

.dg-login-input {
  display: block;
  width: 100%;
  padding: 13px 2px;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  color: var(--dg-fg);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.dg-login-input::placeholder { color: var(--dg-fg-dim); }
.dg-login-input:focus { outline: none; border-bottom-color: var(--dg-fg); }

/* Die Browser-Ausfüllhilfe malt sonst ein helles Feld in die dunkle Seite. */
.dg-login-input:-webkit-autofill,
.dg-login-input:-webkit-autofill:hover,
.dg-login-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--dg-fg);
  -webkit-box-shadow: 0 0 0 100px var(--dg-bg) inset;
  caret-color: var(--dg-fg);
}
.dg-login-input:autofill { background: none; color: var(--dg-fg); }

.dg-login-submit {
  width: 100%;
  margin-top: 30px;
  padding: 13px 20px;
  background: var(--dg-btn-bg);
  color: var(--dg-btn-fg);
  border: none;
  border-radius: 999px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.dg-login-submit:hover { background: var(--dg-btn-hover); }
.dg-login-submit:disabled { opacity: 0.45; cursor: not-allowed; }

/* Fehlerseite teilt sich die Shell mit der Anmeldung. */
.dg-login-hint {
  margin-bottom: 4px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--dg-fg-soft);
}

.dg-login-error {
  margin-top: 16px;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #f87171;
}

/* Der Weg zum DropGrinder-Dashboard, den abgelehnte Anmeldungen mitbringen. */
.dg-login-error a {
  display: block;
  margin-top: 8px;
  color: var(--dg-fg-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding-bottom: 2px;
  width: fit-content;
  margin-inline: auto;
  transition: color 0.15s, border-color 0.15s;
}

.dg-login-error a:hover { color: var(--dg-fg); border-bottom-color: var(--dg-fg); }

.dg-login-foot {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dg-fg-dim);
  animation: dg-fade-up 0.5s 0.24s ease both;
}

.dg-login-foot a { text-decoration: none; transition: color 0.15s; }
.dg-login-foot a:hover { color: var(--dg-fg-soft); }

/* ── Meldungen ─────────────────────────────────────────────────────────── */

.dg-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--dg-card-bd);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--dg-fg-soft);
}

.dg-note i { margin-top: 2px; flex: none; }
/* Fehlermeldungen bringen die rohe Serverursache in einer zweiten Zeile mit. */
.dg-note span[data-field="text"] { white-space: pre-wrap; }
.dg-note-ok { border-color: rgba(22, 163, 74, 0.35); background: rgba(22, 163, 74, 0.1); color: #86efac; }
.dg-note-warn { border-color: var(--dg-accent-bd); background: var(--dg-accent-dim); color: #fbbf24; }
.dg-note-bad { border-color: var(--dg-danger-bd); background: rgba(220, 38, 38, 0.1); color: #fca5a5; }
.dg-note[hidden] { display: none; }

/* ── Popup ─────────────────────────────────────────────────────────────── */

/* Hier stand einmal ein zweites `.dg-modal` — als Hülle, die den Bildschirm
   ausfüllt. Weiter unten steht dasselbe Wort für die Karte darin. Beide
   Regeln galten gleichzeitig: die Karte erbte `position: fixed; inset: 0`
   und klebte damit oben links statt in der Mitte, und `align-items: center`
   schob ihren Inhalt zur Mitte. Die Hülle heißt jetzt überall
   `.dg-modal-overlay`, `.dg-modal` ist nur noch die Karte. */

.dg-modal-card {
  width: 100%;
  max-width: 460px;
  background: #0b0b0b;
  border: 1px solid var(--dg-card-bd);
  border-radius: 18px;
  padding: 26px 28px;
  animation: dg-fade-up 0.35s ease both;
}

.dg-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.dg-modal-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Archivo', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.dg-modal-close {
  background: none;
  border: none;
  color: var(--dg-fg-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.dg-modal-close:hover { color: var(--dg-fg); background: rgba(255, 255, 255, 0.08); }

.dg-modal-body { display: grid; gap: 14px; }

/* ── Toast ─────────────────────────────────────────────────────────────── */

.dg-toast-host {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: grid;
  gap: 10px;
  max-width: 340px;
}

.dg-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  background: #0b0b0b;
  border: 1px solid var(--dg-card-bd);
  border-radius: 12px;
  font-size: 0.84rem;
  color: var(--dg-fg-soft);
  animation: dg-fade-up 0.3s ease both;
}

.dg-toast i { margin-top: 2px; }
.dg-toast-ok { border-color: rgba(22, 163, 74, 0.35); color: #86efac; }
.dg-toast-bad { border-color: var(--dg-danger-bd); color: #fca5a5; }

/* ── Produktübersicht ──────────────────────────────────────────────────── */

/* ── Popup-Hülle (aus dem Core, Block ab .dg-modal-overlay) ──────────── */

.dg-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 300;
}

.dg-modal-overlay[hidden] { display: none; }

.dg-modal {
  background: #0c0c0c;
  border: 1px solid var(--dg-card-bd);
  border-radius: 18px;
  width: min(880px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.7);
}

.dg-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--dg-card-bd);
}

.dg-modal-title { font-weight: 900; color: var(--dg-fg); font-size: 0.98rem; }

.dg-modal-close {
  background: none;
  border: none;
  color: var(--dg-fg-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.dg-modal-close:hover { color: var(--dg-fg); background: rgba(255, 255, 255, 0.08); }
.dg-modal-body { padding: 20px 22px 26px; overflow-y: auto; }

/* ==========================================================================
   Mailversand — die Bausteine der neuen Seiten

   Unverändert aus DropCore (static/css/dg-core.css) übernommen: Navigation,
   Abzeichen, Punkte, Tabellen, Kennzahlen, Code-Blöcke. Keine eigene
   Palette, keine eigenen Abstände — die beiden Oberflächen gehören zusammen
   und sollen sich gleich bedienen lassen. Nur die DNS- und Status-Teile
   weiter unten sind hier zuhause; es gibt sie drüben nicht.
   ========================================================================== */

/* ── Navigation in der Kopfzeile ───────────────────────────────────────── */

.dg-topbar-nav { display: flex; flex-wrap: wrap; gap: 8px; }

.dg-navlink {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  background: var(--dg-card-bg);
  border: 1px solid var(--dg-card-bd);
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--dg-fg-soft);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.dg-navlink:hover { color: var(--dg-fg); background: rgba(255, 255, 255, 0.1); }
.dg-navlink.is-active { color: var(--dg-accent); border-color: var(--dg-accent-bd); }
.dg-navlink i { color: inherit; }

/* ── Abzeichen und Punkte ──────────────────────────────────────────────── */

.dg-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--dg-card-bd);
  background: var(--dg-card-icon);
  color: var(--dg-fg-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.dg-badge-ok { border-color: rgba(22, 163, 74, 0.35); background: rgba(22, 163, 74, 0.12); color: #4ade80; }
.dg-badge-warn { border-color: var(--dg-accent-bd); background: var(--dg-accent-dim); color: var(--dg-accent); }
.dg-badge-bad { border-color: var(--dg-danger-bd); background: rgba(220, 38, 38, 0.12); color: #f87171; }

.dg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dg-fg-dim);
  flex: none;
}

.dg-dot-ok { background: var(--dg-success); }
.dg-dot-bad { background: var(--dg-danger); }
.dg-dot-warn { background: var(--dg-warn); }

/* ── Tabellen ──────────────────────────────────────────────────────────── */

.dg-table-scroll { overflow-x: auto; }

.dg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  min-width: 620px;
}

.dg-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dg-fg-dim);
  border-bottom: 1px solid var(--dg-card-bd);
  white-space: nowrap;
  /* Die Kopfzeile bleibt beim Scrollen stehen. Bei hundert Zeilen Protokoll
     ist eine Tabelle ohne sichtbare Spaltennamen nicht mehr lesbar. */
  position: sticky;
  top: 0;
  background: #0c0c0c;
  z-index: 1;
}

.dg-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--dg-fg-soft);
  vertical-align: middle;
}

.dg-table tr:last-child td { border-bottom: none; }
.dg-table td.dg-td-strong { color: var(--dg-fg); font-weight: 700; }
/* Zahlen rechtsbündig — so stehen die Stellen untereinander und ein
   Größenunterschied fällt beim Überfliegen auf. */
.dg-table td.dg-td-num, .dg-table th.dg-td-num { text-align: right; font-variant-numeric: tabular-nums; }
.dg-table-scroll::-webkit-scrollbar { height: 8px; }
.dg-table-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 8px; }

/* Anklickbare Zeile (Protokoll -> Detailansicht). Nur die Farbe wechselt:
   Eine Zeile, die beim Darüberfahren die Lage ändert, lässt die ganze
   Tabelle wackeln. */
.dg-table-klick tbody tr { cursor: pointer; transition: background 0.12s; }
.dg-table-klick tbody tr:hover { background: rgba(255, 255, 255, 0.04); }

.dg-empty {
  padding: 26px;
  text-align: center;
  color: var(--dg-fg-dim);
  font-size: 0.86rem;
  display: grid;
  gap: 12px;
  justify-items: center;
}

/* ── Kennzahlen ────────────────────────────────────────────────────────── */

.dg-stat-row { display: flex; flex-wrap: wrap; gap: 12px; }

.dg-stat {
  flex: 1 1 150px;
  display: grid;
  gap: 4px;
  padding: 14px 18px;
  background: var(--dg-card-bg);
  border: 1px solid var(--dg-card-bd);
  border-radius: 14px;
}

.dg-stat-value.dg-stat-warn { color: var(--dg-accent); }
.dg-stat-value.dg-stat-bad { color: #f87171; }

/* ── Reiter ────────────────────────────────────────────────────────────── */

.dg-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--dg-card-bd);
  margin-bottom: 16px;
}

.dg-tab {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--dg-fg-dim);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.dg-tab:hover { color: var(--dg-fg-soft); }
.dg-tab.is-active { color: var(--dg-fg); border-bottom-color: var(--dg-accent); }

/* ── Filterzeile ───────────────────────────────────────────────────────── */

.dg-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.dg-filter-row .dg-input,
.dg-filter-row .dg-select { max-width: 220px; }

/* ── Code zum Kopieren ─────────────────────────────────────────────────── */

/* Nicht ein Block mit allem drin: Wer in einer Konsole arbeitet, führt die
   Anweisungen nacheinander aus und will genau eine davon in der
   Zwischenablage haben. Der Kopierknopf steht deshalb je Schritt in einer
   eigenen Kopfzeile — und nicht über dem Text, wo er Zeilen verdeckte. */

.dg-sql-schritte { display: grid; gap: 18px; }

.dg-sql-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.dg-sql-titel { font-weight: 700; color: var(--dg-fg); font-size: 0.88rem; }
.dg-sql-nummer { color: var(--dg-fg-dim); font-weight: 900; margin-right: 8px; }

.dg-code {
  display: block;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--dg-card-bd);
  border-radius: 10px;
  font-family: 'Consolas', 'SF Mono', monospace;
  font-size: 0.83rem;
  line-height: 1.65;
  color: var(--dg-fg);
  /* Umbrechen statt waagerecht scrollen: eine GRANT-Zeile mit langen Namen
     wäre sonst zur Hälfte unsichtbar. Kopiert wird über den Knopf. */
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 340px;
  overflow-y: auto;
}

.dg-code-copy {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--dg-card-bd);
  background: rgba(255, 255, 255, 0.07);
  color: var(--dg-fg);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.76rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.dg-code-copy:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Nach dem Kopieren kurz grün — die einzige Rückmeldung, die es braucht. */
.dg-code-copy.is-done {
  background: rgba(22, 163, 74, 0.18);
  border-color: rgba(22, 163, 74, 0.45);
  color: #4ade80;
}

/* ── DNS-Einträge ──────────────────────────────────────────────────────── */

/* Jede Zeile ein Eintrag: Typ, Name, Wert, Zustand, Kopierknopf. Der Wert
   eines DKIM-Schlüssels ist lang — er bekommt deshalb die ganze Breite und
   darf umbrechen, statt die Spalte zu sprengen. */

.dg-dns-liste { display: grid; gap: 12px; }

.dg-dns {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  background: var(--dg-card-bg);
  border: 1px solid var(--dg-card-bd);
  border-radius: 12px;
}

.dg-dns-kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.dg-dns-typ {
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--dg-card-icon);
  font-family: 'Consolas', 'SF Mono', monospace;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--dg-fg);
}

.dg-dns-name { font-family: 'Consolas', 'SF Mono', monospace; font-size: 0.82rem; color: var(--dg-fg); }
.dg-dns-kopf .dg-code-copy { margin-left: auto; }

.dg-dns-wert {
  font-family: 'Consolas', 'SF Mono', monospace;
  font-size: 0.79rem;
  line-height: 1.6;
  color: var(--dg-fg-soft);
  word-break: break-all;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
}

.dg-dns-hinweis { font-size: 0.78rem; color: var(--dg-fg-dim); line-height: 1.55; }
.dg-dns-gefunden { font-size: 0.76rem; color: var(--dg-fg-dim); word-break: break-all; }

/* ── Statuszeichen ─────────────────────────────────────────────────────── */

/* Punkt **und** Text, nie Farbe allein: Wer Rot und Grün nicht unterscheidet,
   liest sonst gar nichts. */

.dg-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.dg-status-ok { color: #4ade80; }
.dg-status-warn { color: var(--dg-accent); }
.dg-status-bad { color: #f87171; }
.dg-status-neutral { color: var(--dg-fg-dim); }

/* ── Detailansicht ─────────────────────────────────────────────────────── */

.dg-detail-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px 16px;
  font-size: 0.84rem;
}

.dg-detail-key { color: var(--dg-fg-dim); }
.dg-detail-val { color: var(--dg-fg-soft); word-break: break-word; }

/* ── Kleinkram ─────────────────────────────────────────────────────────── */

.dg-mono { font-family: 'Consolas', 'SF Mono', monospace; font-size: 0.82rem; }
.dg-soft { color: var(--dg-fg-soft); }
.dg-dim { color: var(--dg-fg-dim); }
.dg-sep { height: 1px; background: var(--dg-card-bd); margin: 4px 0; }
.dg-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dg-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.dg-chip {
  padding: 4px 10px;
  background: var(--dg-card-bg);
  border: 1px solid var(--dg-card-bd);
  border-radius: 999px;
  font-size: 0.76rem;
  color: var(--dg-fg-soft);
}

.dg-spin { animation: dg-drehen 0.9s linear infinite; }

@keyframes dg-drehen {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .dg-spin { animation: none; }
}

.dg-modal-card.dg-modal-wide { max-width: 860px; }

@media (max-width: 720px) {
  .dg-detail-grid { grid-template-columns: 1fr; gap: 2px 0; }
  .dg-detail-key { margin-top: 10px; }
  .dg-navlink span { display: none; }
  .dg-filter-row .dg-input,
  .dg-filter-row .dg-select { max-width: none; flex: 1 1 100%; }
}
