.household-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    display: grid;
    gap: 16px;
}

.household-page,
.household-page * {
    box-sizing: border-box;
}

.household-summary__header,
.household-yearstatements__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.household-yearstatements__controls {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.household-yearstatements__yearBtn {
    min-width: 220px;
    padding: .52rem .62rem;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #fff;
    color: var(--color-text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    line-height: 1.1;
}

.household-yearstatements__yearBtnText {
    font-weight: 600;
}

.household-yearstatements__yearBtn i,
.household-yearstatements__yearBtn svg {
    width: 18px;
    height: 18px;
}

.hs-yearPick__list {
    display: grid;
    gap: 10px;
    /* Keep this popup non-scrollable; we only render a small fixed year range. */
    max-height: none;
    overflow: visible;
    padding: 0;
}

.hs-yearPick__item {
    width: 100%;
    justify-content: center;
}

.hs-yearPick__item.is-active {
    background: var(--btn-primary);
    color: var(--btn-primary-text);
}

.household-yearstatements__addBtn {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: none;
    background: var(--color-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 22px rgba(0,0,0,0.18);
    cursor: pointer;
}

.household-yearstatements__addBtn svg {
    width: 21px;
    height: 21px;
}

.household-summary__title {
    display: grid;
    gap: 6px;
    justify-items: start;
}

.household-add {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    border: none;
    background: var(--color-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 22px rgba(0,0,0,0.18);
    cursor: pointer;
    transform: translate(0, -18px);
}

#hsUploadBtn{
margin-left: 35px;
}

.household-add svg {
    width: 22px;
    height: 22px;
}

.household-summary__state {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
}

.household-summary__state.is-error {
    background: rgba(220,38,38,0.12);
}

.household-summary__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.household-summary__invite {
    width: 100%;
    margin-top: 12px;
    align-self: flex-start;
}

.household-summary__actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0;
    margin-top: 10px;
}

.household-company__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.household-company__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.household-summary__card {
    background: var(--color-white);
    border-radius: 14px;
    padding: 12px 14px;
    display: grid;
    gap: 6px;
    box-shadow: var(--rk-shadow-card);
}

.household-summary__label {
    font-size: .85rem;
    opacity: .75;
}

.household-summary__value {
    font-size: 1.15rem;
    font-weight: 700;
}

.household-summary__valueRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.household-summary__valueRowText {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.household-summary__members {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hs-members__btn {
    padding: 6px;
}

.hs-members {
    position: relative;
    display: grid;
    gap: 18px;
}

.hs-members__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hs-members__title {
    font-size: 1.05rem;
    font-weight: 700;
}

.hs-members__subtitle {
    font-size: .85rem;
    opacity: .7;
}

.hs-members__section {
    display: grid;
    gap: 8px;
}

.hs-members__sectionTitle {
    font-size: .85rem;
    opacity: .7;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.hs-members__sectionTitle--inline {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.hs-members__addMini {
    border: none;
    background: transparent;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #111;
    cursor: pointer;
    transform: translate(0, -7px);
}

.hs-members__addMini svg {
    width: 18px;
    height: 18px;
}

.hs-members__list {
    display: grid;
    gap: 8px;
}

.hs-members__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
}

.hs-members__info {
    display: grid;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.hs-members__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.hs-members__identity {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.hs-members__roleField {
    margin-top: 6px;
}

.hs-members__roleField .hs-members__role {
    min-width: 180px;
    max-width: 260px;
}

.hs-members__roleText {
    font-size: .9rem;
    font-weight: 600;
    opacity: .85;
}

.hs-members__lead {
    width: 28px;
    min-width: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hs-members__leadPlaceholder {
    width: 20px;
    height: 20px;
    display: inline-block;
}

.hs-members__actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.hs-members .icon-btn {
    color: #111;
}

.hs-members .icon-btn--danger,
.hs-members .hs-members__delete {
    color: #dc2626;
}

.hs-members .icon-btn svg,
.hs-members .icon-btn i {
    color: inherit;
    stroke: currentColor;
}

.hs-members__name {
    font-weight: 600;
}

.hs-members__meta {
    font-size: .85rem;
    opacity: .75;
}

.hs-members__empty {
    padding: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    opacity: .7;
}

.hs-members__editFields {
    display: none;
    gap: 8px;
    margin-top: 8px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.hs-members__editInput {
    min-width: 0;
}

.hs-members__row.is-editing .hs-members__editFields {
    display: grid;
}

.hs-members__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.hs-members--stacked-actions .hs-members__footer {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

.hs-members--stacked-actions .hs-members__footer button {
    width: 100%;
}

.hs-members__fab {
    position: sticky;
    bottom: 12px;
    margin-left: auto;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    border: none;
    background: var(--color-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(0,0,0,0.2);
    cursor: pointer;
}

.hs-members__fab--inline {
    position: static;
    margin-left: 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

.hs-members__fab svg {
    width: 26px;
    height: 26px;
}

.hs-personForm__form {
    display: grid;
    gap: 12px;
}

.hs-personForm__row {
    display: grid;
    gap: 6px;
}

.hs-personForm__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.hs-company__list {
    display: grid;
    gap: 12px;
}

.hs-company__field {
    display: grid;
    gap: 6px;
}

/* Upload popup */
.hs-upload__form {
    display: grid;
    gap: 12px;
}

.hs-upload__field {
    display: grid;
    gap: 6px;
}

.hs-upload__field label {
    font-size: .85rem;
    opacity: .75;
}

.hs-upload__field input[type="file"],
.hs-upload__field select {
    width: 100%;
    padding: .55rem .65rem;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #fff;
}

.hs-upload__field select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.2rem;
    background-image:
        linear-gradient(45deg, transparent 50%, #888 50%),
        linear-gradient(135deg, #888 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.hs-upload__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.hs-upload__status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
    opacity: .8;
}

.hs-upload__status.is-error {
    color: #dc2626;
    opacity: 1;
}

.hs-list {
    display: grid;
    gap: 10px;
}

.hs-statement {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
}

.hs-statement + .hs-statement::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 12px;
    right: 12px;
    height: 1px;
    background: rgba(255,255,255,0.18);
}

.hs-statement__main {
    display: grid;
    gap: 4px;
}

.hs-statement__year {
    font-weight: 700;
    font-size: 1rem;
}

.hs-statement__file {
    font-weight: 600;
}

.hs-statement__sub {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: .85rem;
    opacity: .75;
}

.hs-dot {
    opacity: .5;
}

.hs-statement__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hs-statement__download,
.hs-statement__delete,
.hs-statement__preview {
    text-decoration: none;
}

/* override header icon button color */
.household-page .icon-btn {
    color: var(--color-text-secondary);
    transform: translate(0, -2px);
}

.household-page .icon-btn svg {
    color: inherit;
}

.hs-empty {
    padding: 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    opacity: .8;
}

@media (max-width: 720px) {
    .household-yearstatements__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .household-yearstatements__controls {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}
