:root {
  --placeholder: #147eb3;
}

* { box-sizing: border-box; }
body { margin: 0; padding: 24px; background: var(--surface); font-size: 11px; line-height: 16px; }
.booking-sheet { width: 100%; margin: 0 auto; padding: 32px; flex: 1; background: var(--surface-low); }
.booking-header { position: relative; min-height: 92px; background: #fff; }
.recipient-grid { display: grid; grid-template-columns: 145px 55px 1fr; gap: 4px 5px; padding: 5px; font-weight: 700; }
.booking-logo { position: absolute; top: -5px; right: 7px; width: 188px; height: 87px; object-fit: contain; }
h1 { width: fit-content; margin: 0 0 24px; padding: 8px 18px; border: 0; border-left: 4px solid var(--gold); border-radius: 4px; color: #fff; background: var(--primary); box-shadow: var(--shadow-1); font-size: 24px; line-height: 32px; text-align: left; }
.booking-success { margin: 0 0 24px; padding: 14px 18px; border: 1px solid #86c99a; border-radius: 6px; color: #14532d; background: #dcfce7; font-size: 14px; font-weight: 600; text-align: center; }
.booking-success[hidden] { display: none; }
.booking-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 24px; }
.booking-column { position: relative; min-width: 0; padding: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-lowest); box-shadow: var(--shadow-1); }
.booking-column::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--primary), var(--gold)); }
.form-section { margin-top: 20px; }
.form-section:first-child { margin-top: 0; }
.form-section h2 { margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--primary); font-size: 18px; line-height: 24px; font-weight: 700; }

