.form-page {
  max-width: 980px;
  margin: 0 auto;
}

.form-page-head {
  display: flex;
  align-items: flex-start;
  gap: 17px;
  margin-bottom: 20px;
  padding: 26px 29px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--forest), #245d4f);
  color: #fff;
  box-shadow: var(--shadow);
}

.form-page-head h2 {
  margin: 0;
  font: 600 clamp(28px, 4vw, 38px) Georgia;
}

.form-page-head p:last-child {
  margin: 8px 0 0;
  color: #c4d8d1;
  font-size: 13px;
}

.back-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid #ffffff29;
  border-radius: 12px;
  background: #ffffff10;
  color: #fff;
  font-size: 22px;
}

.back-button:hover { background: #ffffff20; }

.rental-form {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 6px 0 17px;
}

.form-section-title:not(:first-child) {
  margin-top: 31px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.form-section-title > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #edf3f0;
  color: var(--forest);
  font-size: 10px;
  font-weight: 900;
}

.form-section-title b,
.form-section-title small { display: block; }
.form-section-title b { font: 600 18px Georgia; }
.form-section-title small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.field-wide { grid-column: 1 / -1; }

.field input,
.field select {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid #d9dedb;
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
}

.field select {
  appearance: none;
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--forest) 50%), linear-gradient(135deg, var(--forest) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field select:disabled { cursor: not-allowed; background-color: #f1f3f1; color: #8d9893; }

.field input:focus,
.field select:focus,
.currency-input:focus-within {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px #123d3414;
}

.field.invalid input,
.field.invalid select,
.field.invalid .currency-input,
.photo-upload.invalid {
  border-color: #d34f45;
  box-shadow: 0 0 0 3px #d34f4510;
}

.field-error {
  min-height: 13px;
  color: #c44138;
  font-size: 10px;
  font-weight: 700;
}

.currency-input {
  display: flex;
  align-items: center;
  height: 48px;
  overflow: hidden;
  border: 1px solid #d9dedb;
  border-radius: 10px;
  background: #fff;
}

.currency-input b { padding-left: 13px; color: var(--forest); font-size: 12px; }
.currency-input input { height: 46px; border: 0; box-shadow: none !important; }

.photo-upload {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  overflow: hidden;
  border: 1.5px dashed #9bb2aa;
  border-radius: 15px;
  background: #f8faf8;
  cursor: pointer;
}

.photo-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-upload > span { display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--muted); text-align: center; }
.photo-upload > span > b { color: var(--forest); font-size: 31px; }
.photo-upload > span > strong { color: var(--ink); font-size: 13px; }
.photo-upload > span > small { font-size: 10px; }
.photo-upload img { width: 100%; height: 300px; object-fit: contain; background: #eef1ef; }
.photo-error { display: block; margin-top: 7px; }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }
.primary-button,
.secondary-button { min-width: 135px; height: 48px; border-radius: 11px; font-weight: 800; }
.primary-button { border: 0; background: linear-gradient(135deg, var(--gold), #e6c66e); color: #26352f; }
.primary-button:disabled { cursor: wait; opacity: .65; }
.secondary-button { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.preview-notice { margin: 13px 0 0; color: var(--muted); font-size: 10px; text-align: right; }

.guest-data-page { max-width: 1120px; margin: 0 auto; }
.guest-data-head { margin-bottom: 14px; }
.guest-data-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 10px; margin-bottom: 14px; }
.guest-search,
.guest-date-filter { display: flex; align-items: center; gap: 9px; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.guest-search:focus-within,
.guest-date-filter:focus-within { border-color: var(--forest); box-shadow: 0 0 0 3px #123d3414; }
.guest-search span,
.guest-date-filter span { flex: 0 0 auto; font-size: 17px; }
.guest-search input,
.guest-date-filter input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 13px; }
.guest-data-status { padding: 35px 15px; border: 1px dashed #cfd7d2; border-radius: 15px; background: #ffffff80; color: var(--muted); text-align: center; font-size: 13px; }
.guest-data-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.guest-web-card { display: grid; grid-template-columns: minmax(0, 1fr) 142px; gap: 11px 13px; padding: 15px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow); }
.guest-card-identity { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.guest-card-identity > span { display: grid; place-items: center; width: 35px; height: 35px; flex: 0 0 auto; border-radius: 11px; background: #e9f2ee; color: var(--forest); font-weight: 900; }
.guest-card-identity div { min-width: 0; }
.guest-card-identity h3 { margin: 0 0 5px; overflow: hidden; color: var(--ink); font: 600 16px Georgia; text-overflow: ellipsis; white-space: nowrap; }
.guest-card-identity p { margin: 3px 0 0; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.guest-photo-button { grid-column: 2; grid-row: 1 / span 2; width: 142px; padding: 0; overflow: hidden; border: 1px solid #dfe3df; border-radius: 11px; background: #f1f3f1; color: var(--muted); }
.guest-photo-button:not(:disabled):hover { border-color: var(--gold); }
.guest-photo-button:disabled { cursor: default; }
.guest-photo-button img { display: block; width: 100%; height: 84px; object-fit: cover; background: #e9ecea; }
.guest-photo-button small { display: block; padding: 5px; font-size: 9px; }
.guest-photo-button.photo-failed img { visibility: hidden; }
.guest-unit-line { grid-column: 1; padding: 7px 9px; border-radius: 9px; background: #f4f7f5; color: var(--forest); font-size: 10px; font-weight: 800; }
.guest-card-detail { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.35fr 110px; gap: 10px; padding-top: 11px; border-top: 1px solid var(--line); }
.guest-card-detail > div:not(.guest-card-actions) { display: flex; flex-direction: column; gap: 3px; }
.guest-card-detail small { margin-top: 4px; color: #8c9893; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.guest-card-detail b { color: var(--ink); font-size: 10px; }
.guest-card-detail strong { color: var(--forest); font-size: 12px; }
.guest-card-actions { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
.guest-card-actions button { height: 30px; border: 1px solid #cbd8d3; border-radius: 8px; background: #f5f9f7; color: var(--forest); font-size: 10px; font-weight: 900; }
.guest-card-actions button:last-child { border-color: #f0cbc8; background: #fff5f4; color: #c54e45; }
.guest-pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin-top: 17px; }
.guest-pagination b { color: var(--muted); font-size: 11px; }
.guest-pagination button { justify-self: start; min-width: 120px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--forest); font-size: 11px; font-weight: 900; }
.guest-pagination .next { justify-self: end; border: 0; background: var(--forest); color: #fff; }
.ktp-modal { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 55px 20px 20px; background: #071713e8; }
.ktp-modal img { display: block; max-width: min(940px, 95vw); max-height: 84vh; border: 5px solid #fff; border-radius: 13px; background: #fff; box-shadow: 0 20px 70px #0008; object-fit: contain; }
.ktp-modal button { position: fixed; top: 18px; right: 22px; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #ffffff55; border-radius: 50%; background: #ffffff18; color: #fff; font-size: 28px; }

.apartment-page { max-width: 980px; margin: 0 auto; }
.apartment-page-head { margin-bottom: 14px; }
.apartment-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.apartment-tabs button { height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 900; }
.apartment-tabs button.active { background: var(--forest); color: #fff; box-shadow: 0 7px 18px #123d3430; }
.apartment-form { padding-top: 22px; }
.apartment-tower-heading { display: flex; align-items: center; justify-content: space-between; margin: 23px 0 10px; }
.apartment-tower-heading b { font-size: 12px; }
.apartment-tower-heading small { color: var(--muted); font-size: 9px; }
.apartment-tower-fields { display: grid; gap: 9px; }
.apartment-tower-row { padding: 13px; border: 1px solid #e4ddca; border-radius: 14px; background: #fffdf8; }
.apartment-tower-main { display: grid; grid-template-columns: minmax(0, 1fr) 42px; align-items: center; gap: 8px; }
.apartment-tower-row .field > span { display: block; margin-bottom: 2px; }
.apartment-tower-row .field-error { min-height: 0; }
.apartment-unit-heading { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 8px; padding-top: 11px; border-top: 1px dashed #ddd3b8; }
.apartment-unit-heading b { font-size: 11px; }
.apartment-unit-heading small { color: var(--muted); font-size: 9px; }
.apartment-unit-fields { display: grid; gap: 7px; }
.apartment-unit-row { display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: center; gap: 7px; }
.remove-unit-web { width: 38px; height: 38px; border: 1px solid #efc8c5; border-radius: 9px; background: #fff3f2; color: #c84f46; font-size: 20px; }
.add-unit-web { height: 36px; margin-top: 8px; padding: 0 12px; border: 1px solid #cbd8d3; border-radius: 9px; background: #f4f8f6; color: var(--forest); font-size: 10px; font-weight: 900; }
.remove-tower-web { width: 42px; height: 42px; margin-bottom: 1px; border: 1px solid #efc8c5; border-radius: 10px; background: #fff3f2; color: #c84f46; font-size: 23px; font-weight: 700; }
.add-tower-web { height: 40px; margin-top: 10px; padding: 0 14px; border: 1px solid #d3bc7e; border-radius: 10px; background: #fffaf0; color: #86671f; font-size: 11px; font-weight: 900; }
.apartment-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.apartment-web-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.apartment-web-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #ebe8f5; color: #6d5aab; font-size: 21px; }
.apartment-open-web { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; min-height: 58px; padding: 6px; border: 0; border-radius: 11px; background: transparent; color: var(--ink); text-align: left; }
.apartment-open-web:hover { background: #f8f6ee; }
.apartment-open-web strong,.apartment-open-web small { display: block; }
.apartment-open-web strong { font: 600 16px Georgia; }
.apartment-open-web small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.apartment-open-web i { color: var(--gold); font-size: 18px; font-style: normal; }
.apartment-web-card h3 { margin: 0; color: var(--ink); font: 600 16px Georgia; }
.apartment-web-card p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.apartment-web-card small { display: block; margin-top: 5px; color: #9a8650; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.apartment-web-actions { display: flex; flex-direction: column; gap: 6px; }
.apartment-web-actions button { width: 58px; height: 29px; border: 1px solid #cbd8d3; border-radius: 8px; background: #f4f8f6; color: var(--forest); font-size: 9px; font-weight: 900; }
.apartment-web-actions button:last-child { border-color: #efc8c5; background: #fff3f2; color: #c84f46; }
.detail-back-button { height: 40px; margin-bottom: 12px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--forest); font-size: 11px; font-weight: 900; }
.apartment-detail-heading { margin-bottom: 13px; padding: 20px; border-radius: 15px; background: linear-gradient(135deg, var(--forest), #245d4f); color: #fff; }
.apartment-detail-heading h3 { margin: 0; font: 600 25px Georgia; }
.apartment-detail-heading>p:last-child { margin: 7px 0 0; color: #c4d8d1; font-size: 11px; }
.apartment-detail-towers { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.apartment-detail-tower { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.apartment-detail-tower h4 { margin: 0 0 10px; font: 600 17px Georgia; }
.apartment-unit-web-buttons { display: grid; gap: 7px; }
.apartment-unit-web-buttons>button { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; min-height: 43px; padding: 6px 10px; border: 1px solid #d7e1dd; border-radius: 10px; background: #f5f8f6; color: var(--ink); text-align: left; }
.apartment-unit-web-buttons>button:hover { border-color: var(--gold); background: #fffaf0; }
.apartment-unit-web-buttons>button span { color: var(--forest); font-size: 18px; }
.apartment-unit-web-buttons>button b { font-size: 11px; }
.apartment-unit-web-buttons>button i { color: var(--gold); font-style: normal; }
.apartment-unit-web-buttons>p { margin: 0; color: var(--muted); font-size: 11px; }
.unit-detail-placeholders { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.unit-detail-placeholders article { padding: 28px 20px; border: 1px dashed #cfc4a5; border-radius: 15px; background: #fffdf7; text-align: center; }
.unit-detail-placeholders span { color: var(--gold); font-size: 34px; }
.unit-detail-placeholders h4 { margin: 10px 0 7px; font: 600 18px Georgia; }
.unit-detail-placeholders p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

@media (max-width: 1180px) {
  .guest-data-list { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .form-page-head { padding: 21px; }
  .rental-form { padding: 19px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .form-actions { flex-direction: column-reverse; }
  .primary-button,
  .secondary-button { width: 100%; }
  .photo-upload { min-height: 190px; }
  .photo-upload img { height: 240px; }
  .guest-data-toolbar { grid-template-columns: minmax(0, 1fr) 150px; gap: 7px; }
  .guest-search,
  .guest-date-filter { height: 44px; padding: 0 10px; }
  .guest-date-filter span { display: none; }
  .guest-web-card { grid-template-columns: minmax(0, 1fr) 128px; padding: 12px; }
  .guest-photo-button { width: 128px; }
  .guest-photo-button img { height: 78px; }
  .guest-card-detail { grid-template-columns: 1fr 1.35fr 86px; }
  .apartment-list { grid-template-columns: 1fr; }
  .apartment-detail-towers,.unit-detail-placeholders { grid-template-columns: 1fr; }
}

@media (max-width: 470px) {
  .guest-data-toolbar { grid-template-columns: minmax(0, 1fr) 132px; }
  .guest-search input { font-size: 12px; }
  .guest-web-card { grid-template-columns: minmax(0, 1fr) 116px; gap: 9px; }
  .guest-photo-button { width: 116px; }
  .guest-card-detail { grid-template-columns: 1fr 1.25fr; }
  .guest-card-actions { grid-column: 1 / -1; flex-direction: row; }
  .guest-card-actions button { flex: 1; }
}
