/* Centinela Resident 2026 — calm, mobile-first and task-led. */
:root {
  --resident-navy: #0a2732;
  --resident-navy-2: #123c48;
  --resident-green: #087a62;
  --resident-mint: #26b997;
  --resident-gold: #e6b44b;
  --resident-canvas: #f4f1ea;
  --resident-surface: #ffffff;
  --resident-soft: #eaf3ef;
  --resident-ink: #132e38;
  --resident-muted: #60747a;
  --resident-danger: #a83244;
  --resident-radius: 22px;
}

html { background: var(--resident-canvas); }
body[data-centinela-portal="residente"] {
  background: var(--resident-canvas);
  color: var(--resident-ink);
  min-width: 320px;
  overscroll-behavior-x: none;
}
body[data-centinela-portal="residente"] button { touch-action: manipulation; }
body[data-centinela-portal="residente"] .app-shell { max-width: none; padding: 0; }

/* Access screen */
body[data-centinela-portal="residente"] .login-layout {
  background: var(--resident-canvas);
  grid-template-columns: minmax(0, 1fr) minmax(430px, .78fr);
  min-height: 100dvh;
}
body[data-centinela-portal="residente"] .brand-panel {
  background: var(--resident-navy);
  border-radius: 0;
  padding: clamp(32px, 6vw, 88px);
}
body[data-centinela-portal="residente"] .brand-panel::after {
  background: none;
  border: 120px solid rgba(38, 185, 151, .08);
  border-radius: 50%;
  height: 520px;
  inset: auto -280px -300px auto;
  width: 520px;
}
body[data-centinela-portal="residente"] .brand-copy { max-width: 650px; }
body[data-centinela-portal="residente"] .brand-copy h1 {
  font-size: clamp(44px, 6.4vw, 92px);
  letter-spacing: -.065em;
  line-height: .93;
  margin: 18px 0 26px;
}
body[data-centinela-portal="residente"] .brand-copy p { color: #d7e5e6; font-size: 17px; }
body[data-centinela-portal="residente"] .login-panel {
  background: var(--resident-canvas);
  border-radius: 0;
  padding: clamp(28px, 5vw, 72px);
}
body[data-centinela-portal="residente"] .login-card { max-width: 420px; }
body[data-centinela-portal="residente"] .login-card h2 { font-size: clamp(32px, 4vw, 44px); }
body[data-centinela-portal="residente"] .field input,
body[data-centinela-portal="residente"] .field select,
body[data-centinela-portal="residente"] .field textarea {
  border: 2px solid #ccd8d4;
  border-radius: 14px;
  font-size: 16px;
  min-height: 54px;
}
body[data-centinela-portal="residente"] .primary {
  background: var(--resident-green);
  border-radius: 14px;
  box-shadow: none;
  color: #fff;
}
body[data-centinela-portal="residente"] .primary:hover { background: #06644f; }

/* Main resident home */
body[data-centinela-portal="residente"] .dashboard {
  margin: 0 auto;
  max-width: 1240px;
  padding: 0 clamp(18px, 4vw, 48px) 64px;
}
body[data-centinela-portal="residente"] .topbar {
  align-items: center;
  background: rgba(244, 241, 234, .96);
  border: 0;
  display: flex;
  margin: 0;
  min-height: 82px;
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 40;
}
.resident-brand { align-items: center; background: transparent; border: 0; display: inline-flex; padding: 0; }
.resident-brand img { display: block; height: auto; width: 142px; }
body[data-centinela-portal="residente"] .profile { margin-left: auto; }
body[data-centinela-portal="residente"] .profile-copy strong { font-size: 14px; }
body[data-centinela-portal="residente"] .profile-copy small { font-size: 12px; }
body[data-centinela-portal="residente"] .avatar {
  background: var(--resident-soft);
  color: var(--resident-green);
  height: 42px;
  width: 42px;
}
body[data-centinela-portal="residente"] .icon-button {
  background: transparent;
  border: 0;
  color: var(--resident-muted);
  font-weight: 700;
  min-height: 44px;
}
body[data-centinela-portal="residente"] .icon-button:hover { background: #e8e5de; color: var(--resident-ink); }

body[data-centinela-portal="residente"] .welcome {
  align-items: stretch;
  background: var(--resident-navy);
  border: 0;
  border-radius: 30px;
  box-shadow: none;
  display: grid;
  gap: clamp(28px, 5vw, 72px);
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .65fr);
  padding: clamp(30px, 5vw, 58px);
}
body[data-centinela-portal="residente"] .welcome::after { display: none; }
.welcome-copy { align-self: center; min-width: 0; }
.residential-name {
  color: #91ddca !important;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 14px !important;
}
body[data-centinela-portal="residente"] .welcome h1 {
  font-size: clamp(42px, 6vw, 72px);
  letter-spacing: -.06em;
  line-height: .95;
  margin: 0 0 18px;
  text-wrap: balance;
}
body[data-centinela-portal="residente"] .welcome-copy > p:not(.residential-name) {
  color: #d2e1e2;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.55;
  max-width: 660px;
}
.welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.welcome-primary, .welcome-secondary {
  align-items: center;
  border: 0;
  border-radius: 14px;
  display: flex;
  gap: 12px;
  min-height: 64px;
  padding: 10px 18px;
  text-align: left;
}
.welcome-primary { background: var(--resident-mint); color: #062b2a; }
.welcome-secondary { background: #173f49; color: #fff; }
.welcome-primary:hover { background: #56cbaa; }
.welcome-secondary:hover { background: #20515d; }
.welcome-actions .resident-icon { flex: 0 0 auto; height: 25px; width: 25px; }
.welcome-actions b, .welcome-actions small { display: block; }
.welcome-actions b { font-size: 14px; }
.welcome-actions small { margin-top: 2px; opacity: .75; }
.home-status {
  align-self: stretch;
  background: #f5f1e8;
  border-radius: 22px;
  color: var(--resident-ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
}
.home-status-head { align-items: center; display: flex; gap: 13px; }
.home-status-head .resident-icon { color: var(--resident-green); height: 30px; width: 30px; }
.home-status-head b, .home-status-head small { display: block; }
.home-status-head small { color: var(--resident-muted); margin-top: 3px; }
.home-status-grid { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin: 26px 0; }
.home-status-grid span { background: #fff; border-radius: 14px; padding: 15px; }
.home-status-grid b, .home-status-grid small { display: block; }
.home-status-grid b { color: var(--resident-navy); font-size: 28px; letter-spacing: -.04em; }
.home-status-grid small { color: var(--resident-muted); line-height: 1.3; margin-top: 4px; }
.home-status > p { align-items: center; color: var(--resident-green); display: flex; font-size: 12px; font-weight: 700; margin: 0; }
.live-dot { background: var(--resident-mint); border-radius: 50%; height: 8px; margin-right: 8px; width: 8px; }

body[data-centinela-portal="residente"] .section { margin-top: 38px; }
body[data-centinela-portal="residente"] .section-head { align-items: center; margin-bottom: 16px; }
body[data-centinela-portal="residente"] .section-head h2 { font-size: clamp(22px, 2.5vw, 30px); letter-spacing: -.02em; word-spacing: .1em; }
body[data-centinela-portal="residente"] .section-head p { font-size: 14px; }
body[data-centinela-portal="residente"] .quick-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
body[data-centinela-portal="residente"] .quick {
  align-items: center;
  background: var(--resident-surface);
  border: 0;
  border-radius: 18px;
  box-shadow: none;
  display: flex;
  gap: 14px;
  min-height: 104px;
  padding: 18px;
  text-align: left;
  transition: background-color .16s ease, transform .16s ease;
}
body[data-centinela-portal="residente"] .quick:hover { background: #e9f3ef; box-shadow: none; transform: translateY(-2px); }
body[data-centinela-portal="residente"] .quick:active { transform: scale(.985); }
body[data-centinela-portal="residente"] .quick > span:last-child { min-width: 0; }
body[data-centinela-portal="residente"] .quick b { font-size: 15px; margin: 0 0 5px; }
body[data-centinela-portal="residente"] .quick small { font-size: 12px; }
body[data-centinela-portal="residente"] .quick-icon {
  background: var(--resident-soft);
  border-radius: 12px;
  color: var(--resident-green);
  flex: 0 0 auto;
  height: 44px;
  width: 44px;
}
.resident-icon { display: block; height: 22px; width: 22px; }
.quick--sos { background: #f9e9e9 !important; }
.quick--sos .quick-icon, .quick-icon--alert { background: #f4d8dc !important; color: var(--resident-danger) !important; }
.quick--alert .quick-icon { background: #fff4d8 !important; color: #9b6710 !important; }

body[data-centinela-portal="residente"] .content-grid {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
body[data-centinela-portal="residente"] .card,
body[data-centinela-portal="residente"] .gate-requests,
body[data-centinela-portal="residente"] .portal-explorer {
  background: var(--resident-surface);
  border: 0;
  border-radius: var(--resident-radius);
  box-shadow: none;
  padding: 24px;
}
.card-heading { align-items: baseline; display: flex; gap: 12px; justify-content: space-between; margin-bottom: 16px; }
.card-heading h3 { margin: 0 !important; }
.card-heading > span { color: var(--resident-muted); font-size: 12px; }
body[data-centinela-portal="residente"] .list-row { border-color: #e8edea; min-width: 0; padding: 14px 0; }
body[data-centinela-portal="residente"] .list-row small { overflow-wrap: anywhere; }
.empty-state { align-items: center; color: var(--resident-muted); display: flex; flex-direction: column; min-height: 180px; justify-content: center; text-align: center; }
.empty-state .resident-icon { color: var(--resident-green); height: 34px; width: 34px; }
.empty-state b { color: var(--resident-ink); margin-top: 14px; }
.empty-state p { margin: 6px 0 0; }
.empty-state.compact { min-height: 120px; }

body[data-centinela-portal="residente"] .resident-dock { display: none; }
body[data-centinela-portal="residente"] .dialog { border: 0; border-radius: 24px; max-height: min(88dvh, 780px); overflow-y: auto; }
body[data-centinela-portal="residente"] .dialog::backdrop { background: rgba(5, 29, 37, .68); }

@media (max-width: 900px) {
  body[data-centinela-portal="residente"] .welcome { grid-template-columns: 1fr; }
  body[data-centinela-portal="residente"] .home-status { min-height: 220px; }
  body[data-centinela-portal="residente"] .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  body[data-centinela-portal="residente"] .dashboard { padding: 0 14px calc(108px + env(safe-area-inset-bottom)); }
  body[data-centinela-portal="residente"] .topbar { margin: 0 -14px; min-height: 68px; padding: 10px 16px; }
  .resident-brand img { width: 122px; }
  body[data-centinela-portal="residente"] .profile-copy { display: none; }
  body[data-centinela-portal="residente"] .profile .avatar { height: 38px; width: 38px; }
  body[data-centinela-portal="residente"] .icon-button { font-size: 12px; padding: 8px; }
  body[data-centinela-portal="residente"] .welcome { border-radius: 22px; gap: 24px; padding: 26px 20px 20px; }
  body[data-centinela-portal="residente"] .welcome h1 { font-size: 42px; }
  body[data-centinela-portal="residente"] .welcome-copy > p:not(.residential-name) { font-size: 15px; }
  .welcome-actions { display: grid; }
  .welcome-primary, .welcome-secondary { width: 100%; }
  .home-status { padding: 18px; }
  .home-status-grid { margin: 20px 0; }
  body[data-centinela-portal="residente"] .section { margin-top: 30px; }
  body[data-centinela-portal="residente"] .section-head { align-items: flex-start; }
  body[data-centinela-portal="residente"] .section-head h2 { font-size: 24px; }
  body[data-centinela-portal="residente"] .quick-grid { grid-template-columns: 1fr; }
  body[data-centinela-portal="residente"] .quick { min-height: 88px; padding: 15px; }
  body[data-centinela-portal="residente"] .content-grid { grid-template-columns: 1fr; }
  body[data-centinela-portal="residente"] .card,
  body[data-centinela-portal="residente"] .gate-requests,
  body[data-centinela-portal="residente"] .portal-explorer { border-radius: 18px; padding: 19px; }
  body[data-centinela-portal="residente"] .resident-dock {
    align-items: center;
    background: #fff;
    border: 0;
    border-radius: 20px;
    bottom: max(10px, env(safe-area-inset-bottom));
    box-shadow: 0 16px 42px rgba(10, 39, 50, .2);
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    left: 12px;
    min-height: 70px;
    padding: 7px;
    position: fixed;
    right: 12px;
    z-index: 80;
  }
  body[data-centinela-portal="residente"] .resident-dock button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 14px;
    color: var(--resident-muted);
    display: flex;
    flex-direction: column;
    font-size: 11px;
    font-weight: 700;
    gap: 3px;
    justify-content: center;
    min-height: 54px;
  }
  body[data-centinela-portal="residente"] .resident-dock .resident-dock__main { background: var(--resident-green); color: #fff; }
  body[data-centinela-portal="residente"] .resident-dock .resident-icon { height: 21px; width: 21px; }
  body[data-centinela-portal="residente"] .dialog { border-radius: 24px 24px 0 0; margin: auto 0 0; max-height: 90dvh; width: 100%; }
  body[data-centinela-portal="residente"] .dialog form { padding: 22px 18px calc(20px + env(safe-area-inset-bottom)); }
  body[data-centinela-portal="residente"] .dialog-actions { display: grid; }
  body[data-centinela-portal="residente"] .dialog-actions button { width: 100%; }
}

@media (max-width: 800px) {
  body[data-centinela-portal="residente"] .login-layout { display: block; }
  body[data-centinela-portal="residente"] .brand-panel { border-radius: 0; min-height: 310px; padding: max(28px, env(safe-area-inset-top)) 24px 38px; }
  body[data-centinela-portal="residente"] .brand-copy h1 { font-size: 48px; }
  body[data-centinela-portal="residente"] .trust-list { display: none; }
  body[data-centinela-portal="residente"] .login-panel { border-radius: 24px 24px 0 0; margin-top: -24px; padding: 32px 22px max(32px, env(safe-area-inset-bottom)); position: relative; }
}

@media (prefers-reduced-motion: reduce) {
  body[data-centinela-portal="residente"] *,
  body[data-centinela-portal="residente"] *::before,
  body[data-centinela-portal="residente"] *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Resident multiscreen application */
body[data-centinela-portal="residente"] .resident-view[hidden] { display: none !important; }
body[data-centinela-portal="residente"] .dashboard.resident-app {
  margin: 0;
  max-width: none;
  min-height: 100dvh;
  padding: 0;
}
.resident-workspace { min-width: 0; }
.resident-views { margin: 0 auto; max-width: 1180px; padding: 18px clamp(18px, 4vw, 48px) 64px; }
.resident-view { min-width: 0; }
.view-title { height: 1px; margin: -1px; overflow: hidden; position: absolute; width: 1px; }
.view-heading { align-items: flex-end; display: flex; gap: 24px; justify-content: space-between; margin: 28px 0 30px; }
.view-heading h1 { color: var(--resident-navy); font-size: clamp(38px, 5vw, 62px); letter-spacing: -.055em; line-height: 1; margin: 8px 0 10px; }
.view-heading p { color: var(--resident-muted); font-size: 16px; margin: 0; }
.view-heading [data-view-heading]:focus { outline: none; }
.destination-actions { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 28px; }
.destination-actions--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.action-tile {
  align-items: center;
  background: var(--resident-surface);
  border: 1px solid #dce5e1;
  border-radius: 18px;
  color: var(--resident-ink);
  display: flex;
  gap: 14px;
  min-height: 88px;
  padding: 16px;
  text-align: left;
}
.action-tile:hover { border-color: var(--resident-mint); transform: translateY(-1px); }
.action-tile--primary { background: var(--resident-green); border-color: var(--resident-green); color: #fff; }
.action-tile--warning { border-color: #ead6a3; }
.action-tile .resident-icon { flex: 0 0 auto; height: 26px; width: 26px; }
.action-tile span { display: grid; gap: 3px; }
.action-tile b { font-size: 15px; }
.action-tile small { color: inherit; opacity: .72; }
.home-glance { align-items: stretch; display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) minmax(220px, .34fr); margin-top: 22px; }
.home-glance .card { margin: 0; }
.sos-shortcut {
  align-items: center;
  background: #fff5f4;
  border: 1px solid #efcbc7;
  border-radius: 20px;
  color: var(--resident-danger);
  display: flex;
  gap: 14px;
  min-height: 96px;
  padding: 20px;
  text-align: left;
}
.sos-shortcut .resident-icon { flex: 0 0 auto; height: 28px; width: 28px; }
.sos-shortcut span, .unit-profile-card div { display: grid; gap: 4px; }
.sos-shortcut small { color: #805a5d; }
.unit-profile-card { align-items: center; background: var(--resident-navy); border-radius: 22px; color: #fff; display: flex; gap: 16px; margin-bottom: 24px; padding: 22px; }
.unit-profile-card small { color: #c9dcde; }
.avatar--large { height: 54px !important; width: 54px !important; }
.account-actions { align-items: center; border-top: 1px solid #d8e0dc; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; padding-top: 24px; }
.text-action--danger { color: var(--resident-danger); margin-left: auto; }

@media (min-width: 960px) {
  body[data-centinela-portal="residente"] .resident-app { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
  body[data-centinela-portal="residente"] .resident-rail {
    align-items: stretch;
    background: var(--resident-navy);
    display: flex;
    flex-direction: column;
    gap: 7px;
    height: 100dvh;
    padding: 118px 16px 24px;
    position: sticky;
    top: 0;
  }
  .resident-rail button { align-items: center; background: transparent; border: 0; border-radius: 14px; color: #bcd0d2; display: flex; font-weight: 750; gap: 12px; min-height: 52px; padding: 12px 14px; text-align: left; }
  .resident-rail button[aria-current="page"] { background: rgba(38, 185, 151, .18); color: #fff; }
  .resident-rail .resident-icon { height: 22px; width: 22px; }
  body[data-centinela-portal="residente"] .resident-workspace > .topbar { padding-left: clamp(18px, 4vw, 48px); padding-right: clamp(18px, 4vw, 48px); }
  body[data-centinela-portal="residente"] .resident-dock { display: none; }
}

@media (max-width: 959px) {
  body[data-centinela-portal="residente"] .resident-rail { display: none; }
  .resident-views { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  body[data-centinela-portal="residente"] .resident-dock {
    align-items: center;
    background: #fff;
    border-radius: 20px;
    bottom: max(8px, env(safe-area-inset-bottom));
    box-shadow: 0 12px 38px rgba(10, 39, 50, .18);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    left: 10px;
    min-height: 68px;
    padding: 6px;
    position: fixed;
    right: 10px;
    z-index: 80;
  }
  body[data-centinela-portal="residente"] .resident-dock button { align-items: center; background: transparent; border: 0; border-radius: 13px; color: var(--resident-muted); display: flex; flex-direction: column; font-size: 10px; font-weight: 750; gap: 3px; justify-content: center; min-height: 54px; min-width: 0; padding: 5px 2px; }
  body[data-centinela-portal="residente"] .resident-dock button[aria-current="page"] { background: var(--resident-soft); color: var(--resident-green); }
  body[data-centinela-portal="residente"] .resident-dock .resident-icon { height: 20px; width: 20px; }
}

@media (max-width: 720px) {
  body[data-centinela-portal="residente"] .resident-workspace > .topbar { margin: 0; }
  .resident-views { padding: 12px 14px calc(100px + env(safe-area-inset-bottom)); }
  .view-heading { align-items: flex-start; margin: 18px 2px 24px; }
  .view-heading h1 { font-size: 42px; }
  .view-heading > button { flex: 0 0 auto; }
  .destination-actions, .destination-actions--compact { grid-template-columns: 1fr; }
  .action-tile { min-height: 78px; }
  .home-glance { grid-template-columns: 1fr; }
  .account-actions { align-items: stretch; display: grid; }
  .text-action--danger { margin-left: 0; min-height: 48px; }
}
