/* ═══════════════════════════════════════════════════════════
   BeredskapsHUB — Utskriftsstil
   ═══════════════════════════════════════════════════════════ */

@media print {
  @page {
    size: A4;
    margin: 25mm 20mm 25mm 25mm;
  }

  @page :first {
    margin-top: 0;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  /* Hide UI elements */
  .app-header,
  .sidebar,
  .doc-toolbar,
  .doc-toc,
  .toolbar-actions,
  .toast-container,
  .modal-overlay,
  .app-footer,
  .btn,
  .mobile-menu-btn {
    display: none !important;
  }

  body {
    background: white !important;
    font-family: 'Times New Roman', Times, serif;
    font-size: 11pt;
    line-height: 1.5;
    color: #000 !important;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .doc-container {
    display: block !important;
  }

  .doc-main {
    width: 100% !important;
  }

  .doc-content {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  /* Cover page */
  .doc-cover {
    background: #1a3a6b !important;
    color: white !important;
    padding: 60mm 20mm 40mm !important;
    page-break-after: always;
    min-height: 200mm;
  }

  .cover-title {
    font-size: 24pt !important;
    font-weight: bold !important;
  }

  .cover-municipality {
    font-size: 12pt !important;
  }

  /* Chapter breaks */
  .chapter {
    page-break-before: auto;
    page-break-inside: avoid;
  }

  .chapter:nth-child(1) { page-break-before: always; }

  .chapter-header {
    page-break-after: avoid;
  }

  .chapter-title {
    font-size: 14pt !important;
    font-weight: bold !important;
    color: #1a3a6b !important;
  }

  .chapter-num {
    background: #1a3a6b !important;
    color: white !important;
    width: 28pt !important;
    height: 28pt !important;
    font-size: 10pt !important;
    border-radius: 4pt !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .section-title {
    font-size: 11pt !important;
    font-weight: bold !important;
    color: #1a3a6b !important;
    border-left: 3pt solid #2a5298 !important;
    padding-left: 8pt !important;
    page-break-after: avoid;
  }

  .section-body {
    font-size: 10pt !important;
    line-height: 1.6 !important;
  }

  /* Tables */
  .table-wrap {
    overflow: visible !important;
    border: 1pt solid #ccc !important;
    border-radius: 0 !important;
    page-break-inside: auto;
  }

  table {
    font-size: 9pt !important;
    width: 100% !important;
    border-collapse: collapse !important;
  }

  thead {
    display: table-header-group;
  }

  thead tr {
    background: #1a3a6b !important;
    color: white !important;
  }

  thead th {
    padding: 6pt 8pt !important;
    font-size: 8pt !important;
    font-weight: bold !important;
    border: 1pt solid #0d2247 !important;
  }

  tbody td {
    padding: 5pt 8pt !important;
    border: 1pt solid #ddd !important;
    vertical-align: top !important;
  }

  tbody tr:nth-child(even) {
    background: #f5f7fa !important;
  }

  /* Callout boxes */
  .callout {
    border: 1pt solid #ccc !important;
    border-left-width: 4pt !important;
    padding: 8pt 10pt !important;
    margin: 8pt 0 !important;
    page-break-inside: avoid;
  }

  .callout.info    { border-left-color: #1a3a6b !important; background: #f0f4fa !important; }
  .callout.warning { border-left-color: #d97706 !important; background: #fffbf0 !important; }
  .callout.danger  { border-left-color: #c8102e !important; background: #fff5f7 !important; }
  .callout.success { border-left-color: #1a7a4a !important; background: #f0faf5 !important; }

  /* Highlight boxes */
  .highlight-box {
    border: 1pt solid #c0cce0 !important;
    background: #f5f8ff !important;
    padding: 8pt 10pt !important;
    page-break-inside: avoid;
  }

  /* Badges */
  .badge-ok    { color: #1a7a4a !important; }
  .badge-warn  { color: #d97706 !important; }
  .badge-danger{ color: #c8102e !important; }
  .badge-info  { color: #1a3a6b !important; }

  /* Page numbers */
  .doc-body {
    padding: 0 !important;
  }

  /* Links */
  a { color: #1a3a6b !important; text-decoration: none !important; }

  /* Avoid orphans */
  p { orphans: 3; widows: 3; }

  h1, h2, h3, h4 { page-break-after: avoid; }

  /* Chapter law ref */
  .chapter-law-ref {
    background: #ffe8ec !important;
    color: #c8102e !important;
    border: 1pt solid #f0b0bc !important;
    padding: 1pt 5pt !important;
    font-size: 7pt !important;
  }
}