.table-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); min-height: 25px; border: 1px solid var(--outline); background: var(--surface-lowest); }
.table-row + .table-row { border-top: 0; }
.form-section .table-row:first-of-type { border-radius: 4px 4px 0 0; }
.form-section .table-row:last-child { border-radius: 0 0 4px 4px; }
.table-row > label { padding: 4px 7px; border-right: 1px solid var(--outline); color: var(--primary); font-weight: 600; }
input, textarea { width: 100%; min-width: 0; padding: 4px 7px; border: 0; border-radius: 0; color: var(--on-surface); background: var(--surface-lowest); font: 11px/16px Inter, Arial, sans-serif; outline: 0; transition: background-color 160ms ease, box-shadow 160ms ease; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--placeholder); opacity: 1; }
input:hover, textarea:hover { background: var(--surface-low); }
input:focus-visible, textarea:focus-visible { position: relative; z-index: 2; background: #fff; box-shadow: inset 0 0 0 2px var(--primary); }

.address-row { min-height: 76px; }
.address-fields { display: grid; grid-template-rows: 50px 25px; }
.address-fields textarea { height: 50px; resize: none; border-bottom: 1px solid var(--outline); }
.address-fields > div { display: grid; grid-template-columns: 1fr 1fr; }
.address-fields > div input + input { border-left: 1px solid var(--outline); }

.paired-row { grid-template-columns: 140px minmax(0, 1fr) 84px 140px; }
.paired-row > input:first-of-type { border-right: 1px solid var(--outline); }
.paired-row > label:nth-of-type(2) { border-right: 1px solid var(--outline); }
.sector-row > label { display: flex; justify-content: space-between; padding-right: 30px; }
.sector-row > div { display: grid; grid-template-columns: repeat(3, 1fr); }
.sector-row > div > * + * { border-left: 1px solid var(--outline); }
.date-time-row > div { display: grid; grid-template-columns: 1fr 1fr; }
.date-time-row > div > * + * { border-left: 1px solid var(--outline); }
.date-picker-field { position: relative; display: block; min-width: 0; background: var(--surface-lowest); cursor: pointer; }
.date-picker-field .date-display { width: 100%; height: 100%; padding-right: 38px; cursor: pointer; }
.date-picker-field .native-date { position: absolute; width: 1px; height: 1px; padding: 0; opacity: 0; pointer-events: none; }
.date-picker-button { position: absolute; z-index: 3; top: 50%; right: 5px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 3px; color: var(--primary); background: transparent; cursor: pointer; transform: translateY(-50%); }
.date-picker-button::before { content: ""; position: absolute; top: 7px; left: 6px; width: 14px; height: 13px; border: 1.5px solid currentColor; border-radius: 2px; background: linear-gradient(to bottom, currentColor 0 3px, transparent 3px); }
.date-picker-button::after { content: ""; position: absolute; top: 13px; left: 10px; width: 2px; height: 2px; background: currentColor; box-shadow: 4px 0 currentColor, 0 4px currentColor, 4px 4px currentColor; }
.date-picker-button:hover, .date-picker-button:focus-visible { background: var(--surface-low); outline: 1px solid var(--primary); }
.date-picker-field:focus-within { z-index: 2; box-shadow: inset 0 0 0 2px var(--primary); }
.truck-row { min-height: 51px; }
.truck-row > div { display: grid; grid-template-columns: 1fr 1.35fr; grid-template-rows: 25px 25px; }
.truck-row > div input:nth-child(even) { border-left: 1px solid var(--outline); }
.truck-row > div input:nth-child(-n + 2) { border-bottom: 1px solid var(--outline); }
.tall-row { min-height: 50px; }
.tall-row textarea { min-height: 49px; resize: none; }
.booking-actions { display: grid; grid-template-columns: 160px minmax(0, 1fr); align-items: center; gap: 8px 12px; margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-low); font-size: 11px; line-height: 16px; }
.action-button { display: block; padding: 9px 12px; overflow: hidden; border: 1px solid var(--primary); border-radius: 4px; color: #fff; background: var(--primary); font-weight: 600; text-align: center; text-decoration: none; white-space: nowrap; cursor: pointer; box-shadow: var(--shadow-1); transition: color 160ms ease, background-color 160ms ease, transform 160ms ease; }
.action-button:hover, .action-button:focus-visible { color: var(--primary); background: var(--gold); outline: 0; transform: translateY(-1px); }
.file-picker { min-width: 0; display: grid; gap: 7px; color: var(--primary); font-weight: 600; }
.file-picker input { width: 100%; min-width: 0; padding: 5px; border: 1px solid var(--outline-variant); border-radius: 4px; color: var(--on-surface-variant); background: #fff; font: inherit; cursor: pointer; }
.file-picker input::file-selector-button { margin-right: 8px; padding: 7px 10px; border: 1px solid var(--primary); border-radius: 3px; color: #fff; background: var(--primary); font: inherit; font-weight: 600; cursor: pointer; }
.file-picker input:hover::file-selector-button,
.file-picker input:focus-visible::file-selector-button { color: var(--primary); background: var(--gold); }
.file-picker input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.submit-row { display: flex; justify-content: flex-end; margin-top: 24px; }
.booking-submit { min-width: 170px; padding: 12px 24px; border: 1px solid var(--primary); border-radius: 4px; color: #fff; background: var(--primary); font: 600 11px/16px Inter, Arial, sans-serif; cursor: pointer; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14); transition: color 160ms ease, background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
.booking-submit:hover, .booking-submit:focus-visible { color: var(--primary); background: var(--gold); outline: 0; transform: translateY(-1px); box-shadow: 0 7px 16px rgba(15, 23, 42, 0.18); }
.booking-submit.is-loading { display: inline-flex; align-items: center; justify-content: center; gap: 9px; color: #fff; background: var(--primary); cursor: wait; opacity: .82; transform: none; }
.booking-submit.is-loading::before { content: ""; width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: booking-spin .7s linear infinite; }
@keyframes booking-spin { to { transform: rotate(360deg); } }

@media (max-width: 820px) {
  .booking-columns { grid-template-columns: 1fr; gap: 16px; }
  .booking-sheet { padding: 24px 16px; }
}

@media (max-width: 620px) {
  body { padding: 8px; font-size: 11px; line-height: 16px; }
  .table-row, .paired-row, .sector-row, .date-time-row, .truck-row { grid-template-columns: 1fr; }
  .table-row > label { border-right: 0; border-bottom: 1px solid var(--outline); font-weight: 600; }
  .paired-row > input:first-of-type, .paired-row > label:nth-of-type(2) { border-right: 0; border-bottom: 1px solid var(--outline); }
  .sector-row > div { grid-template-columns: 1fr; }
  .sector-row > div > * + *, .date-time-row > div > * + * { border-left: 0; border-top: 1px solid var(--outline); }
  .address-row, .truck-row, .tall-row { min-height: 0; }
  .booking-column { padding: 20px 14px; }
  .booking-actions { grid-template-columns: 1fr; }
  .booking-submit { width: 100%; }
}

@media print {
  @page { size: A4 landscape; margin: 5mm; }
  body { padding: 0; font-size: 12px; line-height: 17px; }
  .booking-sheet { width: 287mm; }
  .booking-columns { gap: 18mm; }
  .booking-column { padding: 4mm; border-color: #777; box-shadow: none; }
  .form-section { break-inside: avoid; }
  .header, .site-footer { display: none; }
  .submit-row { display: none; }
  .page { width: auto; min-height: 0; border: 0; box-shadow: none; }
}
