/*
 * ╔══════════════════════════════════════════════════════════════╗
 * ║        HIDDEN VALLEY HOA – SHARED PAGE DESIGN SYSTEM         ║
 * ║  Reusable design patterns across all pages.                  ║
 * ║  Keeps individual pages clean — just add class names.        ║
 * ╚══════════════════════════════════════════════════════════════╝
 */

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes hoa-fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hoa-anim-1 { animation: hoa-fadeUp 0.4s 0.00s ease both; }
.hoa-anim-2 { animation: hoa-fadeUp 0.4s 0.08s ease both; }
.hoa-anim-3 { animation: hoa-fadeUp 0.4s 0.14s ease both; }
.hoa-anim-4 { animation: hoa-fadeUp 0.4s 0.20s ease both; }
.hoa-anim-5 { animation: hoa-fadeUp 0.4s 0.26s ease both; }

/* ── Page Header ─────────────────────────────────────────────────────────── */
h1.hoa-title, h2.hoa-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--hoa-brand);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    line-height: 1;
    margin-bottom: 0;
}
h2.hoa-title { font-size: 1.5rem; }
.hoa-subtitle {
    font-size: 0.82rem;
    color: var(--hoa-muted-light);
    margin-top: 0.3rem;
    font-weight: 300;
}

/* ── Action Button (CTA, add, primary) ──────────────────────────────────── */
.hoa-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--hoa-cta);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(26,74,110,0.28);
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    text-decoration: none;
}
.hoa-action-btn:hover {
    background: var(--hoa-brand-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(26,74,110,0.32);
}
.hoa-action-btn:disabled,
.hoa-action-btn[disabled] {
    background: #b0bec5;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
}
.hoa-action-btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    box-shadow: none;
}
.hoa-secondary-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--hoa-surface);
    color: var(--hoa-brand);
    border: 1px solid var(--hoa-border);
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
    text-decoration: none;
}
.hoa-secondary-btn:hover {
    background: var(--hoa-border-light);
    border-color: var(--hoa-border-mid);
    color: var(--hoa-brand);
}

/* ── Stat Cards ──────────────────────────────────────────────────────────── */
.hoa-stat-card {
    background: #fff;
    border: 1px solid var(--hoa-border-light);
    border-radius: 12px;
    padding: 1.2rem 1.4rem;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}
