
/* ============================================================
   HABNEX Design System Fix v1
   Admin + Resident + Control
   ============================================================ */

:root{
  --hnx-green:#087ca8;
  --hnx-green-2:#0b91c4;
  --hnx-green-dark:#0d3345;
  --hnx-green-soft:#eaf5fa;
  --hnx-green-soft-2:#f3f8fb;

  --hnx-danger:#aa454c;
  --hnx-danger-2:#c6535a;
  --hnx-danger-soft:#fff0f1;

  --hnx-warning:#a8791b;
  --hnx-warning-soft:#fff7e6;

  --hnx-text:#243f4a;
  --hnx-muted:#74827d;
  --hnx-line:#dce7e3;
  --hnx-surface:#ffffff;
  --hnx-soft:#f6faf8;

  --hnx-radius:12px;
  --hnx-shadow:0 9px 23px rgba(19,55,47,.08);
}

/* ---------------- BUTTON SYSTEM ---------------- */

.hn-btn,
.hn-resident-profile-btn{
  -webkit-appearance:none;
  appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:42px;
  padding:10px 15px;
  box-sizing:border-box;
  border:1px solid transparent;
  border-radius:11px;
  font-family:inherit;
  font-size:11px;
  font-weight:900;
  line-height:1.1;
  text-decoration:none;
  cursor:pointer;
  transition:
    transform .15s ease,
    filter .15s ease,
    border-color .15s ease,
    background .15s ease,
    box-shadow .15s ease;
}

.hn-btn:hover,
.hn-resident-profile-btn:hover{
  transform:translateY(-1px);
}

.hn-btn:disabled,
.hn-resident-profile-btn:disabled{
  opacity:.48;
  cursor:not-allowed;
  transform:none!important;
  box-shadow:none!important;
}

.hn-btn-primary,
.hn-resident-profile-btn{
  background:linear-gradient(135deg,var(--hnx-green-2),var(--hnx-green));
  color:#fff;
  border-color:transparent;
  box-shadow:0 8px 18px rgba(8,125,105,.18);
}

.hn-btn-primary:hover,
.hn-resident-profile-btn:hover{
  filter:brightness(.98);
  box-shadow:0 11px 24px rgba(8,125,105,.22);
}

.hn-btn-secondary{
  background:#fff;
  color:#405a67;
  border-color:var(--hnx-line);
  box-shadow:none;
}

.hn-btn-secondary:hover{
  color:var(--hnx-green);
  border-color:#bcd4cc;
  background:#fbfdfc;
}

.hn-btn-light{
  background:var(--hnx-green-soft-2);
  color:#365865;
  border-color:#e0ebe7;
}

.hn-btn-danger{
  background:var(--hnx-danger-soft);
  color:var(--hnx-danger);
  border-color:#f0d8da;
  box-shadow:none;
}

.hn-btn-danger:hover{
  background:#fde8e9;
  color:#98383f;
  border-color:#e8c5c8;
}

.hn-btn-link{
  text-decoration:none!important;
}

.hn-full-btn{
  width:100%;
}

.hn-form-actions,
.hn-top-actions,
.hn-card-actions-inline,
.hn-control-header-actions{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:9px;
}

/* Raw admin buttons that escaped the component system */
.hn-admin-page button:not(.hn-btn):not(.swal2-confirm):not(.swal2-cancel):not(.swal2-deny):not(.swal2-close),
body.hn-admin-pro button:not(.hn-btn):not(.swal2-confirm):not(.swal2-cancel):not(.swal2-deny):not(.swal2-close){
  -webkit-appearance:none;
  appearance:none;
  min-height:40px;
  padding:9px 13px;
  border:1px solid var(--hnx-line);
  border-radius:10px;
  background:#fff;
  color:#405a67;
  font-family:inherit;
  font-size:10px;
  font-weight:850;
  cursor:pointer;
}

.hn-admin-page form[action*="/eliminar"] button:not(.hn-btn),
.hn-admin-page form[action*="/revocar"] button:not(.hn-btn),
.hn-admin-page form[action*="/anular"] button:not(.hn-btn),
body.hn-admin-pro form[action*="/eliminar"] button:not(.hn-btn),
body.hn-admin-pro form[action*="/revocar"] button:not(.hn-btn),
body.hn-admin-pro form[action*="/anular"] button:not(.hn-btn){
  background:var(--hnx-danger-soft);
  border-color:#f0d8da;
  color:var(--hnx-danger);
}

/* ---------------- FORMS ---------------- */

.hn-admin-page input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.hn-admin-page select,
.hn-admin-page textarea,
body.hn-admin-pro input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
body.hn-admin-pro select,
body.hn-admin-pro textarea{
  box-sizing:border-box;
  border-color:#d7e3df;
  color:var(--hnx-text);
  font-family:inherit;
}

