[hidden] { display: none !important; }

:root {
  --bg: #f3f4fb;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-solid: #ffffff;
  --surface-soft: #f6f6fd;
  --surface-border: rgba(255, 255, 255, 0.75);
  --border: #dddaf2;
  --text: #2e245c;
  --muted: #7e76a0;
  --primary: #5f38cb;
  --primary-dark: #46279b;
  --primary-soft: rgba(95, 56, 203, 0.12);
  --accent: #1db7cf;
  --success: #22a86d;
  --success-soft: rgba(34, 168, 109, 0.14);
  --warning: #d79b1f;
  --warning-soft: rgba(215, 155, 31, 0.14);
  --danger: #e06277;
  --danger-soft: rgba(224, 98, 119, 0.14);
  --shadow: 0 24px 60px rgba(66, 43, 136, 0.14);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --input-bg: #f6f6fd;
  --modal-bg: rgba(255,255,255,0.98);
}

[data-theme="dark"] {
  --bg: #12101f;
  --surface: rgba(30, 26, 52, 0.97);
  --surface-solid: #1e1a34;
  --surface-soft: #1a1730;
  --surface-border: rgba(255, 255, 255, 0.06);
  --border: #2e2a4a;
  --text: #e8e4ff;
  --muted: #8a82b0;
  --primary: #7c5ce8;
  --primary-dark: #a98af5;
  --primary-soft: rgba(124, 92, 232, 0.18);
  --accent: #22cfe8;
  --success: #2dd17e;
  --success-soft: rgba(45, 209, 126, 0.14);
  --warning: #f0b429;
  --warning-soft: rgba(240, 180, 41, 0.14);
  --danger: #f07080;
  --danger-soft: rgba(240, 112, 128, 0.14);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  --input-bg: #1a1730;
  --modal-bg: rgba(24, 20, 42, 0.99);
}

* { box-sizing: border-box; }

html { transition: background 0.3s, color 0.3s; }

html[data-theme="dark"],
html[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(29, 183, 207, 0.06), transparent 24%),
    radial-gradient(circle at bottom right, rgba(95, 56, 203, 0.10), transparent 30%),
    var(--bg);
}

/* theme-toggle-btn oculto temporalmente — se activa cuando dark mode esté listo */
.theme-toggle-btn { display: none; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(29, 183, 207, 0.12), transparent 24%),
    radial-gradient(circle at bottom right, rgba(95, 56, 203, 0.14), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: "Nunito", system-ui, sans-serif;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
  appearance: none;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--range-progress, 50%), rgba(126, 118, 160, 0.25) var(--range-progress, 50%), rgba(126, 118, 160, 0.25) 100%);
  box-shadow: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(95, 56, 203, 0.24);
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(95, 56, 203, 0.24);
}

.page-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(243, 244, 251, 0.82);
  backdrop-filter: blur(10px);
}

.page-loading-card {
  width: min(360px, 100%);
  padding: 28px;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
}

.page-loading-card strong,
.login-brand h1,
.promo-card h2,
.dashboard-topbar h1,
.section-head h2,
.modal-head h2 {
  font-family: "Sora", sans-serif;
  margin: 0;
}

.page-loading-card span {
  color: var(--muted);
  line-height: 1.6;
}

.spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(95, 56, 203, 0.12);
  border-top-color: var(--accent);
  border-right-color: var(--primary);
  animation: spin 0.9s linear infinite;
}

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

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.foundation-login-body,
.foundation-dashboard-body {
  min-height: 100vh;
}

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 520px) 1fr;
  gap: 40px;
  padding: 48px;
  align-items: center;
}

.login-column { display: grid; gap: 26px; }
.login-brand { display: flex; align-items: center; gap: 18px; }
.login-brand img, .sidebar-brand img { width: 58px; height: 58px; border-radius: 18px; }
.login-copy, .placeholder-card p { margin: 0; color: var(--muted); line-height: 1.7; font-size: 15px; }

.panel-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.login-card { padding: 26px; display: grid; gap: 18px; }

.promo-card {
  width: min(560px, 100%);
  padding: 36px;
  border-radius: 38px;
  background: linear-gradient(160deg, rgba(95, 56, 203, 0.97), rgba(58, 33, 133, 0.97));
  color: #fff;
  box-shadow: var(--shadow);
}

.promo-list {
  margin: 20px 0 0;
  padding-left: 20px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.82);
}

label, fieldset { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; }
label > span, legend { font-size: 14px; font-weight: 800; }
.field-hint { color: var(--muted); font-size: 12px; line-height: 1.5; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
}

textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}

input:focus, textarea:focus, select:focus {
  border-color: rgba(95, 56, 203, 0.38);
  box-shadow: 0 0 0 4px rgba(95, 56, 203, 0.08);
}

.btn { border: 0; border-radius: 14px; padding: 10px 20px; font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-family: inherit; transition: opacity 0.15s, box-shadow 0.15s; }
.btn-primary { background: linear-gradient(135deg, #0d9488, #0891b2); color: #fff; box-shadow: 0 4px 14px rgba(13,148,136,0.28); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(13,148,136,0.38); opacity: 0.95; }
.btn-secondary { background: var(--primary-soft); color: var(--primary-dark); }
.btn-ghost { background: rgba(255, 255, 255, 0.12); color: #fff; }
.btn-danger { background: linear-gradient(135deg, #e74c3c, #c0392b); color: #fff; }
.btn-success { background: linear-gradient(135deg, #2ecc71, #27ae60); color: #fff; }
.btn-block { width: 100%; }

.form-message { margin: 0; font-size: 14px; font-weight: 800; }
.form-message.error { color: var(--danger); }
.form-message.success { color: var(--success); }

.dashboard-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 24px;
  padding: 20px 24px 24px;
}

.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 18px;
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, rgba(60, 52, 137, 0.98), rgba(83, 74, 183, 0.98) 62%, rgba(127, 119, 221, 0.98));
  color: #fff;
  box-shadow: var(--shadow);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
  margin-bottom: 18px;
}

.sidebar-brand strong, .sidebar-profile strong {
  display: block;
  font-size: 18px;
  color: #f6f2ff;
}
.sidebar-brand span, .sidebar-profile span {
  display: block;
  color: rgba(214, 240, 255, 0.78);
}

.sidebar-nav { display: grid; gap: 16px; }
.sidebar-nav-group {
  display: grid;
  gap: 4px;
}
.sidebar-nav-kicker {
  margin: 0 8px 6px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(216, 210, 255, 0.75);
}
.sidebar-nav-group + .sidebar-nav-group {
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 4px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 14px;
  padding: 11px 12px;
  background: transparent;
  color: #ded7ff;
  text-align: left;
  font-weight: 900;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.sidebar-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.sidebar-link-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
}
.sidebar-link-text {
  min-width: 0;
  flex: 1;
}
.sidebar-link-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #f8f6ff;
  font-size: 10px;
  font-weight: 900;
}

.sidebar-link.active, .sidebar-link:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fefcff;
  transform: translateX(1px);
}

.sidebar-profile {
  padding: 18px;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.sidebar-profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.sidebar-profile img { width: 54px; height: 54px; border-radius: 18px; object-fit: cover; }

.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: calc(100vh - 48px);
}
.dashboard-main > * { min-width: 0; }
.dashboard-appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 42px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  position: relative;
  z-index: 20;
  overflow: visible;
}
.dashboard-appbar-context {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.dashboard-appbar-context #appbar-context-section {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.dashboard-appbar-context #appbar-context-detail {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.dashboard-appbar-separator {
  color: rgba(126, 118, 160, 0.4);
  font-weight: 400;
}
.dashboard-heading {
  display: grid;
  gap: 0;
  padding: 0;
}
.dashboard-topbar {
  display: block;
  margin: 0;
}
.dashboard-topbar h1 {
  margin: 0;
  font-size: clamp(30px, 3vw, 40px);
  line-height: 0.96;
  letter-spacing: -0.04em;
}
.dashboard-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.dashboard-mobile-brand,
.dashboard-mobile-tabbar {
  display: none;
}
.dashboard-mobile-brand {
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.dashboard-mobile-brand img {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(11, 13, 30, 0.2);
}
.dashboard-mobile-brand div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.dashboard-mobile-brand strong {
  font-family: "Sora", sans-serif;
  font-size: 14px;
  line-height: 1;
}
.dashboard-mobile-brand span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.mobile-tabbar-link {
  border: 0;
  background: transparent;
}
.mobile-tabbar-icon-shell {
  position: relative;
  display: inline-flex;
}
.mobile-tabbar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mobile-tabbar-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
}
.mobile-tabbar-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8a69, #ff5876);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 8px 14px rgba(255, 88, 118, 0.32);
}
.topbar-account-shell {
  position: relative;
  display: flex;
  align-items: center;
  z-index: 40;
}
.topbar-account-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 42px;
  padding: 3px 12px 3px 3px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(95, 56, 203, 0.04);
}
.topbar-account-btn:hover {
  border-color: rgba(95, 56, 203, 0.22);
}
.topbar-account-btn[aria-expanded="true"] {
  border-color: rgba(95, 56, 203, 0.32);
  box-shadow: 0 14px 30px rgba(95, 56, 203, 0.12);
}
.topbar-account-btn img {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  object-fit: cover;
  background: var(--surface-soft);
  border: 2px solid rgba(95, 56, 203, 0.12);
}
.topbar-account-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
}
.topbar-account-copy strong {
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}
.topbar-account-copy small {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.topbar-account-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
}
.topbar-account-caret svg {
  width: 16px;
  height: 16px;
}
.topbar-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 224px;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(126, 118, 160, 0.18);
  border-radius: 20px;
  background: var(--modal-bg);
  box-shadow: 0 24px 42px rgba(66, 43, 136, 0.16);
  z-index: 80;
}
.topbar-menu-item {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  text-align: left;
}
.topbar-menu-item:hover {
  background: var(--surface-soft);
}
.topbar-menu-item.danger {
  color: var(--danger);
}
.topbar-menu-item.danger:hover {
  color: var(--danger);
  background: rgba(224, 98, 119, 0.08);
}

.dash-section { display: none; }
.dash-section.active {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.section-hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 12px;
  padding: 0;
}
.section-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.section-hero-btn {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(29, 183, 207, 0.16);
}
.pets-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.45fr) repeat(4, minmax(150px, 0.9fr)) auto;
  gap: 12px;
  align-items: end;
}
.filter-field {
  display: grid;
  gap: 6px;
}
.filter-field span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.filter-field input,
.filter-field select {
  min-height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
}
.filter-search input {
  padding-left: 16px;
}
.filter-reset-btn {
  min-height: 44px;
  border-radius: 14px;
  padding: 0 16px;
}
.stats-grid, .dashboard-grid { display: grid; gap: 18px; }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }

.stat-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
}

.stat-card.alt { background: linear-gradient(160deg, rgba(29, 183, 207, 0.15), rgba(255, 255, 255, 0.95)); }
.stat-card.warm { background: linear-gradient(160deg, rgba(215, 155, 31, 0.14), rgba(255, 255, 255, 0.95)); }
.stat-card.cool { background: linear-gradient(160deg, rgba(95, 56, 203, 0.12), rgba(255, 255, 255, 0.95)); }

/* Pending adoptions alert banner */
.pending-alert-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-bottom: 18px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(95, 56, 203, 0.08), rgba(29, 183, 207, 0.08));
  border: 1.5px solid var(--primary);
  box-shadow: 0 2px 12px rgba(95, 56, 203, 0.12);
  cursor: pointer;
  text-align: left;
  transition: background 0.18s, box-shadow 0.18s, transform 0.15s;
}
.pending-alert-card:hover {
  background: linear-gradient(135deg, rgba(95, 56, 203, 0.14), rgba(29, 183, 207, 0.12));
  box-shadow: 0 4px 20px rgba(95, 56, 203, 0.2);
  transform: translateY(-1px);
}
.pending-alert-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.pending-alert-icon svg { stroke: #fff; }
.pending-alert-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pending-alert-body strong {
  font-family: "Sora", sans-serif;
  font-size: 16px;
  color: var(--primary-dark);
}
.pending-alert-body span {
  font-size: 13px;
  color: var(--muted);
}
.pending-alert-arrow {
  font-size: 20px;
  color: var(--primary);
  font-weight: 900;
}

.stat-label {
  display: block;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-card strong { display: block; margin: 12px 0 4px; font-family: "Sora", sans-serif; font-size: 34px; }
.stat-card small { color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.panel-card .section-head h2 {
  margin: 0;
  font-size: clamp(20px, 2.1vw, 27px);
  line-height: 1.04;
}
.section-subcopy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.mini-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
}

.pill-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pill-card { padding: 14px 16px; border-radius: var(--radius-md); background: var(--surface-soft); border: 1px solid var(--border); }
.pill-card span { display: block; color: var(--muted); font-weight: 800; margin-bottom: 6px; }
.pill-card strong { font-size: 22px; font-family: "Sora", sans-serif; }

.stack-list { display: grid; gap: 12px; }
.stack-item { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--surface-soft); border: 1px solid var(--border); }
.stack-item strong { display: block; }

.help-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(95, 56, 203, 0.10), rgba(29, 183, 207, 0.12));
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
}

.help-hero h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.05;
}

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

.help-card {
  display: grid;
  gap: 10px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
}

.help-card-primary {
  background: linear-gradient(160deg, rgba(95, 56, 203, 0.13), rgba(255, 255, 255, 0.96));
}

.help-card-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: "Sora", sans-serif;
  font-weight: 900;
}

.help-card h3 {
  margin: 0;
  color: var(--text);
  font-family: "Sora", sans-serif;
  font-size: 17px;
}

.help-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.help-card button {
  justify-self: start;
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 900;
  cursor: pointer;
}

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

.help-guide-panel {
  padding: 22px;
}

.help-checklist {
  display: grid;
  gap: 12px;
}

.help-check-item {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.help-check-item strong {
  color: var(--text);
}

.help-check-item span,
.help-faq p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.help-faq {
  border-top: 1px solid var(--border);
  padding: 14px 0;
}

.help-faq:last-child {
  border-bottom: 1px solid var(--border);
}

.help-faq summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 900;
}

.help-faq p {
  margin: 8px 0 0;
}

@media (max-width: 860px) {
  .help-hero,
  .help-layout,
  .help-quick-grid {
    grid-template-columns: 1fr;
  }

  .help-hero {
    padding: 20px;
  }

  .help-hero .section-hero-actions,
  .help-hero .section-hero-btn {
    width: 100%;
  }
}
.stack-item small, .table-empty, .empty-inline { color: var(--muted); }
.stack-item--milestone { background: linear-gradient(135deg, rgba(95,56,203,0.07), rgba(29,183,207,0.07)); border-color: rgba(95,56,203,0.18); }
.stack-item--milestone strong { color: var(--primary-dark); }
.stack-item--agenda { background: linear-gradient(135deg, rgba(215,155,31,0.08), rgba(255,255,255,0.95)); border-color: rgba(215,155,31,0.3); transition: background 0.15s, transform 0.12s; align-items: flex-start; }
.stack-item--agenda:hover { background: linear-gradient(135deg, rgba(215,155,31,0.14), rgba(255,255,255,0.95)); transform: translateX(2px); }
.stack-item-icon { font-size: 22px; flex-shrink: 0; line-height: 1; }
.stack-item-icon--agenda { width: 36px; height: 36px; border-radius: 10px; background: rgba(215,155,31,0.15); color: #a07010; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.agenda-notes { display: block; margin-top: 3px; color: #8a6000; font-style: italic; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid rgba(126, 118, 160, 0.14); }
th { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.operations-card {
  border-radius: 30px;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 24px;
}
.operations-card .table-wrap {
  flex: 1;
  overflow: visible;
}
.operations-table tbody tr {
  transition: background 0.16s ease;
}
.operations-table tbody tr:hover {
  background: rgba(95, 56, 203, 0.025);
}
.operations-table td {
  vertical-align: middle;
}

.table-person { display: flex; align-items: center; gap: 12px; }
.table-person > div { display: flex; flex-direction: column; min-width: 0; }
.table-person strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.table-person small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-avatar { width: 44px; height: 44px; border-radius: 14px; object-fit: cover; background: linear-gradient(135deg, var(--primary-soft), rgba(29, 183, 207, 0.18)); }
.table-home-text {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(126, 118, 160, 0.16);
  background: rgba(126, 118, 160, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.table-home-text.assigned {
  background: rgba(250, 238, 218, 0.88);
  border-color: rgba(250, 199, 117, 0.95);
  color: #7a5412;
}
.table-home-text.adopted {
  background: var(--success-soft);
  border-color: rgba(34, 168, 109, 0.35);
  color: var(--success);
}

.status-badge { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 900; }
.status-badge.good { background: var(--success-soft); color: var(--success); }
.status-badge.warning { background: var(--warning-soft); color: var(--warning); }
.status-badge.danger { background: var(--danger-soft); color: var(--danger); }
.status-badge.muted { background: rgba(126, 118, 160, 0.12); color: var(--muted); }

.placeholder-card { min-height: 240px; place-content: center; }
.form-grid, .modal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full, .modal-grid .full { grid-column: 1 / -1; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-group label, .checkbox-inline { display: inline-flex; align-items: center; gap: 10px; }
.checkbox-group input, .checkbox-inline input { width: 18px; height: 18px; margin: 0; }

/* Tipos de rescate — chips táctiles */
.checkbox-group label:has(input[name="rescueType"]) {
  gap: 0;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  min-height: 44px;
  user-select: none;
}
.checkbox-group label:has(input[name="rescueType"]:checked) {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 3px 12px rgba(95, 56, 203, 0.22);
}
.checkbox-group label:has(input[name="rescueType"]:hover):not(:has(:checked)) {
  border-color: var(--primary);
  color: var(--primary);
}
.checkbox-group input[name="rescueType"] {
  display: none;
}

.modal-stack-field {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.stack-field-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.stack-field-title {
  display: block;
  font-size: 14px;
  font-weight: 900;
}

.chip-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-option {
  position: relative;
  display: inline-flex;
}

.chip-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.chip-option span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.chip-option:hover span {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(95, 56, 203, 0.08);
}

.chip-option input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 10px 18px rgba(95, 56, 203, 0.18);
}

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

.photo-upload-shell {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.condition-description {
  grid-column: 1 / -1;
}

.condition-list {
  display: grid;
  gap: 10px;
}

.photo-preview-list {
  display: grid;
  gap: 10px;
}

.photo-preview-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
}

.photo-preview-card img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 14px;
}

.photo-preview-card strong {
  display: block;
  margin-bottom: 4px;
}

.photo-preview-card small {
  color: var(--muted);
  line-height: 1.5;
}

.photo-preview-card button {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-weight: 900;
}

.condition-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
}

.condition-card strong {
  display: block;
  margin-bottom: 4px;
}

.condition-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.condition-card button {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-weight: 900;
}

.modal { width: min(780px, calc(100vw - 24px)); border: 0; padding: 0; background: transparent; }
.modal::backdrop { background: rgba(28, 22, 48, 0.46); backdrop-filter: blur(6px); }

.modal-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.modal-head h2,
.modal-head h3 { flex: 1; }
.icon-btn,
.modal-close-btn {
  flex-shrink: 0;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text-sec);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.icon-btn:hover,
.modal-close-btn:hover { background: var(--border); }

/* ── Phone prefix input (Chile +56) ── */
.phone-wrap-admin {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.phone-wrap-admin:focus-within {
  border-color: rgba(95, 56, 203, 0.38);
  box-shadow: 0 0 0 4px rgba(95, 56, 203, 0.08);
}
.phone-prefix-admin {
  padding: 14px 8px 14px 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  user-select: none;
}
.phone-wrap-admin input {
  border: none !important;
  border-radius: 0 !important;
  padding: 14px 16px 14px 4px;
  background: transparent;
  flex: 1;
  min-width: 0;
  width: auto;
  box-shadow: none !important;
}
.phone-wrap-admin input:focus {
  border: none !important;
  box-shadow: none !important;
}

/* ── Checkbox rows inside forms ── */
.form-field-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface-soft);
  transition: background .15s;
}
.form-field-check:hover { background: var(--border); }
.form-field-check input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  margin: 0;
}
.form-field-check .field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

/* ── Adoption stat chips — acentos de color por tipo ── */
#section-adoptions .stats-row .stat-chip { border-top: 2.5px solid transparent; }
#section-adoptions .stats-row .stat-chip:nth-child(1) { border-top-color: var(--muted); }
#section-adoptions .stats-row .stat-chip:nth-child(2) { border-top-color: var(--warning, #f0a500); }
#section-adoptions .stats-row .stat-chip:nth-child(3) { border-top-color: var(--success); }
#section-adoptions .stats-row .stat-chip:nth-child(4) { border-top-color: var(--danger); }

/* ── Detail modal footer — sin botón Cerrar, grupo de acciones full-width ── */
.adop-actions-footer {
  padding: 0;
  background: none;
  display: block;
}
.adop-actions-footer .adop-action-group {
  display: flex;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}

/* ── Modal detalle adopción — campos estilizados ── */
.adop-detail-status { margin-top: 6px; }
.adop-detail-body { display: grid; gap: 10px; padding: 0; margin-bottom: 16px; }
.adop-info-group {
  background: var(--surface-soft);
  border-radius: 16px;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}
.adop-info-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adop-info-field { display: grid; gap: 2px; min-width: 0; }
.adop-info-label {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.adop-info-value { font-size: 14px; font-weight: 700; color: var(--text); word-break: break-word; }
.adop-bool-row { display: flex; gap: 6px; flex-wrap: wrap; }
.adop-bool-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.adop-bool-chip.yes {
  background: rgba(34, 168, 109, 0.1);
  border-color: rgba(34, 168, 109, 0.3);
  color: var(--success);
}
.adop-info-date {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin: 0;
}
.adop-notes-block {
  background: var(--surface-soft);
  border-radius: 14px;
  padding: 10px 14px;
  display: grid;
  gap: 4px;
}
.adop-notes-block.internal {
  background: rgba(255, 249, 230, 0.9);
  border: 1px solid rgba(215, 155, 31, 0.2);
}
.adop-notes-block p { margin: 0; font-size: 13px; color: var(--text); }
.adop-notes-block.internal p { color: #8a5800; }
/* Seguimiento: card separada visualmente */
.adop-seguimiento-section {
  background: var(--surface-soft);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 14px 16px;
  display: grid;
  gap: 12px;
  margin-top: 4px;
}
.adop-seguimiento-section .followup-section-label { margin-bottom: 0; }

/* ── Stats row (adoption counts) ── */
.stats-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.stat-chip {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-weight: 700;
  font-size: 22px;
  color: var(--text);
  line-height: 1;
}
.stat-chip small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* ── Filter chip row (adoption status tabs) ── */
.filter-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-sec);
  font-family: "Nunito", sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.filter-chip:hover { background: var(--surface-soft); color: var(--text); }
.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 900;
}
.modal-actions {
  position: sticky;
  bottom: -24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
  margin-left: -24px;
  margin-right: -24px;
  margin-bottom: -24px;
  padding: 18px 24px 24px;
  background: linear-gradient(180deg, rgba(243, 244, 251, 0), rgba(243, 244, 251, 0.92) 24%, rgba(243, 244, 251, 1) 60%);
}
.modal-actions .btn-ghost {
  background: var(--surface-soft);
  color: var(--text);
}
.help-list { margin: 0; padding-left: 20px; line-height: 1.8; color: var(--muted); }

/* ══════════════════════════════════════════════
   Pet modal – 4 pasos
══════════════════════════════════════════════ */
.pet-modal-v2 {
  width: min(660px, calc(100vw - 24px));
  border: 0;
  padding: 0;
  background: transparent;
}
.pet-modal-v2::backdrop { background: rgba(28, 22, 48, 0.46); backdrop-filter: blur(6px); }

.pet-modal-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
  max-height: calc(100vh - 32px);
}

