/* ============================================================
   Mailing-Automat — gemeinsames Stylesheet
   promo.bittel.de

   Herkunft der Gestaltung:
   - Struktur, Farben, Tabellen  → Filialcockpit (strato/templates/tpl_main.php)
   - Schrift-Paarung, Knopfform  → Pauline (frontend/app/globals.css)

   Beide nutzen Raleway und ein Magenta als einzige Akzentfarbe. Übernommen
   ist Cockpits dunkleres #D4005F statt Paulines #E82C7C: es trägt auch als
   Textfarbe auf Weiß (rund 6:1 Kontrast), und dieses Portal ist tabellen-
   lastig wie das Cockpit, nicht flächig wie der Chat.
   ============================================================ */

:root {
  /* ---- Akzent (Cockpit) ---- */
  --pink:        #D4005F;
  --pink-light:  #FAE6EF;
  --pink-dark:   #A8004C;

  /* ---- Graustufen (Cockpit) ---- */
  --gray-50:     #F9FAFB;
  --gray-100:    #F3F4F6;
  --gray-200:    #E5E7EB;
  --gray-400:    #9CA3AF;
  --gray-600:    #4B5563;
  --gray-800:    #1F2937;
  --white:       #FFFFFF;

  /* ---- Fristen-Ampel ----
     Bewusst entsättigt, damit das Magenta die einzige kräftige Farbe
     bleibt. Das Portal lebt von Terminen: jede Frist trägt einen dieser
     drei Zustände. */
  --danger:      #C81E1E;   /* Frist in <= 7 Tagen oder verstrichen */
  --danger-bg:   #FDECEC;
  --warn:        #B45309;   /* Frist in 8 bis 21 Tagen */
  --warn-bg:     #FEF3E2;
  --ok:          #15803D;   /* erledigt oder weit weg */
  --ok-bg:       #ECFDF3;

  /* ---- Form (Cockpit: Karten/Schatten, Pauline: Knopfradius) ---- */
  --radius:      14px;
  --r-btn:       22px;
  --r-pill:      12px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.05);
  --transition:  .2s ease;

  --breit:       1400px;   /* Cockpits Inhaltsbreite */
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Paulines Serif — hier nur für Seitentitel, nicht für Fließtext. */
.serif {
  font-family: 'Playfair Display', 'Times New Roman', Times, serif;
  font-weight: 400;
  letter-spacing: -.02em;
}

/* ══════════════ Kopfzeile ══════════════ */

header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: var(--breit);
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.logo-img { height: 36px; object-fit: contain; }
.header-divider { width: 1px; height: 28px; background: var(--gray-200); }
.header-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--gray-800);
  letter-spacing: -.01em;
}
.header-sync {
  margin-left: auto;
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 500;
  text-align: right;
  line-height: 1.4;
}
.header-sync b { color: var(--gray-600); font-weight: 600; }

/* ══════════════ Reiter ══════════════ */

nav.tabs {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}
.tabs-inner {
  max-width: var(--breit);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}
.tab {
  appearance: none;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-400);
  padding: 14px 16px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.tab:hover { color: var(--gray-600); }
.tab.active { color: var(--pink); border-bottom-color: var(--pink); }
.tab .tab-count {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
}
.tab.active .tab-count { color: var(--pink); }

/* ══════════════ Seitenrumpf ══════════════ */

main {
  max-width: var(--breit);
  margin: 0 auto;
  padding: 28px 32px 64px;
}

.seitentitel {
  font-size: 28px;
  margin: 0 0 4px;
  color: var(--gray-800);
}
.seitenlead {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--gray-600);
  font-weight: 500;
}

/* ══════════════ Karten ══════════════ */

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card + .card { margin-top: 20px; }
.card-head {
  padding: 16px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
  letter-spacing: -.01em;
}
.card-sub { font-size: 12px; color: var(--gray-400); font-weight: 500; }
.card-head .rechts { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 20px 24px 24px; }

