:root {
  --brand-600: #1f35c9;
  --brand-700: #1a2ba7;
  --brand-50:  #eef2ff;
}

body { background: #f7f9fc; color: #0b1220; font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif; }
.btn-primary { background-color: var(--brand-600); border-color: var(--brand-600); }
.btn-primary:hover, .btn-primary:focus { background-color: var(--brand-700); border-color: var(--brand-700); }
.text-brand { color: var(--brand-600) !important; }
.bg-brand-soft { background-color: var(--brand-50); }

.app { min-height: 100vh; }
.app-sidebar {
  width: 260px; flex-shrink: 0;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.app-sidebar a.active { background: var(--brand-50); color: var(--brand-700) !important; }
.app-main { min-width: 0; background: #f7f9fc; }

.kpi { border-radius: 16px; background: #fff; padding: 1rem 1.1rem; border: 1px solid #e5e7eb; }
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #64748b; }
.kpi-value { font-size: 1.5rem; font-weight: 600; margin-top: 2px; }

.card-soft { border: 1px solid #e5e7eb; border-radius: 16px; background: #fff; }
.table > :not(caption) > * > * { vertical-align: middle; }

.hero {
  background: radial-gradient(ellipse at top, rgba(31,53,201,0.15), transparent 60%);
  padding: 5rem 0;
}
.tag { display: inline-block; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); font-size: 12px; font-weight: 600; padding: .3rem .7rem; }

@media (max-width: 768px) {
  .app { flex-direction: column; }
  .app-sidebar { width: 100%; min-height: 0; }
}

/* PDF-Export via Browser-Druck ("Als PDF speichern"). Auf der
   Präsentationsseite sorgt das für eine saubere mehrseitige Ausgabe
   mit Logo im Kopf, KPIs, Diagrammen, Kalkulationstabelle und Annahmen. */
/* Formularfeld-Wichtigkeits-Kennzeichnung in unit-edit. */
.label-must      { color: #0b1220; font-weight: 600; }
.label-must::before  { content: '● '; color: #dc2626; font-size: 0.7em; vertical-align: middle; margin-right: .15em; }
.label-nice      { color: #0b1220; font-weight: 500; }
.label-opt       { color: #94a3b8; font-weight: 400; }
.label-opt::after    { content: ' (optional)'; font-size: .8em; color: #cbd5e1; }
.field-hint      { font-size: .75em; color: #94a3b8; margin-top: .25em; }

.print-cover, .print-footer { display: none; }

@media print {
  body { background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10.5pt; }
  .no-print, .app-sidebar, .nav-tabs { display: none !important; }
  header.border-bottom { border-bottom: 1px solid #cfd6e4 !important; }
  .card-soft { box-shadow: none !important; border-color: #d0d7e2 !important; break-inside: avoid; page-break-inside: avoid; }
  .tab-content > .tab-pane { display: block !important; opacity: 1 !important; visibility: visible !important; }
  .tab-content > .tab-pane + .tab-pane { page-break-before: always; break-before: page; padding-top: .5rem; }
  input, select, textarea {
    border: 0 !important; background: transparent !important; padding: 0 !important;
    box-shadow: none !important; color: inherit !important; font-weight: 600;
    -webkit-appearance: none !important; appearance: none !important; min-height: 0 !important;
  }
  #calculator .btn-group { display: none !important; }
  a { color: inherit !important; text-decoration: none !important; }
  tr, .kpi { page-break-inside: avoid; break-inside: avoid; }
  thead { display: table-header-group; }
  h1, h2, h3 { page-break-after: avoid; }

  /* Deckblatt + Abschluss-Seite nur im Druck. */
  .print-cover {
    display: flex !important; flex-direction: column; justify-content: space-between;
    min-height: 260mm; text-align: center; page-break-after: always; padding: 20mm 0;
  }
  .print-cover .pc-logo   { max-height: 70px; max-width: 60%; margin: 0 auto; }
  .print-cover .pc-title  { font-size: 26pt; font-weight: 600; margin-top: 30mm; line-height: 1.2; }
  .print-cover .pc-sub    { font-size: 14pt; color: #475569; margin-top: 6mm; }
  .print-cover .pc-meta   { font-size: 10pt; color: #64748b; margin-top: 40mm; }
  .print-footer { display: block !important; text-align: center; color: #64748b; font-size: 9pt; margin-top: 20mm; page-break-before: always; padding-top: 60mm; }

  @page {
    margin: 18mm 14mm 22mm 14mm; size: A4;
    @bottom-right { content: "Seite " counter(page) " / " counter(pages); font: 9pt sans-serif; color: #64748b; }
    @bottom-left  { content: string(brand-name); font: 9pt sans-serif; color: #64748b; }
  }
}