/* Header */
.pet-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px 14px;
  flex-shrink: 0;
}
.pet-modal-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 3px;
}
.pet-modal-header h2 {
  font-family: "Sora", sans-serif;
  font-size: 17px;
  font-weight: 800;
  margin: 0;
  color: var(--text);
}

/* Step bar */
.pet-step-bar {
  display: flex;
  align-items: center;
  padding: 0 24px 14px;
  gap: 0;
  flex-shrink: 0;
}
.pet-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.pet-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
}
.pet-step-item.active .pet-step-dot {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(95,56,203,.35);
}
.pet-step-item.done .pet-step-dot {
  background: var(--primary-soft);
  color: var(--primary);
}
.pet-step-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  transition: color .2s;
}
.pet-step-item.active .pet-step-label,
.pet-step-item.done  .pet-step-label { color: var(--primary); }
.pet-step-item.active,
.pet-step-item.done { cursor: pointer; }
.pet-step-item.active:hover .pet-step-dot,
.pet-step-item.done:hover .pet-step-dot { opacity: 0.8; }
/* En edición todos los dots son navegables */
.pet-step-bar--edit .pet-step-item { cursor: pointer; }
.pet-step-bar--edit .pet-step-item:hover .pet-step-dot { opacity: 0.8; }
.pet-step-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin-bottom: 14px;
  min-width: 12px;
}

/* Progress bar */
.pet-modal-progress {
  height: 3px;
  background: var(--border);
  flex-shrink: 0;
}
.pet-modal-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
  transition: width .3s ease;
}

/* Step panels */
.pet-step-panel {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

/* Footer */
.pet-modal-footer {
  padding: 14px 24px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(243,244,251,0), rgba(243,244,251,.92) 20%, rgba(243,244,251,1) 55%);
}
[data-theme="dark"] .pet-modal-footer {
  background: linear-gradient(180deg, rgba(18,16,30,0), rgba(18,16,30,.95) 20%, rgba(18,16,30,1) 55%);
}
.pet-modal-footer-step {
  display: flex;
  gap: 10px;
}
.pet-modal-footer-step .btn { flex: 1; justify-content: center; }
.pet-modal-footer-step .btn-primary { flex: 2; }
.pet-modal-footer-step .btn-ghost {
  background: var(--surface-soft);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.pet-modal-footer-step .btn-primary:disabled {
  background: var(--border);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}

/* Summary card */
.pet-summary-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-top: 4px;
}
.pet-summary-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 10px;
}
.pet-summary-body { display: flex; flex-direction: column; gap: 6px; }
.pet-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}
.pet-summary-key {
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  dialog.pet-modal-v2 {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0;
  }
  .pet-modal-card {
    border-radius: 20px 20px 0 0;
    max-height: 92dvh;
  }
  .pet-modal-header { padding: 18px 18px 10px; }
  .pet-step-bar { padding: 0 18px 12px; }
  .pet-step-label { font-size: 9px; }
  .pet-step-dot { width: 24px; height: 24px; font-size: 11px; }
  .pet-step-panel { padding: 16px 18px; }
  .pet-modal-footer { padding: 12px 18px 18px; }
  .pet-modal-footer-step .btn-ghost {
    background: var(--surface-soft) !important;
    color: var(--text) !important;
    border: 1.5px solid var(--border) !important;
  }
}

@media (max-width: 1100px) {
  .login-layout, .dashboard-shell, .stats-grid, .dashboard-grid, .pill-grid, .form-grid, .form-grid-2, .modal-grid, .condition-grid, .photo-grid, .pets-filters { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  /* Removed conflicting mobile rules — all mobile overrides are in the max-width:768px block */
}

.inline-select {
  width: auto;
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}
.inline-select.status-teal {
  background: #e1f5ee;
  color: #0f6e56;
  border-color: #5dcaa5;
}
.inline-select.status-purple {
  background: #eeedfe;
  color: #3c3489;
  border-color: #afa9ec;
}
.inline-select.status-amber {
  background: #faeeda;
  color: #633806;
  border-color: #fac775;
}
.inline-select.status-gray {
  background: var(--surface-soft);
  color: var(--muted);
  border-color: var(--border);
}

.inline-select-locked {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  font-weight: 700;
  white-space: nowrap;
  cursor: default;
  user-select: none;
}
.inline-select-locked.status-teal { background: #e1f5ee; color: #0f6e56; border-color: #5dcaa5; }
.inline-select-locked.status-purple { background: #eeedfe; color: #3c3489; border-color: #afa9ec; }
.inline-select-locked.status-amber { background: #faeeda; color: #633806; border-color: #fac775; }
.inline-select-locked.status-gray { background: var(--surface-soft); color: var(--muted); border-color: var(--border); }

.table-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.table-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 900;
  background: var(--primary-soft);
  color: var(--primary-dark);
  text-decoration: none;
}
.table-action-btn.primary {
  background: var(--primary);
  color: #fff;
}
.table-action-btn.soft-danger {
  background: rgba(224, 98, 119, 0.1);
  color: var(--danger);
}

.temporary-home-modal-head {
  margin-top: 18px;
  margin-bottom: 10px;
}
.temporary-home-modal-head h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 20px;
  line-height: 1.08;
}
.temporary-home-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.temporary-home-meta-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}
.temporary-home-meta-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.temporary-home-meta-card strong {
  display: block;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.temporary-home-pets-list {
  display: grid;
  gap: 12px;
}
.temporary-home-pet-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--border);
}
.temporary-home-pet-card img {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--surface-soft);
}
.temporary-home-pet-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}
.temporary-home-pet-card small {
  display: block;
  color: var(--muted);
  line-height: 1.5;
}
.temporary-home-pet-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.table-action-btn:hover { background: var(--primary); color: #fff; }
.table-action-btn.soft-danger:hover { background: var(--danger); color: #fff; }
.table-action-danger:hover { background: var(--danger) !important; color: #fff !important; }

/* ── Records fullscreen panel ───────────────────────────────── */
/* Pet records section layout */
#section-pet-records {
  gap: 0 !important;
  height: calc(100vh - 120px);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  width: 100%;
}

/* Hero gradient header */
.records-hero {
  position: relative;
  padding: 20px 28px 18px 72px;
  background: linear-gradient(135deg, #5f38cb 0%, #7c4dff 35%, #1db7cf 100%);
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.records-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.records-hero-paw {
  position: absolute;
  color: rgba(255,255,255,0.07);
}
.records-hero-paw-1 {
  width: 100px; height: 100px;
  top: -18px; right: 24px;
  transform: rotate(-18deg);
  animation: pawFloat1 6s ease-in-out infinite;
}
.records-hero-paw-2 {
  width: 68px; height: 68px;
  bottom: -8px; left: 60px;
  transform: rotate(22deg);
  animation: pawFloat2 7s ease-in-out infinite;
}
.records-hero-paw-3 {
  width: 48px; height: 48px;
  top: 12px; left: 200px;
  transform: rotate(-40deg);
  animation: pawFloat3 5s ease-in-out infinite;
}
@keyframes pawFloat1 { 0%,100%{transform:rotate(-18deg) translateY(0)} 50%{transform:rotate(-14deg) translateY(-6px)} }
@keyframes pawFloat2 { 0%,100%{transform:rotate(22deg) translateX(0)} 50%{transform:rotate(26deg) translateX(5px)} }
@keyframes pawFloat3 { 0%,100%{transform:rotate(-40deg) scale(1)} 50%{transform:rotate(-36deg) scale(1.08)} }

/* Back button */
.records-back-btn {
  position: absolute;
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
  z-index: 5;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.16);
  backdrop-filter: blur(8px);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
}
.records-back-btn:hover {
  background: rgba(255,255,255,0.28);
  transform: translateY(-50%) scale(1.08);
}

/* Pet selector dropdown in hero */
.records-pet-selector {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 5;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-family: "Nunito", sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(6px);
  outline: none;
  max-width: 200px;
}
.records-pet-selector option {
  color: var(--text);
  background: #fff;
}
.records-pet-selector:hover {
  border-color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.2);
}

/* Agenda toggle button active state */
.record-agenda-btn.active {
  background: rgba(224, 98, 119, 0.1);
  color: var(--danger);
  border-color: rgba(224, 98, 119, 0.3);
}

/* Hero content layout */
.records-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 18px;
}
.records-avatar-ring {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  padding: 3px;
  background: linear-gradient(135deg, rgba(255,255,255,0.5), rgba(255,255,255,0.18));
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.records-avatar-ring img {
  width: 100%;
  height: 100%;
  border-radius: 15px;
  object-fit: cover;
  background: rgba(255,255,255,0.25);
}
.records-hero-info {
  min-width: 0;
}
.records-hero-eyebrow {
  display: none;
}
.records-hero-title {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  color: #fff;
}
.records-hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.records-hero-meta strong {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: rgba(255,255,255,0.18);
  padding: 4px 12px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.records-hero-meta span {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  font-weight: 700;
}

/* Body */
.records-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  background: var(--bg);
  min-height: 0;
}

.caretaker-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 20px 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(29,183,207,0.10), rgba(95,56,203,0.07));
  border: 1.5px solid rgba(29,183,207,0.3);
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}
.caretaker-banner > svg { color: var(--accent); }
.caretaker-banner strong { color: var(--primary-dark); }
.caretaker-banner[data-adopted="true"] {
  background: linear-gradient(135deg, rgba(34,168,109,0.10), rgba(34,168,109,0.05));
  border-color: rgba(34,168,109,0.35);
}
.caretaker-banner[data-adopted="true"] > svg { color: var(--success); }
.caretaker-banner[data-adopted="true"] strong { color: var(--success); }
.caretaker-banner[data-adopted="true"] .caretaker-banner-actions { display: none; }
.caretaker-banner-body { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.caretaker-banner-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.caretaker-contact-label { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.btn-contact {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 10px;
  font-size: 12px; font-weight: 700; text-decoration: none;
  transition: opacity 0.15s, transform 0.12s;
}
.btn-contact:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-contact-email { background: rgba(95,56,203,0.12); color: var(--primary-dark); }
.btn-contact-wsp { background: rgba(37,211,102,0.15); color: #1a7a3e; }

#records-content {
  width: 100%;
  min-height: 100%;
}

#records-content.records-layout {
  height: 100%;
}

/* ── Split layout ────────────────────────────────────────────── */
.records-split-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  width: 100%;
  height: 100%;
}

/* ── Left sidebar ────────────────────────────────────────────── */
.records-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px 18px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.records-sidebar-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}
.records-sidebar-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateX(2px);
  box-shadow: 0 4px 14px rgba(95,56,203,0.08);
}
.records-sidebar-btn.active {
  background: linear-gradient(135deg, var(--primary), #7c4dff);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(95,56,203,0.28);
  transform: translateX(0);
}
.records-sidebar-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
.records-sidebar-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Right panel ─────────────────────────────────────────────── */
.records-right-panel {
  padding: 24px 24px 32px 18px;
  overflow-y: auto;
  max-height: calc(100vh - 32px - 150px);
}

/* ── Sub-filter chips ────────────────────────────────────────── */
.records-sub-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.records-sub-chip {
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 800;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s ease;
}
.records-sub-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.records-sub-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(95,56,203,0.18);
}

/* ── Timeline records ────────────────────────────────────────── */
.records-timeline {
  display: grid;
  gap: 16px;
}

/* Timeline item row */
.record-timeline-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  position: relative;
}
/* Vertical connector line */
.record-timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 44px;
  bottom: -16px;
  width: 2px;
  background: var(--border);
}
/* Dot / icon circle */
.record-timeline-dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--record-color, var(--primary));
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--record-color, var(--primary)) 30%, transparent);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.record-timeline-dot span {
  font-size: 18px;
  line-height: 1;
  filter: none;
}
/* Card */
.record-timeline-card {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid rgba(221,218,242,0.6);
  border-top: 3.5px solid var(--record-color, var(--primary));
  padding: 16px 18px;
  box-shadow: 0 4px 16px rgba(95,56,203,0.05);
  display: grid;
  gap: 8px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.record-timeline-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(95,56,203,0.1);
}
.record-timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.record-timeline-head strong {
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
}
.record-date {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  background: var(--surface-soft);
  padding: 4px 10px;
  border-radius: 8px;
}
.record-timeline-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.record-type-badge {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
}
.record-next-date {
  font-size: 12px;
  font-weight: 800;
  color: #1264a3;
  background: rgba(29, 183, 207, 0.10);
  border: 1px solid rgba(29, 183, 207, 0.25);
  border-radius: 8px;
  padding: 3px 9px;
}
.record-value {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: var(--primary);
}
.record-clinic {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.record-clinic-icon {
  font-size: 13px;
}
/* Campo extra específico por tipo (Tipo de visita, Nro. lote, etc.) */
.record-extra-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--rec-color, var(--primary)) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--rec-color, var(--primary)) 18%, transparent);
  width: fit-content;
  max-width: 100%;
}
.record-extra-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--rec-color, var(--primary));
}
.record-extra-label::after {
  content: ":";
}
.record-extra-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}
/* Nro. de serie — texto secundario, sin badge coloreado */
.record-extra-field--serial {
  background: transparent;
  border: none;
  padding: 2px 0;
  gap: 5px;
}
.record-extra-field--serial .record-extra-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b6880;    /* gris oscuro legible, no tan tenue */
}
.record-extra-field--serial .record-extra-value {
  font-size: 11px;
  font-weight: 600;
  color: #3d3a52;    /* más oscuro para contraste — nota del análisis */
  letter-spacing: 0.02em;
}

/* Acciones editar / eliminar en tarjeta vet */
.record-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}
.record-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.record-action-btn:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--primary-soft, #ddd9f5);
}
.record-action-btn.danger {
  color: #E74C3C;
  border-color: rgba(231,76,60,0.25);
}
.record-action-btn.danger:hover {
  background: rgba(231,76,60,0.06);
  border-color: rgba(231,76,60,0.4);
}
.record-notes-box {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}
.record-notes {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

/* ── Weight chart ────────────────────────────────────────────── */
.weight-chart-wrapper {
  background: linear-gradient(135deg, #32B5E8, #3DDC97);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 28px rgba(50,181,232,0.22);
  overflow: hidden;
  position: relative;
}
.weight-chart-wrapper::before {
  content: "";
  position: absolute;
  top: -40px; right: -20px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.weight-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}
.weight-chart-kicker {
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.7);
  margin-bottom: 4px;
}
.weight-chart-value {
  display: block;
  font-size: 38px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  text-shadow: 0 3px 8px rgba(0,0,0,0.15);
}
.weight-chart-value small {
  font-size: 16px;
  font-weight: 700;
  opacity: 0.7;
}
.weight-diff-badge {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.weight-diff-badge.up {
  background: rgba(224,98,119,0.2);
  color: #fff;
  border: 1px solid rgba(224,98,119,0.4);
}
.weight-diff-badge.down {
  background: rgba(34,168,109,0.2);
  color: #fff;
  border: 1px solid rgba(34,168,109,0.4);
}
.weight-chart-svg {
  width: 100%;
  height: auto;
  display: block;
  font-family: "Nunito", sans-serif;
}

/* ── Photo preview in card ───────────────────────────────────── */
.record-photo-preview {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(221,218,242,0.7);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(244, 241, 255, 0.95), rgba(251, 250, 255, 0.98));
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}
.record-photo-preview img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(56vh, 420px);
  object-fit: contain;
  border-radius: 12px;
  transition: transform 0.25s ease;
}
.record-photo-preview:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(95,56,203,0.08);
}
.record-photo-preview:hover img {
  transform: scale(1.01);
}

.modal-photo {
  width: min(1120px, calc(100vw - 28px));
}
.modal-photo::backdrop {
  background: rgba(18, 14, 30, 0.78);
  backdrop-filter: blur(10px);
}
.record-photo-modal-card {
  padding: 14px;
  border-radius: 30px;
  background: rgba(24, 20, 40, 0.94);
  box-shadow: 0 30px 80px rgba(10, 8, 18, 0.42);
}
.record-photo-modal-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.record-photo-modal-close {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.record-photo-modal-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}
.record-photo-modal-frame img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 22px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.28);
}

/* ── Severity badge ──────────────────────────────────────────── */
.record-severity-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

/* ── Agenda button in notes ──────────────────────────────────── */
.record-agenda-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 7px 16px;
  border: 1.5px solid var(--primary);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s ease;
}
.record-agenda-btn:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(95,56,203,0.25);
}
.record-agenda-btn:disabled {
  cursor: default;
  opacity: 0.8;
}
.record-agenda-btn.done {
  background: rgba(34,168,109,0.1);
  border-color: #22a86d;
  color: #22a86d;
}

.records-loading { display: flex; justify-content: center; padding: 48px; }

