/* Dedicated A4 landscape briefing sheet for /planning/YYYY/M/print. */

:root {
  --ink: #151719;
  --ink-soft: #343940;
  --muted: #646b73;
  --quiet: #8c939b;
  --line: #d7dde2;
  --line-soft: #edf0f2;
  --paper: #ffffff;
  --surface: #fbfcfc;
  --surface-raised: #f6f8f9;
  --blue-ink: #185f93;
  --blue-line: #a7cde5;
  --blue-fill: #edf7fb;
  --mep-ink: #5b568f;
  --mep-line: #d3d0e8;
  --mep-fill: #f5f4fb;
  --rest-ink: #5b7850;
  --rest-line: #d5e4ce;
  --rest-fill: #f4f9f1;
  --leave-ink: #557747;
  --leave-line: #caddbd;
  --leave-fill: #eef7e7;
  --sol-ink: #9d4d3b;
  --sol-line: #ebcfc8;
  --sol-fill: #fff3f0;
  --escale-fill: #edf6f6;
  --s-1: 0.8mm;
  --s-2: 1.4mm;
  --s-3: 2.4mm;
  --s-4: 3.2mm;
  --radius: 7px;
}

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

html {
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 10px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
}

@page {
  size: A4 landscape;
  margin: 8mm 9mm;
}

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

.print-sheet {
  display: grid;
  grid-template-rows: 21mm 14mm minmax(0, 1fr) 4.6mm;
  row-gap: 3.2mm;
  width: 279mm;
  min-height: 194mm;
  margin: 0 auto;
  background: var(--paper);
}

.print-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 8mm;
  padding-bottom: 3mm;
  border-bottom: 0.7px solid var(--line);
}

.print-identity {
  position: relative;
  min-width: 0;
  padding-top: 2.4mm;
}

.print-identity::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 22mm;
  height: 0.9mm;
  border-radius: 2px;
  background: var(--blue-ink);
}

.print-kicker {
  color: var(--quiet);
  font-size: 6.6px;
  font-weight: 760;
  line-height: 1;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.print-pilot-name {
  margin-top: 1.8mm;
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
  line-height: 1.05;
  letter-spacing: 0;
}

.print-pilot-subtitle {
  margin-top: 0.9mm;
  color: var(--muted);
  font-size: 7.7px;
  font-weight: 560;
  line-height: 1.18;
  letter-spacing: 0;
}

.print-month-label {
  justify-self: center;
  color: var(--ink);
  width: max-content;
  font-size: 34px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0.05em;
  padding-inline: 1mm;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.print-header-note {
  display: grid;
  justify-self: end;
  justify-items: end;
  gap: 1mm;
  color: var(--quiet);
  font-size: 7px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.print-header-note span:first-child {
  color: var(--muted);
  font-weight: 760;
}

.print-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1.8mm;
  padding: 1.2mm 0;
  border-top: 0.5px solid var(--line-soft);
  border-bottom: 0.5px solid var(--line-soft);
}

.print-metric {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 2mm;
  min-height: 11.6mm;
  padding: 1.55mm 2.2mm 1.65mm;
  border: 0.5px solid #dfe5e9;
  border-left: 1.3mm solid var(--blue-ink);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-raised) 100%);
}

.print-metric-value {
  color: var(--ink);
  font-size: 18.4px;
  font-weight: 880;
  line-height: 0.95;
  letter-spacing: 0;
}

.print-metric-label {
  color: var(--muted);
  font-size: 6.35px;
  font-weight: 720;
  line-height: 1.05;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.print-calendar {
  min-height: 0;
}

.print-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  height: 4.8mm;
  color: var(--ink);
  font-size: 7.6px;
  font-weight: 820;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.print-section-title span {
  color: var(--quiet);
  font-size: 6.8px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.print-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1.25mm;
  height: calc(100% - 4.8mm);
}

.print-month-grid.weeks-5 {
  grid-template-rows: 4.8mm repeat(5, minmax(25.4mm, 1fr));
}

.print-month-grid.weeks-6 {
  grid-template-rows: 4.8mm repeat(6, minmax(20.6mm, 1fr));
}

.print-weekday {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 7px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.045em;
}

.print-cal-cell {
  position: relative;
  display: grid;
  grid-template-rows: 4.8mm minmax(0, 1fr) 5.55mm;
  min-width: 0;
  min-height: 0;
  padding: 1.35mm 1.55mm 1.3mm;
  border: 0.65px solid #dde4e9;
  border-radius: var(--radius);
  background: #ffffff;
  overflow: hidden;
  break-inside: avoid;
  page-break-inside: avoid;
}

.print-cal-cell::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1.05mm;
  background: transparent;
}

.print-cal-cell.is-placeholder {
  border-color: transparent;
  background: transparent;
}

.print-cal-cell.is-placeholder::before {
  content: none;
}

.print-cal-cell.type-vol,
.print-cal-cell.type-vol_mep,
.print-cal-cell.type-suite_vol,
.print-cal-cell.type-arrivee_j1 {
  border-color: var(--blue-line);
  background: var(--blue-fill);
}

.print-cal-cell.type-vol::before,
.print-cal-cell.type-vol_mep::before,
.print-cal-cell.type-suite_vol::before,
.print-cal-cell.type-arrivee_j1::before,
.print-cal-cell.type-escale::before {
  background: var(--blue-ink);
}

