:root {
  --brand-primary: #4B0D1E;
  --brand-primary-2: #5A1124;
  --brand-secondary: #C97F96;
  --brand-soft: #D8B7CF;
  --brand-bg: #FAF6F8;
  --brand-text: #2D1A21;
  --brand-border: #ECD9E2;
  --semantic-success-bg: #2F7A63;
  --semantic-success-text: #FFFFFF;
  --semantic-warning-bg: #F0DFC0;
  --semantic-warning-text: #5F4313;
  --semantic-danger-bg: #9A4A61;
  --semantic-danger-text: #FFFFFF;
  --semantic-info-bg: #E9D7E2;
  --semantic-info-text: var(--brand-primary);
  --semantic-neutral-bg: #ECE6EA;
  --semantic-neutral-text: var(--brand-primary);
  --status-vacant-bg: #7C6670;
  --status-inhabited-bg: var(--brand-primary);
  --status-airbnb-bg: #E6CAD8;
  --status-airbnb-border: #B96F88;
  --status-unknown-bg: #F3E7EE;
  --status-unknown-border: #D4AFC0;
}
body { color: var(--brand-text); }
.bg-brand-light { background: var(--brand-bg); }
.brand-navbar { background: linear-gradient(90deg,var(--brand-primary),var(--brand-primary-2)); }
.app-navbar-inner {
  gap: 0.85rem;
}
.mobile-nav-toggle {
  border-color: rgba(255, 255, 255, 0.45);
}
.mobile-nav-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.navbar-brand {
  font-weight: 600;
}
.navbar-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.community-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}
.sidebar-brand { background: #f7e9ef; }
.desktop-sidebar {
  border-right: 1px solid #ebd8e2;
}
.sidebar-brand .nav-link {
  color: var(--brand-primary);
  font-weight: 600;
  padding: 0.55rem 0.7rem;
  border-radius: 0.75rem;
}
.sidebar-brand .nav-link:hover,
.sidebar-brand .nav-link:focus {
  background: rgba(201, 127, 150, 0.12);
}
.sidebar-offcanvas {
  background: #f7e9ef;
  width: min(88vw, 320px);
}
.sidebar-offcanvas .offcanvas-header {
  background: linear-gradient(90deg,var(--brand-primary),var(--brand-primary-2));
  color: #fff;
}
.sidebar-offcanvas .btn-close {
  filter: invert(1);
}
.btn-brand { background: var(--brand-primary); color: #fff; }
.btn-brand:hover { background: var(--brand-primary-2); color: #fff; }
.badge-status { background: var(--brand-secondary); }
.card { border: 1px solid #e8d7df; }
.app-main {
  min-width: 0;
}
.app-alert {
  border-radius: 0.85rem;
  border-width: 1px;
}
.filter-summary-bar {
  padding: 0.9rem 1rem;
  border: 1px solid #e8d7df;
  border-left: 4px solid var(--brand-secondary);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
}

.entity-search-card,
.house-search-card {
  border-radius: 14px;
}

.entity-search-topbar,
.house-search-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: end;
}

.entity-search-topbar.entity-search-topbar-single {
  grid-template-columns: minmax(0, 1fr) auto;
}

/* Estados de cuenta: dos filtros numéricos angostos + filtros rápidos + acciones.
   Columnas al ancho del contenido para que los inputs no floten en tracks 1fr. */
.entity-search-topbar.entity-search-topbar-ledger {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  column-gap: 1.25rem;
}

.entity-search-field,
.house-search-field {
  min-width: 0;
}

.entity-search-actions,
.house-search-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.entity-search-advanced,
.house-search-advanced {
  border-top: 1px solid #eddce4;
  padding-top: 0.9rem;
}

.entity-search-advanced summary,
.house-search-advanced summary {
  cursor: pointer;
  list-style: none;
  color: var(--brand-primary);
  font-weight: 600;
}

.entity-search-advanced summary::-webkit-details-marker,
.house-search-advanced summary::-webkit-details-marker {
  display: none;
}

.entity-search-advanced .summary-open-label,
.house-search-advanced .summary-open-label {
  display: none;
}

.entity-search-advanced[open] .summary-closed-label,
.house-search-advanced[open] .summary-closed-label {
  display: none;
}

.entity-search-advanced[open] .summary-open-label,
.house-search-advanced[open] .summary-open-label {
  display: inline;
}

.entity-search-advanced-grid,
.house-search-advanced-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.9rem;
}

.entity-search-advanced-grid.entity-search-advanced-grid-compact {
  grid-template-columns: 1.3fr repeat(3, minmax(0, 1fr));
}

.entity-search-advanced-group,
.house-search-advanced-group {
  min-width: 0;
}

.entity-search-group-label,
.house-search-group-label {
  display: inline-block;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.entity-search-checklist,
.house-search-checklist {
  display: grid;
  gap: 0.45rem;
}

.house-filter-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.filter-chip {
  text-decoration: none !important;
  padding: 0.55rem 0.75rem;
}

.app-card {
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(75, 13, 30, 0.04);
}

.app-form-card {
  max-width: 960px;
}

.form-helper-card {
  border: 1px solid rgba(124, 31, 60, 0.14);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(252, 244, 247, 0.96));
  padding: 0.9rem 1rem;
}

.service-charge-notice {
  border-color: rgba(95, 67, 19, 0.24);
  background: linear-gradient(180deg, rgba(255, 251, 242, 0.98), rgba(250, 241, 222, 0.92));
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.page-title-block {
  min-width: 0;
}

.page-lead {
  color: rgba(45, 26, 33, 0.72);
  max-width: 72ch;
}

.errorlist {
  margin: 0.35rem 0 0;
  padding-left: 1rem;
  color: var(--semantic-danger-bg);
  font-size: 0.94rem;
}

.errorlist li {
  margin-bottom: 0.2rem;
}

.app-form .errorlist,
.app-form .alert-danger,
.app-form .alert-warning {
  scroll-margin-top: 7rem;
}

.page-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.page-actions form {
  margin: 0;
}

.app-form {
  display: grid;
  gap: 1rem;
}

.app-form p {
  display: grid;
  gap: 0.45rem;
  margin: 0;
}

.app-form label {
  font-weight: 600;
  color: var(--brand-text);
}

.app-form input[type="text"],
.app-form input[type="number"],
.app-form input[type="email"],
.app-form input[type="password"],
.app-form input[type="date"],
.app-form input[type="datetime-local"],
.app-form input[type="tel"],
.app-form input[type="url"],
.app-form select,
.app-form textarea,
.app-form .form-control,
.app-form .form-select {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  border: 1px solid #d9c3ce;
  border-radius: 12px;
  background: #fff;
  color: var(--brand-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.app-form .input-group .form-control,
.app-form .input-group .form-select {
  width: 1%;
}

.app-form .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 16px 12px;
  padding-right: 2.5rem;
}

.app-form textarea {
  min-height: 120px;
  resize: vertical;
}

.app-form input[type="file"] {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid #d9c3ce;
  border-radius: 12px;
  background: #fff;
}

.app-form input:focus,
.app-form select:focus,
.app-form textarea:focus {
  outline: none;
  border-color: var(--brand-secondary);
  box-shadow: 0 0 0 0.2rem rgba(201, 127, 150, 0.18);
}

.app-form .helptext,
.app-form .form-text {
  color: rgba(45, 26, 33, 0.68);
  font-size: 0.92rem;
}

.app-form ul.errorlist {
  margin: 0;
  padding-left: 1.1rem;
  color: #8c2343;
}

.app-form .btn {
  justify-self: start;
}

.gps-capture-card {
  border: 1px solid #e4ccd7;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 246, 248, 0.96));
  padding: 1rem;
}

.gps-capture-map {
  min-height: 138px;
  border: 1px solid #ead7e0;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(75, 13, 30, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(75, 13, 30, 0.07) 1px, transparent 1px),
    radial-gradient(circle at 32% 35%, rgba(201, 127, 150, 0.3), transparent 26%),
    linear-gradient(135deg, #f9eef3, #fffafc);
  background-size: 34px 34px, 34px 34px, 100% 100%, 100% 100%;
}

.gps-capture-map::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 2px dashed rgba(75, 13, 30, 0.14);
  border-radius: 999px;
}

.gps-capture-pin {
  width: 24px;
  height: 24px;
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50% 50% 50% 0;
  background: #9a4a61;
  box-shadow: 0 8px 18px rgba(75, 13, 30, 0.18);
  transform: translate(-50%, -70%) rotate(-45deg) scale(0.72);
  opacity: 0.5;
}

.gps-capture-pin::after {
  content: "";
  width: 8px;
  height: 8px;
  position: absolute;
  left: 8px;
  top: 8px;
  border-radius: 50%;
  background: #fff;
}

.gps-capture-card.has-location .gps-capture-pin {
  opacity: 1;
  transform: translate(-50%, -70%) rotate(-45deg) scale(1);
}

.gps-coordinates {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.gps-detail-point {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
}

.finance-report-shell {
  max-width: 1100px;
}

.finance-report-header {
  align-items: flex-end;
}

.finance-report-title {
  max-width: 62ch;
}

.finance-report-kicker {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(75, 13, 30, 0.62);
}

.finance-report-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid #ead7e0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
}

.finance-report-summary {
  align-items: center;
}

.finance-report-note {
  border-left: 4px solid var(--brand-secondary);
}

@media (max-width: 767.98px) {
  .finance-report-meta {
    grid-template-columns: 1fr;
  }
}

@media print {
  body.finance-print-page {
    background: #fff !important;
  }

  body.finance-print-page .app-navbar,
  body.finance-print-page .desktop-sidebar,
  body.finance-print-page .sidebar-offcanvas,
  body.finance-print-page .page-actions,
  body.finance-print-page .app-alert,
  body.finance-print-page .finance-report-screen-only {
    display: none !important;
  }

  body.finance-print-page .app-shell,
  body.finance-print-page .row,
  body.finance-print-page .app-main {
    display: block !important;
  }

  body.finance-print-page .container-fluid,
  body.finance-print-page .app-main {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.finance-print-page .finance-report-shell {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  body.finance-print-page .finance-report-header {
    margin-bottom: 1rem;
  }

  body.finance-print-page .finance-report-meta,
  body.finance-print-page .card {
    break-inside: avoid;
    box-shadow: none !important;
    background: #fff !important;
  }

  body.finance-print-page a {
    color: inherit !important;
    text-decoration: none !important;
  }

  body.finance-print-page .table th,
  body.finance-print-page .table td {
    background: #fff !important;
  }

  @page {
    size: auto;
    margin: 14mm;
  }
}

.read-only-field {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border: 1px solid #e7d5dd;
  border-radius: 12px;
  background: #f7f1f4;
  color: rgba(45, 26, 33, 0.84);
  cursor: default;
}

.table-card .card-body {
  padding: 1rem 1.1rem;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/*
 * When .table-actions sits on a <td> (e.g. estado de cuenta, listado de
 * ledgers), it must stay a real table cell. Using display:flex on the cell
 * itself takes it out of the table layout, so it no longer matches the row
 * height: the row's bottom border breaks under that cell and the button is
 * misaligned vertically. Keep it as a centered table cell and let its inner
 * wrapper / buttons handle the horizontal layout instead. (The mobile
 * card layout below re-stacks these cells as a grid, overriding this.)
 */
td.table-actions {
  display: table-cell;
  vertical-align: middle;
  white-space: nowrap;
}

td.table-actions > .btn,
td.table-actions > a,
td.table-actions > form {
  vertical-align: middle;
}

td.table-actions > .btn:not(:last-child),
td.table-actions > a:not(:last-child) {
  margin-right: 0.5rem;
}

.table-actions form {
  margin: 0;
}

.detail-identity {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.detail-avatar {
  width: 88px;
  height: 88px;
  border-radius: 1.2rem;
  background: linear-gradient(135deg, rgba(75, 13, 30, 0.14), rgba(201, 127, 150, 0.24));
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}

.detail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-meta {
  display: grid;
  gap: 0.75rem;
}

.detail-meta-item {
  display: grid;
  gap: 0.2rem;
}

.detail-meta-item small {
  color: rgba(45, 26, 33, 0.68);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.portal-access-status {
  padding: 0.95rem 1rem;
  border: 1px solid #ecd6df;
  border-left: 4px solid var(--brand-secondary);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.88);
}

.portal-access-actions {
  border-top: 1px solid #f0e1e8;
  padding-top: 1rem;
}

.portal-access-block-form textarea {
  min-height: 110px;
  resize: vertical;
}

.portal-credentials-alert {
  border-left: 4px solid var(--brand-secondary);
}

.portal-credentials-card {
  display: grid;
  gap: 0.85rem;
}

.portal-credentials-header {
  color: var(--brand-text);
}

.portal-credentials-preview {
  margin: 0;
  padding: 0.95rem 1rem;
  border: 1px solid #cce8f2;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.78);
  color: var(--brand-text);
  font: inherit;
  white-space: pre-wrap;
}

.stacked-list {
  display: grid;
  gap: 0.85rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.stacked-list-item {
  border: 1px solid #ebd8e2;
  border-radius: 1rem;
  background: #fff;
  padding: 1rem;
  box-shadow: 0 10px 20px rgba(75, 13, 30, 0.04);
}

.stacked-list-meta {
  color: rgba(45, 26, 33, 0.68);
}

.toolbar-card {
  border-radius: 14px;
}

.toolbar-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(0, 1.6fr) auto;
  gap: 0.85rem;
  align-items: end;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
}

.stat-card {
  border: 1px solid #ebd8e2;
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.9);
}

.stat-card-link {
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stat-card-link:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 0.25rem 0.75rem rgba(45, 26, 33, 0.08);
}

.stat-card-link span {
  display: block;
  color: rgba(45, 26, 33, 0.7);
}

.stat-card-link strong {
  display: block;
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--brand-primary);
}

.list-empty {
  margin: 0;
  color: rgba(45, 26, 33, 0.7);
}

.responsive-card-table td[data-label]::before {
  content: attr(data-label);
  display: none;
}

a.link-brand,
a.link-brand:visited,
button.link-brand,
.btn-link.link-brand,
.table a.link-brand,
.table a.link-brand:visited {
  color: var(--brand-primary);
  text-decoration: none !important;
  font-weight: 700;
  display: inline-block;
  padding: 0.05rem 0.2rem;
  margin-inline: -0.2rem;
  border-bottom: 0;
  border-radius: 0.4rem;
  box-shadow: none;
  transition: color 0.2s ease;
}

a.link-brand:hover,
a.link-brand:focus,
a.link-brand:active,
button.link-brand:hover,
button.link-brand:focus,
button.link-brand:active,
.btn-link.link-brand:hover,
.btn-link.link-brand:focus,
.btn-link.link-brand:active,
.table a.link-brand:hover,
.table a.link-brand:focus,
.table a.link-brand:active {
  color: var(--brand-primary-2);
  text-decoration: none !important;
  background-color: transparent;
  box-shadow: none;
}

.house-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.badge-brand-success,
.badge-brand-warning,
.badge-brand-danger,
.badge-brand-info,
.badge-brand-neutral {
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
}

.badge-brand-success {
  background-color: var(--semantic-success-bg) !important;
  color: var(--semantic-success-text) !important;
}

.badge-brand-warning {
  background-color: var(--semantic-warning-bg) !important;
  color: var(--semantic-warning-text) !important;
  border-color: rgba(95, 67, 19, 0.14);
}

.badge-brand-danger {
  background-color: var(--semantic-danger-bg) !important;
  color: var(--semantic-danger-text) !important;
}

.badge-brand-info {
  background-color: var(--semantic-info-bg) !important;
  color: var(--semantic-info-text) !important;
  border-color: rgba(75, 13, 30, 0.14);
}

.badge-brand-neutral {
  background-color: var(--semantic-neutral-bg) !important;
  color: var(--semantic-neutral-text) !important;
  border-color: rgba(75, 13, 30, 0.12);
}

.house-status-vacant {
  background-color: var(--status-vacant-bg) !important;
  color: #fff !important;
}

.house-status-inhabited {
  background-color: var(--status-inhabited-bg) !important;
  color: #fff !important;
}

.house-status-airbnb {
  background-color: var(--status-airbnb-bg) !important;
  color: var(--brand-primary) !important;
  border-color: var(--status-airbnb-border);
}

.house-status-unknown {
  background-color: var(--status-unknown-bg) !important;
  color: var(--brand-primary) !important;
  border-color: var(--status-unknown-border);
}

.table-row-link,
.house-row-link {
  cursor: pointer;
}

.house-sort-header {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.house-sort-header:hover,
.house-sort-header:focus {
  color: var(--brand-primary);
  text-decoration: none;
}

.house-sort-indicator {
  font-size: 0.8em;
  line-height: 1;
}

.house-sort-indicator-muted {
  color: rgba(0, 0, 0, 0.25);
  font-weight: 400;
}

.house-polygon-group-row td {
  background-color: rgba(75, 13, 30, 0.04);
  font-weight: 600;
  color: var(--brand-primary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.75rem;
  border-top: 1px solid rgba(75, 13, 30, 0.08);
}

.house-polygon-group-row {
  cursor: default;
}

.house-people-count {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.house-people-icon {
  font-size: 1rem;
  opacity: 0.7;
}

.ledger-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.ledger-kpi {
  background: rgba(75, 13, 30, 0.04);
  border: 1px solid rgba(75, 13, 30, 0.08);
  border-radius: 0.6rem;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ledger-kpi-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: rgba(75, 13, 30, 0.62);
}

.ledger-kpi-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.ledger-kpi-danger {
  background: var(--semantic-danger-bg);
  border-color: rgba(150, 30, 50, 0.18);
}

.ledger-kpi-danger .ledger-kpi-value {
  color: var(--semantic-danger-text);
}

.ledger-kpi-positive {
  background: var(--semantic-success-bg);
  border-color: rgba(20, 90, 50, 0.18);
}

.ledger-kpi-positive .ledger-kpi-value {
  color: var(--semantic-success-text);
}

.house-detail-tabs .nav-link {
  color: var(--brand-primary);
  font-weight: 600;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.house-detail-tabs .nav-link.active {
  background: transparent;
  border-color: transparent;
  border-bottom: 2px solid var(--brand-primary);
}

.house-tab-count {
  background: rgba(75, 13, 30, 0.08);
  color: var(--brand-primary);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 1.4rem;
  text-align: center;
}

.nav-link.active .house-tab-count {
  background: var(--brand-primary);
  color: #fff;
}

.empty-state-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stat-card-danger {
  background: var(--semantic-danger-bg) !important;
  color: var(--semantic-danger-text) !important;
  border-color: rgba(150, 30, 50, 0.18);
}

.bulk-diff-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}

.bulk-diff-list li + li {
  margin-top: 0.15rem;
}

.bulk-preview-table tr.table-danger td {
  background-color: rgba(220, 53, 69, 0.08);
}

.bulk-example-table {
  font-size: 0.75rem;
  white-space: nowrap;
}

.bulk-example-table th,
.bulk-example-table td {
  padding: 0.25rem 0.5rem;
}

.resident-house-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.resident-house-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.1rem 1.15rem;
  background: #fff;
  border: 1px solid rgba(75, 13, 30, 0.1);
  border-radius: 0.85rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
  box-shadow: 0 1px 2px rgba(75, 13, 30, 0.04);
}

.resident-house-card:hover,
.resident-house-card:focus-visible {
  border-color: rgba(75, 13, 30, 0.28);
  box-shadow: 0 6px 18px rgba(75, 13, 30, 0.1);
  text-decoration: none;
  color: inherit;
  transform: translateY(-1px);
}

.resident-house-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.resident-house-card-eyebrow {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(75, 13, 30, 0.6);
  font-weight: 600;
}

.resident-house-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0.1rem 0 0.05rem;
  color: var(--brand-primary);
}

.resident-house-card-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.resident-house-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(75, 13, 30, 0.06);
}

.resident-house-stat {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.resident-house-stat-icon {
  font-size: 1.4rem;
  opacity: 0.75;
}

.resident-house-stat-value {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-primary);
  line-height: 1;
}

.resident-house-stat-label {
  display: block;
  font-size: 0.75rem;
  color: rgba(75, 13, 30, 0.6);
  margin-top: 0.1rem;
}

.resident-house-card-cta {
  align-self: flex-end;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-primary);
}

@media (max-width: 768px) {
  .ledger-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.table-row-link td,
.house-row-link td {
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.table-row-link:hover td,
.table-row-link:focus-visible td,
.house-row-link:hover td,
.house-row-link:focus-visible td {
  background-color: rgba(201, 127, 150, 0.08);
}

.table-row-link:hover a.link-brand,
.table-row-link:focus-visible a.link-brand,
.table-row-link a.link-brand:hover,
.table-row-link a.link-brand:focus,
.table-row-link a.link-brand:active,
.house-row-link:hover a.link-brand,
.house-row-link:focus-visible a.link-brand,
.house-row-link a.link-brand:hover,
.house-row-link a.link-brand:focus,
.house-row-link a.link-brand:active {
  color: var(--brand-primary-2);
  background-color: transparent !important;
  box-shadow: none;
}

.login-card {
  max-width: 640px;
  border-radius: 14px;
}

.login-form {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.login-field {
  display: grid;
  gap: 0.6rem;
  text-align: left;
}

.login-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-text);
  text-align: left;
  margin: 0;
}

.login-input,
.login-form input[type="text"],
.login-form input[type="password"],
.login-form input[type="email"] {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid #d9c3ce;
  border-radius: 10px;
  background: #fff;
  color: var(--brand-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-input.form-control {
  min-height: 48px;
}

.login-input.form-control:focus,
.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus,
.login-form input[type="email"]:focus {
  outline: none;
  border-color: var(--brand-secondary);
  box-shadow: 0 0 0 0.2rem rgba(201, 127, 150, 0.18);
}

.login-submit {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 600;
}

/* ── Resident dashboard (mobile-first) ──────────────────────────────────── */

.resident-shell {
  display: grid;
  gap: 1.1rem;
  max-width: 920px;
  margin-inline: auto;
}

.resident-greeting {
  display: grid;
  gap: 0.15rem;
}

.resident-greeting-title {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  color: var(--brand-text);
}

.resident-greeting-date {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(45, 26, 33, 0.62);
}

.resident-greeting-date::first-letter {
  text-transform: uppercase;
}

/* House chip */
.resident-house-chip,
.resident-house-chip:visited {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid #ead8e1;
  border-radius: 0.95rem;
  background: #fff;
  color: var(--brand-text);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(75, 13, 30, 0.04);
  min-height: 48px;
}

.resident-house-chip:hover,
.resident-house-chip:focus {
  border-color: rgba(75, 13, 30, 0.22);
  color: var(--brand-primary);
}

.resident-house-chip-id {
  font-weight: 700;
  font-size: 1rem;
}

.resident-house-chip-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.resident-house-chip-more {
  font-size: 0.78rem;
  color: rgba(45, 26, 33, 0.6);
}

.resident-house-chip-chevron {
  width: 18px;
  height: 18px;
  color: rgba(45, 26, 33, 0.45);
}

/* Hero */
.resident-hero {
  display: grid;
  gap: 0.35rem;
  padding: 1.2rem 1.15rem 1.05rem;
  border-radius: 1.1rem;
  border: 1px solid #ead8e1;
  background: #fff;
  box-shadow: 0 10px 24px rgba(75, 13, 30, 0.05);
}

.resident-hero-eyebrow {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(45, 26, 33, 0.6);
}

.resident-hero-title {
  font-size: 2rem;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--brand-text);
}

.resident-hero-subtitle {
  margin: 0.1rem 0 0.35rem;
  color: rgba(45, 26, 33, 0.72);
  font-size: 0.95rem;
  line-height: 1.4;
}

.resident-hero-cta {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background: var(--brand-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  min-height: 44px;
  box-shadow: 0 6px 14px rgba(75, 13, 30, 0.18);
  transition: transform 0.12s ease;
}

.resident-hero-cta:hover,
.resident-hero-cta:focus {
  color: #fff;
  transform: translateY(-1px);
}

.resident-hero-cta svg {
  width: 16px;
  height: 16px;
}

.resident-hero--success {
  border-color: rgba(47, 122, 99, 0.22);
  background: linear-gradient(180deg, #f4faf7, #e9f5f0);
}

.resident-hero--success .resident-hero-title {
  color: #1f6a55;
}

.resident-hero--info {
  border-color: rgba(28, 89, 145, 0.18);
  background: linear-gradient(180deg, #f3f8fd, #e6f0fa);
}

.resident-hero--info .resident-hero-title {
  color: #1c5991;
}

.resident-hero--danger {
  border-color: rgba(180, 47, 75, 0.28);
  background: linear-gradient(180deg, #fff5f6, #fde6ea);
}

.resident-hero--danger .resident-hero-title {
  color: #a8253f;
}

.resident-hero--neutral {
  background: #fff;
}

/* Quick actions */
.resident-quick-actions {
  display: grid;
  gap: 0.6rem;
}

.resident-quick-actions-warn {
  padding: 0.55rem 0.85rem;
  border-radius: 0.8rem;
  background: rgba(255, 230, 200, 0.55);
  border: 1px solid rgba(180, 110, 30, 0.2);
  color: #7c4a17;
  font-size: 0.85rem;
}

.resident-quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.resident-quick-action,
.resident-quick-action:visited {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.55rem;
  padding: 1rem 0.6rem;
  min-height: 104px;
  border: 1px solid #ead8e1;
  border-radius: 1rem;
  background: #fff;
  color: var(--brand-text);
  text-decoration: none;
  text-align: center;
  box-shadow: 0 6px 14px rgba(75, 13, 30, 0.04);
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.resident-quick-action:hover,
.resident-quick-action:focus {
  border-color: rgba(75, 13, 30, 0.22);
  color: var(--brand-primary);
  transform: translateY(-1px);
}

.resident-quick-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(75, 13, 30, 0.06);
  color: var(--brand-primary);
}

.resident-quick-action-icon svg {
  width: 22px;
  height: 22px;
}

.resident-quick-action-label {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
}

.resident-quick-action.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Sections (timeline) */
.resident-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.resident-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: var(--brand-text);
}

.resident-section-link,
.resident-section-link:visited {
  font-size: 0.85rem;
  color: var(--brand-primary);
  text-decoration: none;
}

.resident-section-link:hover,
.resident-section-link:focus {
  text-decoration: underline;
}

.resident-timeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.resident-timeline-link,
.resident-timeline-link:visited {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: 'kind title date' 'kind body body';
  column-gap: 0.7rem;
  row-gap: 0.25rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border: 1px solid #ead8e1;
  border-radius: 0.85rem;
  background: #fff;
  color: var(--brand-text);
  text-decoration: none;
  min-height: 56px;
}

.resident-timeline-link:hover,
.resident-timeline-link:focus {
  border-color: rgba(75, 13, 30, 0.22);
  color: var(--brand-primary);
}

.resident-timeline-kind {
  grid-area: kind;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: rgba(75, 13, 30, 0.07);
  color: rgba(45, 26, 33, 0.7);
  white-space: nowrap;
  align-self: center;
}

.resident-timeline-kind--notification {
  background: rgba(28, 89, 145, 0.09);
  color: #1c5991;
}

.resident-timeline-title {
  grid-area: title;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
}

.resident-timeline-body {
  grid-area: body;
  color: rgba(45, 26, 33, 0.68);
  font-size: 0.83rem;
  line-height: 1.3;
}

.resident-timeline-date {
  grid-area: date;
  font-size: 0.78rem;
  color: rgba(45, 26, 33, 0.55);
  white-space: nowrap;
}

.resident-timeline-empty {
  padding: 1rem;
  border: 1px dashed #ead8e1;
  border-radius: 0.85rem;
  color: rgba(45, 26, 33, 0.6);
  text-align: center;
  font-size: 0.9rem;
}

/* Activity line */
.resident-activity-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(75, 13, 30, 0.04);
  color: rgba(45, 26, 33, 0.78);
  font-size: 0.88rem;
  justify-self: start;
}

.resident-activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-primary);
  flex-shrink: 0;
}

/* Tablet+: hero and quick actions side by side */
@media (min-width: 768px) {
  .resident-shell {
    gap: 1.25rem;
  }

  .resident-greeting-title {
    font-size: 1.8rem;
  }

  .resident-hero-title {
    font-size: 2.4rem;
  }

  .resident-hero-and-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 1.1rem;
    align-items: start;
  }

  .resident-quick-actions-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .resident-shell {
    max-width: 1080px;
  }
}

@media (max-width: 576px) {
  .login-card {
    margin-inline: 0.75rem;
  }
}

@media (max-width: 992px) {
  .app-main {
    padding: 1rem !important;
  }

  .brand-navbar {
    padding-block: 0.45rem;
  }

  .navbar-brand {
    font-size: 1.15rem;
    line-height: 1.2;
    white-space: normal;
  }

  .navbar-meta {
    width: 100%;
    justify-content: space-between;
  }

  .community-meta {
    min-width: 0;
    flex: 1 1 auto;
  }

  .entity-search-topbar,
  .house-search-topbar,
  .entity-search-topbar.entity-search-topbar-ledger {
    grid-template-columns: 1fr;
  }

  .entity-search-advanced-grid,
  .house-search-advanced-grid {
    grid-template-columns: 1fr 1fr;
  }

  .page-actions {
    width: 100%;
  }

  .toolbar-grid {
    grid-template-columns: 1fr 1fr;
  }

  .toolbar-grid > *:nth-child(3),
  .toolbar-grid > *:nth-child(4) {
    grid-column: 1 / -1;
  }

  .detail-identity {
    align-items: flex-start;
  }

}

@media (max-width: 576px) {
  .page-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .page-actions .btn,
  .page-actions form,
  .page-actions form .btn,
  .app-form .btn,
  .table-actions .btn,
  .table-actions form,
  .table-actions form .btn {
    width: 100%;
  }

  .table-actions {
    display: grid;
  }

  .toolbar-grid {
    grid-template-columns: 1fr;
  }

  .toolbar-grid > *:nth-child(3),
  .toolbar-grid > *:nth-child(4) {
    grid-column: auto;
  }

  .entity-search-actions,
  .house-search-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .entity-search-actions .btn,
  .house-search-actions .btn {
    width: 100%;
  }

  .entity-search-advanced-grid,
  .house-search-advanced-grid {
    grid-template-columns: 1fr;
  }

  .entity-search-topbar.entity-search-topbar-single {
    grid-template-columns: 1fr;
  }

  .filter-summary-bar {
    padding: 0.85rem 0.9rem;
  }

  .responsive-card-table {
    border-collapse: separate;
    border-spacing: 0;
  }

  .responsive-card-table thead {
    display: none;
  }

  .responsive-card-table,
  .responsive-card-table tbody,
  .responsive-card-table tr,
  .responsive-card-table td {
    display: block;
    width: 100%;
  }

  .responsive-card-table tbody {
    display: grid;
    gap: 0.7rem;
  }

  .responsive-card-table tr {
    border: 1px solid #ebd8e2;
    border-radius: 0.85rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 14px rgba(75, 13, 30, 0.035);
  }

  .responsive-card-table td {
    border: 0;
    padding: 0.68rem 0.85rem;
  }

  .responsive-card-table td + td {
    border-top: 1px solid #f2e5eb;
  }

  .responsive-card-table td[data-label]::before {
    display: block;
    margin-bottom: 0.24rem;
    color: rgba(45, 26, 33, 0.68);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .responsive-card-table td[colspan]::before {
    display: none;
  }

  .responsive-card-table td.table-actions {
    display: grid;
    gap: 0.45rem;
    white-space: normal;
  }

  .responsive-card-table .table-actions {
    display: grid;
  }

  .responsive-card-table .table-actions .btn,
  .responsive-card-table .table-actions form,
  .responsive-card-table .table-actions form .btn {
    width: 100%;
  }

  /* Reset the desktop inline spacing so full-width stacked buttons don't overflow. */
  .responsive-card-table td.table-actions > .btn,
  .responsive-card-table td.table-actions > a {
    margin-right: 0;
  }

  .responsive-card-table--compact tbody {
    gap: 0.6rem;
  }

  .responsive-card-table--compact tr {
    border-radius: 0.8rem;
    box-shadow: 0 4px 10px rgba(75, 13, 30, 0.03);
  }

  .responsive-card-table--compact td {
    padding: 0.58rem 0.75rem;
  }

  .responsive-card-table--compact td[data-label]::before {
    margin-bottom: 0.2rem;
    font-size: 0.66rem;
    letter-spacing: 0.04em;
  }

  .responsive-card-table--compact td .small,
  .responsive-card-table--compact td small,
  .responsive-card-table--compact td .text-muted.small {
    display: block;
    margin-top: 0.12rem;
    line-height: 1.25;
    font-size: 0.78rem;
  }

  .responsive-card-table--compact .table-actions {
    gap: 0.45rem;
    justify-items: start;
  }

  .responsive-card-table--compact .table-actions .btn,
  .responsive-card-table--compact .table-actions form,
  .responsive-card-table--compact .table-actions form .btn {
    width: auto;
  }

  .responsive-card-table--compact .table-actions.is-stacked .btn,
  .responsive-card-table--compact .table-actions.is-stacked form,
  .responsive-card-table--compact .table-actions.is-stacked form .btn {
    width: 100%;
  }

  .responsive-card-table .table-row-link:hover td,
  .responsive-card-table .table-row-link:focus-visible td,
  .responsive-card-table .house-row-link:hover td,
  .responsive-card-table .house-row-link:focus-visible td {
    background-color: transparent;
  }

}

.notification-bell .dropdown-toggle::after { display: none; }
.notification-bell .badge { font-size: 0.65rem; }
.notification-bell-menu {
  width: 320px;
  max-width: 95vw;
}
.notification-bell-menu .dropdown-header {
  padding: 0.6rem 1rem;
}
.notification-bell-body {
  max-height: 320px;
  overflow-y: auto;
}
.notification-bell-item {
  padding: 0.6rem 1rem;
  border-top: 1px solid #f0e1ea;
}
.notification-bell-item:first-child { border-top: 0; }
.notification-bell-item .btn-link {
  color: var(--brand-primary);
  text-decoration: none;
}
.notification-bell-item .btn-link:hover { text-decoration: underline; }
.notification-bell-unread {
  background: rgba(201, 127, 150, 0.12);
  font-weight: 600;
}

/* On phones the bell is not at the right edge of the navbar (the user menu
   sits to its right). Bootstrap positions navbar dropdowns statically (absolute,
   right-aligned to the bell), so a 320px menu runs off the left of the screen.
   Re-anchor the panel to the full-width navbar row instead of the bell: it stays
   within the viewport and, being absolute (not fixed), scrolls away with the
   page like a normal dropdown. */
@media (max-width: 575.98px) {
  .navbar-meta { position: relative; }
  .notification-bell { position: static; }
  .notification-bell-menu.dropdown-menu {
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    max-width: none !important;
  }
}

.evidence-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #ebd8e2;
}

.sidebar-brand .nav-link.active {
  background: rgba(75, 13, 30, 0.1);
  border-radius: 6px;
}
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}
.btn-loading::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  width: 0.85rem;
  height: 0.85rem;
  margin: -0.425rem 0 0 -0.425rem;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-loading-spin 0.75s linear infinite;
}
@keyframes btn-loading-spin {
  to { transform: rotate(360deg); }
}

.booking-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.6rem;
  padding: 0.9rem;
  border: 1px solid #ebd8e2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}
.booking-slot-button {
  min-height: 2.5rem;
  white-space: normal;
}
.booking-slot-button.active {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}

.reservation-weekly-board {
  display: grid;
  gap: 1rem;
}
.reservation-weekly-heading,
.reservation-area-week-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.reservation-weekly-heading h3,
.reservation-area-week-title h4 {
  font-size: 1.15rem;
}
.reservation-weekly-legend {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: #5f4b55;
  font-size: 0.9rem;
}
.reservation-weekly-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.reservation-slot-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  display: inline-block;
}
.reservation-slot-dot-available {
  background: #ffffff;
  border: 1px solid #d9c2ce;
}
.reservation-slot-dot-reserved {
  background: #c8c0c5;
}
.reservation-area-week {
  border: 1px solid #ebd8e2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 1rem;
  box-shadow: 0 12px 30px rgba(70, 18, 36, 0.05);
  min-width: 0;
}
.reservation-area-week-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.reservation-week-arrow {
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8c7d0;
  border-radius: 6px;
  background: #fff;
  color: #4b0d1e;
  font-size: 1.35rem;
  line-height: 1;
}
.reservation-week-arrow:hover:not(:disabled) {
  border-color: #4b0d1e;
  background: #fbf6f8;
}
.reservation-week-arrow:disabled {
  color: #a99ca3;
  background: #f6f0f3;
  cursor: not-allowed;
}
.reservation-week-grid {
  display: grid;
  grid-template-columns: repeat(var(--reservation-days), minmax(8.5rem, 1fr));
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  opacity: 1;
  transition: opacity 180ms ease;
  max-width: 100%;
  min-width: 0;
}
.reservation-week-grid.is-fading {
  opacity: 0.35;
}
.reservation-day-column {
  min-width: 8.5rem;
  border: 1px solid #f0dfe7;
  border-radius: 8px;
  background: #fff;
}
.reservation-day-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #f0dfe7;
  color: #2a1320;
}
.reservation-day-header span {
  color: #806c76;
}
.reservation-day-slots {
  display: grid;
  gap: 0.35rem;
  padding: 0.65rem;
}
.reservation-week-slot {
  display: block;
  min-height: 2rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #ead8e1;
  border-radius: 6px;
  color: #3f2934;
  background: #fff;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
}
.reservation-week-slot.is-reserved {
  color: #6c6268;
  border-color: #d6cdd2;
  background: #e7e1e4;
}
.reservation-week-slot.is-past {
  color: #8b7c84;
  background: #f7f1f4;
}
.reservation-week-slot.is-empty {
  color: #8b7c84;
  background: #f7f1f4;
  font-weight: 500;
}

@media (max-width: 768px) {
  .reservation-week-grid {
    grid-template-columns: repeat(var(--reservation-days), minmax(7.5rem, 1fr));
  }
  .reservation-day-column {
    min-width: 7.5rem;
  }
}

@media (max-width: 576px) {
  .reservation-weekly-board {
    gap: 0.8rem;
  }
  .reservation-weekly-heading {
    gap: 0.55rem;
  }
  .reservation-weekly-heading h3,
  .reservation-area-week-title h4 {
    font-size: 1rem;
  }
  .reservation-weekly-legend {
    gap: 0.55rem;
    font-size: 0.78rem;
  }
  .reservation-area-week {
    padding: 0.7rem;
  }
  .reservation-area-week-title {
    gap: 0.55rem;
  }
  .reservation-area-week-title p {
    font-size: 0.72rem;
  }
  .reservation-area-week-controls {
    gap: 0.35rem;
  }
  .reservation-area-week-controls .badge {
    font-size: 0.68rem;
  }
  .reservation-week-arrow {
    width: 1.85rem;
    height: 1.85rem;
    font-size: 1.1rem;
  }
  .reservation-week-grid {
    grid-template-columns: repeat(var(--reservation-days), minmax(0, 1fr));
    gap: 0.28rem;
    overflow-x: visible;
  }
  .reservation-day-column {
    min-width: 0;
    border-radius: 6px;
  }
  .reservation-day-header {
    display: grid;
    justify-items: center;
    gap: 0.05rem;
    padding: 0.42rem 0.12rem;
    line-height: 1.1;
  }
  .reservation-day-header strong,
  .reservation-day-header span {
    max-width: 100%;
    overflow: visible;
    white-space: nowrap;
  }
  .reservation-day-header strong {
    font-size: 0.62rem;
  }
  .reservation-day-header span {
    font-size: 0.58rem;
  }
  .reservation-day-slots {
    gap: 0.22rem;
    padding: 0.35rem 0.18rem;
  }
  .reservation-week-slot {
    min-height: 1.45rem;
    padding: 0.18rem 0.05rem;
    border-radius: 5px;
    font-size: 0.58rem;
    font-weight: 600;
  }
}

/* ─── Gatehouse kiosk · V3 ─────────────────────────────────────────────── */
.kiosk-frame { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.kf-shell { display: flex; flex-direction: column; gap: 12px; padding: 0; }

.kf-search {
  background: #fff;
  padding: 10px 14px;
  border: 1px solid #ebd8e2;
  border-radius: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  box-shadow: 0 1px 2px rgba(75, 13, 30, 0.04);
}
.kf-search-input {
  flex: 1;
  min-width: 0;
  max-width: 80px;
  padding: 10px 12px;
  border: 1px solid #d9c3ce;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-text);
  text-align: center;
}
.kf-search-input:focus {
  outline: 2px solid rgba(75, 13, 30, 0.25);
  outline-offset: 1px;
  border-color: var(--brand-primary);
}
.kf-search-sep { color: rgba(45, 26, 33, 0.4); font-weight: 800; }
.kf-search-btn {
  background: var(--brand-primary);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  margin-left: auto;
}
.kf-search-btn:hover { background: var(--brand-primary-2); }
.kf-search-clear {
  background: #fff;
  color: var(--brand-primary);
  border: 1px solid #d9c3ce;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.kf-search-clear:hover { background: var(--brand-soft); color: var(--brand-primary); }

.kf-content { display: flex; flex-direction: column; gap: 12px; }

.kf-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.kf-status-dot.ok { background: var(--semantic-success-bg); }
.kf-status-dot.bad { background: var(--semantic-danger-bg); }

.kf-house {
  background: linear-gradient(180deg, #fff, #fdf6f8);
  border: 1px solid #ebd8e2;
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 6px;
}
.kf-house-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.kf-house-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(75, 13, 30, 0.55);
}
.kf-house-id {
  font-size: 26px;
  font-weight: 800;
  color: var(--brand-text);
  line-height: 1.05;
}
.kf-house-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.kf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid transparent;
}
.kf-chip.ok { background: rgba(47, 122, 99, 0.12); color: var(--semantic-success-bg); }
.kf-chip.bad { background: rgba(154, 74, 97, 0.14); color: var(--semantic-danger-bg); }
.kf-chip.info { background: var(--semantic-info-bg); color: var(--brand-primary); }
.kf-chip.warn { background: var(--semantic-warning-bg); color: var(--semantic-warning-text); }
.kf-chip.neutral { background: var(--semantic-neutral-bg); color: var(--brand-primary); }

.kf-solvency-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.kf-solvency-pill.ok {
  background: rgba(47, 122, 99, 0.12);
  border: 1px solid rgba(47, 122, 99, 0.35);
  color: var(--semantic-success-bg);
}
.kf-solvency-pill.bad {
  background: rgba(154, 74, 97, 0.12);
  border: 1px solid rgba(154, 74, 97, 0.32);
  color: var(--semantic-danger-bg);
}

.kf-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: #f3e7ee;
  border-radius: 12px;
}
.kf-tab {
  flex: 1;
  padding: 8px 6px;
  text-align: center;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand-primary);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.kf-tab.is-active {
  background: #fff;
  box-shadow: 0 1px 2px rgba(75, 13, 30, 0.06);
}
.kf-tab .ct {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  height: 18px;
  line-height: 18px;
  border-radius: 999px;
  background: var(--brand-primary);
  color: #fff;
  font-size: 11px;
  margin-left: 4px;
}
.kf-tab:not(.is-active) .ct {
  background: rgba(75, 13, 30, 0.18);
  color: var(--brand-primary);
}

.kf-tab-scroll {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kf-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kf-tab-panel[hidden] { display: none; }

.kf-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
  margin-top: 2px;
}
.kf-group-title {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(75, 13, 30, 0.62);
}
.kf-group-count { font-size: 11px; color: rgba(45, 26, 33, 0.5); font-weight: 600; }
.kf-divider { height: 1px; background: #ead8e1; margin: 4px 0 2px; border: 0; }

.kf-action-card {
  background: #fff;
  border: 1px solid #ebd8e2;
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 10px;
}
.kf-action-card.is-inside {
  background: linear-gradient(180deg, #f4faf7, #e9f5f0);
  border-color: rgba(47, 122, 99, 0.28);
}
.kf-action-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.kf-action-head-info { min-width: 0; flex: 1; }
.kf-action-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kf-name { font-weight: 700; font-size: 16px; color: var(--brand-text); }
.kf-meta { color: rgba(45, 26, 33, 0.65); font-size: 12.5px; margin-top: 2px; }
.kf-due { font-size: 12px; color: rgba(45, 26, 33, 0.55); }

.kf-plate {
  display: inline-block;
  font-family: ui-monospace, Menlo, "Courier New", monospace;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: #f6efee;
  border: 1px solid #e8d7df;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 13px;
  color: var(--brand-text);
}
.kf-plate-md { font-size: 14px; }

.kf-authorized {
  background: #f6efee;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}
.kf-authorized-plates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.kf-action-row { display: flex; gap: 8px; }
.kf-action-btn {
  flex: 1;
  min-height: 56px;
  border-radius: 12px;
  border: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  cursor: pointer;
  width: 100%;
}
.kf-action-btn.entry { background: var(--semantic-success-bg); }
.kf-action-btn.exit { background: var(--semantic-danger-bg); }
.kf-action-card form { display: contents; }

.kf-time-warning {
  padding: 6px 10px;
  border-radius: 6px;
  background: #fff3cd;
  color: #856404;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.kf-status-stripe {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.kf-status-stripe.in {
  background: rgba(47, 122, 99, 0.18);
  color: var(--semantic-success-bg);
}

.kf-people { display: grid; gap: 8px; }
.kf-person {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  background: #fff;
  border: 1px solid #ebd8e2;
  border-radius: 12px;
}
.kf-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(75, 13, 30, 0.14), rgba(201, 127, 150, 0.24));
  color: var(--brand-primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.kf-avatar-photo { object-fit: cover; background: none; }
.kf-person-info { min-width: 0; flex: 1; }
.kf-person-name { font-weight: 700; font-size: 14px; color: var(--brand-text); }
.kf-person-meta { font-size: 12px; color: rgba(45, 26, 33, 0.6); }
.kf-person-rel {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--semantic-neutral-bg);
  color: var(--brand-primary);
  white-space: nowrap;
}

.kf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
  gap: 8px;
}
.kf-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(75, 13, 30, 0.06);
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.kf-empty-title { font-weight: 800; font-size: 16px; color: var(--brand-text); }
.kf-empty-msg { font-size: 13px; color: rgba(45, 26, 33, 0.6); max-width: 280px; }

.kf-error-card {
  background: #fff5f6;
  border: 1px solid rgba(180, 47, 75, 0.28);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 8px;
  text-align: center;
  justify-items: center;
}
.kf-error-emoji { font-size: 36px; }
.kf-error-title { font-weight: 800; font-size: 18px; color: var(--semantic-danger-bg); }
.kf-error-msg { font-size: 13.5px; color: rgba(45, 26, 33, 0.7); }
.kf-error-btn {
  margin-top: 6px;
  background: var(--brand-primary);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
}
.kf-error-btn:hover { background: var(--brand-primary-2); color: #fff; }

/* Indicador dinámico de requisitos de contraseña */
.pwd-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.3;
  margin-top: 6px;
  color: #6c757d;
  transition: color 0.2s ease;
}
.pwd-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ced4da;
  flex-shrink: 0;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.pwd-status[data-state="ok"] { color: var(--semantic-success-bg, #2f7a63); }
.pwd-status[data-state="ok"] .pwd-status-dot {
  background: var(--semantic-success-bg, #2f7a63);
  box-shadow: 0 0 0 3px rgba(47, 111, 78, 0.18);
}
.pwd-status[data-state="fail"] { color: var(--semantic-danger-bg, #b02a37); }
.pwd-status[data-state="fail"] .pwd-status-dot {
  background: var(--semantic-danger-bg, #b02a37);
  box-shadow: 0 0 0 3px rgba(176, 42, 55, 0.18);
}

.pwd-requirements {
  list-style: none;
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f7f7f9;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.pwd-requirements li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 3px 0;
  color: #5c6470;
  transition: color 0.2s ease;
}
.pwd-req-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ced4da;
  background: transparent;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.pwd-requirements li[data-state="ok"] {
  color: var(--semantic-success-bg, #2f7a63);
  font-weight: 500;
}
.pwd-requirements li[data-state="ok"] .pwd-req-icon {
  background: var(--semantic-success-bg, #2f7a63);
  border-color: var(--semantic-success-bg, #2f7a63);
}
.pwd-requirements li[data-state="ok"] .pwd-req-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.pwd-requirements li[data-state="fail"] {
  color: var(--semantic-danger-bg, #b02a37);
}
.pwd-requirements li[data-state="fail"] .pwd-req-icon {
  border-color: var(--semantic-danger-bg, #b02a37);
}
.pwd-requirements li[data-state="fail"] .pwd-req-icon::before,
.pwd-requirements li[data-state="fail"] .pwd-req-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 2px;
  height: 10px;
  background: var(--semantic-danger-bg, #b02a37);
}
.pwd-requirements li[data-state="fail"] .pwd-req-icon::before { transform: rotate(45deg); }
.pwd-requirements li[data-state="fail"] .pwd-req-icon::after { transform: rotate(-45deg); }

/* Paginación estilo Odoo (PaginatedListMixin + partials/pagination.html) */
.pager-bar { row-gap: 0.5rem; }
.pager-size-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--brand-primary);
  font-weight: 600;
}
.pager-size-option:hover { background: var(--semantic-neutral-bg, #ECE6EA); }
.pager-size-option.active {
  background: var(--brand-primary);
  color: #fff;
  cursor: default;
}
/* Brand-coherent page nav (override Bootstrap's default blue) */
.pager-bar .pagination .page-link { color: var(--brand-primary); }
.pager-bar .pagination .page-link:focus {
  box-shadow: 0 0 0 0.2rem rgba(75, 13, 30, 0.25);
}
.pager-bar .pagination .page-item.active .page-link {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

/* ============================================================================
   Toast de carga de esquina (Maquilishuat)
   Píldora discreta con el emblema animado del árbol. La animación es 100% CSS
   (sin loop de JS); el controlador en js/loader.js solo monta/desmonta el nodo
   tras el umbral de ~2s. Reutiliza los tokens --brand-* del :root de arriba.
   ============================================================================ */

/* ─── Emblema (árbol que crece en loop, ~6s) ──────────────────────────────── */
.emblem { display: block; overflow: visible; }
.emblem .trunk  { fill: var(--brand-primary); }
.emblem .leaf-1 { fill: var(--brand-secondary); opacity: 1; }
.emblem .leaf-2 { fill: var(--brand-secondary); opacity: 1; }
.emblem .leaf-3 { fill: var(--brand-soft); opacity: 0.55; }
.emblem .branch { stroke: #fff; stroke-width: 2.8; stroke-linecap: round; fill: none; }

.emblem.grow .trunk  { transform-origin: 50% 95%; animation: tree-trunk 6s ease-in-out infinite; }
.emblem.grow .canopy { transform-origin: 50% 70%; animation: tree-sway 6s ease-in-out infinite; }
.emblem.grow .leaf-1 { transform-origin: 50% 50%; animation: leaf-1 6s ease-in-out infinite; }
.emblem.grow .leaf-2 { transform-origin: 50% 50%; animation: leaf-2 6s ease-in-out infinite; }
.emblem.grow .leaf-3 { transform-origin: 50% 50%; animation: leaf-3 6s ease-in-out infinite; }
.emblem.grow .branch { stroke-dasharray: 1; stroke-dashoffset: 1; animation: branch-draw 6s ease-in-out infinite; }

@keyframes tree-trunk {
  0%, 3%  { transform: scaleY(0);    opacity: 0; }
  8%      { transform: scaleY(0.05); opacity: 1; }
  22%     { transform: scaleY(1.04); opacity: 1; }
  26%     { transform: scaleY(1);    opacity: 1; }
  85%     { transform: scaleY(1);    opacity: 1; }
  96%     { transform: scaleY(0);    opacity: 0; }
  100%    { transform: scaleY(0);    opacity: 0; }
}
@keyframes leaf-1 {
  0%, 24% { transform: scale(0);    opacity: 0; }
  36%     { transform: scale(1.08); opacity: 0.82; }
  44%     { transform: scale(1);    opacity: 0.82; }
  72%     { transform: scale(1);    opacity: 0.82; }
  82%     { transform: scale(0.6) translate(-3px, 9px) rotate(-22deg); opacity: 0; }
  100%    { transform: scale(0);    opacity: 0; }
}
@keyframes leaf-2 {
  0%, 27% { transform: scale(0);    opacity: 0; }
  39%     { transform: scale(1.08); opacity: 0.85; }
  47%     { transform: scale(1);    opacity: 0.85; }
  74%     { transform: scale(1);    opacity: 0.85; }
  84%     { transform: scale(0.6) translate(3px, 9px) rotate(22deg); opacity: 0; }
  100%    { transform: scale(0);    opacity: 0; }
}
@keyframes leaf-3 {
  0%, 30% { transform: scale(0);    opacity: 0; }
  42%     { transform: scale(1.08); opacity: 0.85; }
  50%     { transform: scale(1);    opacity: 0.85; }
  76%     { transform: scale(1);    opacity: 0.85; }
  86%     { transform: scale(0.4) translate(0, -6px); opacity: 0; }
  100%    { transform: scale(0);    opacity: 0; }
}
@keyframes branch-draw {
  0%, 28% { stroke-dashoffset: 1; }
  44%     { stroke-dashoffset: 0; }
  78%     { stroke-dashoffset: 0; }
  90%     { stroke-dashoffset: -1; }
  100%    { stroke-dashoffset: -1; }
}
@keyframes tree-sway {
  0%, 48%   { transform: rotate(0deg); }
  56%       { transform: rotate(-2.5deg); }
  66%       { transform: rotate(2.5deg); }
  74%, 100% { transform: rotate(0deg); }
}

/* ─── La píldora del toast ─────────────────────────────────────────────────── */
.corner-toast {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  padding: 8px 16px 8px 10px;
  box-shadow: 0 8px 24px rgba(75, 13, 30, 0.12), 0 2px 6px rgba(75, 13, 30, 0.06);
  white-space: nowrap;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.corner-toast .emblem { flex: none; }
.corner-toast .ct-text {
  font-size: 13px; font-weight: 600; color: var(--brand-text); letter-spacing: 0.01em;
}

/* Puntitos opcionales (variante CON puntitos). Omitir el span para la variante limpia. */
.ct-dots { display: inline-flex; gap: 5px; margin-left: 2px; }
.ct-dots span {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(75, 13, 30, 0.22);
  animation: dot-pulse 1.4s ease-in-out infinite;
}
.ct-dots span:nth-child(1) { animation-delay: 0s; }
.ct-dots span:nth-child(2) { animation-delay: 0.2s; }
.ct-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-pulse {
  0%, 80%, 100% { background: rgba(75, 13, 30, 0.18); transform: scale(0.85); }
  40%           { background: var(--brand-primary);  transform: scale(1.15); }
}

/* ─── Anclaje + entrada ────────────────────────────────────────────────────── */
/* Escritorio: esquina inferior derecha, sube y aparece. */
.toast-anchor-corner {
  position: fixed; right: 18px; bottom: 18px; z-index: 5000;
  animation: toast-in-corner 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes toast-in-corner {
  0%   { opacity: 0; transform: translateY(14px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Móvil: centrado en pantalla. */
.toast-anchor-center {
  position: fixed; left: 50%; top: 50%; z-index: 5000;
  transform: translate(-50%, -50%);
  animation: toast-in-center 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes toast-in-center {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.94); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* En pantallas chicas, incluso un toast anclado a esquina pasa a estar centrado. */
@media (max-width: 600px) {
  .toast-anchor-corner { right: auto; bottom: auto; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    animation-name: toast-in-center; }
}

/* Respeta usuarios con movimiento reducido: muestra estado final sin animación. */
@media (prefers-reduced-motion: reduce) {
  .emblem.grow .trunk, .emblem.grow .canopy, .emblem.grow .leaf-1,
  .emblem.grow .leaf-2, .emblem.grow .leaf-3, .emblem.grow .branch,
  .ct-dots span, .toast-anchor-corner, .toast-anchor-center {
    animation: none !important;
  }
  .emblem.grow .branch { stroke-dashoffset: 0; }
}