.records-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.table-home-cell { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.table-home-cell span { font-size: 13px; font-weight: 700; }

.modal-lg { width: min(860px, calc(100vw - 24px)); }

/* Record modal — type tabs */
.record-type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.record-type-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: color 0.15s, border-color 0.15s;
}
.record-type-tab:hover { color: var(--primary); }
.record-type-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Record modal — subtype button row */
.record-subtype-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.record-subtype-btn {
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.record-subtype-btn:hover { border-color: var(--primary); color: var(--primary); }
.record-subtype-btn.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

/* Record modal — section containers */
.vet-field[hidden],
.rem-field[hidden],
.log-field[hidden] { display: none !important; }

/* Pagination */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 24px 4px;
}
.pagination-info {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
/* Panel-card internal padding (non-table content) */
.panel-card > .section-head { padding: 20px 24px 0; }
.panel-card > .pill-grid { padding: 0 20px 20px; }
.panel-card > .stack-list,
.panel-card > .empty-inline { padding: 0 20px 20px; }

/* Mobile tab bar — hidden on desktop */
.records-mobile-tab-bar { display: none; }

/* ── Agenda layout (strip + detail panel) — shared desktop/mobile ── */
.agenda-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0;
  height: 100%;
  min-height: 0;
}
.agenda-main {
  overflow-y: auto;
  border-right: 1px solid var(--border);
  min-height: 0;
}
.agenda-detail-panel {
  overflow-y: auto;
  padding: 20px 16px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  transition: opacity 0.2s;
}
.agenda-detail-panel:not(.agenda-detail-panel--active) .agenda-detail-card { display: none; }
.agenda-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  min-height: 160px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.agenda-detail-panel--active .agenda-detail-empty { display: none; }

/* Detail card */
.agenda-detail-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.agenda-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border-radius: 14px;
  border: 1px solid var(--border);
}
.agenda-detail-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}
.agenda-detail-title-wrap { flex: 1; min-width: 0; }
.agenda-detail-title {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.agenda-detail-time {
  font-size: 12px;
  color: var(--muted);
}
.agenda-detail-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  text-transform: capitalize;
}
.agenda-detail-desc {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  margin: 0;
  padding: 10px 14px;
  background: var(--surface-soft);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.agenda-detail-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.agenda-detail-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 7px 12px;
  background: var(--surface-soft);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.agenda-detail-field strong { color: var(--muted); font-weight: 700; }
.agenda-detail-field span { color: var(--text); font-weight: 600; }
.agenda-detail-photos {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.agenda-detail-photo {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.agenda-detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.agenda-detail-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Active card highlight — background tint injected via JS (hexToRgba) per event color */
.records-event-item.agenda-card-active {
  border-left-width: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}

/* Mobile chevron — visible solo en mobile */
.agenda-card-chevron {
  display: none;
  font-size: 18px;
  color: var(--muted);
  flex-shrink: 0;
  align-self: center;
  margin-left: auto;
  padding-left: 8px;
}

/* Mobile back button — visible solo en mobile */
.agenda-detail-mobile-back {
  display: none;
}

/* Mobile overlay — direct child of <body>, no containing-block issues */
#agenda-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  overflow-y: auto;
  flex-direction: column;
}
#agenda-mobile-overlay.agenda-mobile-overlay--active {
  display: flex;
}

@media (max-width: 768px) {
  .agenda-layout {
    display: block;
  }
  .agenda-main {
    border-right: none;
  }
  /* Panel in DOM stays hidden on mobile — overlay handles it */
  .agenda-detail-panel {
    display: none !important;
  }
  .agenda-card-chevron { display: flex; }
  .agenda-detail-mobile-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 1;
    flex-shrink: 0;
  }
  .agenda-detail-mobile-back button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    padding: 0;
  }
  .agenda-detail-mobile-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
}

/* Clinic/location subtitle in event cards */
.records-event-clinic {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Strip base styles (shared desktop + mobile) */
.records-strip-wrapper { background: var(--bg); }
.records-week-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px 6px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.records-week-nav-btn {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s;
}
.records-week-nav-btn:hover { background: var(--primary-soft); color: var(--primary); }
.records-week-nav-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.records-week-strip {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.records-week-strip::-webkit-scrollbar { display: none; }
.records-week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface-soft);
  cursor: pointer;
  min-width: 52px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  flex: 1;
}
.records-week-day:hover { background: var(--primary-soft); border-color: rgba(95,56,203,0.3); transform: translateY(-1px); }
.records-week-day.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.records-week-day.has-events { border-color: rgba(95,56,203,0.4); }
.records-week-day-name {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.records-week-day.active .records-week-day-name,
.records-week-day.active .records-week-day-num { color: #fff; }
.records-week-day-num {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}
.records-week-day-dots {
  display: flex;
  gap: 2px;
  margin-top: 4px;
  min-height: 5px;
}
.records-week-dot { width: 5px; height: 5px; border-radius: 50%; }
.records-week-day.active .records-week-dot { background: rgba(255,255,255,0.7) !important; }

/* Day event list */
.records-day-section-label {
  padding: 12px 18px 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  background: var(--bg);
}
.records-event-item {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  margin: 0 14px 10px;
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  cursor: default;
}
.records-event-item[data-strip-event-id] { cursor: pointer; }
.records-event-item[data-strip-event-id]:hover {
  background: var(--surface-soft);
  box-shadow: 0 2px 10px rgba(95,56,203,0.08);
  transform: translateX(2px);
}
.records-event-item[data-strip-event-id]:active { transform: scale(0.98); }
.records-event-time {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 1px;
  min-width: 36px;
  font-weight: 700;
}
.records-event-body { flex: 1; min-width: 0; }
.records-event-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.records-event-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.records-event-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  display: inline-block;
  margin-top: 4px;
  font-weight: 700;
}

/* ── MOBILE ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .dashboard-shell {
    display: block;
    min-height: 100vh;
    padding: 0;
  }

  /* Sidebar → compact sticky top bar */
  .dashboard-sidebar { display: none; }

  .dashboard-main {
    padding: 0 14px calc(108px + env(safe-area-inset-bottom));
    gap: 14px;
  }
  #dashboard-app[data-active-section="pet-records"] .dashboard-main {
    padding-bottom: 20px;
  }
  .dashboard-mobile-brand {
    display: inline-flex;
    grid-area: brand;
    color: #fff;
  }
  .dashboard-mobile-brand span {
    display: none;
  }
  .dashboard-appbar {
    position: sticky;
    top: 0;
    z-index: 90;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand account"
      "context context";
    gap: 8px;
    margin: 0 -12px;
    padding: 12px 16px 8px;
    background: linear-gradient(160deg, rgba(60, 52, 137, 0.98), rgba(83, 74, 183, 0.98) 62%, rgba(127, 119, 221, 0.98));
    border-radius: 0;
    box-shadow: none;
  }
  /* Breadcrumbs — ocultar en mobile, ya hay título y nav inferior */
  .dashboard-appbar-context { display: none; }
  /* Ajustar grid del appbar sin la fila de breadcrumbs */
  .dashboard-appbar {
    grid-template-areas: "brand account";
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto;
  }
  .dashboard-appbar-context #appbar-context-detail,
  .dashboard-appbar-separator {
    color: #fff;
  }
  .dashboard-topbar-actions {
    grid-area: account;
    width: auto;
    justify-content: flex-end;
  }
  .topbar-account-shell {
    width: auto;
  }
  /* Account btn: solo avatar, sin nombre/email/caret */
  .topbar-account-btn {
    min-height: 36px;
    padding: 3px;
    gap: 0;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
    box-shadow: none;
    border-radius: 12px;
  }
  .topbar-account-btn:hover {
    border-color: rgba(255, 255, 255, 0.26);
  }
  .topbar-account-btn[aria-expanded="true"] {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 24px rgba(8, 10, 28, 0.24);
  }
  .topbar-account-btn img {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.14);
  }
  /* Ocultar nombre, email y caret en mobile */
  .topbar-account-copy,
  .topbar-account-caret { display: none; }
  .topbar-account-copy small {
    max-width: 118px;
    color: rgba(236, 244, 255, 0.76);
  }
  .topbar-account-caret {
    color: rgba(255, 255, 255, 0.78);
  }
  .topbar-account-menu {
    right: 0;
    left: auto;
    min-width: min(260px, calc(100vw - 32px));
  }
  .dashboard-topbar {
    margin: -14px -12px 0;
    padding: 0 16px 20px;
    background: linear-gradient(160deg, rgba(60, 52, 137, 0.98), rgba(83, 74, 183, 0.98) 62%, rgba(127, 119, 221, 0.98));
    border-radius: 0 0 28px 28px;
    box-shadow: 0 16px 36px rgba(44, 27, 104, 0.22);
  }
  .dashboard-topbar h1 {
    color: #fff;
    font-size: 26px;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .dash-section {
    gap: 12px;
  }
  .pets-filters {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(126, 118, 160, 0.14);
    box-shadow: 0 18px 34px rgba(66, 43, 136, 0.08);
  }
  .filter-reset-btn { width: 100%; }
  .pending-alert-card {
    align-items: flex-start;
    padding: 14px 16px;
    gap: 12px;
  }
  .pending-alert-arrow { display: none; }
  .panel-card,
  .promo-card,
  .stat-card,
  .operations-card,
  .modal-card { border-radius: 24px; }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .section-hero {
    gap: 10px;
  }
  .section-hero-actions,
  .section-hero-btn {
    width: 100%;
  }
  .section-hero-btn { min-height: 50px; }
  .stats-grid,
  .profile-stats-display,
  .stats-edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid,
  .pill-grid,
  .profile-fields { grid-template-columns: 1fr; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 14px 14px; }
  .stat-card strong { font-size: 26px; margin: 6px 0 2px; }
  .stat-card small { font-size: 11px; }
  .stack-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .stats-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat-chip {
    justify-content: space-between;
    min-width: 0;
    padding: 12px 14px;
    font-size: 19px;
  }
  .filter-chip-row,
  .profile-tab-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .filter-chip,
  .profile-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .mini-chip {
    font-size: 11px;
    padding: 6px 10px;
  }

  .table-wrap {
    overflow: visible;
  }
  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
  }
  .table-wrap thead {
    display: none;
  }
  .table-wrap tbody {
    display: grid;
    gap: 12px;
  }
  .table-wrap tr {
    padding: 6px 0;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(126, 118, 160, 0.12);
    box-shadow: 0 16px 30px rgba(66, 43, 136, 0.08);
  }
  .table-wrap tr.table-empty-row {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .table-wrap td {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 10px 12px;
    align-items: start;
    padding: 12px 16px;
    border: 0;
    font-size: 13px;
    word-break: break-word;
  }
  .table-wrap td + td {
    border-top: 1px solid rgba(126, 118, 160, 0.12);
  }
  .table-wrap td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .table-wrap td.table-cell-primary,
  .table-wrap td.table-cell-actions {
    grid-template-columns: 1fr;
  }
  .table-wrap td.table-cell-primary::before,
  .table-wrap td.table-cell-actions::before {
    margin-bottom: 2px;
  }
  .table-empty {
    padding: 18px 16px !important;
    text-align: center;
  }
  .table-empty::before {
    content: none !important;
  }
  .table-avatar {
    width: 40px;
    height: 40px;
  }
  .table-person {
    align-items: flex-start;
  }
  .table-person strong,
  .table-person small {
    white-space: normal;
  }
  .table-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }
  .table-action-btn {
    justify-content: center;
    min-height: 40px;
    text-align: center;
  }
  .inline-select,
  .inline-select-locked,
  .table-home-text,
  .status-badge {
    max-width: 100%;
  }

  .profile-tab {
    font-size: 12px;
    padding: 8px 12px;
  }

  .dashboard-mobile-tabbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 110;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    padding: 10px 6px calc(10px + env(safe-area-inset-bottom));
    border-radius: 26px;
    background: rgba(39, 28, 83, 0.96);
    box-shadow: 0 26px 44px rgba(19, 11, 47, 0.34);
    backdrop-filter: blur(16px);
  }
  #dashboard-app[data-active-section="pet-records"] .dashboard-mobile-tabbar {
    display: none;
  }
  /* Ocultar topbar en historial — el hero ya tiene toda la info */
  #dashboard-app[data-active-section="pet-records"] .dashboard-topbar {
    display: none;
  }
  .mobile-tabbar-link {
    display: grid;
    justify-items: center;
    gap: 6px;
    min-width: 0;
    padding: 6px 2px;
    border-radius: 18px;
    color: rgba(230, 235, 255, 0.72);
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
  }
  .mobile-tabbar-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: translateY(-1px);
  }
  .mobile-tabbar-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: currentColor;
  }
  .mobile-tabbar-link.active .mobile-tabbar-icon {
    background: linear-gradient(145deg, rgba(29, 183, 207, 0.95), rgba(95, 56, 203, 0.95));
    box-shadow: 0 12px 24px rgba(29, 183, 207, 0.22);
  }
  .mobile-tabbar-label {
    font-size: 10px;
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: -0.01em;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }

  /* Records section on mobile */
  #section-pet-records {
    height: auto;
    min-height: calc(100vh - 180px);
  }
  .records-hero {
    padding: 16px 16px 14px 56px;
  }
  .records-back-btn {
    left: 12px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }
  .records-pet-selector {
    position: static;
    width: 100%;
    margin-top: 8px;
  }
  .records-hero-content {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }
  .records-avatar-ring {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }
  .records-avatar-ring img {
    border-radius: 11px;
  }
  .records-hero-title {
    font-size: 16px;
  }
  .records-hero-meta {
    gap: 6px;
  }
  /* Split layout → stacked on mobile */
  .records-split-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .records-sidebar {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding: 14px 14px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .records-sidebar-btn {
    padding: 10px 14px;
    font-size: 13px;
    white-space: nowrap;
    border-radius: 12px;
    flex-shrink: 0;
  }
  .records-right-panel {
    padding: 18px 16px 24px;
    max-height: none;
  }
  .records-sub-chip {
    padding: 6px 12px;
    font-size: 12px;
  }
  .record-timeline-item {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
  }
  .record-timeline-dot {
    width: 36px;
    height: 36px;
  }
  .record-timeline-dot span { font-size: 15px; }
  .record-timeline-item:not(:last-child)::before {
    left: 17px;
    top: 36px;
  }
  .record-timeline-card {
    padding: 14px 14px;
    border-radius: 14px;
  }

  /* ── Records mobile tab bar (embedded in gradient header) ── */
  .records-mobile-tab-bar {
    display: flex;
    border-top: 1px solid rgba(255,255,255,0.2);
    margin-top: 12px;
  }
  .records-mobile-tab {
    flex: 1;
    padding: 8px 4px 7px;
    font-size: 10px;
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-weight: 700;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
  }
  .records-mobile-tab.active {
    color: #fff;
    font-weight: 800;
  }
  .records-mobile-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 10%; right: 10%;
    height: 2px;
    background: #fff;
    border-radius: 2px 2px 0 0;
  }
  .rmtc {
    font-size: 9px;
    opacity: 0.8;
    margin-left: 2px;
  }
  /* Hide desktop sidebar completely on mobile */
  .records-sidebar { display: none; }
  .records-split-layout { display: block; }
  .records-right-panel { padding: 0; max-height: none; }

  /* Sub-filter pills — horizontal scroll on mobile */
  .records-sub-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 10px 14px 8px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
    background: #fff;
    gap: 6px;
  }
  .records-sub-chips::-webkit-scrollbar { display: none; }
  .records-sub-chip { flex-shrink: 0; }

  /* ── Strip overrides for mobile (compact sizing) ── */
  .agenda-layout { grid-template-columns: 1fr; }
  .agenda-detail-panel { display: none; }
  .records-week-nav { padding: 8px 14px 4px; }
  .records-week-nav-btn { width: 28px; height: 28px; font-size: 13px; }
  .records-week-nav-label { font-size: 10px; }
  .records-week-strip { padding: 6px 14px 8px; gap: 4px; }
  .records-week-day { min-width: 36px; border-radius: 10px; padding: 5px 3px 6px; }
  .records-week-day-num { font-size: 13px; }
  .records-week-day-name { font-size: 7px; }
  .records-week-dot { width: 4px; height: 4px; }
  .records-day-section-label { padding: 8px 14px 4px; font-size: 11px; }
  .records-event-item { margin: 0 10px 8px; padding: 8px 10px; border-radius: 10px; gap: 8px; }
  .records-event-time { font-size: 9px; min-width: 30px; }
  .records-event-name { font-size: 11px; }
  .records-event-desc { font-size: 10px; }
  .records-event-clinic { font-size: 10px; }
  .records-event-badge { font-size: 9px; padding: 2px 7px; }

  /* ── Hero overrides para layout móvil correcto ── */
  .records-hero {
    padding: 12px 14px 0 50px;
  }
  /* Selector: restaurar absoluto, chip pequeño top-right */
  .records-pet-selector {
    position: absolute;
    top: 10px;
    right: 12px;
    width: auto;
    max-width: 140px;
    margin-top: 0;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
  }
  /* Back btn arriba izquierda fijo */
  .records-back-btn {
    top: 12px;
    transform: none;
    left: 10px;
  }
  /* Hero content más compacto */
  .records-hero-content {
    margin-bottom: 10px;
    gap: 10px;
  }
  .records-avatar-ring {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    padding: 2px;
  }
  .records-avatar-ring img { border-radius: 10px; }
  .records-hero-title { font-size: 17px; }
  .records-hero-meta { gap: 5px; margin-top: 4px; }
  .records-hero-meta strong { font-size: 11px; padding: 3px 9px; }
  .records-hero-meta span { font-size: 10px; }

  /* ── Caretaker banner compacto ── */
  .caretaker-banner {
    margin: 8px 10px 0;
    padding: 8px 11px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.4;
  }
  .caretaker-banner-body { gap: 7px; }
  .caretaker-contact-label { font-size: 10px; }
  .btn-contact { font-size: 10px; padding: 4px 9px; }

  /* ── Sub-filter pills más grandes ── */
  .records-sub-chip {
    font-size: 12px;
    padding: 7px 12px;
  }

  /* ── Week nav compacto ── */
  .records-week-nav { padding: 7px 12px 3px; }
  .records-week-nav-label { font-size: 11px; }
  .records-week-strip { padding: 5px 12px 7px; gap: 3px; }
  .records-week-day { min-width: 38px; border-radius: 11px; }
  .records-week-day-num { font-size: 14px; }
  .records-week-day-name { font-size: 7px; }

  /* ── Day section label ── */
  .records-day-section-label {
    font-size: 12px;
    padding: 9px 14px 5px;
    font-weight: 800;
    letter-spacing: -0.01em;
  }

  /* ── Event items más parecidos al mockup ── */
  .records-event-item {
    margin: 0 12px 8px;
    padding: 10px 12px;
    border-radius: 11px;
  }
  .records-event-time {
    font-size: 10px;
    min-width: 34px;
  }
  .records-event-name {
    font-size: 13px;
    font-weight: 700;
  }
  .records-event-desc {
    font-size: 11px;
    margin-top: 2px;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
  .records-event-badge {
    font-size: 10px;
    padding: 3px 9px;
    border-radius: 9px;
    margin-top: 5px;
  }

  /* ── Caretaker banner — compactar a tira discreta ── */
  .caretaker-banner {
    flex-direction: row;
    align-items: center;
    padding: 6px 10px;
    margin: 6px 10px 0;
    gap: 6px;
    border-radius: 8px;
    font-size: 10px;
    line-height: 1.3;
  }
  .caretaker-banner > svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 0; }
  .caretaker-banner-body { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 3px; }
  .caretaker-banner-body > span { font-size: 10px; }
  .caretaker-banner-actions { display: none; }

  /* ── Botones táctiles — mínimo 44px ── */
  .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* ── Inputs/selects táctiles — mínimo 48px ── */
  input, select { min-height: 48px; padding: 12px 16px; }
  textarea { min-height: auto; padding: 12px 16px; }

  /* ── Campos de formulario: más espacio vertical ── */
  label, fieldset { gap: 10px; }
  .form-grid, .modal-grid { gap: 18px; }

  /* ── Pill-cards más limpias ── */
  .pill-card { padding: 12px 14px; }
  .pill-card span { font-size: 10px; margin-bottom: 4px; }
  .pill-card strong { font-size: 18px; }
}

/* ── Foundation profile card ────────────────────────────────── */
.profile-card { padding: 0; overflow: hidden; }
.profile-card > .profile-card-head { padding: 18px 24px 0; margin-bottom: 0; }
.profile-card > .profile-card-head h2 {
  font-size: 18px;
  line-height: 1.1;
}

.profile-tab-nav {
  display: flex;
  gap: 4px;
  padding: 12px 24px 0;
  border-bottom: 2px solid var(--border);
}
.profile-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
  border-radius: 10px 10px 0 0;
  transition: 0.15s;
}
.profile-tab:hover { color: var(--primary); background: var(--primary-soft); }
.profile-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.profile-tab-panel { padding: 24px; display: grid; gap: 20px; }

