/* ── Ubuntu from Google Fonts — loaded via <link> in HTML head ── */

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

:root {
  --blue: #2563eb;
  --blue-soft: rgba(37, 99, 235, 0.08);
  --amber: #f59e0b;
  --green-bg: #d1fae5;
  --green-text: #065f46;
  --red-bg: #ffe4e6;
  --red-text: #9f1239;
  --text: #1e293b;
  --text-mid: #475569;
  --text-muted: #94a3b8;
  --border: #e8ecf2;
  --bg-card: #ffffff;
  --bg-section: #f8fafc;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08), 0 8px 28px rgba(0, 0, 0, 0.06);
  --radius: 10px;
}

body {
  font-family: "Ubuntu", Arial, sans-serif;
  font-size: 13px;
  color: var(--text);
  background: #dde3ec;
  line-height: 1.45;
}

/* ════════════════════════════════
   Page
   ════════════════════════════════ */
.page {
  width: 210mm;
  min-height: 297mm;
  background: var(--bg-section);
  margin: 24px auto;
  padding: 14mm 15mm 12mm;
  display: flex;
  flex-direction: column;
  gap: 10mm;
  box-shadow: 0 6px 40px rgba(0, 0, 0, 0.14);
}

/* ════════════════════════════════
   Page 1 header
   ════════════════════════════════ */
.report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 5mm;
  border-bottom: 2px solid var(--border);
}

.header-brand {
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
}

.header-center {
  text-align: center;
}

.hotel-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.report-period {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-right {
  text-align: right;
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ════════════════════════════════
   Pages 2–3 header — compact
   ════════════════════════════════ */
.page-subheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 3.5mm;
  border-bottom: 1.5px solid var(--border);
}

.subheader-brand {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
}

.subheader-meta {
  font-size: 10px;
  color: var(--text-muted);
}

.subheader-section {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-mid);
}

/* ════════════════════════════════
   Section
   ════════════════════════════════ */
.section {
  display: flex;
  flex-direction: column;
  gap: 3.5mm;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 2mm;
  border-bottom: 1.5px solid var(--border);
}

/* ════════════════════════════════
   KPI Cards
   ════════════════════════════════ */
.kpi-row {
  display: flex;
  gap: 4mm;
}

.kpi-card {
  flex: 1;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 4.5mm 5mm;
}

.kpi-label {
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text-muted);
  margin-bottom: 2mm;
}

.kpi-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 2.5mm;
}

.kpi-delta {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 600;
  margin-bottom: 2mm;
}

.kpi-delta.positive {
  background: var(--green-bg);
  color: var(--green-text);
}
.kpi-delta.negative {
  background: var(--red-bg);
  color: var(--red-text);
}
.kpi-delta.neutral {
  background: var(--border);
  color: var(--text-mid);
}

.kpi-benchmark {
  font-size: 9px;
  color: var(--text-muted);
}

/* ════════════════════════════════
   Chart legend
   ════════════════════════════════ */
.chart-legend {
  display: flex;
  gap: 5mm;
  font-size: 9.5px;
  color: var(--text-muted);
  align-items: center;
}

.legend-swatch {
  display: inline-block;
  width: 11px;
  height: 10px;
  border-radius: 2px;
  margin-right: 3px;
  vertical-align: middle;
}

.legend-swatch.hotel {
  background: var(--blue);
}
.legend-swatch.benchmark {
  background: #cbd5e1;
}
.legend-swatch.season {
  background: var(--blue);
}
.legend-swatch.hist {
  background: transparent;
  border: 1.5px dashed #cbd5e1;
}
.legend-swatch.trends {
  background: var(--blue-soft);
  border: 1.5px solid var(--blue);
}
.legend-swatch.hist-hotel {
  background: transparent;
  border: 1.5px dashed #cbd5e1;
}
.legend-swatch.prev-hotel {
  background: transparent;
  border: 1.5px solid #93c5fd;
}

.chart {
  width: 100%;
  height: auto;
}

/* ════════════════════════════════
   Highlights
   ════════════════════════════════ */
.highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3mm;
}

.highlights li {
  font-size: 11.5px;
  line-height: 1.55;
}

/* ════════════════════════════════
   Ski days — progress bars
   ════════════════════════════════ */
.ski-days-table {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 4mm 5mm;
  display: flex;
  flex-direction: column;
  gap: 2.5mm;
}

.ski-days-row {
  display: flex;
  align-items: center;
  gap: 3mm;
  font-size: 10.5px;
}

.ski-days-month {
  width: 22mm;
  color: var(--text-mid);
  flex-shrink: 0;
}

.ski-days-bar-wrap {
  flex: 1;
  height: 8px;
  background: #f1f5f9;
  border-radius: 99px;
  overflow: hidden;
}

.ski-days-bar-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 99px;
}

.ski-days-count {
  width: 18mm;
  text-align: right;
  color: var(--text-muted);
  font-size: 10px;
  flex-shrink: 0;
}

.ski-days-note {
  font-size: 8.5px;
  color: var(--text-muted);
  margin-top: 1mm;
  padding-top: 2mm;
  border-top: 1px solid var(--border);
}

/* ════════════════════════════════
   Events table
   ════════════════════════════════ */
.events-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.events-table th {
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 700;
  text-align: left;
  padding: 3mm 4mm 2.5mm;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.events-table td {
  padding: 2mm 4mm;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: var(--text-mid);
}

.events-table tr:first-child td {
  color: var(--text);
}
.events-table tr:last-child td {
  border-bottom: none;
}

.impact-badge {
  display: inline-block;
  padding: 1.5px 7px;
  border-radius: 99px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.impact-badge.molto-alto {
  background: #fef2f2;
  color: #991b1b;
}
.impact-badge.alto {
  background: #fffbeb;
  color: #92400e;
}
.impact-badge.medio {
  background: #eff6ff;
  color: #1d4ed8;
}
.impact-badge.basso {
  background: #f8fafc;
  color: var(--text-muted);
}

/* ════════════════════════════════
   STR snapshot
   ════════════════════════════════ */
.str-row {
  display: flex;
  gap: 4mm;
}

.str-card {
  flex: 1;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 3.5mm 4mm;
  text-align: center;
}

.str-card-label {
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 1.5mm;
}

.str-card-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.str-card-sub {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 1mm;
}

/* ════════════════════════════════
   Footer
   ════════════════════════════════ */
.report-footer {
  margin-top: auto;
  padding-top: 3mm;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8px;
  color: var(--text-muted);
}

.footer-brand {
  font-weight: 700;
  color: var(--text-mid);
}

/* ════════════════════════════════
   Print
   ════════════════════════════════ */
@media print {
  body {
    background: white;
  }

  .page {
    margin: 0;
    padding: 14mm 15mm 6mm;
    box-shadow: none;
    width: 210mm;
    height: 297mm;
    page-break-after: always;
    background: white;
    position: relative;
  }

  .page:last-child {
    page-break-after: avoid;
  }

  .report-footer {
    position: absolute;
    bottom: 6mm;
    left: 15mm;
    right: 15mm;
    margin-top: 0;
  }

  @page {
    size: A4;
    margin: 0;
  }
}
