:root {
  --petrol: #234955;
  --petrol-dark: #1b3842;
  --text: #1a1a1a;
  --muted: #4a4a4a;
  --border: #d0d7de;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #e9ecef;
  color: var(--text);
  font-size: 9.5pt;
  line-height: 1.38;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #111;
  padding: 12px 24px;
  display: flex;
  justify-content: flex-end;
}

.btn-print {
  background: var(--petrol);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-print:hover {
  background: var(--petrol-dark);
}

/* Foglio A4 a schermo */
.a4-page {
  width: 210mm;
  min-height: 297mm;
  background: #ffffff;
  margin: 20px auto;
  padding: 14mm 15mm;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Header CV */
.cv-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.header-left h1 {
  font-size: 20pt;
  font-weight: 700;
  color: var(--petrol);
  line-height: 1.15;
  margin-bottom: 4px;
}

.header-left .subtitle {
  font-size: 9.5pt;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.header-left .contacts {
  font-size: 8.5pt;
  color: var(--muted);
  line-height: 1.45;
}

.header-left .contacts a {
  color: var(--petrol);
  text-decoration: none;
}

.header-center img {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--petrol);
}

.header-right {
  display: flex;
  gap: 12px;
}

.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.qr-box img {
  width: 58px;
  height: 58px;
}

.qr-box span {
  font-size: 7pt;
  font-weight: 700;
  color: var(--petrol);
  letter-spacing: 0.04em;
}

/* Sezioni */
.cv-section {
  margin-bottom: 13px;
}

.cv-section h2 {
  font-size: 10.5pt;
  font-weight: 700;
  color: var(--petrol);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1.5px solid var(--petrol);
  padding-bottom: 2px;
  margin-bottom: 7px;
}

.rich-paragraphs p,
.body-text {
  margin-bottom: 5px;
  text-align: justify;
}

/* Esperienze con colonna data a sinistra */
.exp-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.exp-date {
  font-size: 8.5pt;
  font-weight: 600;
  color: var(--petrol);
  line-height: 1.3;
}

.exp-body h4 {
  font-size: 9.8pt;
  font-weight: 700;
  color: var(--text);
}

.exp-company {
  font-size: 8.8pt;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.exp-bullets {
  padding-left: 14px;
}

.exp-bullets li {
  margin-bottom: 3.5px;
  text-align: justify;
}

/* Griglia competenze */
.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.skill-row {
  display: grid;
  grid-template-columns: 155px 1fr;
  gap: 10px;
}

.skill-cat {
  font-weight: 700;
  color: var(--petrol);
  font-size: 9pt;
}

.skill-desc {
  font-size: 9pt;
}

/* Pagina 2 */
.sub-cat {
  font-size: 9.5pt;
  font-weight: 700;
  color: var(--petrol);
  margin-bottom: 6px;
}

.mt-12 {
  margin-top: 10px;
}

.bottom-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Stampa / Esportazione PDF */
@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  body {
    background: #ffffff;
  }
  .no-print {
    display: none !important;
  }
  .a4-page {
    margin: 0;
    box-shadow: none;
    width: 210mm;
    height: 297mm;
    page-break-after: always;
  }
  .a4-page:last-child {
    page-break-after: auto;
  }
}