.hoa-stat-card:hover {
    box-shadow: 0 6px 24px rgba(26,45,61,0.09);
    transform: translateY(-2px);
}
.hoa-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}
.hoa-stat-brand::before   { background: linear-gradient(90deg, var(--hoa-brand), var(--hoa-brand-hover)); }
.hoa-stat-success::before { background: linear-gradient(90deg, var(--hoa-success), #81c784); }
.hoa-stat-warning::before { background: linear-gradient(90deg, var(--hoa-warning), #ffb74d); }
.hoa-stat-info::before    { background: linear-gradient(90deg, var(--hoa-brand-accent), #64b5f6); }
.hoa-stat-danger::before  { background: linear-gradient(90deg, var(--hoa-danger), #ef9a9a); }

.hoa-stat-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--hoa-muted-light);
    margin-bottom: 0.45rem;
}
.hoa-stat-value {
    font-size: 2.2rem;
    font-weight: 300;
    line-height: 1;
    margin-bottom: 0.2rem;
}
.hoa-stat-value-sm {
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1;
    margin-bottom: 0.2rem;
}
.hoa-stat-brand   .hoa-stat-value,
.hoa-stat-brand   .hoa-stat-value-sm { color: var(--hoa-brand); }
.hoa-stat-success .hoa-stat-value,
.hoa-stat-success .hoa-stat-value-sm { color: var(--hoa-success); }
.hoa-stat-warning .hoa-stat-value,
.hoa-stat-warning .hoa-stat-value-sm { color: var(--hoa-warning); }
.hoa-stat-info    .hoa-stat-value,
.hoa-stat-info    .hoa-stat-value-sm { color: var(--hoa-brand-accent); }
.hoa-stat-danger  .hoa-stat-value,
.hoa-stat-danger  .hoa-stat-value-sm { color: var(--hoa-danger); }

.hoa-stat-desc {
    font-size: 0.75rem;
    color: var(--hoa-muted-light);
    font-weight: 300;
}
.hoa-stat-icon {
    position: absolute;
    bottom: 10px; right: 12px;
    opacity: 0.06;
    pointer-events: none;
    font-size: 3.5rem;
}

/* ── Toolbar (search + filters) ─────────────────────────────────────────── */
.hoa-toolbar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}
.hoa-search-wrap { position: relative; }
.hoa-search-icon {
    position: absolute;
    left: 0.75rem; top: 50%;
    transform: translateY(-50%);
    color: var(--hoa-muted-light);
    pointer-events: none;
    font-size: 0.78rem;
}
.hoa-search-input {
    width: 100%;
    padding: 0.55rem 0.85rem 0.55rem 2.2rem;
    border: 1px solid var(--hoa-border-mid);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    color: var(--hoa-text);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}
.hoa-search-input:focus {
    border-color: var(--hoa-brand-accent);
    box-shadow: 0 0 0 3px rgba(41,121,168,0.12);
}
.hoa-search-input::placeholder { color: var(--hoa-muted-light); }

.hoa-filter-select {
    padding: 0.55rem 2.2rem 0.55rem 0.85rem;
    border: 1px solid var(--hoa-border-mid);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    color: var(--hoa-text);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7f8e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
    height: 100%;
}
.hoa-filter-select:focus { border-color: var(--hoa-brand-accent); }

/* ── Table Card ──────────────────────────────────────────────────────────── */
.hoa-table-card {
    background: #fff;
    border: 1px solid var(--hoa-border-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(26,45,61,0.05);
}
.hoa-table-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--hoa-border-light);
}
.hoa-table-count { font-size: 0.78rem; color: var(--hoa-muted-light); }
.hoa-table-count strong { color: var(--hoa-text); font-weight: 600; }

.hoa-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}
.hoa-table thead th {
    background: var(--hoa-surface);
    padding: 0.65rem 1.1rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--hoa-muted);
    border-bottom: 1px solid var(--hoa-border);
    white-space: nowrap;
    overflow: hidden;
}
.hoa-th-sort { cursor: pointer; user-select: none; }
.hoa-th-sort:hover { color: var(--hoa-muted); }
.hoa-sort-icon { display: inline-block; width: 0.7rem; text-align: center; font-size: 0.6rem; margin-left: 0.2rem; vertical-align: middle; color: #fff; }
.hoa-sort-inactive { opacity: 0.25; }
.hoa-table tbody tr {
    border-bottom: 1px solid var(--hoa-border-light);
    transition: background 0.12s;
}
.hoa-table tbody tr:last-child { border-bottom: none; }
.hoa-table tbody tr:hover { background: var(--hoa-row-alt) !important; }
.hoa-table tbody tr:nth-child(even) { background: var(--hoa-bg-subtle); }
.hoa-table tbody tr:nth-child(odd)  { background: #fff; }
.hoa-table td {
    padding: 0.8rem 1.1rem;
    font-size: 0.82rem;
    color: var(--hoa-text);
    vertical-align: middle;
}

/* ── Content Card (general purpose, with optional header) ───────────────── */
.hoa-content-card {
    background: #fff;
    border: 1px solid var(--hoa-border-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(26,45,61,0.05);
}
.hoa-content-header {
    background: var(--hoa-surface);
    padding: 0.75rem 1.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--hoa-brand);
    border-bottom: 2px solid var(--hoa-brand);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.hoa-content-body { padding: 1.25rem; }
.hoa-content-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--hoa-border-light);
    background: transparent;
}

/* ── Avatar circles ─────────────────────────────────────────────────────── */
.hoa-avatar {
    width: 34px; height: 34px;
    background: var(--hoa-surface);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--hoa-brand-hover);
    border: 1.5px solid var(--hoa-border);
    flex-shrink: 0;
}
.hoa-avatar-lg {
    width: 48px; height: 48px;
    font-size: 1rem;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.hoa-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    white-space: nowrap;
}
.hoa-badge-brand   { background: rgba(26,45,61,0.08); color: var(--hoa-brand); border: 1px solid var(--hoa-border); }
.hoa-badge-general { background: rgba(26,45,61,0.08); color: var(--hoa-brand); border: 1px solid var(--hoa-border); }
.hoa-badge-road    { background: var(--hoa-warning-bg); color: var(--hoa-warning); border: 1px solid #ffcc80; }

/* ── Status pills (with leading dot) ────────────────────────────────────── */
.hoa-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    white-space: nowrap;
}
.hoa-status::before {
    content: none;
}
.hoa-status-success { background: var(--hoa-success-bg); color: var(--hoa-success); border: 1px solid #a5d6a7; }
.hoa-status-warning { background: var(--hoa-warning-bg); color: var(--hoa-warning); border: 1px solid #ffcc80; }
.hoa-status-danger  { background: var(--hoa-danger-bg);  color: var(--hoa-danger);  border: 1px solid #ef9a9a; }
.hoa-status-muted   { background: var(--hoa-bg-subtle);  color: var(--hoa-muted);   border: 1px solid var(--hoa-border); }
.hoa-status-info    { background: rgba(41,121,168,0.08); color: var(--hoa-brand-accent); border: 1px solid rgba(41,121,168,0.25); }

/* ── Icon edit/action button ────────────────────────────────────────────── */
.hoa-icon-btn {
    width: 30px; height: 30px;
    border-radius: 7px;
    border: 1px solid var(--hoa-border-mid);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--hoa-muted-light);
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    padding: 0;
    font-size: 0.75rem;
}
.hoa-icon-btn:hover {
    border-color: var(--hoa-brand-accent);
    color: var(--hoa-brand-accent);
    background: var(--hoa-surface);
}
.hoa-icon-btn-danger:hover {
    border-color: var(--hoa-danger);
    color: var(--hoa-danger);
    background: var(--hoa-danger-bg);
}

/* ── Notice / empty-state card ──────────────────────────────────────────── */
.hoa-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--hoa-muted-light);
    font-style: italic;
    font-size: 0.85rem;
}
.hoa-empty i { font-size: 2rem; display: block; margin-bottom: 0.75rem; opacity: 0.4; }

/* ── Info alert ──────────────────────────────────────────────────────────── */
.hoa-alert-info {
    background: var(--hoa-surface);
    border: 1px solid var(--hoa-border);
    border-left: 4px solid var(--hoa-brand-accent);
    border-radius: 8px;
    padding: 0.85rem 1.1rem;
    font-size: 0.82rem;
    color: var(--hoa-text);
}
.hoa-alert-warning {
    background: var(--hoa-warning-bg);
    border: 1px solid #ffcc80;
    border-left: 4px solid var(--hoa-warning);
    border-radius: 8px;
    padding: 0.85rem 1.1rem;
    font-size: 0.82rem;
    color: var(--hoa-text);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESIDENTS PAGE  (rd-*)
   ═══════════════════════════════════════════════════════════════════════════ */
.rd-page { font-family: 'DM Sans', sans-serif; }
.rd-page-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem; font-weight: 600;
    color: var(--hoa-brand);
    display: flex; align-items: center; gap: 0.6rem; line-height: 1;
}
.rd-subtitle { font-size: 0.82rem; color: var(--hoa-muted-light); margin-top: 0.3rem; font-weight: 300; }
.rd-add-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: var(--hoa-cta); color: #fff; border: none; border-radius: 8px;
    padding: 0.55rem 1.1rem; font-size: 0.82rem; font-weight: 600; cursor: pointer;
    box-shadow: 0 2px 10px rgba(26,74,110,0.28);
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    white-space: nowrap; text-decoration: none;
}
.rd-add-btn:hover {
    background: var(--hoa-brand-hover); color: #fff;
    transform: translateY(-1px); box-shadow: 0 4px 16px rgba(26,74,110,0.32);
}
.rd-stat-card {
    background: #fff; border: 1px solid var(--hoa-border-light);
    border-radius: 12px; padding: 1.2rem 1.4rem;
    position: relative; overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}
.rd-stat-card:hover { box-shadow: 0 6px 24px rgba(26,45,61,0.09); transform: translateY(-2px); }
.rd-stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.rd-stat-card.rd-total::before    { background: linear-gradient(90deg, var(--hoa-brand), var(--hoa-brand-hover)); }
.rd-stat-card.rd-occupied::before { background: linear-gradient(90deg, var(--hoa-success), #81c784); }
.rd-stat-card.rd-vacant::before   { background: linear-gradient(90deg, var(--hoa-warning), #ffb74d); }
.rd-stat-card.rd-showing::before  { background: linear-gradient(90deg, var(--hoa-brand-accent), #64b5f6); }
.rd-stat-label {
    font-size: 0.68rem; font-weight: 600; letter-spacing: 0.09em;
    text-transform: uppercase; color: var(--hoa-muted-light); margin-bottom: 0.45rem;
}
.rd-stat-value { font-size: 2.2rem; font-weight: 300; line-height: 1; margin-bottom: 0.2rem; }
.rd-stat-card.rd-total    .rd-stat-value { color: var(--hoa-brand); }
.rd-stat-card.rd-occupied .rd-stat-value { color: var(--hoa-success); }
.rd-stat-card.rd-vacant   .rd-stat-value { color: var(--hoa-warning); }
.rd-stat-card.rd-showing  .rd-stat-value { color: var(--hoa-brand-accent); }
.rd-stat-desc { font-size: 0.75rem; color: var(--hoa-muted-light); font-weight: 300; }
.rd-stat-icon { position: absolute; bottom: 10px; right: 12px; opacity: 0.06; pointer-events: none; }
.rd-search-wrap { position: relative; }
.rd-search-icon {
    position: absolute; left: 0.75rem; top: 50%;
    transform: translateY(-50%); color: var(--hoa-muted-light); pointer-events: none;
}
.rd-search-input {
    width: 100%; padding: 0.55rem 0.85rem 0.55rem 2.2rem;
    border: 1px solid var(--hoa-border-mid); border-radius: 8px;
    font-size: 0.82rem; color: var(--hoa-text); background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s; outline: none;
}
.rd-search-input:focus { border-color: var(--hoa-brand-accent); box-shadow: 0 0 0 3px rgba(41,121,168,0.12); }
.rd-search-input::placeholder { color: var(--hoa-muted-light); }
.rd-filter-select {
    padding: 0.55rem 2.2rem 0.55rem 0.85rem;
    border: 1px solid var(--hoa-border-mid); border-radius: 8px;
    font-size: 0.82rem; color: var(--hoa-text);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7f8e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none; cursor: pointer; outline: none; transition: border-color 0.15s;
}
.rd-filter-select:focus { border-color: var(--hoa-brand-accent); }
.rd-table-card {
    background: #fff; border: 1px solid var(--hoa-border-light);
    border-radius: 12px; overflow: hidden; box-shadow: 0 2px 12px rgba(26,45,61,0.05);
}
.rd-table-meta {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--hoa-border-light);
}
.rd-table-count { font-size: 0.78rem; color: var(--hoa-muted-light); }
.rd-table-count strong { color: var(--hoa-text); font-weight: 600; }

/* ── Residents Pagination ── */
.rd-page .pagination .page-link {
    color: var(--hoa-brand);
    border-color: var(--hoa-border);
    font-size: 0.8rem;
    padding: 0.3rem 0.65rem;
}
.rd-page .pagination .page-link:hover {
    background: var(--hoa-surface);
    color: var(--hoa-brand);
    border-color: var(--hoa-brand);
}
.rd-page .pagination .page-item.active .page-link {
    background: var(--hoa-brand);
    border-color: var(--hoa-brand);
    color: #fff;
}
.rd-page .pagination .page-item.disabled .page-link {
    color: var(--hoa-muted-light);
    border-color: var(--hoa-border-light);
}
.rd-table { width: 100%; border-collapse: collapse; margin: 0; }
.rd-table thead th {
    background: var(--hoa-surface); padding: 0.65rem 1.1rem;
    font-size: 0.68rem; font-weight: 600; letter-spacing: 0.09em;
    text-transform: uppercase; color: var(--hoa-muted);
    border-bottom: 1px solid var(--hoa-border); white-space: nowrap; overflow: hidden;
}
@media (min-width: 768px) {
    .rd-table { table-layout: fixed; }
    .rd-table thead th:nth-child(1) { width: 52px; }
    .rd-table thead th:nth-child(2) { width: 32%; }
    .rd-table thead th:nth-child(3) { width: 28%; }
    .rd-table thead th:nth-child(4) { width: 16%; }
    .rd-table thead th:nth-child(5) { width: 14%; }
    .rd-table thead th:nth-child(6) { width: 52px; }
}
.rd-th-sort { cursor: pointer; user-select: none; }
.rd-th-sort:hover { color: var(--hoa-muted); }
.rd-sort-icon { display: inline-block; width: 0.7rem; text-align: center; font-size: 0.6rem; margin-left: 0.2rem; vertical-align: middle; color: #fff; flex-shrink: 0; }
.rd-sort-inactive { opacity: 0.25; }
.rd-table tbody tr { border-bottom: 1px solid var(--hoa-border-light); transition: background 0.12s; }
.rd-table tbody tr:last-child { border-bottom: none; }
.rd-table tbody tr:hover { background: var(--hoa-row-alt) !important; }
.rd-table tbody tr:nth-child(even) { background: var(--hoa-bg-subtle); }
.rd-table tbody tr:nth-child(odd)  { background: #fff; }
.rd-table td { padding: 0.8rem 1.1rem; font-size: 0.82rem; color: var(--hoa-text); vertical-align: middle; }
.rd-table td:first-child { padding-right: 0.5rem; }
.rd-avatar {
    width: 34px; height: 34px; background: var(--hoa-surface); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.68rem; font-weight: 600; color: var(--hoa-brand-hover);
    border: 1.5px solid var(--hoa-border); flex-shrink: 0;
}
.rd-name strong { font-weight: 600; color: var(--hoa-brand); }
.rd-name span   { color: var(--hoa-muted-light); }
.rd-addr-street { font-weight: 500; }
.rd-addr-city   { font-size: 0.75rem; color: var(--hoa-muted-light); }
.rd-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.7rem; font-weight: 600; padding: 0.2rem 0.6rem;
    border-radius: 20px; white-space: nowrap;
}
.rd-badge-general { background: rgba(26,45,61,0.08); color: var(--hoa-brand); border: 1px solid var(--hoa-border); }
.rd-badge-road    { background: var(--hoa-warning-bg); color: var(--hoa-warning); border: 1px solid #ffcc80; }
.rd-status {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.7rem; font-weight: 600; padding: 0.25rem 0.65rem; border-radius: 20px;
}
.rd-status::before { content: none; }
.rd-status-occupied { background: var(--hoa-success-bg); color: var(--hoa-success); border: 1px solid #a5d6a7; }
.rd-status-vacant   { background: var(--hoa-warning-bg); color: var(--hoa-warning); border: 1px solid #ffcc80; }
.rd-edit-btn {
    width: 30px; height: 30px; border-radius: 7px;
    border: 1px solid var(--hoa-border-mid); background: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--hoa-muted-light); padding: 0;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.rd-edit-btn:hover { border-color: var(--hoa-brand-accent); color: var(--hoa-brand-accent); background: var(--hoa-surface); }
@keyframes rd-fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.rd-anim-1 { animation: rd-fadeUp 0.4s 0.00s ease both; }
.rd-anim-2 { animation: rd-fadeUp 0.4s 0.08s ease both; }
.rd-anim-3 { animation: rd-fadeUp 0.4s 0.14s ease both; }
.rd-anim-4 { animation: rd-fadeUp 0.4s 0.20s ease both; }

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN USERS PAGE  (au-*)
   ═══════════════════════════════════════════════════════════════════════════ */
.au-approve-btn {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--hoa-success, #4CAF50); color: #fff;
    border: none; border-radius: 7px; padding: 0.35rem 0.85rem;
    font-family: 'DM Sans', sans-serif; font-size: 0.78rem; font-weight: 500;
    cursor: pointer; transition: opacity 0.15s; white-space: nowrap;
}
.au-approve-btn:hover:not(:disabled) { opacity: 0.85; }
.au-approve-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.au-reject-btn {
    display: inline-flex; align-items: center; gap: 5px;
    background: #fff; color: var(--hoa-danger, #D32F2F);
    border: 1px solid var(--hoa-danger, #D32F2F); border-radius: 7px;
    padding: 0.35rem 0.85rem; font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem; font-weight: 500; cursor: pointer;
    transition: background 0.15s, color 0.15s; white-space: nowrap;
}
.au-reject-btn:hover:not(:disabled) { background: var(--hoa-danger-bg, #fdecea); }
.au-reject-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.au-admin-btn {
    display: inline-flex; align-items: center; gap: 5px;
    background: #fff; color: var(--hoa-brand);
    border: 1px solid var(--hoa-border-mid); border-radius: 7px;
    padding: 0.35rem 0.85rem; font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem; font-weight: 500; cursor: pointer;
    transition: all 0.15s; white-space: nowrap;
}
.au-admin-btn:hover:not(:disabled) { border-color: var(--hoa-brand); background: var(--hoa-surface); }
.au-admin-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.au-revoke-btn {
    display: inline-flex; align-items: center; gap: 5px;
    background: #fff; color: var(--hoa-muted-light);
    border: 1px solid var(--hoa-border-light); border-radius: 7px;
    padding: 0.35rem 0.85rem; font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem; font-weight: 500; cursor: pointer;
    transition: all 0.15s; white-space: nowrap;
}
.au-revoke-btn:hover:not(:disabled) { border-color: var(--hoa-danger, #D32F2F); color: var(--hoa-danger, #D32F2F); background: var(--hoa-danger-bg, #fdecea); }
.au-revoke-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.au-role-admin {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(26,53,40,.1); color: var(--hoa-brand);
    border-radius: 20px; padding: 2px 10px;
    font-size: 0.74rem; font-weight: 600;
}
.au-role-member {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--hoa-surface); color: var(--hoa-muted);
    border-radius: 20px; padding: 2px 10px;
    font-size: 0.74rem; font-weight: 500;
}
/* Admin users table — fully self-contained fixed layout */
.au-table {
    table-layout: fixed; width: 100%;
    border-collapse: collapse; margin: 0;
}
.au-table thead th {
    background: var(--hoa-surface);
    padding: 0.65rem 0.75rem;
    font-size: 0.68rem; font-weight: 600;
    letter-spacing: 0.09em; text-transform: uppercase;
    color: var(--hoa-muted);
    border-bottom: 1px solid var(--hoa-border);
    white-space: nowrap; overflow: hidden;
}
.au-table tbody tr {
    border-bottom: 1px solid var(--hoa-border-light);
    transition: background 0.12s;
}
.au-table tbody tr:last-child { border-bottom: none; }
.au-table tbody tr:hover { background: var(--hoa-row-alt) !important; }
.au-table tbody tr:nth-child(even) { background: var(--hoa-bg-subtle); }
.au-table tbody tr:nth-child(odd)  { background: #fff; }
.au-table td {
    padding: 0.75rem 0.75rem;
    font-size: 0.82rem; color: var(--hoa-text);
    vertical-align: middle;
}
/* Column widths */
.au-table .au-col-name    { width: 30%; }
.au-table .au-col-prop    { width: 25%; }
.au-table .au-col-role    { width: 130px; white-space: nowrap; }
.au-table .au-col-actions { width: 230px; white-space: nowrap; text-align: right; }
.au-cell-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Mobile: icon-only buttons, hide property column */
@media (max-width: 600px) {
    .au-table .au-col-prop            { display: none; }
    .au-table td:nth-child(2)         { display: none; }
    .au-table .au-col-role            { width: 60px; }
    .au-table .au-col-actions         { width: 90px; }
    .au-approve-btn span,
    .au-reject-btn span,
    .au-admin-btn span,
    .au-revoke-btn span               { display: none; }
    .au-approve-btn, .au-reject-btn,
    .au-admin-btn, .au-revoke-btn     { padding: 5px 7px; min-width: unset; }
    .au-table .hoa-avatar             { display: none; }
}
.au-section-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--hoa-muted);
    margin-bottom: 10px; margin-top: 8px;
}
.au-section-label span.au-badge-warn {
    background: var(--hoa-warning-bg, #fef9ee); color: var(--hoa-warning, #E65100);
    border: 1px solid var(--hoa-warning, #E65100);
    border-radius: 20px; padding: 1px 8px; font-size: 0.7rem;
}
.au-section-label span.au-badge-ok {
    background: var(--hoa-success-bg, #e8f5e9); color: var(--hoa-success, #4CAF50);
    border: 1px solid var(--hoa-success, #4CAF50);
    border-radius: 20px; padding: 1px 8px; font-size: 0.7rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PROFILE PAGE  (pf-*)
   ═══════════════════════════════════════════════════════════════════════════ */
.pf-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 18px; margin-bottom: 18px;
}
@media (max-width: 768px) { .pf-grid { grid-template-columns: 1fr; } }
.pf-label {
    display: block; font-size: 0.74rem; font-weight: 600;
    color: var(--hoa-muted); letter-spacing: 0.05em;
    text-transform: uppercase; margin-bottom: 5px;
}
.pf-input {
    width: 100%; padding: 0.48rem 0.75rem;
    border: 1px solid var(--hoa-border-mid); border-radius: 8px;
    font-family: 'DM Sans', sans-serif; font-size: 0.88rem;
    color: var(--hoa-page-text-dark, #1e2d3d); background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s; box-sizing: border-box;
}
.pf-input:focus { outline: none; border-color: var(--hoa-brand); box-shadow: 0 0 0 3px rgba(41,121,168,0.12); }
.pf-input.invalid { border-color: var(--hoa-danger, #D32F2F); }
.pf-error { font-size: 0.75rem; color: var(--hoa-danger, #D32F2F); margin-top: 3px; }
.pf-save-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; background: var(--hoa-brand); color: #fff;
    border: none; border-radius: 8px; padding: 0.55rem 1rem;
    font-family: 'DM Sans', sans-serif; font-size: 0.88rem; font-weight: 600;
    cursor: pointer; transition: opacity 0.15s;
}
.pf-save-btn:hover:not(:disabled) { opacity: 0.88; }
.pf-save-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.pf-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 0.83rem; }
.pf-dt { color: var(--hoa-muted-light); font-weight: 500; white-space: nowrap; }
.pf-dd { color: var(--hoa-page-text-dark, #1e2d3d); }
.pf-acct-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 640px) { .pf-acct-grid { grid-template-columns: 1fr; } }
.pf-acct-label { font-size: 0.72rem; color: var(--hoa-muted-light); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.pf-acct-value { font-size: 0.88rem; font-weight: 600; color: var(--hoa-page-text-dark, #1e2d3d); }
.pf-alert-success {
    display: flex; align-items: center; gap: 7px;
    background: var(--hoa-success-bg, #e8f5e9); color: #2e7d32;
    border-left: 3px solid var(--hoa-success, #4CAF50);
    border-radius: 7px; padding: 8px 12px; font-size: 0.82rem; margin-bottom: 12px;
}
.pf-alert-danger {
    display: flex; align-items: center; gap: 7px;
    background: var(--hoa-danger-bg, #fdecea); color: var(--hoa-danger, #D32F2F);
    border-left: 3px solid var(--hoa-danger, #D32F2F);
    border-radius: 7px; padding: 8px 12px; font-size: 0.82rem; margin-bottom: 12px;
}
.pf-map-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; background: #fff; color: var(--hoa-brand);
    border: 1px solid var(--hoa-border-mid); border-radius: 8px;
    padding: 0.45rem 1rem; font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem; font-weight: 500; text-decoration: none; transition: all 0.15s;
}
.pf-map-btn:hover { border-color: var(--hoa-brand); background: var(--hoa-surface, #eef2f7); }
.pf-pw-btn {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--hoa-surface, #eef2f7); color: var(--hoa-brand);
    border: 1px solid var(--hoa-border); border-radius: 7px;
    padding: 5px 12px; font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem; font-weight: 500; text-decoration: none; transition: all 0.15s;
}
.pf-pw-btn:hover { border-color: var(--hoa-brand); background: #fff; }
.pf-address-hero {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; background: var(--hoa-surface, #eef2f7);
    border-radius: 10px; margin-bottom: 16px;
}
.pf-address-icon {
    width: 44px; height: 44px; flex-shrink: 0; border-radius: 10px;
    background: var(--hoa-brand);
    display: flex; align-items: center; justify-content: center; color: #fff;
}
.pf-address-text .street { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 600; color: var(--hoa-brand); }
.pf-address-text .city { font-size: 0.78rem; color: var(--hoa-muted-light); margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════════════════
   BYLAWS PAGE  (bl-*)
   ═══════════════════════════════════════════════════════════════════════════ */
.bl-page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
    animation: hoa-fadeUp 0.35s ease both;
}
.bl-title {
    font-family: 'Playfair Display', serif; font-size: 1.75rem; font-weight: 600;
    color: var(--hoa-brand); display: flex; align-items: center; gap: 0.65rem;
    line-height: 1; margin: 0;
}
.bl-subtitle { font-size: 0.8rem; color: var(--hoa-muted-light); margin-top: 0.35rem; font-weight: 300; }
.bl-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bl-layout {
    display: grid; grid-template-columns: 200px 1fr;
    gap: 20px; align-items: start;
    animation: hoa-fadeUp 0.35s 0.07s ease both;
}
@media (max-width: 768px) {
    .bl-layout { grid-template-columns: 1fr; }
    .bl-toc-card { display: none; }
}
.bl-toc-card {
    background: #fff; border: 1px solid var(--hoa-border-light);
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 2px 10px rgba(26,45,61,0.05);
    position: sticky; top: 70px;
}
.bl-toc-header {
    background: #fff; padding: 10px 14px;
    border-bottom: 1px solid var(--hoa-border-light);
    border-left: 4px solid var(--hoa-brand-mid, var(--hoa-brand));
    font-size: 0.67rem; font-weight: 700; letter-spacing: 0.11em;
    text-transform: uppercase; color: var(--hoa-muted);
}
.bl-toc-list { list-style: none; padding: 6px 0; margin: 0; }
.bl-toc-item a {
    display: flex; align-items: center; gap: 8px; padding: 5px 14px;
    font-size: 0.78rem; color: var(--hoa-muted); text-decoration: none;
    border-left: 3px solid transparent; transition: all 0.12s;
}
.bl-toc-item a:hover { background: var(--hoa-green-faintest, #f5f7fa); color: var(--hoa-brand); }
.bl-toc-item.active a {
    background: rgba(41,121,168,0.07); color: var(--hoa-brand);
    border-left-color: var(--hoa-brand); font-weight: 500;
}
.bl-toc-numeral {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 5px;
    background: var(--hoa-surface, #eef2f7); border: 1px solid var(--hoa-border);
    font-size: 0.58rem; font-weight: 700; color: var(--hoa-muted);
    flex-shrink: 0; transition: all 0.12s;
}
.bl-toc-item.active .bl-toc-numeral { background: var(--hoa-brand); border-color: var(--hoa-brand); color: #fff; }
.bl-articles { display: flex; flex-direction: column; gap: 10px; }
.bl-article {
    background: #fff; border: 1px solid var(--hoa-border-light);
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 2px 6px rgba(26,45,61,0.04);
    scroll-margin-top: 72px; transition: box-shadow 0.2s;
}
.bl-article:hover { box-shadow: 0 4px 18px rgba(26,45,61,0.08); }
.bl-article-header {
    display: flex; align-items: center; gap: 12px; padding: 12px 18px;
    background: #fff; border-bottom: 1px solid var(--hoa-border-light);
    border-left: 4px solid var(--hoa-brand);
    cursor: pointer; user-select: none;
    transition: background 0.13s, border-left-color 0.13s;
}
.bl-article-header:hover { background: var(--hoa-green-faintest, #f5f7fa); border-left-color: var(--hoa-brand); }
.bl-article-numeral {
    width: 32px; height: 32px; border-radius: 8px; background: var(--hoa-brand);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 700; color: #fff; flex-shrink: 0;
    letter-spacing: 0.02em; box-shadow: 0 2px 5px rgba(26,45,61,0.22);
}
.bl-article-title {
    font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 600;
    color: var(--hoa-brand); flex: 1; margin: 0;
}
.bl-article-chevron { color: var(--hoa-muted-light); transition: transform 0.2s; flex-shrink: 0; }
.bl-article.collapsed .bl-article-chevron { transform: rotate(-90deg); }
.bl-article-body {
    padding: 16px 20px; font-size: 0.84rem;
    color: var(--hoa-page-text-dark, #1e2d3d); line-height: 1.75;
}
.bl-article.collapsed .bl-article-body { display: none; }
.bl-article-body p { margin-bottom: 0.6rem; }
.bl-article-body p:last-child { margin-bottom: 0; }
.bl-article-body ol, .bl-article-body ul { padding-left: 1.4rem; margin: 0; }
.bl-article-body ol li, .bl-article-body ul li { margin-bottom: 0.5rem; padding-left: 0.25rem; }
.bl-article-body ol li:last-child, .bl-article-body ul li:last-child { margin-bottom: 0; }
.bl-article-body strong { color: var(--hoa-brand); font-weight: 600; }
.bl-adopted-note {
    background: var(--hoa-surface, #eef2f7); border: 1px solid var(--hoa-border-light);
    border-radius: 10px; padding: 12px 18px;
    font-size: 0.8rem; color: var(--hoa-muted); font-style: italic;
}
@media print {
    .no-print { display: none !important; }
    .bl-article-body { display: block !important; }
    .bl-article-header { cursor: default; }
    .bl-article-chevron { display: none; }
}

/* ── InvoicePrint ── */
.invoice-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 30px;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 0.92rem;
    color: #1a1a1a;
}
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 3px solid var(--hoa-brand);
    padding-bottom: 16px;
    margin-bottom: 20px;
}
.hoa-info h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--hoa-brand);
    margin: 6px 0 2px;
}
.hoa-info p { margin: 0; font-size: 0.82rem; color: #555; }
.invoice-meta { text-align: right; }
.invoice-meta .invoice-label {
    font-size: 2rem;
    font-weight: 800;
    color: var(--hoa-brand);
    letter-spacing: 2px;
    line-height: 1;
}
.invoice-meta table { margin-left: auto; margin-top: 8px; }
.invoice-meta td { padding: 1px 4px; font-size: 0.83rem; }
.invoice-meta td:first-child { color: #888; text-align: right; padding-right: 10px; }
.invoice-meta td:last-child  { font-weight: 600; }
.bill-to { margin-bottom: 24px; }
.bill-to .section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.bill-to .recipient-name { font-size: 1.05rem; font-weight: 700; color: var(--hoa-brand); }
.bill-to .recipient-info { font-size: 0.85rem; color: #555; }
.line-items-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.line-items-table thead th {
    background: var(--hoa-brand);
    color: #fff;
    padding: 7px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.line-items-table thead th:last-child,
.line-items-table thead th:nth-child(2),
.line-items-table thead th:nth-child(3) { text-align: right; }
.line-items-table tbody td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--hoa-surface);
    font-size: 0.88rem;
}
.line-items-table tbody td:nth-child(2),
.line-items-table tbody td:nth-child(3),
.line-items-table tbody td:last-child { text-align: right; }
.line-items-table tbody tr:nth-child(even) { background: #fafafa; }
.invoice-totals { display: flex; justify-content: flex-end; margin-bottom: 20px; }
.totals-box { width: 240px; }
.totals-box table { width: 100%; border-collapse: collapse; }
.totals-box td { padding: 4px 10px; font-size: 0.9rem; }
.totals-box .total-row td {
    background: var(--hoa-brand);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    padding: 8px 10px;
    border-radius: 0;
}
.invoice-notes {
    border-top: 1px solid var(--hoa-surface);
    padding-top: 14px;
    margin-top: 4px;
    font-size: 0.85rem;
    color: #555;
}
.invoice-notes .section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.paid-stamp {
    display: inline-block;
    border: 3px solid #4CAF50;
    color: #4CAF50;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 4px;
    padding: 4px 16px;
    border-radius: 4px;
    transform: rotate(-8deg);
    opacity: 0.85;
    margin-left: 12px;
    vertical-align: middle;
}
.void-stamp {
    display: inline-block;
    border: 3px solid #D32F2F;
    color: #D32F2F;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 4px;
    padding: 4px 16px;
    border-radius: 4px;
    transform: rotate(-8deg);
    opacity: 0.85;
    margin-left: 12px;
    vertical-align: middle;
}
.payment-info {
    background: #f0faf0;
    border: 1px solid #a5d6a7;
    border-radius: 6px;
    padding: 12px 16px;
    margin-top: 16px;
    font-size: 0.87rem;
}
@media print {
    .invoice-page { padding: 0; max-width: 100%; }
    @page { margin: 1.5cm; }
}

/* ── Account Manage Nav ── */
.manage-nav .nav-link {
    color: var(--hoa-muted);
    font-size: 0.85rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    transition: background 0.13s, color 0.13s;
}
.manage-nav .nav-link:hover {
    background: var(--hoa-surface);
    color: var(--hoa-brand);
}
.manage-nav .nav-link.active {
    background: rgba(40, 53, 147, 0.1);
    color: var(--hoa-brand);
    font-weight: 600;
}