.print-cal-cell.type-mep_pure {
  border-color: var(--mep-line);
  background: var(--mep-fill);
}

.print-cal-cell.type-mep_pure::before {
  background: var(--mep-ink);
}

.print-cal-cell.type-repos {
  border-color: var(--rest-line);
  background: var(--rest-fill);
}

.print-cal-cell.type-repos::before {
  background: rgba(79, 116, 68, 0.38);
}

.print-cal-cell.type-conge {
  border-color: var(--leave-line);
  background: var(--leave-fill);
}

.print-cal-cell.type-conge::before {
  background: rgba(70, 111, 57, 0.46);
}

.print-cal-cell.type-sol,
.print-cal-cell.type-suite_sol {
  border-color: var(--sol-line);
  background: var(--sol-fill);
}

.print-cal-cell.type-sol::before,
.print-cal-cell.type-suite_sol::before {
  background: var(--sol-ink);
}

.print-cal-cell.type-escale {
  border-color: #c4dde2;
  background: var(--escale-fill);
}

.print-cal-cell.rotation-start,
.print-cal-cell.rotation-middle,
.print-cal-cell.rotation-end {
  box-shadow: inset 0 -0.8mm 0 rgba(24, 95, 147, 0.11);
}

.print-cal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1mm;
  min-width: 0;
  padding-top: 0.7mm;
}

.print-cal-day {
  color: var(--ink);
  font-size: 9.2px;
  font-weight: 850;
  line-height: 1;
}

.print-cal-badge {
  max-width: 17mm;
  min-height: 3.7mm;
  padding: 0.48mm 1.2mm 0.52mm;
  border: 0.45px solid rgba(21, 23, 25, 0.13);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink-soft);
  font-size: 6.05px;
  font-weight: 800;
  line-height: 1.08;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.print-cal-top .print-layover-marker {
  display: inline-flex;
  flex: 0 0 15px;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-left: auto;
  border: 0.35px solid rgba(24, 95, 147, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  color: var(--blue-ink);
  box-sizing: border-box;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 6.95px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.92;
}

.print-cal-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: end;
  align-items: stretch;
  padding-bottom: 0.45mm;
  text-align: left;
}

.print-cal-primary,
.print-cal-secondary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0;
}

.print-cal-primary {
  color: var(--muted);
  font-size: 6.4px;
  font-weight: 620;
  line-height: 1;
  opacity: 0.8;
}

.print-cal-secondary {
  align-self: stretch;
  color: var(--ink);
  font-size: 11.75px;
  font-weight: 930;
  line-height: 0.98;
  text-align: left;
  word-spacing: -0.35px;
}

.print-cal-cell.type-repos,
.print-cal-cell.type-conge {
  color: var(--rest-ink);
}

.print-cal-cell.type-repos .print-cal-body,
.print-cal-cell.type-conge .print-cal-body {
  grid-row: 2 / 4;
  justify-content: center;
  padding-bottom: 0;
  text-align: center;
}

.print-cal-cell.type-repos .print-cal-primary,
.print-cal-cell.type-conge .print-cal-primary {
  color: var(--rest-ink);
  font-size: 8.05px;
  font-weight: 720;
  line-height: 1;
  opacity: 0.68;
}

.print-cal-cell.type-conge .print-cal-primary {
  color: var(--leave-ink);
}

.print-cal-cell.type-sol .print-cal-primary,
.print-cal-cell.type-suite_sol .print-cal-primary,
.print-cal-cell.type-escale .print-cal-primary,
.print-cal-cell.type-arrivee_j1 .print-cal-primary {
  color: var(--ink-soft);
  font-size: 7.1px;
  font-weight: 780;
  line-height: 1.05;
}

.print-cal-cell.type-sol .print-cal-secondary,
.print-cal-cell.type-suite_sol .print-cal-secondary,
.print-cal-cell.type-escale .print-cal-secondary,
.print-cal-cell.type-arrivee_j1 .print-cal-secondary {
  color: var(--ink);
  font-size: 8.65px;
  font-weight: 760;
}

.print-month-grid.weeks-6 .print-cal-cell {
  grid-template-rows: 4.4mm minmax(0, 1fr) 5.05mm;
  padding: 1.15mm 1.35mm 1.1mm;
}

.print-month-grid.weeks-6 .print-cal-day {
  font-size: 8.6px;
}

.print-month-grid.weeks-6 .print-cal-primary {
  font-size: 6.1px;
}

.print-month-grid.weeks-6 .print-cal-secondary {
  font-size: 10.8px;
}

.print-month-grid.weeks-6 .print-cal-cell.type-repos .print-cal-primary,
.print-month-grid.weeks-6 .print-cal-cell.type-conge .print-cal-primary {
  font-size: 7.5px;
}

.print-month-grid.weeks-6 .print-cal-badge {
  max-width: 15.5mm;
  min-height: 3.45mm;
  font-size: 5.65px;
}

.print-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 5mm;
  border-top: 0.5px solid var(--line-soft);
  color: var(--quiet);
  font-size: 6.2px;
  font-weight: 560;
  line-height: 1;
}

@media screen {
  body {
    padding: 16px;
    background: #f3f4f6;
  }

  .print-sheet {
    min-height: 194mm;
    padding: 8mm 9mm;
    border: 1px solid var(--line);
    box-shadow: 0 18px 42px rgba(25, 28, 33, 0.12);
  }
}
