/* ═══════════════════════════════════════════
   VECINOO – style.css  v2 (Residentfy UX)
   Mobile-first · PHP JSON backend
═══════════════════════════════════════════ */

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
::-webkit-scrollbar { width: 0; background: transparent; }

/* ─── VARIABLES ─── */
:root {
  --primary:      #1e3a8a;
  --primary-dark: #162d6e;
  --secondary:    #3b82f6;
  --secondary-lt: #eff6ff;
  --accent:       #10b981;
  --accent-lt:    #d1fae5;
  --indigo:       #6366f1;
  --indigo-lt:    #eef2ff;
  --orange:       #f97316;
  --orange-lt:    #fff7ed;
  --danger:       #ef4444;
  --danger-lt:    #fef2f2;
  --warn:         #f59e0b;
  --warn-lt:      #fffbeb;
  --dark:         #1e293b;
  --dark-lt:      #f1f5f9;

  --bg:           #f1f5f9;
  --surface:      #ffffff;
  --border:       #e2e8f0;
  --text-main:    #1e293b;
  --text-sub:     #64748b;
  --text-muted:   #94a3b8;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:    0 12px 40px rgba(0,0,0,.16);

  --radius:       16px;
  --radius-sm:    10px;
  --radius-xs:    8px;
  --nav-h:        72px;
  --header-h:     120px;
  --font:         'Inter', sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: #cbd5e1;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

/* ─── APP FRAME (desktop centering) ─── */
.app-frame {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 0;
}
@media (min-width: 640px) {
  .app-frame { padding: 2rem 0; }
}

/* ─── APP CONTAINER (phone shell) ─── */
.app-container {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 640px) {
  .app-container {
    min-height: 0;
    height: 900px;
    border-radius: 2.5rem;
    border: 8px solid #0f172a;
    box-shadow: 0 32px 80px rgba(0,0,0,.45);
    overflow: hidden;
  }
}

/* utility */
.hidden { display: none !important; }
.mb-0 { margin-bottom: 0 !important; }

/* ═══════════════════════════════════════════
   LOGIN
═══════════════════════════════════════════ */
.login-view {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 2rem;
  gap: 0;
}

.login-logo-wrap { text-align: center; margin-bottom: 2rem; }
.login-logo {
  width: 80px; height: 80px;
  background: var(--primary);
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 8px 24px rgba(30,58,138,.35);
}
.login-logo i { font-size: 2.4rem; color: #fff; }
.login-brand {
  font-size: 2rem; font-weight: 800;
  color: var(--text-main); letter-spacing: -.5px;
}
.login-tagline {
  font-size: .875rem; color: var(--text-sub);
  margin-top: 4px; font-weight: 500;
}

.login-fields { width: 100%; display: flex; flex-direction: column; gap: 12px; margin-bottom: 1.5rem; }
.login-input-wrap { position: relative; }
.login-input-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted);
  font-size: .9rem;
}
.login-input {
  width: 100%;
  padding: 14px 14px 14px 42px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
  font-size: .875rem;
  font-family: var(--font);
  color: var(--text-main);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.login-input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
  background: #fff;
}