/* ── Profile identity (logo + name) ─────────────────────────── */
.profile-identity { display: flex; align-items: center; gap: 18px; }
.profile-logo { position: relative; flex-shrink: 0; }
.profile-logo img {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  background: var(--surface-soft);
}
.profile-logo-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.profile-identity-name { display: block; font-size: 20px; font-family: "Sora", sans-serif; font-weight: 800; line-height: 1.1; }
.profile-identity-hint { display: block; color: var(--muted); font-size: 13px; margin-top: 5px; }

/* ── Profile form fields grid ───────────────────────────────── */
.profile-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.profile-fields .full { grid-column: 1 / -1; }
.profile-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── Stats display row (bottom of profile card) ─────────────── */
.profile-stats-display {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  border-top: 1px solid var(--border);
  background: var(--border);
}
.profile-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 10px;
  background: var(--surface);
  text-align: center;
}
.profile-stat-box span {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.profile-stat-box strong {
  font-size: 22px;
  font-family: "Sora", sans-serif;
  color: var(--primary);
}

/* ── Verified / unverified badges ───────────────────────────── */
.verified-chip, .unverified-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
}
.verified-chip { background: var(--success-soft); color: var(--success); }
.unverified-chip { background: var(--warning-soft); color: var(--warning); }

/* ── Invitation badges ──────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; border-radius: 20px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
.badge-blue { background: rgba(79, 195, 247, 0.15); color: #0288d1; }
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-gray { background: rgba(126, 118, 160, 0.12); color: var(--muted); }
.table-action-danger { color: var(--danger) !important; border-color: var(--danger) !important; }
.table-action-warn { color: var(--warning) !important; border-color: var(--warning) !important; }
.table-action-warn:hover { background: var(--warning) !important; color: #fff !important; }

/* ── Stats edit block (inside tab 3) ────────────────────────── */
.stats-edit-block { display: flex; flex-direction: column; gap: 10px; }
.stats-edit-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}
.stats-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stats-edit-grid label { display: flex; flex-direction: column; gap: 4px; }
.stats-edit-grid input { text-align: center; font-weight: 700; }

/* ── Button small ───────────────────────────────────────────── */
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ── Modal small ────────────────────────────────────────────── */
.modal-sm { width: min(460px, calc(100vw - 24px)); }

/* ── User avatar area (modal) ───────────────────────────────── */
.user-avatar-area { display: flex; align-items: center; gap: 14px; }
.user-avatar-area img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  background: var(--surface-soft);
  flex-shrink: 0;
}

/* ── Sidebar profile ────────────────────────────────────────── */
.sidebar-profile {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 12px;
}
.sidebar-profile-card {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255,255,255,0.08);
}
.sidebar-profile-kicker {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.58);
}
.sidebar-profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.sidebar-profile img {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
}
.sidebar-profile strong { display: block; font-size: 14px; }
.sidebar-profile span { display: block; font-size: 12px; color: rgba(255,255,255,0.65); }
.sidebar-profile-btns { display: flex; gap: 8px; }
.sidebar-text-btn {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  padding: 8px 0;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.82);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  transition: background 0.15s;
}
.sidebar-text-btn:hover { background: rgba(255,255,255,0.14); }

.profile-summary-grid { display: none; }
.profile-summary-card { display: none; }

.profile-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 16px 24px 0;
  padding: 24px 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(95,56,203,0.12) 0%, rgba(29,183,207,0.06) 60%, var(--surface) 100%);
  position: relative;
  overflow: hidden;
  min-height: 96px;
}
.profile-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(95,56,203,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.profile-banner-logo {
  position: relative;
  flex-shrink: 0;
  z-index: 1;
}
.profile-banner-logo img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px rgba(95,56,203,0.18), 0 4px 16px rgba(95,56,203,0.22);
  background: var(--surface-soft);
  display: block;
}
.profile-banner-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  z-index: 1;
}
.profile-panel-intro {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}
.profile-panel-intro .field-hint {
  font-size: 13px;
}

/* ───────────────────────────────────────────────────────── 
   CALENDARIO DE RECORDATORIOS 
   ───────────────────────────────────────────────────────── */
.records-calendar-wrapper {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.02);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.calendar-header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-week-label {
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.calendar-nav-btn {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(95, 56, 203, 0.1);
}

.calendar-grid-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.calendar-grid {
  display: grid;
  grid-template-columns: 54px repeat(7, minmax(110px, 1fr));
  position: relative;
  min-width: 820px;
  background: #fff;
}

/* Day headers */
.calendar-cell.header {
  padding: 16px 8px;
  text-align: center;
  border-bottom: 1px solid rgba(126, 118, 160, 0.2);
  border-right: 1px dashed rgba(126, 118, 160, 0.2);
  background: var(--surface-soft);
  font-size: 16px;
  color: var(--text);
  font-weight: 900;
  letter-spacing: -0.01em;
}
.calendar-cell.header:last-child {
  border-right: none;
}

.calendar-cell.header strong {
  display: block;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

/* Hour cells */
.calendar-time-col {
  border-right: 1px solid rgba(126, 118, 160, 0.2);
  background: var(--surface-soft);
}
.calendar-hour-cell {
  height: 60px; /* 1 hour = 60px */
  border-bottom: 1px dashed rgba(126, 118, 160, 0.15);
  box-sizing: border-box;
  text-align: right;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
}
.calendar-hour-cell:last-child {
  border-bottom: none;
}

/* Day columns */
.calendar-day-col {
  border-right: 1px dashed rgba(126, 118, 160, 0.2);
  position: relative;
  background: rgba(255, 255, 255, 0.4);
}
.calendar-day-col:last-child {
  border-right: none;
}
.calendar-hour-line {
  height: 60px;
  border-bottom: 1px dashed rgba(126, 118, 160, 0.15);
  box-sizing: border-box;
}

/* Events */
.calendar-event {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border: 1.5px solid rgba(255,255,255,0.5);
  border-left: 5px solid var(--event-color, var(--primary));
  background: var(--event-bg, var(--surface));
  z-index: 10;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 28px;
  box-sizing: border-box;
}
.calendar-event:hover {
  transform: translateY(-1px) scale(1.01);
  z-index: 20;
  box-shadow: 0 8px 20px rgba(0,0,0,0.14);
}

/* Título: ícono + texto en una línea */
.calendar-event .ev-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.calendar-event .ev-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.calendar-event .ev-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 11px;
}
.calendar-event .ev-desc {
  font-size: 10px;
  line-height: 1.3;
  color: rgba(46, 36, 92, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modo comprimido: solo ícono + hora, sin texto */
.calendar-event.compressed {
  padding: 3px 4px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
}
.calendar-event.compressed .ev-title {
  flex-direction: column;
  gap: 1px;
  align-items: center;
  margin-bottom: 0;
}
.calendar-event.compressed .ev-icon {
  width: 20px;
  height: 20px;
  font-size: 13px;
}
.calendar-event.compressed .ev-text {
  display: none;
}
.calendar-event.compressed .ev-desc {
  display: none;
}
.calendar-event.compressed .ev-time {
  font-size: 9px;
  font-weight: 700;
  color: var(--event-color, var(--primary));
  text-align: center;
  line-height: 1;
}

/* ── En Seguimiento section ──────────────────────────────────── */
.followup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.followup-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.18s, transform 0.14s;
}
.followup-card:hover {
  box-shadow: 0 6px 24px rgba(95,56,203,0.10);
  transform: translateY(-2px);
}
.followup-card--closed {
  opacity: 0.65;
  border-style: dashed;
}

.followup-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.followup-card-pet {
  display: flex;
  align-items: center;
  gap: 10px;
}
.followup-card-icon {
  font-size: 24px;
  line-height: 1;
}
.followup-card-pet strong {
  display: block;
  font-size: 15px;
}

.followup-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.followup-next-cp {
  font-size: 13px;
  color: var(--text);
}

.followup-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.followup-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* Followup — "Cerrar caso" destructivo suave */
.followup-close-btn {
  font-size: 13px;
  background: transparent;
  color: var(--danger);
  border: 1.5px solid rgba(224, 98, 119, 0.35);
}
.followup-close-btn:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

/* Followup — "Ver detalle" más prominente en las cards */
.followup-detail-btn {
  font-size: 13px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
}

/* Followup — hitos: botón táctil de 44px */
.followup-cp-btn {
  min-height: 44px;
  font-size: 13px;
  padding: 0 16px;
  min-width: 90px;
  flex-shrink: 0;
}

/* Banner solo lectura — texto corto/largo según breakpoint */
.banner-text-short { display: none; }

/* Followup detail modal */
.followup-checkpoints {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.followup-cp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.followup-cp-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.followup-cp-icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* ── Empty state — componente compartido ────────────────────── */
.dash-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px 40px;
  gap: 12px;
}
.dash-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(95,56,203,0.10), rgba(29,183,207,0.08));
  border: 1.5px solid rgba(95,56,203,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-bottom: 4px;
}
.dash-empty-title {
  font-size: 17px;
  font-weight: 900;
  font-family: "Sora", sans-serif;
  color: var(--text);
  margin: 0;
}
.dash-empty-body {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  max-width: 280px;
}
.dash-empty-state .btn {
  margin-top: 4px;
  min-height: 44px;
  padding: 0 24px;
  font-size: 14px;
}

@media (max-width: 600px) {
  .followup-grid {
    grid-template-columns: 1fr;
  }
  .followup-cp-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  /* Hito completo: botón ocupa el ancho de la fila */
  .followup-cp-btn {
    width: 100%;
    justify-content: center;
  }
  /* Banner: cambiar a texto corto en mobile */
  .banner-text-full { display: none; }
  .banner-text-short { display: inline; }
}

@media (max-width: 768px) {
  .modal {
    width: min(780px, calc(100vw - 16px));
  }
  .modal-card {
    padding: 20px 16px;
    max-height: calc(100vh - 16px);
    border-radius: 26px;
  }
  .modal-head.section-head {
    display: flex;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: space-between;
    gap: 12px;
  }
  .modal-head > div {
    min-width: 0;
    flex: 1;
  }
  .modal-head h2 {
    font-size: 17px;
    line-height: 1.08;
  }
  .modal-head .icon-btn,
  .modal-head .modal-close-btn {
    margin-left: auto;
    align-self: flex-start;
  }
  .modal-actions {
    bottom: -20px;
    gap: 10px;
    margin-top: 16px;
    margin-left: -16px;
    margin-right: -16px;
    margin-bottom: -20px;
    padding: 14px 16px 16px;
  }

  .profile-card > .profile-card-head {
    padding: 16px 16px 0;
  }
  .profile-banner {
    margin: 12px 16px 0;
    padding: 14px 16px;
  }
  .profile-identity-name {
    font-size: 16px;
    word-break: break-word;
  }
  .profile-identity-hint {
    word-break: break-word;
  }
  .profile-tab-nav {
    gap: 8px;
    padding: 12px 16px 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .profile-tab-nav::-webkit-scrollbar {
    display: none;
  }
  .profile-tab {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 12px;
    padding: 8px 12px;
  }
  .profile-tab-panel {
    padding: 18px 16px;
    gap: 16px;
  }
  .stats-edit-grid,
  .profile-stats-display {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats-edit-grid label,
  .profile-fields label {
    min-width: 0;
  }
  .stats-edit-grid input {
    min-width: 0;
  }
  .profile-stat-box {
    padding: 14px 8px;
  }
  .profile-stat-box span {
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  #temporary-home-detail-modal .modal-card {
    display: grid;
    gap: 14px;
  }
  .temporary-home-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .temporary-home-meta-card:nth-child(3) {
    grid-column: 1 / -1;
  }
  .temporary-home-meta-card {
    padding: 12px 14px;
  }
  .temporary-home-meta-card strong {
    line-height: 1.4;
    word-break: break-word;
  }
  .temporary-home-modal-head {
    margin-top: 4px;
    margin-bottom: 2px;
  }
  .temporary-home-pet-card {
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 14px;
  }
  .temporary-home-pet-card img {
    width: 64px;
    height: 64px;
    border-radius: 14px;
  }
  .temporary-home-pet-card .table-action-btn {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 42px;
  }
  .temporary-home-pet-meta {
    gap: 6px;
    margin-top: 8px;
  }

  .record-type-tabs,
  .record-subtype-row,
  .records-sub-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .record-type-tabs::-webkit-scrollbar,
  .record-subtype-row::-webkit-scrollbar,
  .records-sub-chips::-webkit-scrollbar {
    display: none;
  }
  .record-type-tabs {
    gap: 6px;
    padding-bottom: 6px;
    margin-bottom: 16px;
  }
  .record-type-tab {
    flex-shrink: 0;
    padding: 8px 10px;
    font-size: 12px;
  }
  .record-subtype-row {
    gap: 6px;
    padding-bottom: 4px;
    margin-bottom: 16px;
  }
  .record-subtype-btn {
    flex-shrink: 0;
    padding: 7px 10px;
    font-size: 11px;
  }
  .records-sub-chips {
    gap: 6px;
    margin-bottom: 18px;
    padding-bottom: 14px;
  }
  .records-sub-chip {
    flex-shrink: 0;
    padding: 7px 12px;
    font-size: 12px;
  }
  .records-calendar-wrapper {
    padding: 14px 12px;
    border-radius: 18px;
  }
  .calendar-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
  }
  .calendar-header-nav {
    gap: 8px;
  }
  .calendar-week-label {
    font-size: 12px;
  }
  .calendar-nav-btn {
    width: 28px;
    height: 28px;
  }
  .calendar-grid {
    grid-template-columns: 44px repeat(7, minmax(82px, 1fr));
    min-width: 618px;
  }
  .calendar-cell.header {
    padding: 10px 6px;
    font-size: 13px;
  }
  .calendar-cell.header strong {
    font-size: 10px;
    margin-bottom: 4px;
  }
  .calendar-hour-cell {
    height: 44px;
    padding: 8px 8px 0 0;
    font-size: 10px;
  }
  .calendar-hour-line {
    height: 44px;
  }
  .calendar-event {
    left: 3px;
    right: 3px;
    padding: 4px 5px;
    border-left-width: 4px;
  }
  .calendar-event .ev-title {
    font-size: 10px;
  }
  .calendar-event .ev-desc {
    display: none;
  }

  .stat-card strong { font-size: 30px; margin: 8px 0 2px; }
  .stat-card small { font-size: 12px; }

  /* ── Modal actions: keep as row, never stack on mobile ── */
  .modal-actions {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* ── panel-card border-radius consistent ── */
  .panel-card, .promo-card, .stat-card { border-radius: 24px; }

  /* ── section-head column on mobile ── */
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  /* Modal head stays row */
  .modal-head.section-head {
    flex-direction: row !important;
    align-items: flex-start !important;
  }
}

.stat-label-desktop { display: inline; }
.stat-label-mobile { display: none; }
.pets-filters {
  grid-template-columns: minmax(220px, 1.45fr) minmax(0, 3.8fr);
}
.pets-filter-scroll {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 0.9fr)) auto;
  gap: 12px;
  align-items: end;
}
.pets-filter-scroll .filter-field {
  min-width: 0;
}

@media (max-width: 768px) {
  .stat-label {
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    font-size: 10px;
    letter-spacing: 0.04em;
    line-height: 1.3;
  }
  .stat-label-desktop { display: none; }
  .stat-label-mobile { display: inline; }

  /* Pill grid: 2×2 grid, no horizontal overflow */
  .pill-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .pill-card {
    flex: unset;
  }
  .panel-card > .pill-grid {
    padding: 0 16px 16px;
  }

  .pets-filters {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .pets-filters .filter-field {
    gap: 4px;
  }
  /* Labels visibles en los filtros — el usuario necesita saber qué está filtrando */
  .pets-filters .filter-field span {
    display: block;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .filter-search input {
    min-height: 42px;
    border-radius: 14px;
    padding-left: 14px;
  }
  .pets-filter-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .pets-filter-scroll::-webkit-scrollbar { display: none; }
  .pets-filter-scroll .filter-field,
  .pets-filter-scroll .filter-reset-btn {
    flex: 0 0 auto;
  }
  .pets-filter-scroll .filter-field select {
    width: auto;
    min-height: 38px;
    border-radius: 12px;
    padding: 0 12px;
    font-size: 12px;
  }
  .pets-filter-scroll .filter-reset-btn {
    align-self: flex-end;
    min-height: 38px;
    border-radius: 12px;
    padding: 0 12px;
    font-size: 12px;
  }
  .pets-filter-scroll .filter-field select {
    min-width: 110px;
    background: #fff;
  }
  .pets-filter-scroll .filter-reset-btn {
    width: auto;
  }

  .table-wrap tr.mobile-card-row {
    padding: 0;
  }
  .table-wrap td.mobile-card-cell {
    display: block;
    padding: 0;
    border: 0;
  }
  .table-wrap td.mobile-card-cell::before {
    content: none;
  }

  .pet-mobile-card,
  .home-mobile-card {
    display: grid;
    gap: 14px;
    padding: 16px;
  }
  .pet-mobile-head,
  .home-mobile-head {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
  }
  /* Avatar más grande en mobile */
  .pet-mobile-head .table-avatar {
    width: 50px;
    height: 50px;
    border-radius: 14px;
  }
  .pet-mobile-copy,
  .home-mobile-copy,
  .temporary-home-pet-copy {
    min-width: 0;
  }
  .pet-mobile-copy strong,
  .home-mobile-copy strong {
    display: block;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.15;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
  .pet-mobile-copy small,
  .home-mobile-email,
  .temporary-home-pet-copy small {
    display: block;
    max-width: 100%;
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pet-mobile-status-row,
  .home-mobile-meta-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    align-items: center;
  }
  .pet-mobile-status-row::-webkit-scrollbar,
  .home-mobile-meta-row::-webkit-scrollbar {
    display: none;
  }
  .pet-mobile-status-row .status-badge {
    flex: 0 0 auto;
    padding: 5px 10px;
    font-size: 11px;
  }
  /* Ocultar segundo badge (publicationStatus) — redundante en mobile */
  .pet-mobile-status-row .status-badge ~ .status-badge {
    display: none;
  }
  .pet-mobile-home,
  .home-mobile-chip {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    max-width: 160px;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .pet-mobile-home {
    color: var(--muted);
  }
  .pet-mobile-home.assigned {
    background: rgba(250, 238, 218, 0.88);
    border-color: rgba(250, 199, 117, 0.95);
    color: #7a5412;
  }
  .pet-mobile-home.adopted {
    background: var(--success-soft);
    border-color: rgba(34, 168, 109, 0.35);
    color: var(--success);
  }
  .home-mobile-chip.warning {
    background: rgba(250, 238, 218, 0.88);
    border-color: rgba(215, 155, 31, 0.35);
    color: #946211;
  }

  .pet-mobile-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .pet-mobile-actions .table-action-btn {
    min-height: 44px;
    font-size: 13px;
    border-radius: 14px;
    justify-content: center;
    text-align: center;
  }
  /* Botón primario (Asignar/Cambiar hogar) — ancho completo, sólido */
  .pet-mobile-actions .table-action-btn.primary {
    grid-column: 1 / -1;
    background: var(--primary);
    color: #fff;
  }
  .pet-mobile-actions .table-action-btn.primary:hover {
    background: var(--primary-dark, #4a2ba0);
  }
  /* Editar / Bitácora / Historial — outline claramente secundario */
  .pet-mobile-actions .table-action-btn:not(.primary):not(.table-action-danger):not(.table-action-warn) {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
  }
  .pet-mobile-actions .table-action-btn:not(.primary):not(.table-action-danger):not(.table-action-warn):hover {
    background: var(--surface-soft);
    border-color: var(--primary);
    color: var(--primary-dark);
  }
  /* Eliminar — fila propia + estilo destructivo suave */
  .pet-mobile-actions .table-action-danger {
    grid-column: 1 / -1;
    margin-top: 2px;
    min-height: 40px;
    font-size: 12px;
    border: 1.5px solid rgba(224, 98, 119, 0.3) !important;
    background: rgba(224, 98, 119, 0.06) !important;
    color: var(--danger) !important;
    border-radius: 12px;
  }
  .pet-mobile-actions .table-action-danger:hover {
    background: var(--danger) !important;
    color: #fff !important;
    border-color: var(--danger) !important;
  }

  .home-mobile-count {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 7px 10px;
    border-radius: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
  }
  .home-mobile-count span {
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .home-mobile-count strong {
    font-size: 18px;
    font-family: "Sora", sans-serif;
    line-height: 1;
  }
  .home-mobile-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .home-mobile-actions .table-action-btn,
  .home-mobile-actions a.table-action-btn {
    min-height: 44px;
    padding: 0 10px;
    font-size: 13px;
    border-radius: 14px;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Desvincular — fila completa, estilo destructivo suave */
  .home-mobile-actions .table-action-danger {
    grid-column: 1 / -1;
    margin-top: 4px;
    min-height: 40px;
    font-size: 12px;
    border-radius: 14px;
    border: 1.5px solid rgba(224, 98, 119, 0.35) !important;
    background: rgba(224, 98, 119, 0.07) !important;
    color: var(--danger) !important;
  }
  .home-mobile-actions .table-action-danger:hover {
    background: var(--danger) !important;
    color: #fff !important;
    border-color: var(--danger) !important;
  }
  .home-mobile-actions .table-home-text {
    width: 100%;
    max-width: none;
    justify-content: center;
  }
  .home-mobile-email,
  .temporary-home-meta-card--email strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Fase 3 — Hogares: help banner menos intrusivo en mobile */
  #open-home-help {
    width: auto;
    min-height: 36px;
    padding: 0 14px;
    font-size: 12px;
    background: transparent !important;
    color: var(--primary) !important;
    border: 1.5px solid rgba(95, 56, 203, 0.3) !important;
    box-shadow: none !important;
    font-weight: 700;
  }
  #open-home-help:hover {
    background: rgba(95, 56, 203, 0.07) !important;
  }
  .section-hero-actions:has(#open-home-help) {
    justify-content: flex-start;
  }

  .records-mobile-tab-bar {
    margin: 12px -14px 0;
    padding: 0 14px;
    border-top: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.03);
  }
  .records-mobile-tab {
    padding: 10px 4px 9px;
  }
  .records-mobile-tab.active::after {
    left: 12%;
    right: 12%;
  }
  .records-sub-chips {
    margin-bottom: 0;
    padding: 10px 12px 8px;
    border-bottom: 1px solid rgba(126, 118, 160, 0.16);
    background: #fff;
  }
  .records-sub-chip {
    font-size: 11px;
    padding: 7px 11px;
  }
  .records-week-day {
    min-width: 42px;
    padding: 6px 4px 7px;
  }
  .records-week-dot {
    width: 5px;
    height: 5px;
  }
  .records-day-section-label {
    padding: 10px 14px 6px;
    font-size: 12px;
  }
  .records-event-item {
    margin: 0 12px 10px;
    padding: 11px 12px;
    border-radius: 12px;
  }
  .records-event-time {
    min-width: 36px;
    font-size: 10px;
  }
  .records-event-name {
    font-size: 13px;
  }
  .records-event-desc {
    font-size: 11px;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  /* ── Historial: reestructura header mobile ───────────────────── */

  /* Hero: columna en lugar de bloque con absolutos */
  .records-hero {
    padding: 10px 14px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  /* Fila superior: ← + selector como título */
  .records-hero-toprow {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
  }

  /* Back button: sale del flujo absoluto */
  .records-back-btn {
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
  }

  /* Selector: protagonista visual — ocupa el resto de la fila */
  .records-pet-selector {
    position: static !important;
    top: auto !important;
    right: auto !important;
    flex: 1;
    max-width: none;
    height: 44px;
    font-size: 15px;
    font-weight: 800;
    border-radius: 14px;
    padding: 0 14px;
    background: rgba(255,255,255,0.18);
    border: 1.5px solid rgba(255,255,255,0.35);
    color: #fff;
  }

  /* Hero content: fila compacta avatar + meta */
  .records-hero-content {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
  }
  .records-avatar-ring {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    flex-shrink: 0;
  }
  .records-avatar-ring img {
    border-radius: 10px;
  }

  /* Ocultar título redundante — el selector ES el título ahora */
  .records-hero-title {
    display: none !important;
  }
  .records-hero-eyebrow {
    display: none !important;
  }

  /* Meta: solo la línea de resumen */
  .records-hero-info {
    min-width: 0;
  }
  .records-hero-meta {
    margin-top: 0;
    gap: 4px;
  }
  .records-hero-meta strong {
    font-size: 13px;
    font-weight: 900;
  }
  .records-hero-meta span {
    display: none; /* texto secundario — oculto en Fase 5 */
  }

  /* Tabs: segmented control en lugar de línea con underline */
  .records-mobile-tab-bar {
    display: flex !important;
    gap: 6px;
    padding: 0 0 14px;
    margin: 4px 0 0;
    border-top: none !important;
    background: transparent !important;
  }
  .records-mobile-tab {
    flex: 1;
    min-height: 44px;
    font-size: 13px;
    font-weight: 800;
    padding: 0 4px;
    border-radius: 12px;
    background: rgba(255,255,255,0.13);
    border: 1.5px solid rgba(255,255,255,0.22);
    color: rgba(255,255,255,0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
  }
  .records-mobile-tab.active {
    background: rgba(255,255,255,0.95) !important;
    color: var(--primary) !important;
    border-color: transparent !important;
    font-weight: 900;
  }
  /* Quitar underline — el fondo ya indica estado */
  .records-mobile-tab.active::after {
    display: none !important;
  }
  .rmtc {
    font-size: 10px;
    opacity: 0.75;
    margin-left: 2px;
  }

  /* Caretaker banner: fondo gris suave, no azul llamativo */
  .caretaker-banner {
    background: rgba(243, 244, 251, 0.96) !important;
    border-color: rgba(126, 118, 160, 0.2) !important;
    color: var(--text-secondary);
  }
  .caretaker-banner > svg {
    color: var(--muted) !important;
  }

  /* ── Fase 10 — Empty States ──────────────────────────────────── */
  .dash-empty-state {
    padding: 36px 20px 32px;
  }
  .dash-empty-icon {
    width: 64px;
    height: 64px;
    font-size: 26px;
  }
  .dash-empty-title {
    font-size: 16px;
  }
  .dash-empty-body {
    font-size: 13px;
    max-width: 240px;
  }

  /* ── Fase 9 — Perfil: chips, textarea, botón sticky ─────────── */

  /* Tipos de rescate: chips más compactos en mobile */
  .checkbox-group label:has(input[name="rescueType"]) {
    padding: 8px 14px;
    font-size: 12px;
    min-height: 40px;
  }

  /* Textarea descripción/misión: altura mínima más generosa */
  #foundation-description,
  #foundation-needs,
  #foundation-bank-data {
    min-height: 80px;
    resize: vertical;
  }

  /* Barra fija de acciones del formulario de perfil */
  .profile-form-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    display: flex;
    gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,0.97);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(10px);
    margin-top: 0;
  }
  .profile-form-actions .btn {
    flex: 1;
    min-height: 48px;
    font-size: 15px;
  }
  /* Espacio al fondo del form para que el último campo no quede detrás de la barra */
  #foundation-profile-form {
    padding-bottom: 100px;
  }
  /* Ocultar tabbar mientras el formulario de perfil está abierto */
  body.profile-editing .dashboard-mobile-tabbar {
    display: none !important;
  }

  /* ── Fase 8 — Historial: acciones 44px, serial secundario ──── */

  /* Botones Editar / Eliminar: zona táctil mínima */
  .record-action-btn {
    min-height: 44px;
    padding: 0 16px;
    font-size: 13px;
    border-radius: 12px;
    flex: 1;
    justify-content: center;
  }
  .record-actions {
    gap: 10px;
    margin-top: 6px;
  }
  /* Eliminar: más claro como acción destructiva separada */
  .record-action-btn.danger {
    border: 1.5px solid rgba(231, 76, 60, 0.35);
    background: rgba(231, 76, 60, 0.05);
  }
  .record-action-btn.danger:hover {
    background: #E74C3C;
    color: #fff;
    border-color: #E74C3C;
  }

  /* ── Fase 6 — Dashboard: ceros, actividad, pill cards ──────── */

  /* Stat cards — valor cero visualmente apagado */
  .stat-card strong.is-zero {
    color: var(--muted);
    opacity: 0.5;
  }

  /* Actividad reciente — más aire entre elementos */
  .stack-list {
    gap: 10px;
  }
  .stack-item {
    padding: 14px 16px;
    border-radius: 16px;
    gap: 6px;
  }
  .stack-item strong {
    font-size: 14px;
    line-height: 1.2;
  }
  .stack-item small {
    font-size: 12px;
    line-height: 1.4;
  }
  /* La fecha de cada item — más prominente */
  .stack-item > div:last-child strong {
    font-size: 13px;
    color: var(--text);
  }
  .stack-item > div:last-child small {
    font-size: 11px;
    color: var(--muted);
  }

  /* Pill cards (Estado del rescate) — más respiro vertical */
  .pill-card {
    padding: 16px;
    gap: 6px;
  }
  .pill-card span {
    font-size: 10px;
    margin-bottom: 4px;
    letter-spacing: 0.04em;
  }
  .pill-card strong {
    font-size: 20px;
    line-height: 1;
  }
  .pill-grid {
    gap: 10px;
  }

  /* ── Fase 5 — Historial, Filtros, Modal Hogar ─────────────── */

  /* B. records-hero-meta: ocultar texto secundario redundante */
  .records-hero-meta span {
    display: none;
  }

  /* C. Sub-filter chips: más grandes y tapeables */
  .records-sub-chip {
    font-size: 13px;
    padding: 9px 16px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
  }

  /* D. Modal hogar temporal: más espacio interior y safe-area en botones */
  #temporary-home-detail-modal .modal-card {
    gap: 18px;
  }
  #temporary-home-detail-modal .modal-actions {
    padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
  }
  #temporary-home-detail-modal .temporary-home-meta-card {
    padding: 14px 16px;
  }
  #temporary-home-detail-modal .temporary-home-meta-card strong {
    font-size: 15px;
  }

  /* ── Fase 4 — Formularios / Modales ───────────────────────── */

  /* Labels: ligeramente más grandes y con más aire */
  .modal-card label > span,
  .modal-card legend {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.01em;
  }

  /* Modal-stack-field: menos padding en mobile para no ahogar el contenido */
  .modal-stack-field {
    padding: 12px;
    gap: 10px;
  }

  /* Checkboxes: zona de toque mínima 44px */
  .checkbox-inline,
  .checkbox-group label {
    min-height: 44px;
    padding: 4px 0;
    gap: 12px;
  }
  .checkbox-group {
    gap: 4px;
  }

  /* Range (energía): más fácil de deslizar en touch */
  input[type="range"] {
    height: 28px;
    cursor: pointer;
  }

  /* Condition-grid en mobile: columna única bien espaciada */
  .condition-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Botón "Agregar condición": ancho completo en mobile */
  #add-medical-condition {
    width: 100%;
    min-height: 44px;
  }

  /* Modal-grid: columna única con gap cómodo */
  .modal-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* ── Adopciones — mobile UX ─────────────────────────────── */

  /* Cards custom de solicitudes (reemplaza tabla genérica en mobile) */
  .adoption-mobile-card {
    display: grid;
    gap: 12px;
    padding: 16px;
  }
  .adoption-mobile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }
  .adoption-mobile-copy {
    min-width: 0;
    flex: 1;
  }
  .adoption-mobile-copy strong {
    display: block;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.2;
    white-space: normal;
  }
  .adoption-mobile-copy small {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .adop-new-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 100px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    vertical-align: middle;
    margin-left: 4px;
  }
  .adoption-mobile-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .adoption-mobile-contact {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .adoption-mobile-nophone {
    font-size: 12px;
    color: var(--muted);
    flex: 1;
  }
  .adoption-mobile-date {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
  }
  .adoption-mobile-btn {
    min-height: 44px;
    justify-content: center;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 800;
    background: var(--primary);
    color: #fff;
  }
  .adoption-mobile-btn:hover {
    background: var(--primary-dark, #4a2ba0);
  }

  /* Ocultar section-head eyebrow/title en adopciones — topbar ya muestra el nombre */
  #section-adoptions .section-head > div:first-child {
    display: none;
  }
  #section-adoptions .section-head {
    margin-bottom: 6px;
  }

  /* ── Detail modal — ajustes mobile ─────────────────────────── */
  /* Header: badge debajo del nombre, sin wrap */
  #adoption-detail-modal .modal-head h2 {
    font-size: 20px;
    font-weight: 900;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
  }
  .adop-detail-status .status-badge {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 100px;
  }
  /* Info row 2-col: colapsa solo si el nombre es muy largo; en general cabe */
  .adop-info-row-2 {
    grid-template-columns: 1fr 1fr;
  }
  /* Seguimiento: botón guardar full-width */
  .adop-seguimiento-section #adop-save-followup-btn {
    width: 100%;
    min-height: 44px;
    font-size: 13px;
  }

  /* ── Fix overflow horizontal que rompe position:fixed del tabbar ─ */
  /* El wrapper del filter-chip-row crece a su ancho intrínseco (~500px)
     porque section-head usa align-items:flex-start en column-flex.
     Sin un ancho máximo, desborda el viewport y WebKit/Chrome tratan
     los elementos fixed como absolute, rompiendo el tabbar. */
  .section-head > div:last-child {
    width: 100%;
    min-width: 0;
  }
  .filter-chip-row {
    max-width: 100%;
    min-width: 0;
  }
  /* Safety net: evitar cualquier overflow horizontal residual en el main */
  .dashboard-main {
    overflow-x: hidden;
  }

  /* form-grid-3: 3 checkboxes en fila como chips táctiles */
  .form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .form-grid-3 .form-field-check {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 6px;
    border-radius: 14px;
    background: var(--surface-soft);
    border: 1.5px solid var(--border);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    min-height: 56px;
    transition: background .15s, border-color .15s, color .15s;
  }
  .form-grid-3 .form-field-check:has(input:checked) {
    background: rgba(95, 56, 203, 0.1);
    border-color: var(--primary);
    color: var(--primary);
  }
  .form-grid-3 .form-field-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex-shrink: 0;
  }
  .form-grid-3 .form-field-check .field-label {
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
  }

  /* Filter chips: fade mask para indicar scroll derecho */
  .filter-chip-row {
    -webkit-mask-image: linear-gradient(to right, black 82%, transparent 100%);
    mask-image: linear-gradient(to right, black 82%, transparent 100%);
  }

  /* Detail body: 1fr 1fr → columna única */
  #adop-detail-body > div {
    grid-template-columns: 1fr !important;
  }

  /* Empty state tr: sin card styling */
  .table-wrap tr.table-empty-row {
    background: none;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 20px 0;
  }
  .table-wrap tr.table-empty-row td {
    grid-template-columns: 1fr;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
  }
  .table-wrap tr.table-empty-row td::before { content: none; }

  /* Adoption detail modal: grupo de acciones ocupa todo el ancho */
  .adop-actions-footer {
    padding: 0;
    display: block;
  }
  .adop-action-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  #adop-action-approve {
    grid-column: 1 / -1;
    min-height: 44px;
  }
  #adop-action-reviewing,
  #adop-action-contract {
    min-height: 40px;
    font-size: 12px;
  }
  /* Cuando "En revisión" está oculto, "Borrador" queda solo → span full width */
  .adop-action-group:has(#adop-action-reviewing[hidden]) #adop-action-contract {
    grid-column: 1 / -1;
  }
  /* Cuando "En revisión" es visible pero "Borrador" fuese el único → también full */
  .adop-action-group:has(#adop-action-contract[hidden]) #adop-action-reviewing {
    grid-column: 1 / -1;
  }
  .adop-action-group .table-action-danger {
    grid-column: 1 / -1;
    min-height: 40px;
    font-size: 12px;
    background: rgba(224, 98, 119, 0.07) !important;
    border: 1.5px solid rgba(224, 98, 119, 0.35) !important;
    color: var(--danger) !important;
  }
  .adop-action-group .table-action-danger:hover {
    background: var(--danger) !important;
    color: #fff !important;
    border-color: var(--danger) !important;
  }

  /* Guardar seguimiento: ancho completo en mobile */
  #adop-save-followup-btn {
    width: 100%;
    min-height: 44px;
  }
}