/* ══════════════ Kennzahlen-Kacheln ══════════════ */

.kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kachel {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}
.kachel.ist-danger { border-left-color: var(--danger); }
.kachel.ist-warn   { border-left-color: var(--warn); }
.kachel.ist-ok     { border-left-color: var(--ok); }

.kachel-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400);
  margin-bottom: 8px;
}
.kachel-wert {
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1.1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.kachel-wert.ist-danger { color: var(--danger); }
.kachel-wert.ist-warn   { color: var(--warn); }
.kachel-fuss {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--gray-600);
  font-weight: 500;
}

/* ══════════════ Tabellen (Cockpit) ══════════════ */

.tabelle-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
  padding: 10px;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  line-height: 1.25;
  vertical-align: bottom;
  white-space: nowrap;
}
thead th:first-child { text-align: left; padding-left: 24px; }
thead th:last-child  { padding-right: 24px; }

tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }

tbody td {
  padding: 13px 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-800);
  text-align: right;
  vertical-align: top;
}
tbody td:first-child { text-align: left; padding-left: 24px; }
tbody td:last-child  { padding-right: 24px; }

.zelle-haupt { font-weight: 600; }
.zelle-neben { display: block; font-size: 12px; color: var(--gray-400); font-weight: 500; margin-top: 2px; }
.zahl { font-variant-numeric: tabular-nums; }

/* ══════════════ Pillen ══════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  background: var(--pink-light);
  color: var(--pink);
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge.neutral { background: var(--gray-100); color: var(--gray-600); }
.badge.danger  { background: var(--danger-bg); color: var(--danger); }
.badge.warn    { background: var(--warn-bg);   color: var(--warn); }
.badge.ok      { background: var(--ok-bg);     color: var(--ok); }

/* ══════════════ Knöpfe (Paulines Radius) ══════════════ */

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  padding: 9px 20px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  letter-spacing: .01em;
  white-space: nowrap;
}
.btn-primary { background: var(--pink); color: var(--white); }
.btn-primary:hover { background: var(--pink-dark); }
.btn-ghost {
  background: var(--white);
  color: var(--gray-600);
  border-color: var(--gray-200);
}
.btn-ghost:hover { border-color: var(--gray-400); color: var(--gray-800); }
.btn-klein { padding: 5px 14px; font-size: 12.5px; }

/* ══════════════ Wörtliche Vorgaben der BA ══════════════
   Dateiname und Empfängeradresse werden aus dem Infocenter wörtlich
   übernommen — je Promotion einzeln, nie aus einer Regel abgeleitet.
   Sie stehen deshalb als Monospace-Zitat, nicht als Fließtext. */

.woertlich {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--gray-800);
  display: inline-block;
  overflow-wrap: anywhere;
}

.hinweis {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}
.hinweis.danger { background: var(--danger-bg); color: var(--danger); }
.hinweis.warn   { background: var(--warn-bg);   color: var(--warn); }
.hinweis.info   { background: var(--gray-100);  color: var(--gray-600); }
.hinweis b { font-weight: 700; }

.feldliste { display: grid; grid-template-columns: 200px 1fr; gap: 12px 20px; font-size: 13.5px; align-items: baseline; }
.feldliste dt { color: var(--gray-400); font-weight: 600; }
.feldliste dd { margin: 0; color: var(--gray-800); font-weight: 500; }

/* ══════════════ Schmale Fenster ══════════════ */

@media (max-width: 900px) {
  .header-inner, .tabs-inner, main { padding-left: 16px; padding-right: 16px; }
  thead th:first-child, tbody td:first-child { padding-left: 16px; }
  thead th:last-child,  tbody td:last-child  { padding-right: 16px; }
  .feldliste { grid-template-columns: 1fr; gap: 4px 0; }
  .feldliste dd { margin-bottom: 10px; }
  .seitentitel { font-size: 23px; }
}