.login-role-label {
  font-size: .72rem; font-weight: 700;
  color: var(--text-muted); letter-spacing: .08em;
  text-transform: uppercase; margin-bottom: .75rem; align-self: flex-start;
}
.login-btns { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.btn-login-resident, .btn-login-admin {
  width: 100%; padding: 15px;
  border: none; border-radius: 14px;
  font-size: .9rem; font-weight: 700;
  font-family: var(--font); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .15s, box-shadow .15s;
}
.btn-login-resident:active, .btn-login-admin:active { transform: scale(.98); }
.btn-login-resident {
  background: var(--secondary); color: #fff;
  box-shadow: 0 4px 16px rgba(59,130,246,.35);
}
.btn-login-resident:hover { background: #2563eb; }
.btn-login-admin {
  background: var(--dark); color: #fff;
  box-shadow: 0 4px 16px rgba(30,41,59,.25);
}
.btn-login-admin:hover { background: #0f172a; }
.login-footer {
  margin-top: 1.5rem; font-size: .75rem;
  color: var(--text-muted); text-align: center;
}

/* ═══════════════════════════════════════════
   APP VIEW
═══════════════════════════════════════════ */
.app-view {
  /* Positioned exactly like loginView so the container clips it perfectly:
     header + nav are flex children that never participate in scroll */
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* ─── PAYMENT CARD OVERLAY ─── */
.payment-overlay {
  /* compact strip at the bottom of the card — not a full-cover overlay */
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(3px);
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex; flex-direction: row;
  align-items: center; justify-content: center;
  z-index: 10; padding: 10px 16px;
  gap: 8px;
  animation: fadeIn .25s ease;
}
.payment-overlay-icon {
  width: 28px; height: 28px; flex-shrink: 0;
  background: var(--warn-lt); color: var(--warn);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  animation: pulse-dot .9s ease-in-out infinite alternate;
}
.payment-overlay-title { font-size: .8rem; font-weight: 700; color: var(--text-main); }
.payment-overlay-sub   { display: none; }

/* payment period info */
.card-pay-period {
  font-size: .68rem; font-weight: 600;
  color: var(--text-muted); margin-top: -8px; margin-bottom: 14px;
}

/* disabled pay button */
.btn-pay--blocked {
  background: #e2e8f0 !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}

/* ─── PAYMENT MODAL ─── */
.payment-modal-sheet {
  background: #fff; border-radius: 24px 24px 0 0;
  padding: 20px 20px 36px; width: 100%;
  animation: slideUp .28s cubic-bezier(.22,.82,.22,1);
  max-height: 92vh; overflow-y: auto;
}
.payment-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.payment-modal-title { font-size: 1.1rem; font-weight: 800; color: var(--text-main); }
.payment-modal-close {
  width: 32px; height: 32px;
  background: #f1f5f9; border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-sub); cursor: pointer; font-size: .9rem;
  transition: background .15s;
}
.payment-modal-close:hover { background: var(--border); }
.payment-modal-sub  { font-size: .8rem; color: var(--text-sub); margin-bottom: 20px; line-height: 1.5; }

.payment-field { margin-bottom: 18px; }
.payment-field-label {
  display: block; font-size: .72rem; font-weight: 800;
  color: var(--text-main); text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 8px;
}
.payment-field-label span { color: var(--danger); }
.payment-amount-wrap { position: relative; }
.payment-amount-symbol {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem; font-weight: 800; color: var(--text-sub);
}
.payment-amount-input {
  width: 100%; padding: 14px 14px 14px 32px;
  border: 1.5px solid var(--border); border-radius: 14px;
  font-size: 1.5rem; font-weight: 800; font-family: var(--font);
  color: var(--text-main); background: #f8fafc; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.payment-amount-input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
  background: #fff;
}
.payment-upload-zone {
  position: relative; border: 2px dashed #cbd5e1;
  border-radius: 14px; padding: 24px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: #f8fafc; cursor: pointer;
  transition: background .2s, border-color .2s;
}
.payment-upload-zone:hover { background: #f0f7ff; border-color: var(--secondary); }
.payment-upload-zone input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.payment-upload-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--secondary-lt); color: var(--secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.payment-upload-label  { font-size: .83rem; font-weight: 700; color: var(--text-main); }
.payment-upload-hint   { font-size: .72rem; color: var(--text-muted); }
.payment-upload-name   {
  font-size: .75rem; font-weight: 600; color: var(--accent);
  margin-top: 4px; display: none;
}
.btn-send-payment {
  width: 100%; padding: 15px; margin-top: 8px;
  background: var(--secondary); color: #fff; border: none;
  border-radius: 14px; font-size: .95rem; font-weight: 800;
  font-family: var(--font); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 16px rgba(59,130,246,.35);
  transition: background .2s, transform .1s;
}
.btn-send-payment:hover  { background: #2563eb; }
.btn-send-payment:active { transform: scale(.98); }

/* ─── HEADER ─── */
.app-header {
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
  color: #fff;
  padding: 0 20px 40px;
  border-radius: 0 0 28px 28px;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}
.status-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0 6px;
  font-size: .7rem; font-weight: 600;
}
.status-icons { display: flex; gap: 5px; font-size: .7rem; }
.header-content {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 6px;
}
.header-greeting {
  font-size: .825rem; color: rgba(255,255,255,.75); font-weight: 500; margin-bottom: 2px;
}
.header-title {
  font-size: 1.5rem; font-weight: 800; letter-spacing: -.5px;
}
.header-avatar-wrap {
  position: relative; cursor: pointer; flex-shrink: 0;
}
.header-avatar {
  width: 48px; height: 48px;
  border-radius: 50%; border: 2px solid rgba(255,255,255,.25);
}
.header-notif-dot {
  position: absolute; top: -2px; right: -2px;
  width: 14px; height: 14px;
  background: var(--danger); border-radius: 50%;
  border: 2px solid var(--primary);
}
.header-logout-badge {
  position: absolute; bottom: -6px; right: -6px;
  background: var(--dark); color: #fff;
  font-size: .6rem; padding: 3px 5px;
  border-radius: 6px; line-height: 1;
}

/* ─── MAIN ─── */
.app-main {
  flex: 1; overflow-y: auto;
  padding: 0 16px 8px;
  margin-top: -20px;
  position: relative; z-index: 10;
}

/* ─── TAB SYSTEM ─── */
.tab-root { animation: fadeTab .2s ease; }
@keyframes fadeTab { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.tab-content { padding-bottom: calc(var(--nav-h) + 16px); }

/* ─── SECTION HEADERS ─── */
.section-title {
  font-size: 1rem; font-weight: 700;
  color: var(--text-main); margin: 20px 0 12px;
}
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; margin-top: 20px;
}
.section-link {
  font-size: .78rem; font-weight: 600;
  color: var(--secondary); text-decoration: none;
}

/* ─── BADGES ─── */
.badge {
  display: inline-block; font-size: .68rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}
.badge--warn    { background: var(--warn-lt);   color: var(--warn); }
.badge--danger  { background: var(--danger-lt); color: var(--danger); }
.badge--green   { background: var(--accent-lt); color: var(--accent); }
.badge--primary { background: var(--secondary-lt); color: var(--secondary); }

/* ─── CARDS ─── */
.card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  animation: slideIn .22s ease;
}
@keyframes slideIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

/* Payment card */
.card--pay { padding: 18px; }
.card-pay-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.card-pay-label { font-size: .8rem; color: var(--text-sub); font-weight: 500; }
.card-pay-amount {
  font-size: 2rem; font-weight: 800; color: var(--text-main);
  letter-spacing: -.5px; margin-bottom: 14px;
}
.card-pay-cents { font-size: 1.1rem; color: var(--text-muted); font-weight: 500; }
.btn-pay {
  width: 100%; padding: 14px;
  background: var(--secondary); color: #fff;
  border: none; border-radius: 12px;
  font-size: .9rem; font-weight: 700;
  font-family: var(--font); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 14px rgba(59,130,246,.35);
  transition: background .2s, transform .1s;
}
.btn-pay:hover { background: #2563eb; }
.btn-pay:active { transform: scale(.98); }

/* Visit card */
.card--visit {
  padding: 16px;
  display: flex; align-items: center; gap: 14px;
}
.visit-icon {
  width: 48px; height: 48px; flex-shrink: 0;
  background: var(--secondary-lt); color: var(--secondary);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.visit-info { flex: 1; min-width: 0; }
.visit-name { font-size: .875rem; font-weight: 700; color: var(--text-main); }
.visit-sub  { font-size: .75rem; color: var(--text-sub); margin-top: 2px; }
.visit-qr img { width: 44px; height: 44px; border-radius: 8px; opacity: .7; }

/* Notice card */
.card--notice { padding: 16px; }
.notice-author {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.notice-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; flex-shrink: 0;
}
.notice-name  { font-size: .78rem; font-weight: 700; color: var(--text-main); }
.notice-time  { font-size: .68rem; color: var(--text-muted); }
.notice-title { font-size: .875rem; font-weight: 700; color: var(--text-main); margin-bottom: 6px; }
.notice-body  { font-size: .8rem; color: var(--text-sub); line-height: 1.55; margin-bottom: 12px; }
.notice-footer {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--border); padding-top: 10px;
}
.notice-like {
  font-size: .78rem; font-weight: 600; color: var(--text-sub);
  background: none; border: none; cursor: pointer; display: flex; align-items: center; gap: 5px;
}
.notice-read {
  font-size: .78rem; font-weight: 600; color: var(--secondary);
  background: none; border: none; cursor: pointer;
}

/* ─── QUICK ACTIONS GRID ─── */
.quick-actions {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-bottom: 20px;
}
.qa-btn {
  display: flex; flex-direction: column; align-items: center;
  background: none; border: none; cursor: pointer; gap: 7px;
}
.qa-icon {
  width: 68px; height: 68px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  border: 1px solid transparent;
  transition: transform .15s, box-shadow .15s;
  flex-shrink: 0;
}
.qa-btn:active .qa-icon { transform: scale(.94); }
.qa-icon--blue   { background: var(--secondary-lt); color: var(--secondary); border-color: #dbeafe; }
.qa-icon--indigo { background: var(--indigo-lt);   color: var(--indigo);    border-color: #e0e7ff; }
.qa-icon--orange { background: var(--orange-lt);   color: var(--orange);    border-color: #fed7aa; }
.qa-icon--green  { background: var(--accent-lt);   color: var(--accent);    border-color: #a7f3d0; }
.qa-icon--dark   { background: var(--dark);        color: #fff; }
.qa-icon--danger {
  background: var(--danger-lt); color: var(--danger);
  border-color: #fecaca; position: relative; overflow: hidden;
}
.qa-icon--pulse::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--danger); opacity: .2;
  border-radius: inherit;
  animation: ripple 1.6s ease-out infinite;
}
@keyframes ripple {
  0%   { transform: scale(.8); opacity: .3; }
  70%  { transform: scale(1.2); opacity: 0; }
  100% { transform: scale(.8); opacity: 0; }
}
.qa-label {
  font-size: .68rem; font-weight: 600;
  color: var(--text-sub); text-align: center; line-height: 1.3;
}
.qa-label--danger { color: var(--danger); font-weight: 700; }
.qa-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  background: var(--orange); color: #fff;
  font-size: .65rem; font-weight: 800;
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ─── ADMIN STATS GRID ─── */
.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin: 20px 0 4px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius); border: 1px solid var(--border);
  padding: 14px 16px; box-shadow: var(--shadow-sm);
}
.stat-label { font-size: .72rem; color: var(--text-sub); font-weight: 600; margin-bottom: 4px; }
.stat-value {
  font-size: 1.4rem; font-weight: 800;
  color: var(--text-main); letter-spacing: -.5px;
}
.stat-value--warn    { color: var(--orange); }
.stat-value--primary { color: var(--primary); }
.stat-sub { font-size: .68rem; color: var(--text-muted); margin-top: 3px; }
.stat-sub--green { color: var(--accent); }

/* ─── TASK LIST ─── */
.task-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.task-card {
  background: var(--surface);
  border-radius: var(--radius); border: 1px solid var(--border);
  padding: 14px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 12px;
  animation: slideIn .22s ease;
}
.task-icon {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.task-icon--orange  { background: var(--orange-lt); color: var(--orange); }
.task-icon--danger  { background: var(--danger-lt); color: var(--danger); }
.task-icon--primary { background: var(--secondary-lt); color: var(--secondary); }
.task-icon--blue    { background: var(--secondary-lt); color: var(--secondary); }
.task-info { flex: 1; min-width: 0; }
.task-title { font-size: .83rem; font-weight: 700; color: var(--text-main); }
.task-sub   { font-size: .74rem; color: var(--text-sub); margin-top: 2px; }
.btn-task-view {
  padding: 6px 14px;
  background: var(--secondary-lt); color: var(--secondary);
  border: none; border-radius: 8px;
  font-size: .76rem; font-weight: 700;
  font-family: var(--font); cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}
.btn-task-view:hover { background: #dbeafe; }

/* ─── CASETA BAR ─── */
.caseta-bar {
  background: var(--dark); color: #fff;
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.caseta-status { display: flex; align-items: center; gap: 8px; }
.caseta-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot .9s ease-in-out infinite alternate;
}
@keyframes pulse-dot { from { opacity:1; } to { opacity:.4; } }
.caseta-label { font-size: .82rem; font-weight: 600; }
.caseta-count { font-size: .75rem; color: #94a3b8; }

/* ─── PLACEHOLDER VIEW ─── */
.placeholder-view {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 32px;
  text-align: center;
}
.placeholder-icon { font-size: 3rem; color: #cbd5e1; margin-bottom: 16px; }
.placeholder-title { font-size: 1rem; font-weight: 700; color: var(--text-sub); margin-bottom: 6px; }
.placeholder-sub   { font-size: .83rem; color: var(--text-muted); }

/* ─── MENU LIST ─── */
.menu-list {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
  margin-top: 20px; box-shadow: var(--shadow-sm);
}
.menu-item {
  width: 100%; display: flex; align-items: center;
  gap: 14px; padding: 16px 18px;
  border: none; background: none; cursor: pointer;
  font-family: var(--font); font-size: .875rem; font-weight: 500;
  color: var(--text-main); text-align: left;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: #f8fafc; }
.menu-item-icon { width: 18px; color: var(--secondary); flex-shrink: 0; }
.menu-item span  { flex: 1; }
.menu-item-arrow { color: var(--text-muted); font-size: .7rem; }
.menu-item--danger { color: var(--danger); }
.menu-item--danger .menu-item-icon { color: var(--danger); }

/* ─── ACTIONS BAR ─── */
.actions-bar {
  display: flex; gap: 10px;
  padding: 20px 0 10px;
}
.btn-filtros {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  border: 1.5px solid var(--border);
  border-radius: 10px; background: var(--surface);
  font-size: .875rem; font-weight: 600;
  color: var(--text-main); cursor: pointer;
  font-family: var(--font);
  transition: border-color .2s, background .2s;
}
.btn-filtros:hover { border-color: var(--secondary); background: #f0f7ff; }
.btn-agregar {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border: none; border-radius: 10px;
  background: var(--secondary); color: #fff;
  font-size: .9rem; font-weight: 700; cursor: pointer;
  font-family: var(--font);
  box-shadow: 0 3px 10px rgba(59,130,246,.35);
  transition: background .2s, transform .1s;
}
.btn-agregar:hover  { background: #2563eb; }
.btn-agregar:active { transform: scale(.97); }

/* ─── SEARCH BAR ─── */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.search-input-wrap { position: relative; flex: 1; }
.search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted);
  font-size: .85rem; pointer-events: none;
}
.search-input {
  width: 100%; padding: 10px 12px 10px 36px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: .875rem; font-family: var(--font);
  color: var(--text-main); background: var(--surface); outline: none;
  transition: border-color .2s;
}
.search-input:focus { border-color: var(--secondary); background: #fff; }
.search-input::placeholder { color: var(--text-muted); }
.btn-refresh {
  width: 42px; height: 42px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-sub); cursor: pointer;
  transition: border-color .2s, color .2s;
}
.btn-refresh:hover { border-color: var(--secondary); color: var(--secondary); }

/* ─── VECINOS LIST ─── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 32px; gap: 10px;
}
.empty-icon-wrap {
  width: 80px; height: 80px; border-radius: 50%; background: #f1f5f9;
  display: flex; align-items: center; justify-content: center; margin-bottom: 6px;
}
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text-sub); text-align: center; }
.empty-sub   { font-size: .83rem; color: var(--text-muted); text-align: center; line-height: 1.55; }
.vecinos-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.vecino-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  animation: slideIn .22s ease;
}
.vecino-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--secondary-lt); color: var(--secondary);
  font-weight: 800; font-size: .95rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.vecino-info { flex: 1; min-width: 0; }
.vecino-email {
  font-size: .83rem; font-weight: 600; color: var(--text-main);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vecino-meta  { font-size: .73rem; color: var(--text-sub); margin-top: 2px; }
.vecino-rol-badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 20px; background: var(--secondary-lt);
  color: var(--secondary); font-size: .68rem; font-weight: 700; margin-top: 4px;
}
.vecino-delete {
  width: 34px; height: 34px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: none; color: var(--text-muted); cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
}
.vecino-delete:hover { background: var(--danger-lt); color: var(--danger); border-color: #fecaca; }

/* ─── BOTTOM NAV ─── */
.bottom-nav {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid var(--border);
  padding: 10px 16px 16px;
  z-index: 20;
  box-shadow: 0 -4px 20px rgba(0,0,0,.07);
}
.nav-bar {
  display: flex; justify-content: space-between; align-items: center;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer; font-family: var(--font);
  color: var(--text-muted); min-width: 56px;
  transition: color .2s;
}
.nav-item span { font-size: .62rem; font-weight: 500; }
.nav-item-bg {
  width: 52px; height: 32px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: background .2s;
  position: relative;
}
.nav-item.active { color: var(--primary); }
.nav-item.active .nav-item-bg {
  background: var(--secondary-lt);
  color: var(--primary);
}
.nav-item.active span { font-weight: 700; }
.nav-notif::after {
  content: '';
  position: absolute; top: 2px; right: 8px;
  width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%;
  border: 2px solid #fff;
}

/* spinner */
.spin-anim { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════
   MODAL (agregar vecino)
═══════════════════════════════════════════ */
.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(4px);
  display: none; align-items: flex-end; justify-content: center;
  z-index: 200;
}
.modal-overlay.open {
  display: flex;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.modal {
  width: 100%; max-height: 92%;
  background: var(--surface); border-radius: 22px 22px 0 0;
  display: flex; flex-direction: column; overflow: hidden;
  animation: slideUp .28s cubic-bezier(.22,.82,.22,1);
  box-shadow: 0 -8px 40px rgba(0,0,0,.18);
}
@keyframes slideUp {
  from { transform: translateY(100px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 18px 14px; border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.modal-header-left { display: flex; align-items: flex-start; gap: 12px; }
.modal-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--secondary-lt);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--text-main); line-height: 1.35; margin-top: 4px; }
.modal-close {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--surface); font-size: 1rem; color: var(--text-sub);
  cursor: pointer; flex-shrink: 0; transition: background .2s, color .2s;
}
.modal-close:hover { background: #f1f5f9; color: var(--text-main); }
.modal-body {
  flex: 1; overflow-y: auto;
  padding: 20px 18px; display: flex; flex-direction: column; gap: 18px;
}
.modal-footer {
  display: flex; gap: 10px;
  padding: 14px 18px; border-top: 1px solid var(--border); background: #f8fafc;
}

/* field */
.field-group { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: .78rem; font-weight: 700; color: var(--text-main); }
.field-input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: .875rem; font-family: var(--font);
  color: var(--text-main); background: var(--surface); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field-input:focus { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.field-input::placeholder { color: var(--text-muted); }
.field-input.error { border-color: var(--danger); }
.field-error { font-size: .72rem; color: var(--danger); font-weight: 500; min-height: 14px; display: block; }

.select-wrap { position: relative; }
.field-select {
  width: 100%; padding: 12px 38px 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: .875rem; font-family: var(--font);
  color: var(--text-main); background: var(--surface); outline: none;
  appearance: none; cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.field-select:focus { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.field-select.error { border-color: var(--danger); }

.btn-cancel {
  flex: 1; padding: 13px; background: none;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 600; color: var(--text-main);
  cursor: pointer; font-family: var(--font); transition: background .2s;
}
.btn-cancel:hover { background: #f1f5f9; }
.btn-submit {
  flex: 1; padding: 13px;
  background: var(--secondary); border: none; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 700; color: #fff;
  cursor: pointer; font-family: var(--font);
  box-shadow: 0 3px 10px rgba(59,130,246,.35);
  transition: background .2s, transform .1s;
}
.btn-submit:hover  { background: #2563eb; }
.btn-submit:active { transform: scale(.97); }
.btn-submit:disabled { background: var(--text-muted); cursor: not-allowed; box-shadow: none; transform: none; }

/* ═══════════════════════════════════════════
   CASA AUTOCOMPLETE
═══════════════════════════════════════════ */
.casa-autocomplete { position: relative; }
.casa-input-wrap {
  position: relative; display: flex; align-items: center;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  padding: 0 12px; min-height: 46px;
}
.casa-input-wrap.open,
.casa-input-wrap:focus-within {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.casa-input-wrap.error { border-color: var(--danger); }
.casa-input-icon { flex-shrink: 0; color: var(--text-muted); margin-right: 8px; }
.casa-trigger-input {
  flex: 1; border: none !important; background: transparent !important;
  box-shadow: none !important; padding: 0 !important;
  font-size: .875rem; cursor: pointer; color: var(--text-main); min-width: 0;
}
.casa-trigger-input:focus { outline: none; }
.casa-trigger-input.has-value { font-weight: 600; }
.casa-caret {
  flex-shrink: 0; color: var(--text-muted);
  margin-left: 6px; transition: transform .22s ease;
}
.casa-caret.rotated { transform: rotate(180deg); }

.casa-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,.14);
  z-index: 50; overflow: hidden;
  animation: panelOpen .18s cubic-bezier(.22,.82,.22,1);
}
@keyframes panelOpen {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}
.casa-panel-search {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.casa-panel-search svg { flex-shrink: 0; color: var(--text-muted); }
.casa-panel-input {
  flex: 1; border: none; background: transparent;
  font-size: .875rem; font-family: var(--font);
  color: var(--text-main); outline: none;
}
.casa-panel-input::placeholder { color: var(--text-muted); }
.casa-options {
  list-style: none; max-height: min(280px, 40vh);
  overflow-y: auto; overscroll-behavior: contain;
}
.casa-option {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; cursor: pointer;
  transition: background .15s; border-bottom: 1px solid #f1f5f9;
}
.casa-option:last-child { border-bottom: none; }
.casa-option:hover, .casa-option:focus { background: var(--secondary-lt); outline: none; }
.casa-option.selected { background: var(--secondary-lt); }
.casa-option-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--secondary-lt); color: var(--secondary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.casa-option.selected .casa-option-icon { background: var(--secondary); color: #fff; }
.casa-option-text { flex: 1; min-width: 0; }
.casa-option-num {
  font-size: .875rem; font-weight: 600; color: var(--text-main);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.casa-option-col { font-size: .74rem; color: var(--text-sub); }
.casa-option-check { color: var(--secondary); flex-shrink: 0; }
.casa-no-results {
  padding: 14px; text-align: center;
  font-size: .82rem; color: var(--text-muted);
}
.casa-option mark {
  background: #fef08a; color: var(--text-main);
  border-radius: 2px; padding: 0 1px;
}
.casa-create-btn {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #f0f7ff, #e8f0fe);
  border: none; border-top: 1.5px solid #bfdbfe; cursor: pointer;
  font-size: .875rem; font-weight: 700; color: var(--secondary);
  font-family: var(--font); transition: background .18s; text-align: left;
}
.casa-create-btn:hover { background: #dbeafe; }
.casa-create-icon {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--secondary); color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.casa-quota {
  margin-left: auto; font-size: .72rem; font-weight: 500;
  color: var(--text-sub); background: #dbeafe;
  border-radius: 20px; padding: 2px 8px; white-space: nowrap;
}
.casa-create-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ═══════════════════════════════════════════
   MODAL: PÁNICO
═══════════════════════════════════════════ */
.panic-overlay {
  position: absolute; inset: 0; z-index: 300;
  background: rgba(15,23,42,.65); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
}
.panic-sheet {
  background: #fff; border-radius: 24px 24px 0 0;
  padding: 16px 20px 32px; width: 100%;
  animation: slideUp .28s cubic-bezier(.22,.82,.22,1);
}
.panic-handle {
  width: 40px; height: 4px; background: #e2e8f0;
  border-radius: 4px; margin: 0 auto 18px;
}
.panic-title {
  font-size: 1.2rem; font-weight: 800;
  color: var(--text-main); text-align: center; margin-bottom: 8px;
}
.panic-desc {
  font-size: .82rem; color: var(--text-sub);
  text-align: center; line-height: 1.55; margin-bottom: 20px;
}
.panic-btns { display: flex; flex-direction: column; gap: 10px; }
.btn-panic-main {
  width: 100%; padding: 16px;
  background: var(--danger); color: #fff;
  border: none; border-radius: 14px;
  font-size: .95rem; font-weight: 800;
  font-family: var(--font); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 16px rgba(239,68,68,.4);
  transition: background .2s, transform .1s;
}
.btn-panic-main:active { transform: scale(.98); }
.btn-panic-medical {
  width: 100%; padding: 14px;
  background: var(--orange-lt); color: var(--orange);
  border: none; border-radius: 14px;
  font-size: .875rem; font-weight: 700;
  font-family: var(--font); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s;
}
.btn-panic-medical:hover { background: #fed7aa; }
.btn-panic-cancel {
  width: 100%; padding: 14px;
  background: #f1f5f9; color: var(--text-sub);
  border: none; border-radius: 14px;
  font-size: .875rem; font-weight: 700;
  font-family: var(--font); cursor: pointer;
  transition: background .2s;
}
.btn-panic-cancel:hover { background: var(--border); }

/* ═══════════════════════════════════════════
   TOAST
═══════════════════════════════════════════ */
.toast {
  position: absolute; bottom: calc(var(--nav-h) + 16px); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark); color: #fff;
  padding: 11px 22px; border-radius: 40px;
  font-size: .82rem; font-weight: 600; font-family: var(--font);
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 400; box-shadow: 0 6px 20px rgba(0,0,0,.22); max-width: 90%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--accent); }
.toast.error   { background: var(--danger); }

/* ═══════════════════════════════════════════
   BOOKING DATE STRIP + SLOTS
═══════════════════════════════════════════ */
.date-chip {
  flex-shrink: 0; width: 60px; height: 76px;
  border-radius: 14px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text-main);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.date-chip.active {
  background: var(--indigo); border-color: var(--indigo); color: #fff;
  box-shadow: 0 4px 14px rgba(99,102,241,.35);
}
.date-chip .chip-day  { font-size: .68rem; font-weight: 600; opacity: .75; }
.date-chip .chip-num  { font-size: 1.25rem; font-weight: 800; }
.date-chip .chip-dot  {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--danger); margin-top: 2px;
}
.date-chip.has-events .chip-day { color: inherit; }

/* Slot rows */
.slot-row {
  border-radius: 14px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
}
.slot-row--free {
  background: var(--surface); border: 2px solid var(--accent);
  cursor: pointer; transition: background .15s;
}
.slot-row--free:hover  { background: var(--accent-lt); }
.slot-row--free.selected { background: var(--accent-lt); }
.slot-row--busy {
  background: #f8fafc; border: 1.5px solid var(--border); opacity: .65;
  cursor: not-allowed;
}
.slot-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.slot-icon--free { background: var(--accent-lt); color: var(--accent); }
.slot-icon--busy { background: #e2e8f0; color: var(--text-muted); }
.slot-info { flex: 1; }
.slot-time { font-size: .88rem; font-weight: 800; color: var(--text-main); }
.slot-time--strike { text-decoration: line-through; color: var(--text-muted); }
.slot-sub  { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }
.slot-sub--free { color: var(--accent); font-weight: 600; }
.slot-badge {
  font-size: .65rem; font-weight: 800; padding: 3px 8px; border-radius: 6px;
}
.slot-badge--free  { background: var(--accent-lt); color: var(--accent); }
.slot-badge--busy  { background: #e2e8f0; color: var(--text-muted); }

/* ── Ripple animation for active panic bell ── */
@keyframes ripple {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,.55); }
  70%  { box-shadow: 0 0 0 20px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
@keyframes slideIn {
  from { transform: translateY(-16px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* ── Blinking panic banner ── */
@keyframes panicPulse {
  0%, 100% { opacity: 1;    box-shadow: 0 6px 20px rgba(239,68,68,.5); }
  50%       { opacity: .55; box-shadow: 0 2px  8px rgba(239,68,68,.2); }
}
.panic-banner-pulse {
  animation: panicPulse 1.2s ease-in-out infinite !important;
}


/* ═══════════════════════════════════════════
   STATUS BADGES
═══════════════════════════════════════════ */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .68rem; font-weight: 800; padding: 3px 9px;
  border-radius: 20px; white-space: nowrap;
}
.status--green  { background: var(--accent-lt);  color: var(--accent);  }
.status--red    { background: var(--danger-lt);  color: var(--danger);  }
.status--warn   { background: var(--warn-lt);    color: var(--warn);    }
.status--blue   { background: var(--indigo-lt);  color: var(--indigo);  }
.status--muted  { background: var(--dark-lt);    color: var(--text-sub);}

/* ═══════════════════════════════════════════
   ACTIVITY ROW (home - actividad reciente)
═══════════════════════════════════════════ */
.activity-row {
  background: var(--surface); border-radius: 14px;
  padding: 11px 14px;
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--border);
  cursor: pointer; transition: background .12s;
}
.activity-row:hover { background: var(--dark-lt); }
.activity-row-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex-shrink: 0;
}
.activity-row-icon--green { background: var(--accent-lt); color: var(--accent); }
.activity-row-icon--red   { background: var(--danger-lt); color: var(--danger); }
.activity-row-icon--warn  { background: var(--warn-lt);   color: var(--warn);   }
.activity-row-icon--blue  { background: var(--indigo-lt); color: var(--indigo); }
.activity-row-body { flex: 1; }
.activity-row-title { font-size: .82rem; font-weight: 700; color: var(--text-main); }
.activity-row-sub   { font-size: .7rem; color: var(--text-sub); margin-top: 1px; }
.activity-row-date  { font-size: .68rem; color: var(--text-muted); white-space: nowrap; }

/* ═══════════════════════════════════════════
   HISTÓRICOS TABS (inside modals)
═══════════════════════════════════════════ */
.historic-tabs {
  display: flex; gap: 6px; overflow-x: auto;
  scrollbar-width: none; padding: 4px 0 12px;
  flex-shrink: 0;
}
.htab {
  flex-shrink: 0; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text-sub);
  font-size: .75rem; font-weight: 700; font-family: var(--font);
  padding: 6px 13px; border-radius: 20px; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.htab.active {
  background: var(--primary); color: #fff;
  border-color: var(--primary);
}

/* ═══════════════════════════════════════════
   HISTÓRICO CARD (timeline item)
═══════════════════════════════════════════ */
.historico-card {
  background: var(--surface); border-radius: 14px;
  border: 1.5px solid var(--border); padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 10px;
}
.hc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.hc-title { font-size: .85rem; font-weight: 800; color: var(--text-main); }
.hc-meta  { font-size: .7rem; color: var(--text-muted); margin-top: 2px; }
.hc-desc  { font-size: .78rem; color: var(--text-sub); line-height: 1.5; }
.hc-admin-note {
  background: var(--indigo-lt); border-left: 3px solid var(--indigo);
  border-radius: 0 8px 8px 0; padding: 8px 10px; margin-top: 4px;
}
.hc-admin-note-label { font-size: .65rem; font-weight: 800; color: var(--indigo); text-transform: uppercase; margin-bottom: 2px; }
.hc-admin-note-text  { font-size: .75rem; color: var(--text-main); }

/* ── Admin note on green (resolved/approved) ── */
.hc-admin-note--green {
  background: var(--accent-lt); border-left-color: var(--accent);
}
.hc-admin-note--green .hc-admin-note-label { color: var(--accent); }
.hc-admin-note--red {
  background: var(--danger-lt); border-left-color: var(--danger);
}
.hc-admin-note--red .hc-admin-note-label { color: var(--danger); }

/* ─── Admin-approval card ─── */
.approval-card {
  background: var(--surface); border-radius: 14px;
  border: 1.5px solid var(--border); padding: 14px;
  margin-bottom: 10px;
}
.approval-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.approval-card-title { font-size: .85rem; font-weight: 800; color: var(--text-main); }
.approval-card-meta  { font-size: .72rem; color: var(--text-sub); }
.approval-note-input {
  width: 100%; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 8px 12px; font-size: .8rem; font-family: var(--font);
  color: var(--text-main); background: var(--dark-lt); margin-bottom: 8px;
  outline: none; transition: border-color .15s;
}
.approval-note-input:focus { border-color: var(--secondary); }
.approval-btns { display: flex; gap: 8px; }
.btn-approve {
  flex: 1; background: var(--accent); color: #fff;
  border: none; border-radius: 10px; padding: 9px;
  font-size: .8rem; font-weight: 800; font-family: var(--font); cursor: pointer;
}
.btn-reject {
  flex: 1; background: var(--danger-lt); color: var(--danger);
  border: 1.5px solid var(--danger); border-radius: 10px; padding: 9px;
  font-size: .8rem; font-weight: 800; font-family: var(--font); cursor: pointer;
}
.btn-mark-viewed  { flex: 1; background: var(--indigo-lt); color: var(--indigo); border: 1.5px solid var(--indigo); border-radius: 10px; padding: 9px; font-size: .8rem; font-weight: 800; font-family: var(--font); cursor: pointer; }
.btn-mark-resolved{ flex: 1; background: var(--accent-lt); color: var(--accent); border: 1.5px solid var(--accent); border-radius: 10px; padding: 9px; font-size: .8rem; font-weight: 800; font-family: var(--font); cursor: pointer; }

/* ── qa-dot notification bubble ── */
.qa-dot {
  position: absolute; top: -4px; right: -4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--surface);
  display: none; /* shown by JS */
}

/* ═══════════════════════════════════════════
   NOTIFICATION BELL
═══════════════════════════════════════════ */
.bell-btn {
  position: relative;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--surface); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--text-main);
  cursor: pointer; flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.bell-btn:hover  { background: var(--dark-lt); }
.bell-btn:active { transform: scale(.95); }

/* Shake animation when new notif appears */
@keyframes bellShake {
  0%,100% { transform: rotate(0); }
  15%     { transform: rotate(15deg); }
  30%     { transform: rotate(-12deg); }
  45%     { transform: rotate(10deg); }
  60%     { transform: rotate(-8deg); }
  75%     { transform: rotate(5deg); }
}
.bell-btn.ringing { animation: bellShake .6s ease; }

.bell-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 18px; height: 18px; border-radius: 9px;
  background: var(--danger); color: #fff;
  font-size: .65rem; font-weight: 900; font-family: var(--font);
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid var(--bg);
}
.bell-badge.hidden { display: none; }

/* ═══════════════════════════════════════════
   NOTIFICATION CARD
═══════════════════════════════════════════ */
.notif-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .12s;
  position: relative;
}
.notif-card:last-child { border-bottom: none; }
.notif-card--unread { background: #fff; }
.notif-card--read   { background: var(--dark-lt); opacity: .75; }
.notif-card:hover   { opacity: 1; background: var(--surface); }

/* Unread blue dot */
.notif-card--unread::before {
  content: '';
  position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--indigo);
}

.notif-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .88rem; flex-shrink: 0;
}
.notif-icon--green { background: var(--accent-lt);  color: var(--accent);  }
.notif-icon--red   { background: var(--danger-lt);  color: var(--danger);  }
.notif-icon--blue  { background: var(--indigo-lt);  color: var(--indigo);  }
.notif-icon--warn  { background: var(--warn-lt);    color: var(--warn);    }

.notif-body   { flex: 1; }
.notif-title  { font-size: .82rem; font-weight: 700; color: var(--text-main); }
.notif-sub    { font-size: .72rem; color: var(--text-sub); margin-top: 2px; line-height: 1.4; }
.notif-date   { font-size: .65rem; color: var(--text-muted); margin-top: 3px; }
.btn-mark-one {
  flex-shrink: 0; font-size: .65rem; font-weight: 800;
  color: var(--indigo); background: none; border: none;
  font-family: var(--font); cursor: pointer; padding: 2px 4px;
  opacity: .7;
}
.btn-mark-one:hover { opacity: 1; }

/* -------------------------------------------
   ADMIN PANIC ALERT BANNER
------------------------------------------- */
@keyframes adminPanicPulse {
  0%, 100% { opacity: 1;    box-shadow: 0 4px 24px rgba(239,68,68,.6); }
  50%       { opacity: .75; box-shadow: 0 2px  8px rgba(239,68,68,.25); }
}
.admin-panic-banner {
  display: flex; align-items: flex-start; justify-content: space-between;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; gap: 10px;
  animation: adminPanicPulse 1.4s ease-in-out infinite, slideIn .25s ease;
  color: #fff;
}
.admin-panic-banner.hidden { display: none; }
.admin-panic-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(255,255,255,.22); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.admin-panic-title  { font-size: .88rem; font-weight: 900; margin: 0 0 2px; }
.admin-panic-desc   { font-size: .76rem; opacity: .9;  margin: 0 0 3px; line-height: 1.4; }
.admin-panic-time   { font-size: .66rem; opacity: .75; margin: 0; }
.admin-panic-btn-view {
  background: rgba(255,255,255,.25); border: 1.5px solid rgba(255,255,255,.4);
  color: #fff; font-size: .72rem; font-weight: 800; padding: 5px 12px;
  border-radius: 8px; font-family: var(--font); cursor: pointer; white-space: nowrap;
  transition: background .15s;
}
.admin-panic-btn-view:hover  { background: rgba(255,255,255,.38); }
.admin-panic-btn-ignore {
  background: none; border: none; color: rgba(255,255,255,.7);
  font-size: .68rem; font-weight: 700; font-family: var(--font);
  cursor: pointer; text-decoration: underline; white-space: nowrap;
}
.admin-panic-btn-ignore:hover { color: #fff; }

/* -------------------------------------------
   GLOBAL PANIC BAR  (always-visible layer)
------------------------------------------- */
@keyframes globalPanicPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .72; }
}
.global-panic-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 11px 14px;
  background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
  color: #fff;
  animation: globalPanicPulse 1.1s ease-in-out infinite, slideIn .2s ease;
  z-index: 999; position: relative;
  /* sits above everything as first child of app-container */
}
.global-panic-bar.hidden { display: none !important; }
.global-panic-icon {
  width: 34px; height: 34px; border-radius: 8px;
  background: rgba(255,255,255,.2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.global-panic-title { font-size: .78rem; font-weight: 900; margin: 0; letter-spacing: .02em; }
.global-panic-desc  { font-size: .68rem; opacity: .88; margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.global-panic-btn-view {
  background: rgba(255,255,255,.22); border: 1.5px solid rgba(255,255,255,.4);
  color: #fff; font-size: .72rem; font-weight: 800;
  padding: 5px 10px; border-radius: 8px; font-family: var(--font);
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.global-panic-btn-dismiss {
  background: rgba(255,255,255,.15); border: 1.5px solid rgba(255,255,255,.3);
  color: #fff; font-size: .78rem; font-weight: 700;
  width: 28px; height: 28px; border-radius: 7px; font-family: var(--font);
  cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* -------------------------------------------
   FLOATING PANIC MODAL
------------------------------------------- */
@keyframes fpanic-shake {
  0%,100%{ transform:translateX(0) scale(1); }
  20%    { transform:translateX(-4px) scale(1.05); }
  40%    { transform:translateX(4px) scale(1.05); }
  60%    { transform:translateX(-3px); }
  80%    { transform:translateX(3px); }
}
@keyframes fpanic-icon-pulse {
  0%,100%{ opacity:1; transform:scale(1); }
  50%    { opacity:.7; transform:scale(1.18); }
}
.floating-panic-modal {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  z-index: 9999; width: calc(100% - 24px); max-width: 420px;
  pointer-events: auto;
  animation: fpanic-shake .6s ease forwards;
}
.floating-panic-modal.hidden { display: none !important; }
.floating-panic-card {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #7f1d1d 0%, #dc2626 50%, #ef4444 100%);
  border-radius: 18px; padding: 14px 16px; color: #fff;
  box-shadow: 0 8px 32px rgba(185,28,28,.55), 0 2px 8px rgba(0,0,0,.2);
  border: 1.5px solid rgba(255,255,255,.18);
  animation: fpanic-shake .55s ease;
}
.floating-panic-anim {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  animation: fpanic-icon-pulse 1s ease-in-out infinite;
}
.floating-panic-label { font-size: .6rem; font-weight: 900; letter-spacing: .12em; opacity: .75; margin: 0 0 2px; }
.floating-panic-who  { font-size: .9rem; font-weight: 800; margin: 0 0 2px; }
.floating-panic-type { font-size: .73rem; opacity: .88; margin: 0; }
.floating-panic-time { font-size: .62rem; opacity: .65; margin: 2px 0 0; }
.fpanic-btn-view {
  background: rgba(255,255,255,.2); border: 1.5px solid rgba(255,255,255,.4);
  color: #fff; font-size: .7rem; font-weight: 800; padding: 5px 10px;
  border-radius: 8px; font-family: var(--font); cursor: pointer; white-space: nowrap;
}
.fpanic-btn-dismiss {
  background: none; border: 1.5px solid rgba(255,255,255,.3);
  color: rgba(255,255,255,.8); font-size: .68rem; font-weight: 700; padding: 4px 8px;
  border-radius: 8px; font-family: var(--font); cursor: pointer; white-space: nowrap;
}

/* -------------------------------------------
   GOOGLE LOGIN BUTTON + DIVIDER
------------------------------------------- */
.login-divider {
  display: flex; align-items: center; gap: 10px; margin: 14px 0 12px;
}
.login-divider-line {
  flex: 1; height: 1px; background: var(--border);
}
.login-divider-text {
  font-size: .72rem; color: var(--text-muted); font-weight: 600;
}
.btn-login-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px 16px; border-radius: 14px;
  background: #fff; border: 1.5px solid var(--border);
  color: var(--text-main); font-size: .9rem; font-weight: 700;
  font-family: var(--font); text-decoration: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  transition: box-shadow .15s, transform .15s;
  cursor: pointer;
}
.btn-login-google:hover { box-shadow: 0 4px 16px rgba(0,0,0,.13); transform: translateY(-1px); }
.btn-login-google:active { transform: scale(.98); }

/* -------------------------------------------
   PENDING USER CARD (admin vecinos tab)
------------------------------------------- */
.pending-user-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 10px;
}
.pending-user-avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border); flex-shrink: 0;
}
.pending-user-name { font-size: .85rem; font-weight: 800; color: var(--text-main); margin: 0 0 1px; }
.pending-user-email { font-size: .7rem; color: var(--text-muted); margin: 0; }
.pending-user-date  { font-size: .65rem; color: var(--text-sub);  margin: 2px 0 0; }

/* -------------------------------------------
   PENDING GOOGLE USER VIEW
------------------------------------------- */
@keyframes ringPulse {
  0%,100% { transform: scale(1); opacity: .5; }
  50%     { transform: scale(1.18); opacity: .15; }
}
@keyframes ring2Pulse {
  0%,100% { transform: scale(1); opacity: .3; }
  50%     { transform: scale(1.35); opacity: .08; }
}
@keyframes hourglassSpin {
  0%  { transform: rotate(0deg); }
  50% { transform: rotate(180deg); }
  100% { transform: rotate(180deg); }
}
.pending-view {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #f0f6ff 0%, #eff6ff 50%, #f5f3ff 100%);
  padding: 24px 16px;
}
.pending-view.hidden { display: none !important; }
.pending-view-content {
  display: flex; flex-direction: column; align-items: center;
  max-width: 360px; width: 100%; gap: 0;
}
.pending-anim-wrap {
  position: relative; width: 90px; height: 90px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.pending-anim-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--indigo); opacity: .4;
  animation: ringPulse 2s ease-in-out infinite;
}
.pending-anim-ring--2 {
  inset: -10px;
  animation: ring2Pulse 2s ease-in-out infinite .4s;
}
.pending-avatar-wrap { position: relative; z-index: 1; }
.pending-avatar {
  width: 70px; height: 70px; border-radius: 50%;
  object-fit: cover; border: 3px solid #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.pending-title {
  font-size: 1.25rem; font-weight: 900; color: var(--text-main); margin: 0 0 4px; text-align: center;
}
.pending-name  { font-size: .88rem; font-weight: 700; color: var(--text-sub); margin: 0 0 2px; }
.pending-email { font-size: .72rem; color: var(--text-muted); margin: 0 0 20px; }
.pending-status-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: #fff; border-radius: 16px; padding: 14px 16px;
  border: 1.5px solid var(--border); width: 100%; margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.pending-status-icon {
  font-size: 1.3rem; color: var(--indigo); flex-shrink: 0; margin-top: 2px;
  animation: hourglassSpin 2s ease-in-out infinite;
}
.pending-status-title { font-size: .85rem; font-weight: 800; color: var(--text-main); margin: 0 0 4px; }
.pending-status-sub   { font-size: .73rem; color:var(--text-sub); line-height: 1.5; margin: 0; }
.pending-name-edit  { width: 100%; margin-bottom: 16px; }
.pending-name-label { font-size: .72rem; font-weight: 700; color: var(--text-muted); display: block; margin-bottom: 6px; }
.pending-retry-btn {
  width: 100%; background: var(--indigo); color: #fff; border: none;
  padding: 13px; border-radius: 14px; font-size: .88rem; font-weight: 800;
  font-family: var(--font); cursor: pointer; margin-bottom: 10px;
  transition: opacity .15s;
}
.pending-retry-btn:hover { opacity: .88; }
.pending-back-btn {
  background: none; border: none; color: var(--text-muted); font-size: .78rem;
  font-weight: 600; font-family: var(--font); cursor: pointer;
}