/* ═══════════════════════════════════════════════════
   SECCIÓN CONTENIDO
   ═══════════════════════════════════════════════════ */

.content-mgr-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.content-mgr-header h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

/* Filtros */
.content-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.content-filter-btn {
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.content-filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.content-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(95, 56, 203, 0.28);
}

/* Grid de tarjetas */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* Estado vacío */
.content-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 32px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
}
.content-empty-icon { font-size: 52px; margin-bottom: 12px; }
.content-empty-title { font-size: 18px; font-weight: 900; margin: 0 0 6px; }
.content-empty-sub { font-size: 14px; color: var(--muted); margin: 0 0 20px; }

/* Tarjeta de contenido */
.content-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  box-shadow: 0 4px 20px rgba(66, 43, 136, 0.07);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.content-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(66, 43, 136, 0.12);
}
.content-card-photo {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.content-card-body {
  padding: 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.content-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.content-card-type-badge {
  font-size: 11px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-happy_ending  { background: rgba(34, 168, 109, 0.14); color: #22a86d; }
.badge-rescue_story  { background: rgba(224, 98, 119, 0.14); color: #e06277; }
.badge-news          { background: rgba(95, 56, 203, 0.12);  color: var(--primary); }
.badge-campaign      { background: rgba(183, 29, 183, 0.12); color: #b71db7; }
.badge-post_campaign { background: rgba(29, 183, 207, 0.14); color: var(--accent); }

.content-card-title {
  font-size: 16px;
  font-weight: 900;
  margin: 0;
  line-height: 1.3;
  color: var(--text);
}
.content-card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
  -webkit-line-clamp: 3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.content-card-meta {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

/* ── News-specific styles (admin design) ── */
.news-card {
  position: relative;
  padding-top: 0;
}
.news-card-strip {
  height: 5px;
  width: 100%;
  flex-shrink: 0;
}
.news-card .content-card-head {
  align-items: center;
}
.news-card-time {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
}
.news-card-precaution {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.20);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 12px;
  color: #b91c1c;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-foundation-line {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Publication hero (subtitle + action) — shared by news & content ── */
#section-news .section-hero.news-hero,
#section-content .section-hero.content-hero {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px;
  margin-bottom: 20px;
  margin-top: -6px;
  text-align: left;
}
#section-news .news-hero .news-hero-sub,
#section-content .content-hero .news-hero-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  font-weight: 600;
  flex: 1;
  text-align: left;
}
#section-news .news-hero .section-hero-actions,
#section-content .content-hero .section-hero-actions {
  flex-shrink: 0;
  width: auto;
}
@media (max-width: 768px) {
  #section-news .section-hero.news-hero,
  #section-content .section-hero.content-hero {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  #section-news .news-hero .section-hero-actions,
  #section-content .content-hero .section-hero-actions {
    width: 100% !important;
    flex-shrink: unset;
  }
  #btn-new-content,
  #section-news .news-primary-btn {
    width: 100% !important;
    min-height: 50px;
    justify-content: center;
    border-radius: 16px;
    font-size: 15px;
  }
}
.section-hero-btn .plus-sign {
  font-size: 18px;
  font-weight: 300;
  margin-right: 2px;
}

/* ── Address autocomplete ── */
.nf-address-wrap {
  position: relative;
}
.nf-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(66, 43, 136, 0.14);
  z-index: 200;
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
}
.nf-suggestion-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid var(--border);
}
.nf-suggestion-item:last-child { border-bottom: 0; }
.nf-suggestion-item:hover { background: var(--primary-soft); }
.nf-sug-main {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nf-sug-sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nf-suggestion-empty {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

/* ── Mini mapa de noticias ── */
.nf-map-container {
  height: 200px;
  width: 100%;
  min-width: 0;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 12px;
  background: var(--bg);
  /* Leaflet necesita que el contenedor tenga posición explícita */
  position: relative;
  z-index: 0;
}
.nf-map-hint {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin: 6px 2px 0;
  line-height: 1.4;
}
/* Pin personalizado */
.nf-map-pin {
  width: 28px;
  height: 38px;
  background: var(--primary);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(95, 56, 203, 0.4);
}
.nf-map-pin::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
/* Leaflet dentro del modal — z-index */
.nf-map-container .leaflet-pane { z-index: 1; }
.nf-map-container .leaflet-top,
.nf-map-container .leaflet-bottom { z-index: 2; }

/* ── Stats grid — shared by news & content ── */
#section-news .news-stats-grid,
#section-content .content-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
#section-news .news-stat-card,
#section-content .news-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
#section-news .news-stat-icon,
#section-content .news-stat-icon {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
#section-news .news-stat-card[data-color="primary"] .news-stat-icon,
#section-content .news-stat-card[data-color="primary"] .news-stat-icon { background: rgba(95, 56, 203, 0.10); }
#section-news .news-stat-card[data-color="blue"]    .news-stat-icon,
#section-content .news-stat-card[data-color="blue"] .news-stat-icon { background: rgba(59, 130, 246, 0.10); }
#section-news .news-stat-card[data-color="amber"]   .news-stat-icon,
#section-content .news-stat-card[data-color="amber"] .news-stat-icon { background: rgba(245, 158, 11, 0.14); }
#section-news .news-stat-content,
#section-content .news-stat-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
#section-news .news-stat-value,
#section-content .news-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
#section-news .news-stat-label,
#section-content .news-stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

/* ── Seguimiento section — hero, stats, modal ── */
#section-followup .section-hero.news-hero.followup-hero {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px;
  margin-bottom: 20px;
  margin-top: -6px;
  text-align: left;
}
#section-followup .followup-hero .news-hero-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  font-weight: 600;
  flex: 1;
  text-align: left;
}
#section-followup .followup-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
#section-followup .news-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
#section-followup .news-stat-icon {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
#section-followup .news-stat-card[data-color="primary"] .news-stat-icon { background: rgba(95, 56, 203, 0.10); }
#section-followup .news-stat-card[data-color="blue"]    .news-stat-icon { background: rgba(59, 130, 246, 0.10); }
#section-followup .news-stat-card[data-color="amber"]   .news-stat-icon { background: rgba(245, 158, 11, 0.14); }
#section-followup .news-stat-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
#section-followup .news-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
#section-followup .news-stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

