/* ============================================================
   Property Details ("General Info") — views/BEngine/N/property_details.php

   Everything is scoped under .pd so nothing here can reach the other 42
   admin pages. Palette continues nav-newbng.css.
   ============================================================ */

.pd {
  --ink:       #0c2439;
  --navy:      #123a5c;
  --blue:      #2b74b0;
  --blue-600:  #225d8f;
  --blue-50:   #e7f0f8;
  --slate-50:  #f4f7fa;
  --slate-100: #eaf0f6;
  --slate-200: #dbe4ec;
  --slate-300: #c2d0dd;
  --slate-400: #8296aa;
  --slate-600: #546b82;
  --danger:    #c0392b;
  --danger-50: #fdf0ee;
  --ok:        #2f8f5b;
  --warn:      #b7791f;

  --r:    7px;
  --r-lg: 11px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --serif: "Merriweather", Georgia, serif;

  position: relative;
  padding-bottom: 84px;               /* clearance for the sticky save bar */
  font-family: "Open Sans", sans-serif;
  color: var(--ink);
  background: var(--slate-50);
}

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

/* ================================ TABS ================================ */

.pd-tabs {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 0 12px;
  background: #fff;
  border-bottom: 1px solid var(--slate-200);
  box-shadow: 0 1px 2px rgba(12, 36, 57, .04);
  scrollbar-width: thin;
}
.pd-tabs::-webkit-scrollbar { height: 3px; }
.pd-tabs::-webkit-scrollbar-thumb { background: var(--slate-300); }

.pd-tab {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 15px 16px 14px;
  font-family: var(--serif);
  font-size: 13px;
  color: var(--slate-600);
  background: none;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.pd-tab > i { font-size: 13px; opacity: .65; transition: opacity .18s var(--ease); }
.pd-tab:hover { color: var(--navy); background: var(--slate-50); }
.pd-tab:hover > i { opacity: 1; }
.pd-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: -3px; }

/* sliding underline */
.pd-tab::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: var(--blue);
  transform: scaleX(0);
  transition: transform .22s var(--ease);
}
.pd-tab.is-active { color: var(--navy); font-weight: 700; }
.pd-tab.is-active > i { opacity: 1; color: var(--blue); }
.pd-tab.is-active::after { transform: scaleX(1); }

/* unsaved marker */
.pd-tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warn);
  opacity: 0;
  transform: scale(.4);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.pd-tab.is-dirty .pd-tab-dot { opacity: 1; transform: none; }

/* error count */
.pd-tab-badge {
  display: none;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  font-family: "Open Sans", sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  color: #fff;
  background: var(--danger);
  border-radius: 9px;
}
.pd-tab.has-error { color: var(--danger); }
.pd-tab.has-error .pd-tab-badge { display: inline-block; animation: pdPop .25s var(--ease); }
.pd-tab.has-error .pd-tab-dot { display: none; }

/* =============================== PANELS =============================== */

.pd-panels { padding: 18px; }
.pd-panel[hidden] { display: none; }
.pd-panel.is-active { animation: pdPanelIn .26s var(--ease); }

@keyframes pdPanelIn {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

/* ================================ CARDS =============================== */

.pd-card {
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--r-lg);
  box-shadow: 0 1px 2px rgba(12, 36, 57, .04);
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.pd-card:hover {
  border-color: var(--slate-300);
  box-shadow: 0 4px 16px rgba(12, 36, 57, .07);
}
.pd-card:last-child { margin-bottom: 0; }

.pd-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--slate-100);
}
.pd-card-head > i { font-size: 14px; color: var(--blue); }
.pd-card-head > h4 {
  margin: 0;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}
.pd-hint {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--slate-400);
  text-align: right;
}
.pd-count {
  margin-left: auto;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-50);
  border-radius: 20px;
}
.pd-card-body { padding: 18px; }

/* ================================ GRID ================================ */

.pd-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.pd-grid > .span-2 { grid-column: span 2; }
.pd-grid > .span-3 { grid-column: span 3; }
.pd-grid > .span-4 { grid-column: span 4; }
.pd-grid > .span-6 { grid-column: span 6; }
.pd-grid > .span-8 { grid-column: span 8; }

@media (max-width: 1100px) {
  .pd-grid > .span-2, .pd-grid > .span-3, .pd-grid > .span-4 { grid-column: span 6; }
  .pd-grid > .span-8 { grid-column: span 12; }
}
@media (max-width: 700px) {
  .pd-grid > [class*="span-"] { grid-column: span 12; }
}

/* ============================ FORM FIELDS ============================= */

.pd-f { display: flex; flex-direction: column; min-width: 0; }
.pd-narrow { max-width: 340px; }

.pd-f > label,
.pd-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-600);
}
.pd-req { color: var(--danger); font-weight: 700; }
.pd-sub {
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--slate-400);
}
.pd-f > label .pd-sub { margin: 0; }

.pd-locked {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--slate-400);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 20px;
}

.pd input[type="text"],
.pd input[type="number"],
.pd select,
.pd textarea {
  width: 100%;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--slate-300);
  border-radius: var(--r);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
