:root {
    --bg: #f6f3ee;
    --panel: #fffdf9;
    --ink: #17201c;
    --muted: #6f766f;
    --line: #e4ded4;
    --navy: #10231f;
    --navy-soft: #1d3932;
    --sage: #6f8f7a;
    --gold: #c2a05d;
    --danger: #9f3d3d;
    --shadow: 0 24px 70px rgba(16, 35, 31, 0.14);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
            radial-gradient(circle at top left, rgba(194, 160, 93, 0.20), transparent 32rem),
            linear-gradient(135deg, #f8f5ef 0%, #ebe6dc 100%);
}

a {
    color: inherit;
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.sidebar {
    background: var(--navy);
    color: #f7f1e8;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--gold), #e8d59f);
    color: var(--navy);
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: -0.06em;
}

.brand-text strong {
    display: block;
    font-size: 18px;
    letter-spacing: -0.03em;
}

.brand-text span {
    display: block;
    margin-top: 2px;
    color: rgba(247, 241, 232, 0.66);
    font-size: 13px;
}

.nav-section {
    display: grid;
    gap: 8px;
}

.nav-label {
    color: rgba(247, 241, 232, 0.45);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 6px;
}

.nav-item {
    padding: 12px 14px;
    border-radius: 14px;
    color: rgba(247, 241, 232, 0.78);
    text-decoration: none;
    font-size: 14px;
}

.nav-item.active,
.nav-item:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    color: rgba(247, 241, 232, 0.58);
    font-size: 13px;
    line-height: 1.5;
}

.main {
    padding: 36px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 34px;
}

.eyebrow {
    color: var(--sage);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

h1 {
    margin: 6px 0 0;
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1;
    letter-spacing: -0.06em;
}

h2 {
    margin: 0;
}

.subtle {
    color: var(--muted);
    line-height: 1.6;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.card {
    background: rgba(255, 253, 249, 0.82);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(228, 222, 212, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

.metric-label {
    color: var(--muted);
    font-size: 13px;
}

.metric-value {
    margin-top: 8px;
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -0.06em;
}

.metric-note {
    margin-top: 8px;
    color: var(--sage);
    font-size: 13px;
    font-weight: 700;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.login-wrap {
    width: min(1040px, 100%);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 32px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.login-hero {
    background:
            linear-gradient(rgba(16, 35, 31, 0.80), rgba(16, 35, 31, 0.92)),
            radial-gradient(circle at 20% 20%, rgba(194, 160, 93, 0.38), transparent 26rem),
            var(--navy);
    color: #fff;
    padding: 48px;
    min-height: 560px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.login-hero h1 {
    font-size: clamp(40px, 6vw, 64px);
}

.login-hero p {
    color: rgba(255, 255, 255, 0.72);
    font-size: 16px;
    line-height: 1.7;
    max-width: 440px;
}

.login-panel {
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-title {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: 8px;
}

.form-subtitle {
    color: var(--muted);
    margin-bottom: 30px;
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

label {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}

input,
select {
    width: 100%;
    border: 1px solid var(--line);
    background: #fbfaf7;
    color: var(--ink);
    border-radius: 14px;
    padding: 14px 15px;
    font-size: 15px;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 4px rgba(111, 143, 122, 0.18);
}

button,
.button {
    border: none;
    border-radius: 14px;
    background: var(--navy);
    color: #fff;
    padding: 14px 18px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

button:hover,
.button:hover {
    background: var(--navy-soft);
}

.button-secondary {
    background: transparent;
    color: var(--navy);
    border: 1px solid var(--line);
}

.button-secondary:hover {
    background: rgba(16, 35, 31, 0.06);
}

.alert {
    margin-top: 18px;
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 14px;
}

.alert.error {
    background: rgba(159, 61, 61, 0.10);
    color: var(--danger);
}

.alert.success {
    background: rgba(111, 143, 122, 0.13);
    color: #43624f;
}

.logout-form {
    margin: 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--muted);
    padding: 0 0 14px;
    border-bottom: 1px solid var(--line);
}

.admin-table td {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.table-action {
    color: var(--navy);
    font-weight: 800;
    text-decoration: none;
}

.table-action:hover {
    text-decoration: underline;
}

.empty-state {
    min-height: 240px;
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 10px;
}

.empty-state h2 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.04em;
}

.form-card {
    max-width: 880px;
}

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

.checkbox-field {
    display: flex;
    align-items: center;
}

.checkbox-field label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-field input {
    width: auto;
}

.form-actions {
    margin-top: 28px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

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

@media (max-width: 860px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .topbar {
        align-items: flex-start;
        gap: 18px;
        flex-direction: column;
    }

    .card-grid,
    .login-wrap,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .login-hero {
        min-height: auto;
    }

    .main,
    .login-panel,
    .login-hero {
        padding: 28px;
    }
}

.compact-card {
    padding: 20px 24px;
}

.filters-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(220px, 320px) auto auto;
    gap: 12px;
    align-items: center;
}

.filter-search,
.filter-select {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #d7d4ca;
    border-radius: 10px;
    background: #fffdfa;
    color: #10231f;
    font: inherit;
}

.filter-search:focus,
.filter-select:focus {
    outline: none;
    border-color: #0d2a24;
    box-shadow: 0 0 0 3px rgba(13, 42, 36, 0.12);
}

.small-button {
    min-height: 44px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.table-card {
    padding: 0;
    overflow: hidden;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    padding: 18px 24px 14px;
    text-align: left;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #69716b;
    border-bottom: 1px solid #e5dfd2;
}

.admin-table td {
    padding: 17px 24px;
    border-bottom: 1px solid #eee8dc;
    vertical-align: middle;
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-table tbody tr:hover {
    background: #fbf8f1;
}

.table-action-col {
    width: 80px;
    text-align: right;
}

.pill,
.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.pill {
    background: #f0ede4;
    color: #25332f;
}

.status-pill.enabled {
    background: #e9f5ee;
    color: #1d6b3a;
}

.status-pill.disabled {
    background: #f7e8e8;
    color: #9b2f2f;
}

.pagination {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid #eee8dc;
}

.empty-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 18px;
}

@media (max-width: 900px) {
    .filters-row {
        grid-template-columns: 1fr;
    }

    .small-button {
        width: 100%;
    }
}

.actions-cell {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: flex-end;
}

.inline-form {
    display: inline;
    margin: 0;
}

.link-danger {
    border: 0;
    background: transparent;
    padding: 0;
    color: #9b2f2f;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.link-danger:hover {
    text-decoration: underline;
}

.form-field select:disabled,
.form-field input:disabled {
    background: #f0ede4;
    color: #777;
    cursor: not-allowed;
}

.form-section-title {
    margin: 8px 0 18px;
    font-size: 16px;
    font-weight: 800;
    color: #10231f;
}

.form-section-title:not(:first-child) {
    margin-top: 34px;
    padding-top: 24px;
    border-top: 1px solid #eee8dc;
}

.form-note {
    margin-top: 28px;
    padding: 14px 16px;
    border: 1px solid #e5dfd2;
    border-radius: 12px;
    background: #fbf8f1;
    color: #5f6862;
    font-size: 14px;
}

.form-field select:disabled,
.form-field input:disabled {
    background: #f0ede4;
    color: #777;
    cursor: not-allowed;
}

.delete-form {
    margin-top: 20px;
}

.button.danger {
    background: #9b2f2f;
    color: #fff;
}

.button.danger:hover {
    background: #7f2424;
}

.home-profile-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.home-profile-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.home-profile-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.profile-summary-card {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding: 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.summary-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b756f;
    margin-bottom: 6px;
}

.summary-value {
    font-weight: 700;
    color: #10221d;
    overflow-wrap: anywhere;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
}

.profile-sections {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.profile-card {
    border: 1px solid rgba(16, 34, 29, 0.08);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.profile-card summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 24px 28px;
}

.profile-card summary::-webkit-details-marker {
    display: none;
}

.profile-card summary h2 {
    margin: 0 0 8px;
}

.profile-card summary p {
    margin: 0;
    color: #6b756f;
}

.summary-chevron {
    font-size: 18px;
    transition: transform 0.18s ease;
}

.profile-card:not([open]) .summary-chevron {
    transform: rotate(-90deg);
}

.profile-card-body {
    border-top: 1px solid rgba(16, 34, 29, 0.08);
    padding: 24px 28px 28px;
}

.empty-state {
    min-height: 96px;
    display: flex;
    align-items: center;
    color: #6b756f;
    border: 1px dashed rgba(16, 34, 29, 0.18);
    border-radius: 18px;
    padding: 20px;
    background: rgba(247, 245, 239, 0.55);
}

.report-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(247, 245, 239, 0.7);
    border: 1px solid rgba(16, 34, 29, 0.08);
}

.report-title {
    font-weight: 800;
    color: #10221d;
}

.report-meta {
    margin-top: 4px;
    display: flex;
    gap: 8px;
    color: #6b756f;
    font-size: 13px;
}

@media (max-width: 900px) {
    .home-profile-header {
        flex-direction: column;
    }

    .home-profile-actions {
        justify-content: flex-start;
    }

    .profile-summary-card {
        grid-template-columns: 1fr;
    }

    .report-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

.report-row[open] {
    display: block;
}

.report-row summary {
    cursor: pointer;
    list-style: none;
}

.report-row summary::-webkit-details-marker {
    display: none;
}

.report-row pre {
    margin: 14px 0 0;
    padding: 14px;
    max-height: 420px;
    overflow: auto;
    white-space: pre-wrap;
    border-radius: 12px;
    background: rgba(16, 34, 29, 0.06);
}

/* ============================================================
   HomeTrack Admin - Grouped Home Details Page
   Use with templates/admin/homes/homedetails.html
   ============================================================ */

.button.secondary,
button.secondary {
    background: transparent;
    color: var(--navy);
    border: 1px solid var(--line);
}

.button.secondary:hover,
button.secondary:hover {
    background: rgba(16, 35, 31, 0.06);
}

.button.small,
button.small {
    min-height: 38px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
}

.ht-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.ht-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    border-radius: 24px;
    background:
            radial-gradient(circle at top left, rgba(39, 122, 92, 0.16), transparent 34%),
            linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.94));
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.ht-hero-left {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.ht-hero-left h1 {
    margin: 4px 0 4px;
    font-size: 34px;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.ht-hero-icon,
.ht-list-icon,
.ht-finding-severity,
.ht-loading-orb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.ht-hero-icon {
    width: 62px;
    height: 62px;
    border-radius: 20px;
    color: #0f5e43;
    background: rgba(39, 122, 92, 0.12);
    border: 1px solid rgba(39, 122, 92, 0.18);
}

.ht-hero-icon svg,
.ht-list-icon svg,
.ht-finding-severity svg,
.ht-loading-orb svg {
    width: 24px;
    height: 24px;
}

.ht-hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.ht-hero-actions form {
    margin: 0;
}

.button-icon {
    width: 16px;
    height: 16px;
    margin-right: 7px;
    vertical-align: -3px;
}

.danger-soft {
    color: #9b2424 !important;
    border-color: rgba(180, 45, 45, 0.25) !important;
    background: rgba(180, 45, 45, 0.06) !important;
}

.danger-soft:hover {
    background: rgba(180, 45, 45, 0.11) !important;
}

.ht-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 700;
    border: 1px solid transparent;
}

.ht-alert svg {
    width: 18px;
    height: 18px;
}

.ht-alert.success {
    background: rgba(36, 120, 75, 0.11);
    color: #17613e;
    border-color: rgba(36, 120, 75, 0.18);
}

.ht-alert.error {
    background: rgba(180, 45, 45, 0.11);
    color: #9b2424;
    border-color: rgba(180, 45, 45, 0.18);
}

.ht-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(430px, 0.9fr);
    gap: 16px;
}

.ht-overview-main,
.ht-panel {
    border-radius: 22px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.ht-overview-main {
    padding: 20px;
}

.ht-overview-title-row,
.ht-panel-header,
.ht-finding-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.ht-section-kicker {
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: rgba(15, 23, 42, 0.48);
}

.ht-overview-main h2,
.ht-panel h2,
.ht-system-group-card h3,
.ht-list-item h3,
.ht-finding-card h3,
.ht-finding-group-card h3,
.ht-parse-card h3 {
    margin: 0;
    letter-spacing: -0.025em;
}

.ht-overview-facts {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 9px;
    margin-top: 15px;
}

.ht-overview-facts div {
    padding: 11px 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.035);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.ht-overview-facts span {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    font-weight: 850;
    color: rgba(15, 23, 42, 0.52);
}

.ht-overview-facts strong {
    display: block;
    font-size: 13px;
    color: #111827;
    overflow-wrap: anywhere;
}

.ht-mini-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.ht-mini-stat {
    min-height: 116px;
    padding: 15px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.ht-mini-stat svg {
    width: 20px;
    height: 20px;
    color: var(--sage);
}

.ht-mini-stat span {
    display: block;
    margin-top: 18px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(15, 23, 42, 0.48);
}

.ht-mini-stat strong {
    display: block;
    margin-top: 8px;
    font-size: 26px;
    line-height: 1;
    letter-spacing: -0.04em;
    color: #0f172a;
}

.ht-panel {
    padding: 22px;
}

.ht-panel-header {
    margin-bottom: 16px;
}

.ht-panel-header.compact {
    align-items: flex-end;
    margin-bottom: 14px;
}

.ht-panel-header.compact p {
    margin: 0;
    color: rgba(15, 23, 42, 0.55);
    font-size: 13px;
    font-weight: 650;
}

.ht-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(15, 23, 42, 0.06);
    color: rgba(15, 23, 42, 0.66);
    white-space: nowrap;
}

.ht-pill.good,
.ht-pill.score-good {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.ht-pill.warn,
.ht-pill.score-fair,
.ht-pill.moderate,
.ht-pill.low {
    background: rgba(124, 143, 166, 0.16);
    color: #475569;
}

.ht-pill.score-poor,
.ht-pill.high,
.ht-pill.safety,
.ht-pill.urgent {
    background: rgba(180, 45, 45, 0.12);
    color: #9b2424;
}

.ht-pill.neutral,
.ht-pill.score-unknown,
.ht-pill.info {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.ht-system-group-list,
.ht-finding-group-list,
.ht-parse-list,
.ht-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ht-system-group-card,
.ht-finding-group-card,
.ht-list-item,
.ht-finding-card,
.ht-parse-card {
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(180deg, #fff, #fbfcfd);
}

.ht-system-group-card,
.ht-finding-group-card,
.ht-parse-card {
    overflow: hidden;
}

.ht-system-group-card summary,
.ht-finding-group-card summary,
.ht-parse-card summary {
    cursor: pointer;
    list-style: none;
}

.ht-system-group-card summary::-webkit-details-marker,
.ht-finding-group-card summary::-webkit-details-marker,
.ht-parse-card summary::-webkit-details-marker {
    display: none;
}

.ht-system-group-card summary {
    padding: 16px;
}

.ht-system-group-main {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.ht-system-group-main p,
.ht-finding-group-card summary p,
.ht-list-item p,
.ht-parse-card p,
.ht-finding-meta {
    margin: 5px 0 0;
    color: rgba(15, 23, 42, 0.58);
    font-size: 12px;
    font-weight: 700;
}

.ht-system-group-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(15, 23, 42, 0.58);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.ht-score-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.ht-score-row strong {
    font-size: 12px;
    color: rgba(15, 23, 42, 0.62);
    text-align: right;
}

.ht-score-track {
    position: relative;
    height: 9px;
    border-radius: 999px;
    overflow: hidden;
    background: #e9edf3;
}

.ht-score-track i {
    display: block;
    width: var(--score, 50%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #cbd5e1, #2563eb);
}

.ht-score-track.score-good i {
    background: linear-gradient(90deg, #bfdbfe, #2563eb);
}

.ht-score-track.score-fair i {
    background: linear-gradient(90deg, #e2e8f0, #7892b5);
}

.ht-score-track.score-poor i {
    background: linear-gradient(90deg, #fee2e2, #b85b5b);
}

.ht-score-track.mini {
    height: 6px;
    min-width: 90px;
}

.ht-system-group-note {
    margin-top: 9px;
    color: rgba(15, 23, 42, 0.68);
    font-size: 13px;
    line-height: 1.35;
}

.ht-subsystem-list {
    border-top: 1px solid rgba(15, 23, 42, 0.07);
    padding: 10px 16px 16px;
    display: grid;
    gap: 9px;
}

.ht-subsystem-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 14px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.ht-subsystem-row p {
    margin: 4px 0 0;
    color: rgba(15, 23, 42, 0.58);
    font-size: 12px;
    font-weight: 700;
}

.ht-subsystem-health {
    display: grid;
    gap: 8px;
    align-content: center;
}

.ht-subsystem-notes {
    grid-column: 1 / -1;
    margin: 0;
    color: rgba(15, 23, 42, 0.65);
    font-size: 13px;
    line-height: 1.4;
}

.ht-finding-group-card summary {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
}

.ht-finding-brief {
    margin-top: 8px;
    color: rgba(15, 23, 42, 0.68);
    font-size: 13px;
    line-height: 1.35;
}

.ht-findings-list {
    display: grid;
    gap: 12px;
}

.ht-findings-list.compact {
    padding: 0 16px 16px;
}

.ht-finding-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
}

.ht-finding-card.compact {
    padding: 14px;
}

.ht-finding-severity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.ht-finding-severity svg {
    width: 22px;
    height: 22px;
}

.ht-finding-severity.high,
.ht-finding-severity.safety,
.ht-finding-severity.urgent {
    background: rgba(180, 45, 45, 0.12);
    color: #9b2424;
}

.ht-finding-severity.moderate {
    background: rgba(124, 143, 166, 0.16);
    color: #475569;
}

.ht-finding-card p {
    margin: 9px 0 0;
    color: rgba(15, 23, 42, 0.72);
    line-height: 1.45;
}

.ht-recommendation {
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(39, 122, 92, 0.07);
    border: 1px solid rgba(39, 122, 92, 0.12);
}

.ht-recommendation strong,
.ht-recommendation span {
    display: block;
}

.ht-recommendation strong {
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #17613e;
}

.ht-two-column {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 16px;
}

.ht-list-item {
    display: flex;
    gap: 14px;
    padding: 16px;
}

.ht-list-item.compact {
    padding: 14px;
}

.ht-list-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
}

.ht-list-icon.pdf {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.ht-list-icon.gemini {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
}

.ht-list-content {
    min-width: 0;
    flex: 1;
}

.ht-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.ht-storage-key {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ht-error-text {
    color: #b91c1c !important;
}

.ht-extraction-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ht-extraction-summary div {
    padding: 14px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.035);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.ht-extraction-summary span,
.ht-extraction-summary strong {
    display: block;
}

.ht-extraction-summary span {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(15, 23, 42, 0.48);
}

.ht-extraction-summary strong {
    margin-top: 6px;
    font-size: 16px;
}

.ht-page-details {
    margin-top: 12px;
}

.ht-page-details summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 850;
    color: var(--navy);
}

.ht-page-grid.compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 6px;
    margin-top: 12px;
}

.ht-page-chip.compact {
    padding: 7px 8px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.ht-page-chip span,
.ht-page-chip strong {
    display: block;
}

.ht-page-chip span {
    font-size: 11px;
    font-weight: 850;
    color: rgba(15, 23, 42, 0.5);
}

.ht-page-chip strong {
    margin-top: 2px;
    font-size: 12px;
    color: #111827;
}

.ht-parse-card {
    padding: 0;
    overflow: hidden;
}

.ht-parse-card summary {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
}

.ht-parse-actions {
    padding: 0 16px 14px 74px;
}

.ht-applied-note {
    color: rgba(15, 23, 42, 0.6);
    font-weight: 700;
}

.ht-parse-card pre {
    margin: 0;
    padding: 16px;
    max-height: 460px;
    overflow: auto;
    white-space: pre-wrap;
    background: #0f172a;
    color: #dbeafe;
    font-size: 12px;
    line-height: 1.55;
}

.ht-empty {
    padding: 24px;
    border-radius: 18px;
    border: 1px dashed rgba(15, 23, 42, 0.16);
    background: rgba(15, 23, 42, 0.025);
    color: rgba(15, 23, 42, 0.55);
    font-weight: 700;
    text-align: center;
}

.ht-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(8px);
}

.ht-loading-overlay.active {
    display: flex;
}

.ht-loading-card {
    width: min(440px, 100%);
    padding: 28px;
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(15, 23, 42, 0.24);
    text-align: center;
}

.ht-loading-orb {
    width: 66px;
    height: 66px;
    margin: 0 auto 16px;
    border-radius: 22px;
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.1);
    animation: ht-pulse 1.2s ease-in-out infinite;
}

.ht-loading-card h2 {
    margin: 0 0 8px;
    letter-spacing: -0.03em;
}

.ht-loading-card p {
    margin: 0;
    color: rgba(15, 23, 42, 0.62);
    line-height: 1.5;
}

.ht-progress-bar {
    height: 9px;
    margin-top: 22px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
}

.ht-progress-fill {
    width: 38%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7c3aed, #2563eb, #16a34a);
    animation: ht-loading 1.15s ease-in-out infinite;
}

@keyframes ht-loading {
    0% {
        transform: translateX(-110%);
    }
    100% {
        transform: translateX(290%);
    }
}

@keyframes ht-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.04);
        opacity: 0.86;
    }
}

@media (max-width: 1320px) {
    .ht-overview {
        grid-template-columns: 1fr;
    }

    .ht-overview-facts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .ht-two-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .ht-hero,
    .ht-hero-left,
    .ht-hero-actions,
    .ht-overview-title-row,
    .ht-panel-header,
    .ht-finding-title-row,
    .ht-system-group-main,
    .ht-finding-group-card summary {
        align-items: stretch;
        flex-direction: column;
    }

    .ht-mini-stats,
    .ht-overview-facts,
    .ht-extraction-summary,
    .ht-subsystem-row {
        grid-template-columns: 1fr;
    }

    .ht-parse-card summary {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .ht-parse-card summary .ht-pill {
        grid-column: 2;
        justify-self: start;
    }

    .ht-parse-actions {
        padding-left: 16px;
    }
}

/* ============================================================
   HomeTrack Admin - Home Details V2 refinements
   Tighter summary, prominent findings total, improved finding groups
   ============================================================ */

.ht-overview.v2 {
    grid-template-columns: minmax(0, 1fr) 420px;
    align-items: stretch;
}

.ht-overview-main.v2 {
    padding: 18px;
}

.ht-summary-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.ht-people-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 14px;
}

.ht-people-strip div,
.ht-overview-facts.v2 div {
    min-width: 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.035);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.ht-people-strip span,
.ht-overview-facts.v2 span {
    display: block;
    margin-bottom: 5px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(15, 23, 42, 0.47);
}

.ht-people-strip strong,
.ht-overview-facts.v2 strong {
    display: block;
    min-width: 0;
    font-size: 13px;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ht-overview-facts.v2 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-top: 9px;
}

.ht-overview-side {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 10px;
}

.ht-findings-spotlight {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
    border-radius: 22px;
    background:
            radial-gradient(circle at top right, rgba(37, 99, 235, 0.13), transparent 44%),
            linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px solid rgba(37, 99, 235, 0.14);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.ht-findings-spotlight span {
    display: block;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(15, 23, 42, 0.48);
}

.ht-findings-spotlight strong {
    display: block;
    margin-top: 5px;
    font-size: 54px;
    line-height: 0.95;
    letter-spacing: -0.07em;
    color: #0f172a;
}

.ht-findings-spotlight p {
    margin: 8px 0 0;
    color: rgba(15, 23, 42, 0.6);
    font-size: 13px;
    font-weight: 700;
}

.ht-findings-ring {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.14);
}

.ht-findings-ring svg {
    width: 30px;
    height: 30px;
}

.ht-mini-stats.v2 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ht-mini-stats.v2 .ht-mini-stat {
    min-height: auto;
    padding: 13px;
}

.ht-mini-stats.v2 .ht-mini-stat span {
    margin-top: 10px;
}

.ht-mini-stats.v2 .ht-mini-stat strong {
    font-size: 22px;
}

.ht-finding-group-card.v2 summary {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 16px;
}

.ht-finding-group-count {
    width: 78px;
    height: 78px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    align-content: center;
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
}

.ht-finding-group-count strong {
    display: block;
    font-size: 28px;
    line-height: 1;
    letter-spacing: -0.05em;
}

.ht-finding-group-count span {
    display: block;
    margin-top: 4px;
    font-size: 9px;
    font-weight: 950;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.ht-finding-group-count.urgent,
.ht-finding-group-count.high,
.ht-finding-group-count.safety {
    color: #9b2424;
    background: rgba(180, 45, 45, 0.1);
}

.ht-finding-group-count.repair,
.ht-finding-group-count.moderate {
    color: #475569;
    background: rgba(124, 143, 166, 0.16);
}

.ht-finding-group-count.maintenance,
.ht-finding-group-count.low,
.ht-finding-group-count.info {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
}

.ht-finding-group-main {
    min-width: 0;
}

.ht-finding-group-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ht-finding-group-title-row h3 {
    font-size: 20px;
}

.ht-finding-group-card.v2 summary p {
    margin-top: 5px;
}

.ht-finding-brief {
    max-width: 980px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ht-expand-hint {
    color: rgba(15, 23, 42, 0.46);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ht-finding-group-card[open] .ht-expand-hint {
    color: var(--sage);
}

@media (max-width: 1320px) {
    .ht-overview.v2 {
        grid-template-columns: 1fr;
    }

    .ht-overview-side {
        grid-template-rows: auto;
    }
}

@media (max-width: 960px) {
    .ht-overview-facts.v2,
    .ht-people-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ht-finding-group-card.v2 summary {
        grid-template-columns: 74px minmax(0, 1fr);
    }

    .ht-finding-group-count {
        width: 64px;
        height: 64px;
        border-radius: 20px;
    }

    .ht-finding-group-count strong {
        font-size: 23px;
    }

    .ht-expand-hint {
        grid-column: 2;
    }
}

@media (max-width: 720px) {
    .ht-overview-facts.v2,
    .ht-people-strip,
    .ht-mini-stats.v2 {
        grid-template-columns: 1fr;
    }

    .ht-findings-spotlight {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ============================================================
   Home Details - Import Report Modal
   ============================================================ */

.ht-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(8px);
}

.ht-modal-overlay.active {
    display: flex;
}

.ht-modal-card {
    width: min(620px, 100%);
    border-radius: 28px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 28px 90px rgba(15, 23, 42, 0.24);
    padding: 24px;
}

.ht-modal-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.ht-modal-header h2 {
    margin: 0;
    letter-spacing: -0.035em;
}

.ht-modal-header p {
    margin: 8px 0 0;
    color: rgba(15, 23, 42, 0.62);
    line-height: 1.5;
}

.ht-modal-close {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.06);
    color: rgba(15, 23, 42, 0.7);
    font-size: 26px;
    line-height: 1;
}

.ht-modal-close:hover {
    background: rgba(15, 23, 42, 0.11);
}

.ht-upload-dropzone {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 180px;
    padding: 28px;
    border-radius: 22px;
    border: 1px dashed rgba(15, 23, 42, 0.24);
    background:
            radial-gradient(circle at top, rgba(37, 99, 235, 0.08), transparent 50%),
            rgba(15, 23, 42, 0.025);
    cursor: pointer;
    text-align: center;
}

.ht-upload-dropzone:hover {
    border-color: rgba(37, 99, 235, 0.42);
    background:
            radial-gradient(circle at top, rgba(37, 99, 235, 0.12), transparent 50%),
            rgba(37, 99, 235, 0.03);
}

.ht-upload-dropzone svg {
    width: 38px;
    height: 38px;
    color: #dc2626;
}

.ht-upload-dropzone strong {
    font-size: 18px;
    letter-spacing: -0.025em;
}

.ht-upload-dropzone span {
    color: rgba(15, 23, 42, 0.56);
    font-weight: 700;
}

.ht-upload-dropzone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ht-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

@media (max-width: 720px) {
    .ht-modal-header,
    .ht-modal-actions {
        flex-direction: column;
    }

    .ht-modal-actions .button {
        width: 100%;
    }
}

/* Fix Homes table action spacing */
.admin-table .table-action-col {
    width: 170px;
    min-width: 170px;
    text-align: right;
}

.admin-table td.actions-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    white-space: nowrap;
}

.actions-cell .table-action {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
}

.actions-cell .button,
.actions-cell .button-secondary,
.actions-cell .small-button {
    min-height: 40px;
    padding: 0 16px;
    white-space: nowrap;
}