/* Eigenstaendige Styles - Tailwind kommt via CDN. */

/* Tab-Bar */
.tab-btn {
  background: transparent;
  color: rgba(207, 216, 227, 0.85);
  border: 1px solid transparent;
  border-bottom: none;
  position: relative;
  top: 1px;
  cursor: pointer;
  font-weight: 500;
}
.tab-btn.active {
  background: #f5f7fa;        /* arc-50 */
  color: #1f2837;             /* arc-900 */
  border-color: rgba(255,255,255,0.15);
}
.tab-btn:hover:not(.active) {
  color: white;
}

html { scroll-behavior: smooth; }

body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }

table { border-collapse: collapse; }
thead { position: sticky; top: 0; z-index: 1; }

/* Modal - Animation */
#detail-modal:not(.hidden) > div:last-child {
  animation: slidein .15s ease-out;
}
@keyframes slidein {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* Custom Scrollbar in Sidebar-Listen */
aside [class*="overflow-y"] {
  scrollbar-width: thin;
  scrollbar-color: #cfd8e3 transparent;
}
aside [class*="overflow-y"]::-webkit-scrollbar { width: 6px; }
aside [class*="overflow-y"]::-webkit-scrollbar-thumb { background: #cfd8e3; border-radius: 3px; }

/* Status-Raster (Living-Forest-Stil): feste Slot-Positionen,
   leere Slots mit gestricheltem Rahmen erkennbar.
   Reihenfolge: Verkauf | Lebenszyklus | ML PL | Markt | KD LF */
.sg-grid {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  line-height: 1;
}
.sg-slot {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;          /* 2026-05-20: 30px → 26px fuer schmalere Status-Spalte (loest rechten-Rand-Quetsch) */
  height: 22px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 12px;
}
.sg-slot.empty {
  border-style: dashed;
  border-color: #b8c1cd;            /* etwas dunkler fuer besseren Kontrast (auch im Dark-Mode) */
  background: transparent;
}
.sg-slot.sg-text {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.sg-slot.sg-num {
  width: 32px;          /* 2026-05-20: 38px → 32px (skaliert mit Basis-Slot) */
  gap: 1px;
  font-size: 11px;
}
.sg-slot.sg-num small {
  font-size: 10px;
  font-weight: 600;
}
.sg-gap { width: 8px; display: inline-block; }

/* Mini-Header in der Status-Spalten-Ueberschrift,
   genau ausgerichtet ueber den 7 Status-Slots im Tabellen-Body.
   Emoji-Symbole werden etwas dezent dargestellt (Opacity), damit
   sie als Header und nicht als Daten gelesen werden. */
.sg-slot.sg-head {
  border: none;
  background: transparent;
  height: 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #6b7785;       /* arc-500 */
  padding: 0 2px;
  opacity: 0.7;
  filter: grayscale(0.3);
}
.sg-slot.sg-head:hover {
  opacity: 1;
  filter: none;
}

/* ============================================================================
   Kundenauswertung — Druck-Ansicht (Stufe 37, 2026-08-19)
   ----------------------------------------------------------------------------
   Use-Case: Kollege dreht im Kundengespraech den Laptop um ODER druckt dem
   Kunden eine Auswertung / einen Einzelbeleg aus (z.B. fuer Versicherungsfall).

   WHITELIST-PRINZIP — bewusst so und bitte so lassen:
   Im Druck wird ALLES ausgeblendet und NUR #print-root wieder eingeblendet.
   Der naheliegende Gegenentwurf (interne Elemente per .no-print ausblenden)
   waere eine Blacklist — dabei landet jedes kuenftig hinzugefuegte interne
   Element ungefragt im Kunden-PDF. Genau das darf hier nicht passieren: der
   Kunden-Modal enthaelt Insolvenz-Bewertung, interne Notizen, Vertriebs-
   Quoten und Upselling-Empfehlungen.
   Faustregel: was der Kunde sehen darf, wird in #print-root GESCHRIEBEN —
   nicht "stehengelassen".
   ============================================================================ */

/* Am Bildschirm ist der Druck-Container unsichtbar. */
#print-root { display: none; }

@media print {
  /* 1) Whitelist: alles weg ausser dem Report-Container. */
  body > * { display: none !important; }
  #print-root { display: block !important; }

  @page { size: A4 portrait; margin: 16mm 14mm 18mm 14mm; }

  html, body {
    background: #fff !important;
    color: #000 !important;
  }

  #print-root {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 10pt;
    line-height: 1.35;
    color: #000;
  }

  /* --- Kopf: Firma links, Kunde/Zeitraum rechts --- */
  .pr-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12mm;
    border-bottom: 2px solid #333;
    padding-bottom: 4mm;
    margin-bottom: 6mm;
  }
  .pr-firma   { font-size: 13pt; font-weight: 700; letter-spacing: .2px; }
  .pr-sub     { font-size: 8.5pt; color: #444; margin-top: 1mm; }
  .pr-titel   { font-size: 12pt; font-weight: 600; margin-bottom: 1mm; }
  .pr-meta    { font-size: 9pt; color: #222; text-align: right; }
  .pr-meta b  { font-weight: 600; }

  /* --- Kennzahlen-Zeile --- */
  .pr-kpis {
    display: flex; gap: 8mm; flex-wrap: wrap;
    margin: 0 0 5mm 0; padding: 3mm 0;
    border-bottom: 1px solid #ccc;
  }
  .pr-kpi       { font-size: 9pt; }
  .pr-kpi span  { display: block; color: #555; font-size: 8pt; }
  .pr-kpi b     { font-size: 11pt; font-weight: 700; }

  /* --- Tabellen --- */
  #print-root table { width: 100%; border-collapse: collapse; margin-bottom: 5mm; }
  #print-root thead { display: table-header-group; }   /* Kopf auf JEDER Seite */
  #print-root tfoot { display: table-footer-group; }
  #print-root tr    { break-inside: avoid; page-break-inside: avoid; }
  #print-root th {
    text-align: left; font-size: 8.5pt; font-weight: 600;
    border-bottom: 1.5px solid #333; padding: 1.5mm 2mm;
    background: #f2f2f2 !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  #print-root td {
    padding: 1.2mm 2mm; border-bottom: .4px solid #ddd;
    vertical-align: top;
  }
  #print-root .num  { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
  #print-root .sku  { font-family: Consolas, "Courier New", monospace; font-size: 8.5pt; white-space: nowrap; }
  #print-root tfoot td {
    font-weight: 700; border-top: 1.5px solid #333; border-bottom: none;
    padding-top: 2mm;
  }

  /* --- Fuss --- */
  .pr-fuss {
    margin-top: 6mm; padding-top: 3mm;
    border-top: 1px solid #ccc;
    font-size: 8pt; color: #555;
  }

  .pr-break { break-before: page; page-break-before: always; }
}
