/* ===== House card (shared) =====
   Page shell and house card header shared by the employee house lists:
   /house-management/ (house_management), /hoa-don/ (invoice) and /vnv/ (vnv), including the title line actions.
   Class names keep the original `house-mng` prefix; each page adds its own card body in its app CSS.
   Load before the app CSS so page-specific rules can override these. */

/* ----- Page shell: heading, search, states, list ----- */
.house-mng {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--space-4, 1rem);
}

.house-mng__heading {
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
    margin-bottom: var(--space-3, 0.75rem);
}

.house-mng__back {
    color: var(--foreground, #111827);
    font-size: 1.125rem;
    padding: var(--space-2, 0.5rem);
    margin-left: calc(-1 * var(--space-2, 0.5rem));
}

.house-mng__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

/* ----- Heading actions (shared, templates/includes/heading-action.html) -----
   Links / buttons at the right end of the title line ("Duyệt nhà", "+ Tạo form", "+ Thêm chi phí"). The heading
   gets --actions: the title grows and pushes the actions right; on a narrow line they wrap under the title. */
.house-mng__heading--actions {
    flex-wrap: wrap;
}

.house-mng__heading--actions .house-mng__title {
    flex: 1 1 auto;
    min-width: 0;
}

/* Primary action: filled button */
.house-mng__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2, 0.5rem);
    padding: 0.5rem 1rem;
    border: 0;
    border-radius: var(--radius-md, 0.5rem);
    background: var(--color-primary, #2563eb);
    color: #fff;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.house-mng__action:hover,
.house-mng__action:focus-visible {
    color: #fff;
    filter: brightness(0.92);
}

.house-mng__action:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Secondary action: text link in the primary colour */
.house-mng__action--link {
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: none;
    color: var(--color-primary, #2563eb);
}

.house-mng__action--link:hover,
.house-mng__action--link:focus-visible {
    color: var(--color-primary, #2563eb);
    filter: none;
    text-decoration: underline;
}

.house-mng__search {
    position: relative;
    margin-bottom: var(--space-3, 0.75rem);
}

.house-mng__search-icon {
    position: absolute;
    top: 50%;
    left: 0.875rem;
    transform: translateY(-50%);
    color: var(--muted-foreground, #6b7280);
    pointer-events: none;
}

.house-mng__search .form-control {
    padding-left: 2.5rem;
    border-radius: 999px;
}

.house-mng__state {
    padding: 2rem 0;
    text-align: center;
    color: var(--muted-foreground, #6b7280);
}

.house-mng__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4, 1rem);
}

/* House list page on desktop: wider container, two cards per row */
@media (min-width: 992px) {
    .house-mng--houses {
        max-width: 1200px;
    }

    .house-mng--houses .house-mng__list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

/* ----- Card + header ----- */
.house-mng-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.house-mng-card__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

.house-mng-card__heading {
    flex: 1;
    min-width: 0;
}

.house-mng-card__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
}

.house-mng-card__address {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.house-mng-card__stats {
    display: flex;
    flex-shrink: 0;
    gap: 0.375rem;
}

.house-mng-card__stat {
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    background: #fff;
    color: #111827;
    font-size: 0.85rem;
    white-space: nowrap;
}

.house-mng-card__stat-value {
    color: var(--primary);
}

/* Narrow phones: stack header pills under the address */
@media (max-width: 420px) {
    .house-mng-card__head {
        flex-wrap: wrap;
    }
}
