:root {
  --teal: #347b72;
  --gold: #d4bb78;
  --line: #dfe8e4;
  --muted: #63766f;
  --pale: #edf5f1;
  --canvas: #f3f6f4;
}

body { background: var(--canvas); color: #1f3940; }
.topbar { box-shadow: 0 4px 18px rgb(18 50 74 / 12%); }
main { margin-top: 24px; }
.hero {
  background: linear-gradient(118deg, #183d52 0%, #28625f 100%);
  box-shadow: 0 14px 34px rgb(28 66 72 / 12%);
  border-radius: 20px;
  padding: clamp(22px, 3vw, 34px);
}
.panel, .subpanel {
  border-color: #e1e9e6;
  border-radius: 17px;
  box-shadow: 0 7px 24px rgb(24 54 59 / 4%);
}
.panel { padding: clamp(16px, 2vw, 24px); }
.section-head { margin-bottom: 19px; }
.panel > .section-head > div:first-child,
.subpanel > .section-head > div:first-child {
  border-inline-start: 3px solid #a8c9bd;
  padding-inline-start: 12px;
}
.section-head h2 { font-size: clamp(20px, 2vw, 25px); line-height: 1.35; }
.section-head h3 { font-size: 17px; line-height: 1.45; }
.section-head p, .muted { line-height: 1.7; }
.summary > div {
  min-height: 78px;
  display: grid;
  align-content: center;
  border-color: #e2ebe7;
  border-radius: 14px;
  background: linear-gradient(160deg, #fff, #f8fbf9);
  box-shadow: 0 3px 12px rgb(33 69 70 / 3%);
}
.summary b { font-variant-numeric: tabular-nums; }
.board-card {
  border: 1px solid #e0e9e5;
  border-inline-start: 4px solid var(--teal);
  border-radius: 15px;
  padding: 16px;
  background: linear-gradient(160deg, #fff, #fbfcfb);
  box-shadow: 0 4px 15px rgb(31 65 63 / 4%);
  transition: box-shadow .18s ease, transform .18s ease;
}
.board-card:hover { box-shadow: 0 9px 22px rgb(31 65 63 / 8%); transform: translateY(-2px); }
.board-occupied { border-inline-start-color: #c08a48; }
.board-check-in-today { border-inline-start-color: #6383ae; }
.board-check-out-today { border-inline-start-color: #8274a7; }
.board-upcoming { border-inline-start-color: #6d987b; }
.board-maintenance { border-inline-start-color: #b86a67; }
.board-title { gap: 12px; }
.board-title h3 { line-height: 1.5; }
.board-title b {
  min-width: 36px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf5f1;
  color: #347b72;
  font-size: 19px;
  text-align: center;
}
.board-card li { line-height: 1.65; }
.search-card { border-color: #e0eae6; background: #f8fbf9; border-radius: 15px; }
.tab { border-radius: 999px; }
.tab.active { box-shadow: 0 3px 10px rgb(52 123 114 / 16%); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgb(52 123 114 / 28%);
  outline-offset: 2px;
}
.customer-contact-card { margin-top: 18px; background: #fbfdfc; }
.customer-contact-controls { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 9px; }
.customer-contact-controls label { min-width: 175px; }
.customer-contact-table { min-width: 0; }
.customer-contact-table th, .customer-contact-table td { padding: 13px 14px; }
.customer-contact-table th { background: #edf5f1; }
.international-phone { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; white-space: nowrap; }
.customer-contacts-print-heading { display: none; }

.commission-choice { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line, #dbe4df); border-radius: 14px; background: #f8faf8; }
.commission-choice legend { padding-inline: 8px; color: var(--ink, #24372f); font-weight: 700; }
.commission-options { display: grid; grid-template-columns: repeat(5, minmax(54px, 1fr)); gap: 8px; }
.commission-option { position: relative; display: block; cursor: pointer; }
.commission-option input { position: absolute; opacity: 0; inset-inline-start: 10px; top: 12px; }
.commission-option span { display: grid; min-height: 42px; place-items: center; border: 1px solid var(--line, #dbe4df); border-radius: 10px; background: #fff; color: var(--ink, #24372f); font-weight: 700; }
.commission-option input:checked + span { border-color: #537f68; background: #e8f1eb; box-shadow: inset 0 0 0 1px #537f68; }
.commission-option input:focus-visible + span { outline: 3px solid #b8d2c2; outline-offset: 2px; }
.commission-choice small { display: block; margin-top: 10px; color: #56655d; line-height: 1.7; }
.marketing-report-card { padding: 20px; }
.marketing-print-heading { margin-bottom: 18px; text-align: right; }
.marketing-print-heading h2 { margin: 0 0 6px; }
.marketing-print-heading p { margin: 0; color: #56655d; }
.marketing-report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.marketing-report-grid > section { min-width: 0; padding: 16px; border: 1px solid var(--line, #dbe4df); border-radius: 14px; background: #fff; }
.marketing-report-grid h3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 12px; }
.marketing-report-grid h3 b { display: inline-grid; min-width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #edf5f1; font-size: .9em; }
.marketing-unit-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.marketing-unit-list li { display: flex; justify-content: space-between; align-items: start; gap: 10px; padding: 8px 0; border-bottom: 1px solid #edf1ee; }
.marketing-unit-list li:last-child { border-bottom: 0; }
.marketing-unit-list small { white-space: nowrap; color: #56655d; }
.marketing-report-tools .daily-report-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; }

@media (max-width: 650px) {
  main { margin-top: 15px; padding-inline: 13px; }
  .hero { border-radius: 17px; }
  .board-card { min-height: 0; }
  .board-card ul { max-height: 180px; }
  .customer-contact-controls { align-items: stretch; flex-direction: column; width: 100%; }
  .customer-contact-controls label, .customer-contact-controls button { width: 100%; }
  .customer-contact-card { padding: 15px; }
  .commission-options { grid-template-columns: repeat(3, minmax(54px, 1fr)); }
  .marketing-report-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@page { size: A4 portrait; margin: 14mm; }
#unitsList .compact-actions select { max-width: 145px; min-height: 38px; font-size: 13px; }
#unitsList .compact-actions { justify-content: flex-start; }
.permission-fieldset { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #f8fbf9; }
.permission-fieldset legend { padding: 0 8px; font-weight: 700; color: #214e4c; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 14px; }
.permission-grid label { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.55; }
.permission-grid input { margin-top: 3px; flex: none; accent-color: var(--teal); }
.permission-fieldset small { display: block; margin-top: 10px; color: var(--muted); line-height: 1.6; }
.user-permission-row { display: grid; gap: 12px; align-items: start; }
.permission-editor { margin-top: 10px; }
.user-permission-row .compact-actions { align-self: start; }
@media (max-width: 650px) {
  #unitsList .compact-row { align-items: flex-start; }
  #unitsList .compact-actions { width: 100%; }
  .permission-grid { grid-template-columns: 1fr; }
}
.booking-dialog { width: min(100% - 24px, 980px); padding: 0; overflow: hidden; background: #f4f7f5; }
.booking-dialog form { max-height: 92vh; overflow-y: auto; padding: clamp(16px, 3vw, 28px); }
.booking-dialog-head { position: sticky; top: calc(-1 * clamp(16px, 3vw, 28px)); z-index: 4; margin: calc(-1 * clamp(16px, 3vw, 28px)) calc(-1 * clamp(16px, 3vw, 28px)) 18px; padding: 22px clamp(16px, 3vw, 28px) 17px; background: linear-gradient(120deg, #12324a, #1e5967); color: #fff; box-shadow: 0 7px 18px #0d2b3a24; }
.booking-dialog-head p { color: #dbe8e9; }
.booking-kicker { display: block; margin-bottom: 4px; color: #d5a941; font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.booking-dialog-head .icon { color: #fff; }
.booking-step { margin: 0 0 14px; padding: clamp(15px, 2vw, 21px); border: 1px solid #dce6e2; border-radius: 16px; background: #fff; box-shadow: 0 8px 24px #183b2d0a; }
.booking-step-title { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.booking-step-title > span { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 50%; background: #e3f2ef; color: #116c68; font-weight: 800; }
.booking-step-title h3, .booking-summary h3 { margin: 0; font-size: 17px; color: #173b43; }
.booking-step-title p { margin: 3px 0 0; color: #687a73; font-size: 13px; }
.booking-fields { margin-bottom: 0; }
.field-required, .field-optional, .field-conditional { display: inline-flex; width: fit-content; margin-inline-start: 5px; padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.field-required { background: #fde9e4; color: #9c3d2e; }
.field-optional { background: #edf1ef; color: #607068; }
.field-conditional { background: #fff3d6; color: #765819; }
.pricing-mode-choice { margin: 0; padding: 0; border: 0; }
.pricing-mode-choice legend { margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.pricing-mode-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pricing-mode-options label { cursor: pointer; }
.pricing-mode-options input { position: absolute; opacity: 0; pointer-events: none; }
.pricing-mode-options label > span { display: grid; gap: 4px; min-height: 72px; padding: 13px 14px; border: 1px solid #ccd9d4; border-radius: 13px; background: #fafcfb; transition: border-color .15s, background .15s, box-shadow .15s; }
.pricing-mode-options label > span small { color: #65766e; font-weight: 400; }
.pricing-mode-options input:checked + span { border-color: #168a83; background: #eaf6f3; box-shadow: inset 0 0 0 1px #168a83; }
.pricing-mode-options input:focus-visible + span { outline: 3px solid #168a8340; }
.booking-summary { margin: 15px 0; padding: clamp(16px, 2vw, 22px); border: 1px solid #bcd8d1; border-radius: 17px; background: linear-gradient(135deg, #f8fcfb, #edf6f3); }
.booking-summary-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.summary-pill { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: #173f4b; color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; }
.booking-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.booking-summary-grid > div { display: grid; gap: 5px; min-width: 0; padding: 11px 12px; border: 1px solid #d5e5e0; border-radius: 11px; background: #fff; }
.booking-summary-grid span { color: #687970; font-size: 11px; }
.booking-summary-grid b { overflow-wrap: anywhere; color: #173f4b; font-size: 14px; }
.booking-summary-grid > div:nth-child(4) b, .booking-summary-grid > div:nth-child(6) b { color: #0d746d; font-size: 17px; }
.booking-dialog input:invalid:not(:placeholder-shown), .booking-dialog select:invalid { border-color: #c96555; background: #fffafa; }
.booking-dialog .form-error:not(:empty) { padding: 9px 11px; border-radius: 9px; background: #fff0ed; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 800px) {
  .booking-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .booking-dialog { width: 100%; max-width: none; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .booking-dialog form { max-height: 100dvh; padding: 14px; }
  .booking-dialog-head { top: -14px; margin: -14px -14px 14px; padding: 18px 14px 14px; }
  .booking-step { padding: 14px; border-radius: 13px; }
  .pricing-mode-options { grid-template-columns: 1fr; }
  .booking-summary-head { align-items: stretch; flex-direction: column; }
  .summary-pill { align-self: flex-start; }
  .booking-summary-grid { grid-template-columns: 1fr; }
  .booking-dialog .actions { position: sticky; bottom: -14px; z-index: 3; margin: 14px -14px -14px; padding: 12px 14px; background: #fff; box-shadow: 0 -7px 18px #17313f1a; }
  .booking-dialog .actions button { flex: 1; }
}

@media print {
  body.printing-marketing-report { background: #fff !important; color: #111 !important; font-size: 11pt; }
  body.printing-marketing-report #demoBanner,
  body.printing-marketing-report header,
  body.printing-marketing-report footer,
  body.printing-marketing-report main > :not(#marketingReportPanel),
  body.printing-marketing-report #marketingReportPanel > :not(#marketingReportPrintArea) { display: none !important; }
  body.printing-marketing-report main { max-width: none !important; margin: 0 !important; padding: 0 !important; }
  body.printing-marketing-report #marketingReportPanel,
  body.printing-marketing-report #marketingReportPrintArea { display: block !important; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: #fff !important; }
  body.printing-marketing-report .marketing-print-heading { margin-bottom: 15px; text-align: right; }
  body.printing-marketing-report .marketing-report-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  body.printing-marketing-report .marketing-report-grid > section { padding: 10px; border: 1px solid #cfd6d3; border-radius: 0; break-inside: avoid; }
  body.printing-marketing-report .marketing-unit-list li { padding: 5px 0; border-color: #e2e6e3; }
  body.printing-marketing-report .unit-code { unicode-bidi: isolate; direction: ltr; }
  body.printing-customer-contacts { background: #fff !important; color: #111 !important; font-size: 12pt; }
  body.printing-customer-contacts #demoBanner,
  body.printing-customer-contacts header,
  body.printing-customer-contacts footer,
  body.printing-customer-contacts main > :not(#customerContactsPanel),
  body.printing-customer-contacts #customerContactsPanel > :not(#customerContactsCard),
  body.printing-customer-contacts #customerContactsCard > .customer-contacts-tools { display: none !important; }
  body.printing-customer-contacts main { max-width: none !important; margin: 0 !important; padding: 0 !important; }
  body.printing-customer-contacts #customerContactsPanel,
  body.printing-customer-contacts #customerContactsCard { display: block !important; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: #fff !important; }
  body.printing-customer-contacts .customer-contacts-print-heading { display: block; margin-bottom: 18px; text-align: right; }
  body.printing-customer-contacts .customer-contacts-print-heading h2 { margin: 0 0 6px; font-size: 17pt; }
  body.printing-customer-contacts .customer-contacts-print-heading p { margin: 0; color: #333; }
  body.printing-customer-contacts .customer-contact-table-wrap { overflow: visible; border: 0; }
  body.printing-customer-contacts .customer-contact-table { width: 100%; min-width: 0; border: 1px solid #cfd6d3; }
  body.printing-customer-contacts .customer-contact-table th,
  body.printing-customer-contacts .customer-contact-table td { padding: 10px 12px; border-bottom: 1px solid #d8dfdc; }
  body.printing-customer-contacts .customer-contact-table th { position: static; color: #111; background: #eef2ef !important; }
}
