/* The free leave request template (Wzór wniosku urlopowego): a form, the request as a
   sheet of paper, a table of the six kinds. Colours are the tokens of variables.css.
   Printing shows the sheet and nothing else. */

.wn { padding-block: 8px clamp(48px, 7vw, 88px); display: grid; gap: clamp(28px, 4vw, 48px); }
.wn__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 28px clamp(24px, 3.4vw, 44px); align-items: start; }
.wn-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: clamp(18px, 2.6vw, 28px); box-shadow: var(--shadow); display: grid; gap: 18px; min-width: 0; align-content: start; }
.wn-card h2, .wn-preview h2 { font-size: clamp(22px, 2.4vw, 28px); }
.wn-hint { font-size: 14px; font-weight: 400; line-height: 1.5; color: var(--ink-2); max-width: 66ch; }

/* --- the form -------------------------------------------------------------- */
.wn-fields { display: grid; gap: 14px; }
.wn-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.wn .field input { min-width: 0; }
.wn .field select { width: 100%; min-width: 0; min-height: 50px; padding: 12px 14px; border: 2px solid var(--line-strong); border-radius: 14px; background: var(--bg); font: 500 16px/1.2 var(--text); color: var(--ink); }
.wn .field select:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 4px rgba(var(--teal-rgb), .18); }
.wn-hoursbox { display: grid; gap: 12px; }
.wn-check { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; cursor: pointer; }
.wn-check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--teal-btn); }
.wn-js { display: none; }
.js .wn-js { display: inline-flex; }
.wn-dl { display: grid; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.wn-dl__title { font-size: 15px; font-weight: 700; }

/* --- the count of working days ---------------------------------------------- */
.wn-sum { display: grid; gap: 10px; padding: 14px 18px; border-radius: 16px; background: var(--teal-bg); }
.wn-sum__main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.wn-sum__num { font-size: clamp(36px, 4vw, 46px); font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: var(--deep); }
.wn-sum__label { font-size: 16px; font-weight: 700; color: var(--ink); }
.wn-sum__list { display: grid; gap: 4px; margin: 0; font-size: 14.5px; line-height: 1.45; }
.wn-sum__list:empty, .wn-notes:empty { display: none; }
.wn-sum__row { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr); gap: 4px 12px; }
.wn-sum__row dt { font-weight: 700; color: var(--ink-2); }
.wn-sum__row dd { margin: 0; color: var(--ink); }
.wn-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wn-warn { padding: 10px 14px; border-radius: 12px; background: var(--amber-bg); font-size: 14.5px; line-height: 1.45; color: var(--ink); }

/* --- the request as a sheet of paper ------------------------------------------ */
.wn-preview { display: grid; gap: 14px; min-width: 0; }
.wn-preview__head { display: grid; gap: 4px; }
.wn-sheet { display: grid; gap: 18px; align-content: start; min-height: 540px; padding: clamp(22px, 4vw, 40px) clamp(20px, 5vw, 52px); border: 1px solid var(--line); border-radius: 8px; background: var(--white); box-shadow: var(--shadow); color: var(--ink); font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.wn-sheet p { margin: 0; }
.wn-sheet__top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 28px; align-items: start; }
.wn-sheet__who, .wn-sheet__when { display: grid; gap: 2px; min-width: 0; }
.wn-fill { min-height: 1.7em; padding: 0 2px 1px; border-bottom: 1px dotted var(--ink-3); }
.wn-fill--end { text-align: right; }
.wn-cap { margin-bottom: 8px; font-size: 12px; line-height: 1.3; color: var(--ink-3); text-align: center; }
.wn-sheet__title { margin-top: 10px; font-size: 1.05em; font-weight: 800; letter-spacing: .05em; text-align: center; text-transform: uppercase; }
.wn-sheet__body { line-height: 1.8; }
.wn-row { display: flex; align-items: flex-end; gap: 8px; }
.wn-fill--grow { flex: 1; min-width: 0; }
.wn-sign { justify-self: end; width: min(48%, 260px); margin-top: 14px; text-align: center; }
.wn-sign__line { display: block; height: 2.4em; border-bottom: 1px dotted var(--ink-3); }
.wn-decision { display: grid; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.wn-decision__h { font-weight: 700; }
.wn-decision__boxes { display: flex; flex-wrap: wrap; gap: 6px 32px; }
.wn-box { display: inline-block; width: 15px; height: 15px; margin-right: 8px; border: 1.5px solid var(--ink); border-radius: 3px; vertical-align: -2px; }
.wn-sheet__hr { padding-top: 12px; border-top: 1px dashed var(--line-strong); font-size: 13px; line-height: 1.5; color: var(--ink-2); }

/* --- the six kinds in a table --------------------------------------------------- */
.wn-types .wn-card { gap: 14px; }
.wn-tablewrap { overflow-x: auto; }
.wn-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.wn-table th, .wn-table td { padding: 14px 18px 14px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.wn-table thead th { padding-top: 0; border-top: 0; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.wn-table tbody th { width: 17%; font-weight: 800; }
.wn-table td { color: var(--ink-2); }

@media (min-width: 961px) and (min-height: 840px) {
  .wn-preview { position: sticky; top: calc(var(--top-h) + 16px); }
}
@media (max-width: 960px) {
  .wn__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .wn-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .wn-table, .wn-table tbody, .wn-table tr, .wn-table th, .wn-table td { display: block; }
  .wn-table tr { padding: 14px 0; border-top: 1px solid var(--line); }
  .wn-table th, .wn-table td { padding: 2px 0; border: 0; }
  .wn-table tbody th { width: auto; font-size: 17px; }
  .wn-table td { margin-top: 6px; }
  .wn-table td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
}
@media (max-width: 520px) {
  .wn-pair { grid-template-columns: minmax(0, 1fr); }
  .wn-sum__row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .wn-sheet { font-size: 14px; }
  .wn-sheet__top { grid-template-columns: minmax(0, 1fr); }
  .wn-sign { width: min(70%, 260px); }
}

/* --- print: the sheet alone, on A4 ------------------------------------------------ */
@media print {
  @page { size: A4 portrait; margin: 20mm; }
  html, body { background: var(--white); }
  body > :not(main) { display: none !important; }
  main > :not(.wn) { display: none !important; }
  .wn { display: block; padding: 0; }
  .wn .wrap { max-width: none; padding: 0; }
  .wn__grid { display: block; }
  .wn-form, .wn-preview__head, .wn-types { display: none !important; }
  .wn-sheet { min-height: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; font-size: 12pt; break-inside: avoid; }
}
