@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary-color: #0f172a; /* Dark Navy Color for Harmony */
  --text-main: #334155;     
  --text-muted: #475569;    
  --bg-color: #ffffff;
  --border-color: #cbd5e1;  
  --bg-muted: #f8fafc;      
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 9.5pt;
  line-height: 1.34;
  color: var(--text-main);
  max-width: 850px;
  margin: 0 auto;
  padding: 6mm 10mm;
  background-color: var(--bg-color);
}

/* -----------------------------------
   Header & Thông tin liên hệ
------------------------------------ */
h1 {
  font-size: 21pt;
  font-weight: 700;
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 4px;
  text-align: center;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

h1 + p {
  text-align: center;
  margin-top: 0;
  font-size: 10.5pt;
  margin-bottom: 2px;
}

h1 + p strong {
  color: var(--primary-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

h1 + p + p {
  text-align: center;
  color: var(--text-muted);
  font-size: 8.5pt;
  margin-bottom: 4px;
}

hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 8px 0;
}

h1 + p + p + hr {
  display: none;
}

/* -----------------------------------
   Headings 
------------------------------------ */
h2 {
  font-size: 11pt;
  color: var(--primary-color);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 2px;
  margin-top: 8px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  position: relative;
}

h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 60px;
  height: 2px;
  background-color: var(--primary-color);
}

h3 {
  font-size: 10pt;
  color: var(--primary-color);
  margin-top: 8px;
  margin-bottom: 2px;
  font-weight: 700;
}

h4 {
  font-size: 9pt;
  color: var(--text-main);
  margin-top: 6px;
  margin-bottom: 2px;
  font-weight: 600;
  font-style: italic;
}

/* -----------------------------------
   Typography & Căn chỉnh
------------------------------------ */
p {
  margin: 3px 0; 
  text-align: justify;
}

ul {
  padding-left: 16px;
  margin: 3px 0 4px 0; 
}

li {
  margin-bottom: 2.5px;
  text-align: justify; 
}

strong {
  color: var(--primary-color);
  font-weight: 600;
}

blockquote {
  border-left: 3px solid var(--primary-color);
  padding: 4px 8px;
  margin: 6px 0;
  background: var(--bg-muted);
  border-radius: 0 4px 4px 0;
  font-size: 8.5pt;
  color: var(--text-muted);
}

blockquote p {
  margin: 0;
  font-style: italic;
}

/* -----------------------------------
   Bảng biểu (Table)
------------------------------------ */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 8.5pt;
  border: 1px solid var(--border-color);
}

th, td {
  padding: 6px 8px; 
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  line-height: 1.3;
}

th {
  background-color: var(--bg-muted);
  color: var(--primary-color);
  font-weight: 700;
}

tr:nth-child(even) {
  background-color: #fdfdfd;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

/* -----------------------------------
   Page Break Class
------------------------------------ */
.page-break {
  page-break-before: always;
  break-before: always;
}

/* -----------------------------------
   Tối ưu hóa khi In / Xuất PDF
------------------------------------ */
@media print {
  body {
    padding: 0;
    max-width: 100%;
    margin: 0;
    color: #000;
  }
  
  @page {
    margin: 6mm 10mm;
  }

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

  tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  a {
    color: #000;
  }
  
  th {
    background-color: #f1f5f9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  blockquote {
    background-color: #f8fafc !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  h2::after {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* -----------------------------------
   APPENDIX COMPACT HACKS
------------------------------------ */
h2:nth-of-type(5) ~ ul {
  margin: 1px 0 2px 0;
}
h2:nth-of-type(5) ~ ul li {
  margin-bottom: 1.5px;
  line-height: 1.25;
}
h2:nth-of-type(5) ~ h3 {
  margin-top: 5px;
  margin-bottom: 1px;
}
h2:nth-of-type(5) ~ h4 {
  margin-top: 3px;
  margin-bottom: 1px;
}
h2:nth-of-type(5) ~ blockquote {
  padding: 2px 6px;
  margin: 3px 0;
}
h2:nth-of-type(5) ~ p {
  margin: 1.5px 0;
}