.hn-admin-page input:focus,
.hn-admin-page select:focus,
.hn-admin-page textarea:focus,
body.hn-admin-pro input:focus,
body.hn-admin-pro select:focus,
body.hn-admin-pro textarea:focus{
  border-color:#7bbbd3!important;
  outline:none!important;
  box-shadow:0 0 0 3px rgba(8,125,105,.08)!important;
}

/* Text pairs: title + explanation must never run together */
.hn-check-row > span,
.hn-field > span,
.hn-setting-copy,
.hn-option-copy{
  min-width:0;
}

.hn-check-row strong,
.hn-check-row small,
.hn-setting-copy strong,
.hn-setting-copy small,
.hn-option-copy strong,
.hn-option-copy small{
  display:block;
}

.hn-check-row small,
.hn-setting-copy small,
.hn-option-copy small{
  margin-top:4px;
  color:#82908b;
  line-height:1.45;
}

/* ---------------- CARDS / TABLES ---------------- */

.hn-section,
.hn-card-block,
.hn-form-card,
.hn-amenity-card,
.hn-resident-row,
.hn-integration-card{
  border-color:var(--hnx-line)!important;
}

.hn-table-wrap{
  border-color:var(--hnx-line)!important;
}

.hn-table tbody tr:hover{
  background:#fbfdfc!important;
}

.hn-status,
.hn-role-pill,
.hn-count-pill,
.hn-access-pill{
  line-height:1!important;
}

/* ---------------- RESIDENT RAW BUTTONS ---------------- */

body:not(.hn-admin-page) .hn-profile-remove-form button{
  -webkit-appearance:none;
  appearance:none;
  min-height:40px;
  padding:9px 13px;
  border:1px solid #f0d8da!important;
  border-radius:10px!important;
  background:var(--hnx-danger-soft)!important;
  color:var(--hnx-danger)!important;
  font-family:inherit;
  font-size:10px;
  font-weight:900;
  cursor:pointer;
}

.hn-resident-date-picker button{
  min-height:42px!important;
  padding:10px 14px!important;
  border:1px solid transparent!important;
  border-radius:11px!important;
  background:linear-gradient(135deg,var(--hnx-green-2),var(--hnx-green))!important;
  color:#fff!important;
  font-family:inherit!important;
  font-weight:900!important;
  cursor:pointer!important;
}

.hn-resident-bookings form button{
  min-height:38px!important;
  padding:8px 11px!important;
  border:1px solid #f0d8da!important;
  border-radius:10px!important;
  background:var(--hnx-danger-soft)!important;
  color:var(--hnx-danger)!important;
  font-family:inherit!important;
  font-weight:900!important;
}

/* Reservation slots remain cards, but look intentional */
.hn-resident-slots button{
  cursor:pointer!important;
  transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease!important;
}

.hn-resident-slots button:hover{
  transform:translateY(-1px);
  border-color:#bad4cb!important;
  box-shadow:var(--hnx-shadow);
}

/* ---------------- SWEETALERT: SINGLE SOURCE OF TRUTH ---------------- */

.swal2-container{
  padding:18px!important;
  backdrop-filter:blur(3px);
}

.swal2-container.swal2-backdrop-show{
  background:rgba(18,38,33,.40)!important;
}

.swal2-popup.hnx-swal{
  position:relative!important;
  width:min(430px,calc(100vw - 28px))!important;
  padding:27px 25px 21px!important;
  overflow:hidden!important;
  border:1px solid #dfe9e6!important;
  border-radius:23px!important;
  background:#fff!important;
  box-shadow:0 26px 76px rgba(17,55,47,.20)!important;
  font-family:inherit!important;
}