.pd textarea { resize: vertical; min-height: 76px; line-height: 1.55; }

.pd input:focus,
.pd select:focus,
.pd textarea:focus {
  outline: 0;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(43, 116, 176, .15);
}
.pd input:hover:not(:disabled):not(:focus),
.pd select:hover:not(:disabled):not(:focus),
.pd textarea:hover:not(:focus) { border-color: var(--slate-400); }

.pd input:disabled,
.pd select:disabled,
.pd input[readonly] {
  color: var(--slate-600);
  background: var(--slate-50);
  border-color: var(--slate-200);
  cursor: not-allowed;
}

.pd input::placeholder, .pd textarea::placeholder { color: var(--slate-300); }

.pd select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%238296aa' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.pd select::-ms-expand { display: none; }

/* ---------------------------- validation ----------------------------- */

.pd-err {
  display: none;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--danger);
}
.pd-f.has-error .pd-err { display: block; animation: pdSlideDown .18s var(--ease); }
.pd-f.has-error input,
.pd-f.has-error textarea,
.pd-f.has-error select {
  border-color: var(--danger);
  background: var(--danger-50);
}
.pd-f.has-error input:focus,
.pd-f.has-error textarea:focus { box-shadow: 0 0 0 3px rgba(192, 57, 43, .14); }

/* js-bengine-N.js still adds .border-red on the email/phone inputs it checks */
.pd .border-red { border-color: var(--danger) !important; background: var(--danger-50); }

.pd-shake { animation: pdShake .32s var(--ease); }

@keyframes pdShake {
  0%, 100% { transform: none; }
  20%      { transform: translateX(-5px); }
  40%      { transform: translateX(5px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}
@keyframes pdSlideDown {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pdPop {
  0%   { transform: scale(.5); }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* =========================== CHECK / RADIO ============================ */

.pd-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 10px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: var(--r);
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.pd-check:hover { background: var(--slate-50); border-color: var(--slate-200); }
.pd-check > p { margin: 0; line-height: 1.35; }

.pd-check input[type="checkbox"],
.pd-check input[type="radio"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  position: relative;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  margin: 0;
  background: #fff;
  border: 1.5px solid var(--slate-300);
  border-radius: 5px;
  cursor: pointer;
  transition: background .16s var(--ease), border-color .16s var(--ease);
}
.pd-check input[type="radio"] { border-radius: 50%; }

.pd-check input:checked {
  background: var(--blue);
  border-color: var(--blue);
  animation: pdPop .22s var(--ease);
}
.pd-check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1.5px;
  width: 4px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(43deg);
}
.pd-check input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.pd-check input:disabled { background: var(--slate-100); border-color: var(--slate-200); cursor: not-allowed; }
.pd-check:has(input:checked) { background: var(--blue-50); border-color: rgba(43, 116, 176, .25); }
.pd-check:has(input:disabled) { cursor: not-allowed; opacity: .7; }

.pd-check-bare { padding: 0; flex: 0 0 auto; }
.pd-check-bare:hover, .pd-check-bare:has(input:checked) { background: none; border-color: transparent; }

.pd-checkgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 2px;
}

/* ------------------------- segmented yes/no -------------------------- */

.pd-seg {
  display: inline-flex;
  padding: 3px;
  background: var(--slate-100);
  border-radius: 9px;
}
.pd-seg > label {
  margin: 0;
  cursor: pointer;
}
.pd-seg input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.pd-seg > label > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate-600);
  border-radius: 7px;
  transition: background .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}
.pd-seg > label > span > i { font-size: 11px; opacity: .7; }
.pd-seg > label:hover > span { color: var(--navy); }
.pd-seg > label:has(input:checked) > span {
  color: var(--navy);
  background: #fff;
  box-shadow: 0 1px 3px rgba(12, 36, 57, .14);
}
.pd-seg > label:has(input:checked) > span > i { opacity: 1; color: var(--blue); }
.pd-seg > label:has(input:focus-visible) > span { outline: 2px solid var(--blue); outline-offset: 1px; }

/* ---------------------------- age range ------------------------------ */

.pd-agerange {
  display: flex;
  align-items: center;
  gap: 9px;
}
.pd-agerange select { width: auto; min-width: 74px; }
.pd-agelbl { font-size: 12px; color: var(--slate-400); white-space: nowrap; }

/* --------------------------- note toggle ----------------------------- */

.pd-note-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--slate-200);
}
.pd-note-toggle > strong {
  margin-right: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-600);
}

/* box.ck_box_note_hotel() adds/removes .active on #bookengine_note */
.pd .chdis_des {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .28s var(--ease), opacity .2s var(--ease);
}
.pd .chdis_des.active { max-height: 340px; opacity: 1; }

/* ========================= REPEATABLE ROWS ============================ */

.pd-rows { display: flex; flex-direction: column; gap: 8px; }

.pd-row {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: pdRowIn .22s var(--ease);
}
.pd-row > input[type="text"] { flex: 1 1 auto; }