/* Followup detail modal — footer buttons side-by-side */
#followup-detail-modal .news-modal-footer {
  display: flex;
  gap: 10px;
}

/* Followup modal — adopter info grid */
.followup-adopter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-bottom: 16px;
}
.followup-info-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.followup-info-key {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.followup-info-val {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}
.followup-info-row.span-full {
  grid-column: 1 / -1;
}

/* Followup modal — section labels */
.followup-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  margin: 0 0 8px;
}

/* Followup modal — notes log */
.followup-notes-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.followup-note-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
}
.followup-note-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  display: block;
  margin-bottom: 3px;
}
.followup-note-text {
  font-size: 13px;
  color: var(--text);
  margin: 0;
}

/* ── Modal v2 (2 pasos) ── */
.news-modal-v2::backdrop {
  background: rgba(15, 20, 40, 0.55);
  backdrop-filter: blur(4px);
}
.news-modal-v2 {
  border: none;
  padding: 0;
  border-radius: 24px;
  max-width: 560px;
  width: calc(100% - 40px);
  max-height: 92vh;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}
.news-modal-inner {
  display: flex;
  flex-direction: column;
  max-height: 92vh;
}
.news-modal-head {
  padding: 22px 26px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.news-modal-head .eyebrow {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 3px;
}
.news-modal-head h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}
.news-modal-progress {
  height: 3px;
  background: var(--border);
  flex-shrink: 0;
  overflow: hidden;
}
.news-modal-progress-fill {
  height: 100%;
  width: 50%;
  background: var(--primary);
  transition: width 0.3s ease;
}
.news-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 26px;
}

/* Paso 1 — type tiles */
.news-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
/* Content-modal tiene 3 tiles → 3 columnas para que quepan bien */
#content-step-1 .news-type-grid {
  grid-template-columns: repeat(3, 1fr);
}
#content-step-1 .news-type-tile {
  padding: 14px 10px;
  text-align: center;
  flex-direction: column;
  align-items: center;
}
#content-step-1 .news-type-tile-icon {
  font-size: 26px;
  margin-bottom: 6px;
}
#content-step-1 .news-type-tile-label {
  font-size: 12px;
  text-align: center;
  line-height: 1.3;
}
#content-step-1 .news-type-tile-desc {
  text-align: center;
  font-size: 10.5px;
  line-height: 1.4;
}
.news-type-tile {
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 14px 13px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.news-type-tile:hover { border-color: var(--border); }
.news-type-tile.active {
  background: rgba(95, 56, 203, 0.08);
  border-color: var(--primary);
}
.news-type-tile.active[data-ntype="ALERTA"]    { background: rgba(239, 68, 68, 0.08);  border-color: #ef4444; }
.news-type-tile.active[data-ntype="EVENTO"]    { background: rgba(249, 115, 22, 0.09); border-color: #f97316; }
.news-type-tile.active[data-ntype="GRATIS"]    { background: rgba(34, 197, 94, 0.09);  border-color: #22c55e; }
.news-type-tile.active[data-ntype="DONACION"]  { background: rgba(139, 92, 246, 0.09); border-color: #8b5cf6; }
.news-type-tile.active[data-ntype="VOLUNTARIO"]{ background: rgba(20, 184, 166, 0.09); border-color: #14b8a6; }
.news-type-tile.active[data-ctype="happy_ending"]  { background: rgba(34, 168, 109, 0.09); border-color: #22a86d; }
.news-type-tile.active[data-ctype="rescue_story"]  { background: rgba(224, 98, 119, 0.09); border-color: #e06277; }
.news-type-tile.active[data-ctype="campaign"]      { background: rgba(183, 29, 183, 0.09); border-color: #b71db7; }
.news-type-tile-icon { font-size: 24px; margin-bottom: 5px; }
.news-type-tile-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.news-type-tile.active[data-ntype="ALERTA"]    .news-type-tile-label { color: #ef4444; }
.news-type-tile.active[data-ntype="EVENTO"]    .news-type-tile-label { color: #f97316; }
.news-type-tile.active[data-ntype="GRATIS"]    .news-type-tile-label { color: #22c55e; }
.news-type-tile.active[data-ntype="DONACION"]  .news-type-tile-label { color: #8b5cf6; }
.news-type-tile.active[data-ntype="VOLUNTARIO"] .news-type-tile-label { color: #14b8a6; }
.news-type-tile.active[data-ctype="happy_ending"]  .news-type-tile-label { color: #22a86d; }
.news-type-tile.active[data-ctype="rescue_story"]  .news-type-tile-label { color: #e06277; }
.news-type-tile.active[data-ctype="campaign"]      .news-type-tile-label { color: #b71db7; }
.news-type-tile-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 2px;
}

/* Paso 2 — chip de tipo seleccionado */
.news-type-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.news-type-chip-icon { font-size: 20px; }
.news-type-chip-text { flex: 1; min-width: 0; }
.news-type-chip-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.news-type-chip-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-top: 1px;
}
.news-type-chip-change {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

/* Alert block — campos exclusivos ALERTA */
.news-alert-block {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 14px;
  padding: 14px;
  margin-top: 6px;
}
.news-alert-divider {
  color: #dc2626;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
}

/* ── Coordenadas / Geo ── */
.nf-geo-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.nf-geo-row .btn-sm {
  flex: 1;
  min-width: 140px;
  justify-content: center;
  white-space: nowrap;
}
.nf-geo-status {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 10px;
  line-height: 1.4;
}
.nf-geo-ok {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.nf-geo-missing {
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Footer del modal */
.news-modal-footer {
  padding: 16px 26px 22px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.news-modal-footer-step {
  display: flex;
  gap: 10px;
}
.news-modal-footer-step .btn {
  flex: 1;
  justify-content: center;
}
#news-footer-step-1 .btn-secondary { flex: 1; }
#news-footer-step-1 .btn-primary  { flex: 2; }
.news-modal-footer-step .btn-primary:disabled {
  background: #E2E8F0;
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
  opacity: 1;
}

.content-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
  flex-wrap: wrap;
  row-gap: 6px;
}

/* Badge estado */
.status-badge {
  font-size: 11px;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 999px;
}
.status-badge.published { background: var(--success-soft); color: var(--success); }
.status-badge.draft     { background: rgba(126,118,160,0.14); color: var(--muted); }

/* Progress bar campaña */
.campaign-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.campaign-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
}
.campaign-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.campaign-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #b71db7, var(--primary));
  border-radius: 999px;
  transition: width 0.4s ease;
}


/* Tarjeta urgente */
.content-card.urgent {
  border-color: rgba(215, 155, 31, 0.5);
  box-shadow: 0 4px 20px rgba(215, 155, 31, 0.14);
}
.urgent-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 900;
  background: var(--warning-soft);
  color: var(--warning);
  padding: 3px 8px;
  border-radius: 999px;
  margin-left: 8px;
}

/* Acciones de tarjeta */
.content-card-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}
.content-card-actions button {
  border: 0;
  background: var(--surface-soft);
  color: var(--muted);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.content-card-actions button:hover        { background: var(--primary-soft); color: var(--primary); }
.content-card-actions button.danger:hover { background: var(--danger-soft);  color: var(--danger); }
.content-card-actions button.rendicion {
  background: rgba(29, 183, 207, 0.1);
  color: var(--accent);
}
.content-card-actions button.rendicion:hover {
  background: var(--accent);
  color: #fff;
}
.content-card-actions button.donate-btn {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}
.content-card-actions button.donate-btn:hover {
  background: #22c55e;
  color: #fff;
}

/* ── Modal de contenido ── */
.content-modal-dialog { max-width: 660px; }
.content-modal-dialog .modal-inner {
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
}
/* El div wrapeador del título debe ocupar todo el espacio disponible */
.content-modal-dialog .modal-head > div:first-child { flex: 1; min-width: 0; }

/* ─ Selector de tipo ─ */
.content-type-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}

/* Tile base */
.content-type-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px 12px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: var(--surface-soft);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  text-align: center;
  position: relative;
}
.content-type-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(66, 43, 136, 0.1);
}

/* Icono con fondo pastel por tipo */
.ctype-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: transform 0.18s ease;
}
.content-type-tile:hover .ctype-icon { transform: scale(1.1); }

/* Colores pasteles por tipo */
[data-ctype="happy_ending"]  .ctype-icon { background: rgba(34, 168, 109, 0.14); }
[data-ctype="rescue_story"]  .ctype-icon { background: rgba(224, 98, 119, 0.14); }
[data-ctype="news"]          .ctype-icon { background: rgba(95, 56, 203, 0.12);  }
[data-ctype="campaign"]      .ctype-icon { background: rgba(183, 29, 183, 0.13); }
[data-ctype="post_campaign"] .ctype-icon { background: rgba(29, 183, 207, 0.14); }

/* Borde activo por tipo */
[data-ctype="happy_ending"].active  { border-color: #22a86d; box-shadow: 0 4px 18px rgba(34,168,109,0.18); background: rgba(34, 168, 109, 0.07); }
[data-ctype="rescue_story"].active  { border-color: #e06277; box-shadow: 0 4px 18px rgba(224,98,119,0.18);  background: rgba(224, 98, 119, 0.07); }
[data-ctype="news"].active          { border-color: var(--primary); box-shadow: 0 4px 18px rgba(95,56,203,0.18); background: var(--primary-soft); }
[data-ctype="campaign"].active      { border-color: #b71db7; box-shadow: 0 4px 18px rgba(183,29,183,0.18);  background: rgba(183, 29, 183, 0.07); }
[data-ctype="post_campaign"].active { border-color: var(--accent); box-shadow: 0 4px 18px rgba(29,183,207,0.18); background: rgba(29, 183, 207, 0.07); }

.ctype-label {
  font-size: 10px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: 0.2px;
}

/* ─ Divisores de sección dentro del modal ─ */
.cf-section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}
.cf-section-divider::before,
.cf-section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─ Bloques condicionales con animación ─ */
.cf-block {
  margin-top: 0;
  padding: 20px;
  background: var(--surface-soft);
  border-radius: 16px;
  border: 1px solid var(--border);
  animation: cfBlockIn 0.2s ease;
}
@keyframes cfBlockIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cf-block-photo { width: 100%; }

/* ─ Drop Zone de foto ─ */
.cf-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s ease;
  background: var(--surface);
  position: relative;
}
.cf-drop-zone:hover,
.cf-drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.cf-drop-zone-icon {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
  transition: transform 0.18s ease;
}
.cf-drop-zone:hover .cf-drop-zone-icon { transform: scale(1.15); }
.cf-drop-zone-text {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  margin: 0 0 4px;
}
.cf-drop-zone-sub {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
  opacity: 0.7;
}

/* Thumbnail con X */
.cf-photo-thumb {
  position: relative;
  display: inline-block;
  margin-top: 4px;
}
.cf-photo-thumb img {
  max-width: 100%;
  max-height: 160px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  box-shadow: 0 4px 16px rgba(66, 43, 136, 0.14);
}
.cf-photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: 0;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease;
}
.cf-photo-remove:hover { background: var(--danger); }

/* ─ Lista de gastos ─ */
.expense-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.expense-item {
  display: grid;
  grid-template-columns: 1fr 140px 36px;
  gap: 8px;
  align-items: center;
}
.expense-item button {
  flex-shrink: 0;
  background: var(--danger-soft);
  color: var(--danger);
  border: 0;
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.16s;
}
.expense-item button:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ─ Form actions ─ */
.modal-form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}

/* Botón publicar destacado */
#cf-submit-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 6px 20px rgba(95, 56, 203, 0.3);
  padding: 14px 28px;
  font-size: 14px;
}
#cf-submit-btn:hover {
  box-shadow: 0 8px 28px rgba(95, 56, 203, 0.42);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .content-type-picker { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; gap: 12px; }
  .content-card-footer { flex-direction: column; align-items: flex-start; }
  .expense-item { grid-template-columns: 1fr 100px 36px; }
  .modal-form-actions { flex-direction: column-reverse; }
  #cf-submit-btn { width: 100%; }

  /* ── News & Content sections — mobile design ── */
  .news-hero,
  .content-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .news-hero-title { font-size: 22px; }
  #section-news .section-hero-actions,
  #section-content .section-hero-actions { width: 100%; }
  #section-news .section-hero-btn,
  #section-content .section-hero-btn {
    width: 100%;
    justify-content: center;
  }

  /* Stats mobile: 3 cards in one row, column layout per card */
  #section-news .news-stats-grid,
  #section-content .content-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
  }
  #section-news .news-stat-card,
  #section-content .news-stat-card {
    min-width: 0;
    padding: 10px 8px;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  #section-news .news-stat-icon,
  #section-content .news-stat-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 13px;
    border-radius: 8px;
  }
  #section-news .news-stat-content,
  #section-content .news-stat-content { min-width: 0; }
  #section-news .news-stat-value,
  #section-content .news-stat-value { font-size: 18px; }
  #section-news .news-stat-label,
  #section-content .news-stat-label { font-size: 10px; line-height: 1.3; }

  /* Seguimiento mobile stats */
  #section-followup .followup-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
  }
  #section-followup .news-stat-card {
    min-width: 0;
    padding: 10px 8px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  #section-followup .news-stat-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 13px;
    border-radius: 8px;
  }
  #section-followup .news-stat-content { min-width: 0; }
  #section-followup .news-stat-value { font-size: 18px; }
  #section-followup .news-stat-label { font-size: 10px; line-height: 1.3; }
  .followup-adopter-grid { grid-template-columns: 1fr; }

  /* Modal 2-step mobile */
  .news-modal-v2 {
    width: 100%;
    max-width: none;
    max-height: 96vh;
    border-radius: 20px 20px 0 0;
    margin: auto 0 0;
  }
  .news-modal-head { padding: 18px 20px 14px; }
  .news-modal-body { padding: 18px 20px; }
  .news-modal-footer { padding: 14px 20px 18px; }
  .news-type-grid { grid-template-columns: 1fr; }
  .news-type-tile { padding: 12px 14px; flex-direction: row; align-items: center; gap: 12px; }
  .news-type-tile-icon { font-size: 22px; margin-bottom: 0; }
  .news-type-tile-text { flex: 1; }

  /* Content-step-1 en mobile: vuelve a 1 columna horizontal (igual que noticias) */
  #content-step-1 .news-type-grid {
    grid-template-columns: 1fr;
  }
  #content-step-1 .news-type-tile {
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 12px 14px;
  }
  #content-step-1 .news-type-tile-icon {
    font-size: 22px;
    margin-bottom: 0;
  }
  #content-step-1 .news-type-tile-label {
    font-size: 13px;
    text-align: left;
  }
  #content-step-1 .news-type-tile-desc {
    text-align: left;
  }

  /* Filter bar scrolls horizontally on mobile */
  #section-news .content-filter-bar,
  #section-content .content-filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: -16px;
    margin-right: -16px;
    padding: 0 16px 4px;
    margin-bottom: 16px;
  }
  #section-news .content-filter-bar::-webkit-scrollbar,
  #section-content .content-filter-bar::-webkit-scrollbar { display: none; }
  #section-news .content-filter-btn,
  #section-content .content-filter-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 12px;
  }

  /* Compact news card on mobile */
  .news-card .content-card-body {
    padding: 14px 16px;
    gap: 8px;
  }
  .news-card .content-card-title {
    font-size: 15px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .news-card .content-card-desc {
    font-size: 12px;
    -webkit-line-clamp: 2;
  }
  .news-card .content-card-photo {
    height: 140px;
  }
  .news-card .content-card-footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
  }
  .news-card .content-card-actions button {
    padding: 6px 10px;
    font-size: 12px;
  }
  .news-card-time { font-size: 10px; }
  .news-card-foundation-line { font-size: 11px; }
}

/* ─ Banner rendición de cuentas ─ */
.cf-rendicion-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(29, 183, 207, 0.08);
  border: 1.5px solid rgba(29, 183, 207, 0.25);
  border-radius: 14px;
  padding: 14px 16px;
}
.cf-rendicion-icon {
  font-size: 28px;
  flex-shrink: 0;
  line-height: 1;
}
.cf-rendicion-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--accent);
  margin: 0 0 3px;
}
.cf-rendicion-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* ─ Evidence grid ─ */
.cf-rendicion-label {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin: 20px 0 10px;
}
.cf-evidence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.cf-evidence-slot {}
.cf-evidence-title {
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 2px;
  color: var(--text);
}
.cf-evidence-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 8px;
}
.cf-drop-zone-sm {
  padding: 16px 10px;
  min-height: 90px;
  gap: 4px;
}
.cf-drop-zone-sm .cf-drop-zone-text {
  font-size: 12px;
}

/* ─ Expense accordion ─ */
.cf-expense-accordion {
  margin-top: 18px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.cf-expense-accordion summary {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.cf-expense-accordion summary::-webkit-details-marker { display: none; }
.cf-expense-accordion[open] summary { border-bottom: 1px solid var(--border); }
.cf-expense-accordion > div { padding: 12px 16px 16px; }

/* ─ Campaña auditada (tarjeta transformada) ─ */
.campaign-audited-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.1);
  border: 1.5px solid rgba(34, 197, 94, 0.3);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 900;
  color: #16a34a;
  width: fit-content;
  margin-top: 8px;
}
.content-card.audited .campaign-progress-bar {
  background: rgba(34, 197, 94, 0.15);
}
.content-card.audited .campaign-progress-fill {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

/* ─ Inline Edit Profile Styles ─ */
#foundation-view-mode {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px 28px;
}
.profile-view-section {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px 20px;
}
#foundation-profile-form {
  padding: 20px 24px 28px;
  display: flex;
  flex-direction: column;
}
.profile-edit-section {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px 20px;
  margin-top: 16px;
}
.profile-edit-section:first-child {
  margin-top: 0;
}
.profile-view-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  margin: 0 0 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-view-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 4px;
}
.profile-edit-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  margin: 0 0 16px;
  letter-spacing: 0.02em;
}
.profile-view-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
}
@media (max-width: 640px) {
  .profile-view-grid { grid-template-columns: 1fr; }
}
.profile-view-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.profile-view-item.full {
  grid-column: 1 / -1;
}
.pvi-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.pvi-value {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
}
.pvi-link:not(:empty) {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: rgba(95, 56, 203, 0.4);
  text-underline-offset: 3px;
  cursor: pointer;
}
.pvi-link:empty { display: none; }
.pvi-tags:empty { display: none; }
.pvi-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pvi-tags .rescue-tag {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(95,56,203,0.2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
}

/* Stats row inside profile-view-section */
.pvi-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
@media (max-width: 560px) {
  .pvi-stats-row { grid-template-columns: repeat(2, 1fr); }
}
.pvi-stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pvi-stat-num {
  font-size: 22px;
  font-weight: 800;
  font-family: "Sora", sans-serif;
  color: var(--primary);
  line-height: 1;
}
.pvi-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.pvi-bank {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 4px;
  font-family: monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text);
}
.pvi-bank:empty { display: none; }

/* ── Input con prefijo fijo (ej: +56) ── */
.input-prefix-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 10px);
  overflow: hidden;
  background: var(--surface);
}
.input-prefix-wrap:focus-within {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}
.input-prefix {
  padding: 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-soft);
  border-right: 1px solid var(--border);
  white-space: nowrap;
  line-height: 40px;
  user-select: none;
}
.input-prefix-wrap input {
  border: none !important;
  outline: none !important;
  border-radius: 0 !important;
  flex: 1;
  min-width: 0;
}

