// =============================================================================
// TOM Document — HTML/CSS Styles
// =============================================================================

export function buildDocumentStyles(orgNameEscaped: string): string {
  return `<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>TOM-Dokumentation — ${orgNameEscaped}</title>
<style>
  @page { size: A4; margin: 20mm 18mm 22mm 18mm; }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 10pt;
    line-height: 1.5;
    color: #1e293b;
  }
  .cover {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    page-break-after: always;
  }
  .cover h1 { font-size: 28pt; color: #5b21b6; margin-bottom: 8px; font-weight: 700; }
  .cover .subtitle { font-size: 14pt; color: #7c3aed; margin-bottom: 40px; }
  .cover .org-info {
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    padding: 24px 40px;
    text-align: left;
    width: 400px;
    margin-bottom: 24px;
  }
  .cover .org-info div { margin-bottom: 6px; }
  .cover .org-info .label { font-weight: 600; color: #5b21b6; display: inline-block; min-width: 160px; }
  .cover .legal-ref { font-size: 9pt; color: #64748b; margin-top: 20px; }
  .toc { page-break-after: always; padding-top: 40px; }
  .toc h2 { font-size: 18pt; color: #5b21b6; margin-bottom: 20px; border-bottom: 2px solid #5b21b6; padding-bottom: 8px; }
  .toc-entry { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dotted #cbd5e1; font-size: 10pt; }
  .toc-entry .toc-num { font-weight: 600; color: #5b21b6; min-width: 40px; }
  .section { page-break-inside: avoid; margin-bottom: 24px; }
  .section-header { font-size: 14pt; color: #5b21b6; font-weight: 700; margin: 30px 0 12px 0; border-bottom: 2px solid #ddd6fe; padding-bottom: 6px; }
  .section-body { margin-bottom: 16px; }
  table { width: 100%; border-collapse: collapse; margin: 10px 0 16px 0; font-size: 9pt; }
  th, td { border: 1px solid #e2e8f0; padding: 6px 8px; text-align: left; vertical-align: top; }
  th { background: #f5f3ff; color: #5b21b6; font-weight: 600; font-size: 8.5pt; text-transform: uppercase; letter-spacing: 0.3px; }
  tr:nth-child(even) td { background: #faf5ff; }
  .policy-detail { page-break-inside: avoid; border: 1px solid #e2e8f0; border-radius: 6px; margin-bottom: 16px; overflow: hidden; }
  .policy-detail-header { background: #f5f3ff; padding: 8px 12px; font-weight: 700; color: #5b21b6; border-bottom: 1px solid #ddd6fe; display: flex; justify-content: space-between; }
  .policy-detail-body { padding: 0; }
  .policy-detail-body table { margin: 0; }
  .policy-detail-body th { width: 200px; }
  .badge { display: inline-block; padding: 1px 8px; border-radius: 9999px; font-size: 8pt; font-weight: 600; }
  .badge-active { background: #dcfce7; color: #166534; }
  .badge-draft { background: #f3f4f6; color: #374151; }
  .badge-review { background: #fef9c3; color: #854d0e; }
  .badge-critical { background: #fecaca; color: #991b1b; }
  .badge-high { background: #fed7aa; color: #9a3412; }
  .badge-medium { background: #fef3c7; color: #92400e; }
  .badge-low { background: #f3f4f6; color: #4b5563; }
  .principle { margin-bottom: 10px; padding-left: 20px; position: relative; }
  .principle::before { content: ''; position: absolute; left: 0; top: 6px; width: 10px; height: 10px; background: #7c3aed; border-radius: 50%; }
  .principle strong { color: #5b21b6; }
  .score-box { display: inline-block; padding: 4px 16px; border-radius: 8px; font-size: 18pt; font-weight: 700; margin-right: 12px; }
  .score-excellent { background: #dcfce7; color: #166534; }
  .score-good { background: #dbeafe; color: #1e40af; }
  .score-needs-work { background: #fef3c7; color: #92400e; }
  .score-poor { background: #fecaca; color: #991b1b; }
  .page-footer { position: fixed; bottom: 0; left: 0; right: 0; padding: 8px 18mm; font-size: 7.5pt; color: #94a3b8; display: flex; justify-content: space-between; border-top: 1px solid #e2e8f0; }
  @media print {
    body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .no-print { display: none !important; }
    .page-break { page-break-after: always; }
  }
</style>
</head>
<body>
`
}