.swal2-popup.hnx-swal::before{
  content:""!important;
  position:absolute!important;
  inset:0 0 auto 0!important;
  height:4px!important;
  background:linear-gradient(90deg,var(--hnx-green),#169fd0)!important;
}

.swal2-popup.hnx-swal.hnx-swal-danger-popup::before{
  background:linear-gradient(90deg,var(--hnx-danger),var(--hnx-danger-2))!important;
}

.swal2-popup.hnx-swal .swal2-icon{
  width:52px!important;
  height:52px!important;
  margin:3px auto 14px!important;
  transform:scale(.92)!important;
}

.swal2-popup.hnx-swal .swal2-title{
  margin:0!important;
  padding:0 4px!important;
  color:#193541!important;
  font-size:21px!important;
  font-weight:900!important;
  line-height:1.13!important;
  letter-spacing:-.025em!important;
}

.swal2-popup.hnx-swal .swal2-html-container{
  margin:9px 0 0!important;
  padding:0 6px!important;
  color:#6f7f79!important;
  font-size:12px!important;
  line-height:1.55!important;
}

.swal2-popup.hnx-swal .swal2-actions{
  width:100%!important;
  display:flex!important;
  justify-content:center!important;
  gap:9px!important;
  margin:20px 0 0!important;
}

.swal2-popup.hnx-swal .hnx-swal-confirm,
.swal2-popup.hnx-swal .hnx-swal-cancel,
.swal2-popup.hnx-swal .hnx-swal-deny{
  -webkit-appearance:none!important;
  appearance:none!important;
  min-width:128px!important;
  min-height:44px!important;
  margin:0!important;
  padding:0 17px!important;
  border:1px solid transparent!important;
  border-radius:11px!important;
  box-shadow:none!important;
  font-family:inherit!important;
  font-size:11px!important;
  font-weight:900!important;
  cursor:pointer!important;
}

.swal2-popup.hnx-swal .hnx-swal-confirm{
  background:linear-gradient(135deg,var(--hnx-green-2),var(--hnx-green))!important;
  color:#fff!important;
}

.swal2-popup.hnx-swal .hnx-swal-confirm.hnx-swal-danger{
  background:linear-gradient(135deg,var(--hnx-danger-2),var(--hnx-danger))!important;
  color:#fff!important;
}

.swal2-popup.hnx-swal .hnx-swal-cancel{
  background:var(--hnx-green-soft-2)!important;
  color:#456a77!important;
  border-color:#dbe9e4!important;
}

.swal2-popup.hnx-swal .hnx-swal-deny{
  background:var(--hnx-danger-soft)!important;
  color:var(--hnx-danger)!important;
  border-color:#f0d8da!important;
}

.swal2-popup.hnx-swal .swal2-input,
.swal2-popup.hnx-swal .swal2-textarea,
.swal2-popup.hnx-swal .swal2-select{
  width:100%!important;
  margin:15px 0 0!important;
  box-sizing:border-box!important;
  border:1px solid #ceded9!important;
  border-radius:12px!important;
  background:#fbfdfc!important;
  color:var(--hnx-text)!important;
  box-shadow:none!important;
  font:inherit!important;
}

.swal2-popup.hnx-swal .swal2-input:focus,
.swal2-popup.hnx-swal .swal2-textarea:focus,
.swal2-popup.hnx-swal .swal2-select:focus{
  border-color:#0b91c4!important;
  box-shadow:0 0 0 3px rgba(13,146,124,.10)!important;
}

.swal2-popup.hnx-swal .swal2-icon.swal2-warning{
  border-color:#d9ad52!important;
  color:#a8791b!important;
}

.swal2-popup.hnx-swal .swal2-icon.swal2-error{
  border-color:#ce5b62!important;
  color:#b8444c!important;
}

.swal2-popup.hnx-swal .swal2-icon.swal2-info,
.swal2-popup.hnx-swal .swal2-icon.swal2-question{
  border-color:#58afd0!important;
  color:var(--hnx-green)!important;
}

.swal2-popup.hnx-swal .swal2-icon.swal2-success{
  border-color:#58afd0!important;
}

.swal2-popup.hnx-swal .swal2-icon.swal2-success [class^=swal2-success-line]{
  background-color:var(--hnx-green)!important;
}

.swal2-popup.hnx-swal .swal2-icon.swal2-success .swal2-success-ring{
  border-color:rgba(8,125,105,.23)!important;
}

.swal2-popup.hnx-swal .swal2-validation-message{
  margin:12px 0 0!important;
  border-radius:11px!important;
  background:var(--hnx-danger-soft)!important;
  color:var(--hnx-danger)!important;
  font-size:10px!important;
}

/* Neutralize legacy HABNEX swal class visual leftovers */
.swal2-popup.hn-swal,
.swal2-popup.hn-photo-swal,
.swal2-popup.hn-backup-swal{
  font-family:inherit!important;
}

@media(max-width:640px){
  .hn-form-actions,
  .hn-top-actions{
    display:grid!important;
    grid-template-columns:1fr!important;
  }

  .hn-form-actions .hn-btn,
  .hn-top-actions .hn-btn{
    width:100%!important;
  }
}

@media(max-width:520px){
  .swal2-container{padding:12px!important}

  .swal2-popup.hnx-swal{
    width:calc(100vw - 24px)!important;
    padding:23px 17px 17px!important;
    border-radius:20px!important;
  }

  .swal2-popup.hnx-swal .swal2-title{
    font-size:20px!important;
  }

  .swal2-popup.hnx-swal .swal2-actions{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
  }

  .swal2-popup.hnx-swal .hnx-swal-confirm,
  .swal2-popup.hnx-swal .hnx-swal-cancel,
  .swal2-popup.hnx-swal .hnx-swal-deny{
    width:100%!important;
    min-width:0!important;
  }
}