/* ══════════════════════════════════════════════════════
   MODAL DONACIÓN v2 — Diseño premium
   ══════════════════════════════════════════════════════ */

.adop-detail-modal-v2 {
  max-width: 600px;
}

.donation-modal-v2 {
  max-width: 400px;
}

/* Header con ícono */
.donation-modal-head {
  padding: 20px 24px 16px;
}
.donation-modal-header-content {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.donation-modal-icon-wrap {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 14px;
  background: rgba(34, 197, 94, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 1.5px solid rgba(34, 197, 94, 0.2);
  animation: donationIconPulse 2s ease-in-out infinite;
}
@keyframes donationIconPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.25); }
  50%       { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}
.donation-modal-head h3 {
  font-size: 16px;
  font-weight: 900;
  margin: 2px 0 0;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Body */
.donation-modal-body {
  padding: 20px 24px 8px;
}
.donation-modal-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 20px;
}

/* Bloque del monto */
.donation-amount-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.donation-amount-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.donation-amount-input-wrap {
  display: flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.donation-amount-input-wrap:focus-within {
  border-color: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}
.donation-currency-sign {
  font-size: 28px;
  font-weight: 900;
  color: #16a34a;
  padding: 12px 4px 12px 18px;
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
}
.donation-amount-input {
  border: none !important;
  outline: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  flex: 1;
  min-width: 0;
  font-size: 32px !important;
  font-weight: 900 !important;
  color: var(--text) !important;
  padding: 12px 18px 12px 8px !important;
  line-height: 1;
  -moz-appearance: textfield;
}
.donation-amount-input::-webkit-outer-spin-button,
.donation-amount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.donation-amount-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

/* Botón CTA verde */
.donation-submit-btn {
  background: linear-gradient(135deg, #16a34a, #22c55e) !important;
  color: #fff !important;
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.32) !important;
  font-size: 14px;
  padding: 14px 24px;
}
.donation-submit-btn:hover {
  box-shadow: 0 8px 28px rgba(34, 197, 94, 0.44) !important;
  transform: translateY(-1px);
}

/* ── Dashboard Rediseño — Stat cards ─────────────────────────── */
.stat-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.stat-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon-box--alt  { background: rgba(29, 183, 207, 0.12); }
.stat-icon-box--warm { background: rgba(215, 155, 31, 0.12); }
.stat-icon-box--cool { background: rgba(95, 56, 203, 0.10); }
.stat-change-badge {
  font-size: 11px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34, 168, 109, 0.13);
  color: var(--success);
  white-space: nowrap;
}
.stat-change-badge.neutral {
  background: rgba(126, 118, 160, 0.12);
  color: var(--muted);
}
.stat-label-upper {
  display: block;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
  font-weight: 900;
  color: var(--muted);
  margin-bottom: 2px;
}

/* ── Quick actions row ──────────────────────────────────────── */
.dash-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 22px 12px 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
  font-weight: 900;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.quick-action-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(95, 56, 203, 0.12);
}
.quick-action-desc {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
}
.quick-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.quick-action-icon--heart { background: var(--danger-soft); }
.quick-action-icon--teal  { background: rgba(29, 183, 207, 0.12); }

.foundation-onboarding-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: stretch;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(76, 176, 228, 0.12), rgba(34, 168, 109, 0.10));
  border: 1px solid rgba(76, 176, 228, 0.26);
  box-shadow: var(--shadow);
}
.foundation-onboarding-panel[hidden] {
  display: none;
}
.foundation-onboarding-copy h2 {
  margin: 4px 0 8px;
  font-family: "Sora", sans-serif;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.05;
}
.foundation-onboarding-copy p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.foundation-onboarding-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.foundation-onboarding-steps button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-height: 126px;
  padding: 16px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.06);
  transition: transform 0.15s, box-shadow 0.15s;
}
.foundation-onboarding-steps button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(76, 176, 228, 0.15);
}
.foundation-onboarding-steps span {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 900;
}
.foundation-onboarding-steps strong {
  font-size: 14px;
  line-height: 1.15;
}
.foundation-onboarding-steps small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .foundation-onboarding-panel,
  .foundation-onboarding-steps {
    grid-template-columns: 1fr;
  }
  .foundation-onboarding-steps button {
    min-height: 0;
  }
}

/* ── Right column (dashboard grid) ─────────────────────────── */
.dash-right-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Pill card — colored value + progress bar ─────────────── */
.pill-label {
  display: block;
  color: var(--muted);
  font-weight: 900;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.pill-value {
  font-size: 22px;
  font-family: "Sora", sans-serif;
  display: block;
  margin-bottom: 10px;
}
.pill-value--gray   { color: var(--muted); }
.pill-value--purple { color: var(--primary); }
.pill-value--green  { color: var(--success); }
.pill-value--amber  { color: var(--warning); }
.pill-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(126, 118, 160, 0.15);
  overflow: hidden;
}
.pill-bar-fill {
  height: 100%;
  border-radius: 999px;
  width: 0%;
  transition: width 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.pill-bar--gray   { background: rgba(126, 118, 160, 0.45); }
.pill-bar--purple { background: var(--primary); }
.pill-bar--green  { background: var(--success); }
.pill-bar--amber  { background: var(--warning); }

/* ── mini-chip accent variant ──────────────────────────────── */
.mini-chip--accent {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

/* ── Stat card: clean white + left color accent ─────────────── */
.stat-card      { border-left: 4px solid var(--primary); }
.stat-card.alt  { background: var(--surface); border-left-color: var(--accent); }
.stat-card.warm { background: var(--surface); border-left-color: var(--warning); }
.stat-card.cool { background: var(--surface); border-left-color: var(--success); }

/* ── Pill-grid 2×2 inside right column ─────────────────────── */
.dash-right-col .pill-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ── Pet avatar in recent-pets feed ─────────────────────────── */
.stack-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}
.stack-item-avatar--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  font-size: 18px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
}

/* ── Tablet/narrow overrides for new components ─────────────── */
@media (max-width: 1100px) {
  /* Quick actions: 2×2 on tablet */
  .dash-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* Reorder dashboard panels: Estado del rescate before Actividad reciente */
  .dash-panel-recent { order: 2; }
  .dash-right-col    { order: 1; }
}

/* ── Mobile overrides for new components ───────────────────── */
@media (max-width: 768px) {
  /* Stats: 2×2 grid on mobile (override 1100px 1-col rule) */
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* Quick actions: Flexbox igual al diseño de referencia */
  .dash-quick-actions {
    display: flex;
    gap: 8px;
    padding: 0;
    margin: 0;
    overflow: visible;
  }
  
  .quick-action-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 12px 4px;
    gap: 6px;
    font-size: 10px;
    border-radius: 16px;
    white-space: normal;
    word-wrap: break-word;
    text-align: center;
    line-height: 1.2;
    height: auto;
  }
  
  /* Prevent flex items from stretching the container width */
  .stats-grid, .dashboard-grid {
    max-width: 100%;
    min-width: 0;
  }
  
  .dash-right-col .pill-grid {
    gap: 8px;
  }
  .pill-card {
    padding: 12px 10px;
  }
  .pill-card span {
    font-size: 9px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.2;
  }
  .quick-action-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }
  /* Stat change badge: slightly smaller */
  .stat-change-badge {
    font-size: 10px;
    padding: 3px 8px;
  }
  /* Stat icon: slightly smaller */
  .stat-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }
  /* Activity items: mantener layout horizontal en mobile */
  #recent-pets .stack-item {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 13px;
  }
  
  /* Exact panel-card constraints for mobile */
  .panel-card {
    border-radius: 20px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow: hidden;
  }
  .panel-card > .section-head {
    padding: 14px 16px 10px;
  }
  .panel-card > .section-head .eyebrow {
    font-size: 10px;
    color: var(--accent);
    margin-bottom: 3px;
    letter-spacing: 0.1em;
  }
  .panel-card > .section-head h2 {
    font-size: 16px;
    letter-spacing: 0;
  }
  .panel-card > .stack-list,
  .panel-card > .empty-inline {
    padding: 0 12px 14px;
    gap: 8px;
  }
  .dash-right-col .pill-grid {
    padding: 0 14px 14px;
  }
}

/* ── Activity feed item structure ───────────────────────────── */
.activity-body { flex: 1; min-width: 0; }
.activity-name { display: block; font-weight: 700; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-sub  { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.activity-date {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--surface-soft);
  padding: 3px 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
#recent-pets .stack-item:hover {
  background: var(--surface);
  border-color: rgba(95, 56, 203, 0.2);
}

/* News redesign */
#section-news {
  gap: 18px;
}

#section-news .news-page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "subtitle actions";
  align-items: start;
  gap: 14px 24px;
  padding: 0;
}

#section-news .news-page-heading {
  display: none;
}

/* hidden on desktop, shown only in mobile @media block */
.homes-mobile-generate-btn { display: none; }

/* ── Hogares: section-hero con botón a la derecha ────────────── */
.homes-section-hero {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  margin-bottom: 16px;
}

.homes-help-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 22px;
  border: 1.5px solid var(--surface-border);
  background: var(--surface);
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.14s, border-color 0.14s;
}

.homes-help-btn:hover {
  background: var(--primary-soft);
  border-color: rgba(95, 56, 203, 0.3);
}

@media (max-width: 768px) {
  .homes-section-hero {
    justify-content: flex-start;
  }
  .homes-help-btn {
    font-size: 12px;
    padding: 8px 14px;
  }
  /* Mobile generate code button */
  .homes-mobile-generate-btn {
    display: flex !important;
    width: 100%;
    min-height: 50px;
    justify-content: center;
    font-size: 15px;
    border-radius: 16px;
  }
  /* Mobile: "Nueva Publicación" and similar hero CTAs — full width */
  #section-content .section-hero-actions,
  #section-news .section-hero-actions {
    width: 100%;
  }
  #btn-new-content,
  #btn-new-news {
    width: 100%;
    min-height: 50px;
    justify-content: center;
    font-size: 15px;
    border-radius: 16px;
  }
}

/* ── Hogares: cards grid (siempre visible, tabla legacy oculta) ─ */
.homes-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 0 24px 24px;
  overflow: visible;
}

/* la tabla legacy nunca se muestra — el JS rellena el grid en todos los viewports */
.homes-table-mobile-only { display: none !important; }

@media (max-width: 768px) {
  .homes-cards-grid {
    grid-template-columns: 1fr;
    padding: 0 0 20px;
    gap: 10px;
  }
  /* en mobile el grid contiene home-mobile-card, no home-card */
  .homes-cards-grid .home-mobile-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    box-shadow: 0 3px 14px rgba(66, 43, 136, 0.07);
    overflow: hidden;
  }
}

/* Home card */
.home-card {
  border-radius: 20px;
  border: 1px solid var(--surface-border);
  background: var(--surface-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

.home-card:hover {
  box-shadow: 0 8px 28px rgba(66, 43, 136, 0.12);
  transform: translateY(-2px);
}

.home-card-top {
  padding: 16px 18px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.home-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--primary-soft);
}

.home-card-avatar--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 900;
  font-size: 20px;
  font-family: "Sora", sans-serif;
}

.home-card-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-card-copy strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-card-copy small {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-card-role-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: var(--primary-soft);
  color: var(--primary-dark);
  margin-top: 2px;
  width: fit-content;
}

.home-card-pets {
  padding: 10px 18px 14px;
  border-top: 1px solid var(--surface-border);
}

.home-card-pets-label {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 8px;
}

.home-card-pet-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.home-card-pet-tag {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(215, 155, 31, 0.12);
  color: #a07010;
}

.home-card-pet-tag.muted {
  background: var(--surface-soft);
  color: var(--muted);
  border: 1px solid var(--surface-border);
}

.home-card-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.home-card-no-phone {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 8px;
  padding: 4px 10px;
  width: fit-content;
}

.home-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
}

/* Ver y Escribir/Llamar: iguales en ancho */
.home-card-actions .table-action-btn:not(.table-action-danger) {
  flex: 1;
  text-align: center;
  justify-content: center;
}

/* Desvincular ocupa toda la fila */
.home-card-actions .table-action-danger {
  flex: 1 1 100%;
  text-align: center;
  justify-content: center;
  background: rgba(224, 98, 119, 0.06);
  border-color: rgba(224, 98, 119, 0.3);
  color: var(--danger);
}
.home-card-actions .table-action-danger:hover {
  background: rgba(224, 98, 119, 0.12);
}

/* Invite card */
.home-card--invite {
  border: 2px dashed var(--surface-border);
  background: transparent;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  padding: 28px;
  text-align: center;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.home-card--invite:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-2px);
}

.home-card-invite-icon {
  font-size: 28px;
  line-height: 1;
  color: var(--muted);
}

.home-card--invite strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}

.home-card--invite small {
  font-size: 11px;
  color: var(--muted);
}

/* ── Invitaciones: chip de código en tabla ───────────────────── */
.invit-code-chip {
  font-family: "Courier New", monospace;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--primary-dark);
  background: var(--primary-soft);
  padding: 4px 12px;
  border-radius: 8px;
  display: inline-block;
}

/* tabla de invitaciones — columnas más cómodas */
.invitations-table th,
.invitations-table td {
  white-space: nowrap;
}

.invitations-table td:nth-child(2),
.invitations-table td:nth-child(3) {
  white-space: normal;
  min-width: 100px;
}

.invit-card {
  border-radius: 18px;
  border: 1px solid var(--surface-border);
  background: var(--surface-soft);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.18s, transform 0.18s;
}

.invit-card:hover {
  box-shadow: 0 6px 22px rgba(66, 43, 136, 0.1);
  transform: translateY(-1px);
}

.invit-card--inactive {
  opacity: 0.65;
}

.invit-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.invit-card-code {
  font-family: "Courier New", monospace;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--primary-dark);
  background: var(--primary-soft);
  padding: 5px 12px;
  border-radius: 9px;
}

.invit-card-recipient {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.invit-card-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invit-card-email {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invit-card-email.muted {
  font-style: italic;
}

.invit-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text);
  font-weight: 700;
}

.invit-meta-label {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-right: 6px;
}

.invit-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--surface-border);
}

.invit-btn {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 0.13s, color 0.13s;
  text-align: center;
  white-space: nowrap;
}

.invit-btn--copy {
  background: var(--surface);
  border-color: var(--surface-border);
  color: var(--text);
}
.invit-btn--copy:hover { background: var(--primary-soft); color: var(--primary-dark); }

.invit-btn--warn {
  background: rgba(215, 155, 31, 0.08);
  border-color: rgba(215, 155, 31, 0.4);
  color: var(--warning);
}
.invit-btn--warn:hover { background: rgba(215, 155, 31, 0.16); }

.invit-btn--danger {
  background: rgba(224, 98, 119, 0.06);
  border-color: rgba(224, 98, 119, 0.3);
  color: var(--danger);
}
.invit-btn--danger:hover { background: rgba(224, 98, 119, 0.12); }

/* desktop tabla visible, mobile cards ocultas */
.invit-desktop-table { display: block; }
.invit-mobile-cards-list { display: none; }

@media (max-width: 768px) {
  .invit-desktop-table { display: none !important; }
  .invit-mobile-cards-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 14px 20px;
  }
  /* hogares mobile: Ver + Escribir en fila, Desvincular full-width */
  .homes-cards-grid .home-mobile-actions {
    grid-template-columns: 1fr 1fr;
  }
  .homes-cards-grid .home-mobile-actions .table-action-danger {
    grid-column: 1 / -1;
  }
}

.invitations-empty {
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

/* Toggle label para invitaciones */
.invit-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.invit-toggle-label input[type="checkbox"] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* ── Invitaciones: card mobile ───────────────────────────────── */
@media (max-width: 768px) {
  .invit-mobile-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    background: var(--surface);
    border-radius: 18px;
    border: 1px solid var(--surface-border);
    box-shadow: 0 2px 10px rgba(66, 43, 136, 0.06);
  }
  .invit-mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
  }
  .invit-mobile-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
  }
  .invit-mobile-email {
    font-size: 12px;
    color: var(--muted);
    word-break: break-all;
  }
  .invit-mobile-expires {
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
  }
  .invit-mobile-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--surface-border);
  }
  .invit-mobile-actions .invit-btn {
    min-height: 38px;
    font-size: 12px;
  }
}

/* ── Modal: Cómo registrar un hogar — pasos numerados ───────── */
.help-steps-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.help-steps-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
}

.help-step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-family: "Sora", sans-serif;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-step-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.help-step-body strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.help-step-body span {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Modal: Invitar hogar — layout y hint ────────────────────── */
.invit-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-required {
  color: var(--danger);
  font-weight: 900;
}

.invit-hint-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(29, 183, 207, 0.08);
  border: 1px solid rgba(29, 183, 207, 0.25);
  border-radius: 13px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.invit-hint-icon {
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1.4;
}

.invit-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.invit-modal-footer .btn-primary {
  min-width: 160px;
  justify-content: center;
}

/* ── Pets section: stats header + nueva mascota btn ─────────── */
.pets-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.pets-stat-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pets-stat-chip {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(66, 43, 136, 0.06);
}

.pets-stat-chip strong {
  font-family: "Sora", sans-serif;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.pets-stat-chip span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.pets-stat-chip.success strong { color: var(--success); }
.pets-stat-chip.primary strong { color: var(--primary); }
.pets-stat-chip.warning strong { color: var(--warning); }

/* oculta el hero-actions vacío que se mantiene por compatibilidad */
#section-pets .section-hero-actions:empty { display: none !important; }

@media (max-width: 768px) {
  .pets-section-header {
    flex-direction: column;
    align-items: stretch;
  }
  .pets-stat-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .pets-stat-chip {
    justify-content: space-between;
    border-radius: 12px;
    padding: 10px 14px;
  }
  .pets-section-header > .btn {
    width: 100%;
    min-height: 50px;
    justify-content: center;
  }
}

#section-news .news-page-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8b93a7;
}

#section-news .news-page-title {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(26px, 2.4vw, 32px);
  line-height: 1;
  color: #1a1f36;
}

#section-news .news-page-shell > .news-hero-sub,
#section-news .news-page-subtitle {
  grid-area: subtitle;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #64748b;
}

#section-news .section-hero-actions {
  grid-area: actions;
  display: flex;
  justify-content: flex-end;
  align-self: start;
}

#section-news .news-primary-btn {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #129fc3);
  box-shadow: 0 12px 24px rgba(29, 183, 207, 0.16);
}

#section-news .plus-sign {
  margin-right: 6px;
  font-size: 18px;
  font-weight: 500;
}

#section-news .news-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

#section-news .news-stat-card {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid #e8ecf2;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

#section-news .news-stat-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  color: #475569;
}

#section-news .news-stat-card[data-color="primary"] .news-stat-icon { background: rgba(108, 79, 212, 0.12); color: #6c4fd4; }
#section-news .news-stat-card[data-color="blue"] .news-stat-icon { background: rgba(76, 176, 228, 0.12); color: #2f7fb5; }
#section-news .news-stat-card[data-color="amber"] .news-stat-icon { background: rgba(245, 158, 11, 0.12); color: #c47d11; }

#section-news .news-stat-value {
  font-family: "Sora", sans-serif;
  font-size: 24px;
  color: #111827;
}

#section-news .news-stat-label {
  color: #64748b;
}

#section-news .content-filter-bar {
  margin: 0;
  gap: 10px;
}

#section-news .content-filter-btn {
  padding: 7px 16px;
  border: none;
  background: #ffffff;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
}

#section-news .content-filter-btn.active {
  color: #ffffff;
  box-shadow: none;
}
#section-news .content-filter-btn.active[data-news-filter="all"] {
  background: #7c5cff;
}
#section-news .content-filter-btn.active[data-news-filter="ALERTA"] {
  background: #EF4444;
}
#section-news .content-filter-btn.active[data-news-filter="EVENTO"] {
  background: #F59E0B;
}
#section-news .content-filter-btn.active[data-news-filter="GRATIS"] {
  background: #10B981;
}
#section-news .content-filter-btn.active[data-news-filter="DONACION"] {
  background: #3B82F6;
}
#section-news .content-filter-btn.active[data-news-filter="VOLUNTARIO"] {
  background: #8B5CF6;
}

#section-news .news-results-grid {
  grid-template-columns: repeat(auto-fit, minmax(340px, 376px));
  gap: 18px;
  align-items: start;
}

#section-news .news-results-grid--list {
  grid-template-columns: repeat(auto-fit, minmax(340px, 376px));
}

#section-news .news-card {
  border: 1px solid #e8ecf2;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.05);
}

#section-news .news-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

#section-news .news-card-strip {
  height: 4px;
}

#section-news .news-card-media {
  padding: 14px 14px 0;
}