.pd-row-4 { flex-wrap: wrap; }
.pd-row-4 > input[type="text"] { flex: 1 1 160px; min-width: 0; }

.pd-row-del {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: var(--slate-400);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--r);
  cursor: pointer;
  transition: color .16s var(--ease), background .16s var(--ease), border-color .16s var(--ease);
}
.pd-row-del:hover {
  color: var(--danger);
  background: var(--danger-50);
  border-color: rgba(192, 57, 43, .2);
}

.pd-add {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 15px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue);
  background: none;
  border: 1px dashed var(--slate-300);
  border-radius: var(--r);
  cursor: pointer;
  transition: color .16s var(--ease), background .16s var(--ease), border-color .16s var(--ease);
}
.pd-add:hover {
  color: var(--blue-600);
  background: var(--blue-50);
  border-color: var(--blue);
  border-style: solid;
}
.pd-add > i { font-size: 10px; }

@keyframes pdRowIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ============================= SAVE BAR =============================== */

.pd-savebar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1025;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 20px;
  background: rgba(255, 255, 255, .97);
  border-top: 1px solid var(--slate-200);
  box-shadow: 0 -4px 20px rgba(12, 36, 57, .1);
  transform: translateY(100%);
  transition: transform .26s var(--ease);
}
.pd-savebar.is-visible { transform: none; }

/* clear the side rail — --nav-w is set by nav-newbng.css and tracks collapse */
@media (min-width: 992px) {
  .pd-savebar { left: var(--nav-w, 256px); transition: transform .26s var(--ease), left .22s var(--ease); }
}

.pd-savebar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--slate-600);
}
.pd-savebar-status > i { color: var(--slate-300); transition: color .2s var(--ease); }
.pd-savebar.is-dirty  .pd-savebar-status > i { color: var(--warn); }
.pd-savebar.has-error .pd-savebar-status { color: var(--danger); }
.pd-savebar.has-error .pd-savebar-status > i { color: var(--danger); }

.pd-savebar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.pd-kbd {
  padding: 3px 7px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10.5px;
  color: var(--slate-400);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-bottom-width: 2px;
  border-radius: 5px;
}

.pd-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--r);
  cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease),
              border-color .16s var(--ease), transform .1s var(--ease), opacity .16s var(--ease);
}
.pd-btn:active { transform: translateY(1px); }
.pd-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.pd-btn-ghost {
  color: var(--slate-600);
  background: none;
  border-color: var(--slate-300);
}
.pd-btn-ghost:hover { color: var(--navy); background: var(--slate-50); border-color: var(--slate-400); }

.pd-btn-primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 2px 10px rgba(43, 116, 176, .35);
}
.pd-btn-primary:hover:not(:disabled) { background: var(--blue-600); }
.pd-btn-primary:disabled {
  background: var(--slate-300);
  box-shadow: none;
  cursor: not-allowed;
  opacity: .8;
}

/* spinner only while saving */
.pd-btn .pd-spin { display: none; animation: pdSpin .8s linear infinite; }
.pd-btn.is-busy .pd-spin { display: inline-block; }
.pd-btn.is-busy { pointer-events: none; }

@keyframes pdSpin { to { transform: rotate(360deg); } }

/* ============================== TOASTS ================================ */

.pd-toasts {
  position: fixed;
  right: 18px;
  bottom: 76px;
  z-index: 1060;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}
.pd-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 340px;
  padding: 11px 16px;
  font-size: 12.5px;
  color: #fff;
  background: var(--navy);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 26px rgba(12, 36, 57, .3);
  animation: pdToastIn .24s var(--ease);
}
.pd-toast.is-out { animation: pdToastOut .22s var(--ease) forwards; }
.pd-toast.is-ok    { background: var(--ok); }
.pd-toast.is-error { background: var(--danger); }

@keyframes pdToastIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pdToastOut {
  to { opacity: 0; transform: translateX(24px); }
}

/* ============================== MOBILE ================================ */

@media (max-width: 767px) {
  .pd-panels { padding: 12px; }
  .pd-card-body { padding: 14px; }
  .pd-card-head { flex-wrap: wrap; padding: 12px 14px; }
  .pd-hint, .pd-count { margin-left: 0; flex-basis: 100%; text-align: left; }
  .pd-count { justify-self: start; width: -moz-fit-content; width: fit-content; }

  .pd-tab { padding: 13px 12px; }
  .pd-tab-label { display: none; }             /* icons only — the row must not scroll */
  .pd-tab.is-active .pd-tab-label { display: inline; }
  .pd-tab > i { font-size: 15px; }

  .pd-savebar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .pd-kbd { display: none; }
  .pd-savebar-actions { width: 100%; }
  .pd-btn { flex: 1 1 auto; justify-content: center; }
  .pd-toasts { left: 14px; right: 14px; bottom: 92px; }
  .pd-toast { max-width: none; }

  .pd-agerange { flex-wrap: wrap; }
  .pd-row-4 > input[type="text"] { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .pd *, .pd *::before, .pd *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