#section-news .news-card-photo,
#section-news .news-card .content-card-photo {
  height: 170px;
  border-radius: 14px;
}

#section-news .news-card .content-card-body {
  gap: 10px;
  padding: 16px 18px;
}

#section-news .news-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#section-news .news-type-pill {
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

#section-news .news-card-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  color: #111827;
}

#section-news .news-card-desc,
#section-news .news-card .content-card-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: #64748b;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#section-news .news-card-time {
  padding: 5px 8px;
  border-radius: 999px;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
}

#section-news .news-card-precaution {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.18);
  background: #fff4f4;
  font-size: 12px;
  color: #b91c1c;
}

#section-news .news-card-meta-item,
#section-news .news-card .content-card-meta,
#section-news .news-card-foundation-line {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

#section-news .news-card-footer {
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 18px;
  gap: 10px;
  border-top: 1px solid #e8ecf2;
  background: #fbfcff;
}

#section-news .content-card-actions {
  gap: 8px;
}

#section-news .news-inline-actions {
  margin-top: 2px;
}

#section-news .content-card-actions > button:not(.news-card-action) {
  display: none;
}

#section-news .news-card-action {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}

#section-news .news-card-action:hover {
  background: #eef2ff;
  color: #4338ca;
}

#section-news .news-card-action.danger:hover {
  background: #fff1f2;
  color: #be123c;
}

#section-news .news-empty-state {
  border: 1px dashed #dbe4ee;
  background: #ffffff;
}

@media (max-width: 768px) {
  #section-news .news-page-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "subtitle"
      "actions";
    gap: 14px;
  }

  #section-news .section-hero-actions {
    width: 100%;
  }

  #section-news .news-primary-btn {
    width: 100%;
    justify-content: center;
  }

  #section-news .news-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  #section-news .news-stat-card {
    padding: 10px 8px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  #section-news .news-stat-icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 9px;
    font-size: 12px;
  }

  #section-news .news-stat-value {
    font-size: 18px;
  }

  #section-news .news-stat-label {
    font-size: 10px;
    line-height: 1.35;
  }

  #section-news .news-results-grid--list {
    grid-template-columns: 1fr;
  }

  #section-news .news-card-photo,
  #section-news .news-card .content-card-photo {
    height: 148px;
  }

  #section-news .news-card-title {
    font-size: 16px;
  }

  #section-news .news-card-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  #section-news .content-card-actions {
    width: 100%;
  }
}

/* ── News Detail Drawer Modal ────────────────────────────── */
.news-drawer-modal {
  padding: 0;
  max-width: 480px;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100%;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  border-radius: 0;
  box-shadow: -8px 0 40px rgba(0,0,0,0.12);
  animation: slideInRight 0.22s ease-out forwards;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: none; }
}

.news-drawer-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
}

.news-drawer-hero {
  position: relative;
  padding: 20px 20px 24px;
  flex-shrink: 0;
  overflow: hidden;
}

.news-drawer-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary) 0%, rgba(95,56,203,0.8) 100%);
  z-index: 0;
}

.news-drawer-hero-content {
  position: relative;
  z-index: 2;
}

.news-drawer-back-btn {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  background: rgba(255,255,255,0.22);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.news-drawer-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.22);
  border-radius: 20px;
  padding: 4px 12px;
  margin-bottom: 10px;
  backdrop-filter: blur(8px);
}
.news-drawer-type-pill span {
  font-size: 11px;
  font-weight: 800;
  color: white;
  letter-spacing: 0.05em;
}

.news-drawer-title {
  color: white;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.3px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
  margin: 0;
}

.news-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.news-drawer-body > * {
  flex-shrink: 0;
}

.nd-organizer-card, .nd-section-card {
  margin: 14px 20px 0;
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 16px;
}

.nd-organizer-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nd-organizer-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(95,56,203,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.nd-organizer-kicker, .nd-section-kicker {
  font-size: 10px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.nd-section-kicker { color: var(--muted); }

.nd-organizer-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.nd-precaution-block {
  margin: 14px 20px 0;
  background: linear-gradient(135deg, #FEF2F2, #FEE2E2);
  border-radius: 14px;
  padding: 14px 16px;
}
.nd-precaution-kicker {
  font-size: 10px;
  font-weight: 800;
  color: #DC2626;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.nd-precaution-text {
  font-size: 14px;
  color: #991B1B;
  font-weight: 800;
  line-height: 1.5;
}

.nd-section-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.75;
  margin: 0;
}

.nd-map-placeholder {
  width: 100%;
  height: 140px;
  background: #E8EDF4;
  border-radius: 14px 14px 0 0;
  z-index: 1;
}

.nd-stats-grid {
  margin: 14px 20px 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.nd-stat-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.nd-stat-icon { font-size: 18px; margin-bottom: 4px; }
.nd-stat-value { font-size: 13px; font-weight: 800; color: var(--text); }
.nd-stat-label { font-size: 10px; color: var(--muted); margin-top: 2px; }

.news-drawer-footer {
  padding: 14px 20px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  background: var(--surface);
}

/* Make news card clickable */
.news-card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.news-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}

/* ── Pets: nueva barra de filtros ───────────────────────────────── */
.pets-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.pets-filter-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.pets-filter-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pets-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pets-search-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  pointer-events: none;
  flex-shrink: 0;
}

.pets-search-input {
  height: 40px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  padding: 0 16px 0 40px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  width: 260px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pets-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(101, 62, 224, 0.12);
}

.pets-adoption-chips {
  display: flex;
  gap: 6px;
}

.pets-chip {
  height: 36px;
  padding: 0 16px;
  border-radius: 18px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
}

.pets-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pets-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pets-filter-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.pets-more-filters-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.pets-more-filters-btn:hover,
.pets-more-filters-btn.active {
  border-color: var(--primary);
  color: var(--primary);
}

.pets-extra-filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 16px;
}

.pets-extra-filters[hidden] { display: none !important; }

.pets-extra-filters .filter-field {
  flex: 0 0 auto;
  min-width: 150px;
}

.pets-extra-filters .btn {
  align-self: flex-end;
}

/* ── Pets: overflow menu (···) ───────────────────────────────────── */
.pet-overflow-wrap {
  display: inline-flex;
}

.pet-overflow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.pet-overflow-btn:hover,
.pet-overflow-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.pet-overflow-menu {
  position: fixed;
  z-index: 9999;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  min-width: 190px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pet-overflow-menu[hidden] { display: none !important; }

.pet-menu-item {
  display: block;
  width: 100%;
  padding: 9px 14px;
  border-radius: 9px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}

.pet-menu-item:hover {
  background: var(--surface-soft);
  color: var(--primary);
}

.pet-menu-item--warn {
  color: var(--warning);
}

.pet-menu-item--warn:hover {
  background: rgba(250, 173, 20, 0.08);
  color: var(--warning);
}

.pet-menu-item--danger {
  color: var(--danger);
}

.pet-menu-item--danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.pet-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}

@media (max-width: 768px) {
  .pets-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .pets-filter-bar-left {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .pets-search-input {
    width: 100%;
  }
  .pets-adoption-chips {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    flex-wrap: nowrap;
  }
  .pets-adoption-chips::-webkit-scrollbar { display: none; }
  .pets-filter-bar-right {
    justify-content: space-between;
  }
}

/* ── Pets Mobile Hero (only visible on mobile) ───────────────────── */
.pets-mobile-hero {
  display: none;
}

/* ── Pet Mobile Cards (pmc) ─────────────────────────────────────── */
.pmc-card {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 3px 14px rgba(66, 43, 136, 0.07);
  transition: box-shadow 0.2s;
}

.pmc-card.expanded {
  box-shadow: 0 6px 24px rgba(66, 43, 136, 0.12);
}

.pmc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}

.pmc-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--primary-soft);
}

.pmc-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pmc-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.pmc-meta {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.pmc-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.pmc-home-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.pmc-home-chip.assigned {
  background: rgba(215, 155, 31, 0.12);
  color: #a07010;
}

.pmc-chevron {
  font-size: 14px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.2s;
  line-height: 1;
}

.pmc-chevron.open {
  transform: rotate(180deg);
}

.pmc-actions-panel {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  background: var(--surface-soft);
}

.pmc-actions-panel[hidden] {
  display: none !important;
}

.pmc-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pmc-action-full {
  grid-column: 1 / -1;
  padding: 12px;
  border-radius: 13px;
  border: none;
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: opacity 0.15s;
}

.pmc-action-full:active { opacity: 0.8; }

.pmc-action-half {
  padding: 11px 8px;
  border-radius: 13px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}

.pmc-action-half:active {
  background: var(--surface-soft);
}

.pmc-action-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(95, 56, 203, 0.3);
}

.pmc-action-warn {
  background: rgba(215, 155, 31, 0.08);
  color: var(--warning);
  border: 1.5px solid rgba(215, 155, 31, 0.35);
}

.pmc-action-danger {
  background: rgba(224, 98, 119, 0.06);
  color: var(--danger);
  border: 1.5px solid rgba(224, 98, 119, 0.3);
}

@media (max-width: 768px) {
  /* Mobile hero visible, desktop elements hidden */
  .pets-mobile-hero {
    display: block;
    background: linear-gradient(160deg, #3c3489 0%, #534ab7 62%, #7f77dd);
    border-radius: 24px;
    padding: 20px 18px 16px;
    margin-bottom: 4px;
  }

  .pets-mobile-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
  }

  .pets-mobile-hero-title {
    font-family: "Sora", sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.1;
  }

  .pets-mobile-hero-sub {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
  }

  .pets-mobile-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 14px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    backdrop-filter: blur(8px);
    flex-shrink: 0;
  }

  .pets-mobile-chips .pets-chip {
    background: rgba(255, 255, 255, 0.15);
    border-color: transparent;
    color: rgba(255, 255, 255, 0.85);
  }

  .pets-mobile-chips .pets-chip.active {
    background: rgba(255, 255, 255, 0.95);
    border-color: transparent;
    color: var(--primary-dark);
  }

  /* Hide desktop filter bar + stats header on mobile */
  .pets-section-header,
  .pets-filter-bar,
  .pets-extra-filters,
  .panel-card.operations-card .section-head {
    display: none !important;
  }

  /* Hide table headers on mobile, show as card list */
  .operations-table thead { display: none; }

  /* Override table-wrap mobile styles to allow card layout */
  .operations-card .table-wrap {
    overflow: visible;
  }

  /* pmc cards: remove table styling */
  .pet-mobile-row td,
  .pet-mobile-row {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }

  .mobile-card-cell {
    padding: 0 !important;
    border: none !important;
  }

  /* Spacing between cards */
  .pet-mobile-row + .pet-mobile-row .pmc-card {
    margin-top: 0;
  }

  .operations-table tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
  }

  .pet-mobile-row {
    display: block !important;
  }

  /* Hide desktop overflow btn on mobile */
  .pet-overflow-wrap { display: none; }

  /* Pagination on mobile */
  #pets-pagination .pagination-bar {
    padding: 10px 0 4px;
  }
}

/* ── Noticias: grid 3 columnas fijas ─────────────────────── */
.news-results-grid--3col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.news-card-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px dashed var(--border);
  border-radius: 20px;
  min-height: 200px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.news-card-placeholder:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

/* News cards: uniform height */
.news-results-grid--3col .news-card,
.news-results-grid--3col .content-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-results-grid--3col .content-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

@media (max-width: 1100px) {
  .news-results-grid--3col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .news-results-grid--3col { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════
   MEJORAS UI/UX GLOBALES
   ══════════════════════════════════════════════════════════ */

/* ── 6. HOGARES — card horizontal ──────────────────────── */
/* Desktop horizontal home card — simple row layout */
.home-card--horizontal {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  padding: 16px 20px !important;
  gap: 16px;
  background: var(--surface-solid) !important;
  overflow: visible !important; /* override base .home-card { overflow: hidden } */
  border-radius: 20px !important;
}

.home-card--horizontal .home-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.home-card--horizontal .home-card-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.home-card--horizontal .home-card-copy strong {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-card--horizontal .home-card-copy small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Center column: phone + count — fixed width */
.home-card--horizontal .home-card-center {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  flex: 0 0 auto;
  width: 160px;
  padding: 0 16px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  align-self: stretch;
  justify-content: center;
}

/* Actions column — stacked (Ver / Escribir / Desvincular) */
.home-card--horizontal .home-card-actions--col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 120px;
}

.home-card--horizontal .home-card-actions--col .table-action-btn {
  width: 100%;
  text-align: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.home-card-phone-ok {
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
}

.home-card-no-phone {
  font-size: 12px;
  font-weight: 700;
  color: var(--warning);
}

.home-card-count-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

/* invite slot */
.home-card--invite { flex-direction: column !important; padding: 20px !important; }

/* On mobile, hide — JS renders home-mobile-card instead */
@media (max-width: 768px) {
  .home-card--horizontal { display: none !important; }
}

/* ── 1. BTN — estandarizar tamaño CTA primario ─────────── */
.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: 10px; }
.btn-lg { padding: 12px 24px; font-size: 14px; border-radius: 16px; }

.section-hero-btn,
#open-add-pet-modal,
#btn-new-news,
#open-adoption-manual-btn,
#generate-invitation-btn,
.news-primary-btn {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 800;
  border-radius: 14px;
  height: 42px;
}

/* ── 2. DASHBOARD — quick-action cards ─────────────────── */
.quick-action-card {
  transition: transform 0.18s, box-shadow 0.18s;
}
.quick-action-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(66, 43, 136, 0.12);
}
.quick-action-card .quick-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 10px;
}
.quick-action-card.quick-pets .quick-icon-wrap { background: rgba(95, 56, 203, 0.1); }
.quick-action-card.quick-news .quick-icon-wrap { background: rgba(29, 183, 207, 0.1); }
.quick-action-card.quick-adopt .quick-icon-wrap { background: rgba(224, 98, 119, 0.1); }
.quick-action-card.quick-home .quick-icon-wrap { background: rgba(29, 143, 207, 0.1); }
.quick-action-desc {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 3px;
  line-height: 1.4;
}

/* ── 3. DASHBOARD — Estado del rescate barra con % ──────── */
.rescue-stat-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.rescue-stat-pct {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  flex-shrink: 0;
}
.rescue-stat-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
}

/* ── 4. SEGUIMIENTO — empty state ───────────────────────── */
.followup-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
}
.followup-empty-icon {
  font-size: 48px;
  line-height: 1;
}
.followup-empty-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}
.followup-empty-sub {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin: 0;
  max-width: 280px;
}

/* ── 7. ADOPCIONES — status badges mejorados ───────────── */
.status-badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.status-badge.good     { background: rgba(34, 168, 109, 0.12); color: #166534; }
.status-badge.warning  { background: rgba(215, 155, 31, 0.14); color: #854d0e; }
.status-badge.danger   { background: rgba(224, 98, 119, 0.14); color: #991b1b; }
.status-badge.muted    { background: rgba(126, 118, 160, 0.1); color: var(--muted); }

/* ══════════════════════════════════════════════════════════════════
   MOBILE UI/UX IMPROVEMENTS — v20260427
   ══════════════════════════════════════════════════════════════════ */

/* ── 1. CTA BUTTONS — mobile standardization ────────────────────── */
@media (max-width: 768px) {
  /* Input font-size 16px — prevents Safari zoom */
  input, textarea, select {
    font-size: 16px !important;
  }
  /* Adoption mobile btn: teal */
  .adoption-mobile-btn {
    background: linear-gradient(135deg, #0d9488, #0891b2) !important;
    border-radius: 14px !important;
    min-height: 48px;
    font-size: 14px;
    font-weight: 800;
    color: #fff !important;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0 !important;
  }
  .adoption-mobile-btn:hover {
    box-shadow: 0 6px 20px rgba(13,148,136,0.3) !important;
    background: linear-gradient(135deg, #0f9d92, #0a9bc6) !important;
  }
  /* Home card actions layout */
  .home-mobile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .home-mobile-actions .table-action-btn {
    flex: 1;
    min-width: 80px;
    text-align: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
  }
  .home-mobile-actions .table-action-danger {
    flex: 1 0 100%;
    border-color: rgba(224, 98, 119, 0.3) !important;
    background: rgba(224, 98, 119, 0.07) !important;
    color: #dc2626 !important;
  }
}

/* ── 2. BOTTOM NAV — badge border ───────────────────────────────── */
@media (max-width: 768px) {
  .mobile-tabbar-badge {
    border: 1.5px solid rgba(39, 28, 83, 0.96);
  }
}

/* ── 3. HEADER — compact height ─────────────────────────────────── */
@media (max-width: 768px) {
  .dashboard-appbar {
    padding: 8px 16px 6px !important;
  }
  .dashboard-topbar {
    padding: 0 16px 12px !important;
  }
  .dashboard-topbar h1 {
    font-size: 24px !important;
    padding-top: 2px;
  }
  .pets-mobile-hero {
    padding: 12px 16px 14px !important;
  }
}

/* ── 5. HOGARES — unified card visual ───────────────────────────── */
@media (max-width: 768px) {
  .home-mobile-card {
    background: var(--surface-solid);
    border-radius: 20px !important;
    box-shadow: 0 4px 18px rgba(66, 43, 136, 0.08) !important;
    border: 1px solid var(--border);
    padding: 16px !important;
    gap: 14px !important;
  }
  .invitation-card {
    background: var(--surface-solid);
    border-radius: 20px;
    box-shadow: 0 4px 18px rgba(66, 43, 136, 0.08);
    border: 1px solid var(--border);
    padding: 16px;
  }
}

/* ── 6. PERFIL — unverified badge clickable ─────────────────────── */
.unverified-chip {
  cursor: pointer;
}
.unverified-chip .verify-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(215, 155, 31, 0.25);
  color: var(--warning);
  font-size: 10px;
  font-weight: 900;
  flex-shrink: 0;
}
.verify-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.46);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.verify-sheet {
  width: 100%;
  max-width: 480px;
  background: var(--surface-solid);
  border-radius: 24px 24px 0 0;
  padding: 24px 20px calc(28px + env(safe-area-inset-bottom));
  display: grid;
  gap: 14px;
  box-shadow: 0 -12px 40px rgba(46, 36, 92, 0.2);
  animation: sheet-up 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes sheet-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.verify-sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 99px;
  background: var(--border);
  margin: -8px auto 4px;
}
.verify-sheet h3 {
  font-size: 18px;
  font-weight: 900;
  margin: 0;
}
.verify-sheet p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}
.verify-sheet ol {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.9;
}
.verify-sheet .btn {
  width: 100%;
  min-height: 48px;
  justify-content: center;
  border-radius: 14px;
}
.verify-sheet .btn-ghost-sheet {
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  border: 0;
  cursor: pointer;
  text-align: center;
}

/* ── 8. SEGUIMIENTO — SVG empty state animation ─────────────────── */
.followup-empty-svg {
  width: 80px;
  height: 80px;
  animation: float-paw 3s ease-in-out infinite;
}
@keyframes float-paw {
  0%, 100% { transform: translateY(0);   }
  50%       { transform: translateY(-8px); }
}
.followup-empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 48px 24px 32px;
  gap: 12px;
}
.followup-empty-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  margin: 0;
}
.followup-empty-sub {
  font-size: 14px;
  color: var(--muted);
  max-width: 300px;
  line-height: 1.6;
  margin: 0;
}

/* ── 10. CARDS — consistent active state ────────────────────────── */
@media (max-width: 768px) {
  .pmc-header:active { background: rgba(95, 56, 203, 0.04); }
  .home-mobile-card:active { background: rgba(95, 56, 203, 0.03); }
  .panel-card, .home-mobile-card, .adoption-mobile-card, .pmc-card {
    border-radius: 20px !important;
  }
  .followup-grid, .homes-cards-grid { gap: 12px !important; }
}

/* ── 11. ADOPTION BADGES — mobile ───────────────────────────────── */
@media (max-width: 768px) {
  .adoption-mobile-head .status-badge {
    flex-shrink: 0;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 800;
  }
}

/* ── 12. ADOPCIONES — pet photo ─────────────────────────────────── */
@media (max-width: 768px) {
  .adoption-mobile-card {
    padding: 0 !important;
    overflow: hidden;
    border-radius: 20px !important;
  }
  .adoption-mobile-pet-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
    border-radius: 0;
  }
  .adoption-mobile-pet-placeholder {
    width: 100%;
    height: 72px;
    background: linear-gradient(135deg, var(--primary-soft), rgba(29,183,207,0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
  }
  .adoption-mobile-content {
    padding: 14px 16px 16px;
    display: grid;
    gap: 12px;
  }
}
