:root {
    --ink: #162033;
    --muted: #677085;
    --line: #d9e1ec;
    --surface: #ffffff;
    --page: #f3f6fa;
    --primary: #175a7a;
    --primary-dark: #11435b;
    --accent: #2d8066;
    --warning: #ad6b16;
    --danger: #b42318;
}

.auth-panel { max-width: 520px; margin: 32px auto; padding: 28px; }
.auth-panel h1 { font-size: 1.8rem; }
.auth-form { display: grid; gap: 16px; }
.validation-summary-valid { display: none; }
.location-dialog-trigger { text-align: right; }
.property-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-history { max-height: 480px; overflow-y: auto; }
.chat-message { padding: 16px 0; border-bottom: 1px solid #e5ebf3; }
.chat-message-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.chat-message-meta time { font-size: 0.8rem; color: #66758a; }
.property-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-top: 12px; }
.property-image { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #edf1f6; }
.property-google-map { height: min(60vh, 520px); min-height: 280px; border-radius: 8px; background: #edf1f6; }
.property-view-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0; }
.property-filter-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.property-filter-search, .property-filter-actions { grid-column: 1 / -1; }
@media (max-width: 760px) { .property-filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .property-filter-form { grid-template-columns: 1fr; } }
#property-card-view[hidden], #property-list-view[hidden] { display: none !important; }
.property-list-table { min-width: 900px; }
.property-list-table td, .property-list-table th { padding: 14px 10px; }
.property-list-table tbody th { color: var(--ink); font-size: 1rem; min-width: 160px; }
.property-list-table .button-group { white-space: nowrap; }
.location-dialog-trigger:disabled { background-color: #e9ecef; opacity: 1; }

html {
    font-size: 14px;
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

a {
    color: var(--primary);
}

.btn {
    border-radius: 7px;
    font-weight: 700;
}

.btn-primary {
    border-color: var(--primary);
    background: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
}

.app-navbar {
    background: linear-gradient(90deg, #12324a, #1f6f61);
    box-shadow: 0 10px 24px rgba(18, 50, 74, 0.16);
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand-lockup span:last-child {
    display: grid;
    gap: 2px;
}

.brand-lockup small {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding-inline: 6px;
    flex-shrink: 0;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 800;
}

.navbar-meta {
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.9rem;
}

.app-shell {
    max-width: 1480px;
    padding: 24px;
}

.app-footer {
    padding: 22px 24px;
    color: var(--muted);
    font-size: 0.9rem;
}

.app-alert {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(22, 32, 51, 0.08);
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.page-heading h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
}

.page-heading p {
    max-width: 680px;
    margin: 8px 0 0;
    color: var(--muted);
}

.eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
}

.metric-grid,
.property-grid,
.split-grid,
.form-grid {
    display: grid;
    gap: 16px;
}

.metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.metric-card,
.panel,
.property-card,
.empty-state {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 14px 30px rgba(22, 32, 51, 0.06);
}

.metric-card {
    padding: 18px;
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-weight: 700;
}

.metric-card strong {
    display: block;
    margin-top: 12px;
    font-size: 1.9rem;
    line-height: 1.1;
}

.split-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    margin-bottom: 16px;
}

.panel {
    padding: 18px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.panel-header h2 {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 800;
}

.panel-header p {
    margin: 4px 0 0;
    color: var(--muted);
}

.finance-stack,
.list-stack {
    display: grid;
    gap: 10px;
}

.finance-stack > div,
.property-row,
.details-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #edf1f6;
}

.finance-stack > div:last-child,
.property-row:last-child,
.details-list > div:last-child {
    border-bottom: 0;
}

.finance-stack span,
.property-row small,
.details-list dt,
.muted {
    color: var(--muted);
}

.finance-stack strong,
.property-row b {
    white-space: nowrap;
}

.property-row {
    color: var(--ink);
    text-decoration: none;
}

.property-row span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.app-table {
    margin: 0;
}

.app-table th {
    color: var(--muted);
    font-size: 0.85rem;
}

.app-table td strong,
.app-table td small {
    display: block;
}

.app-table td small {
    color: var(--muted);
    margin-top: 2px;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 180px 180px auto;
    gap: 10px;
}

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

.property-card {
    padding: 18px;
}

.property-card-head,
.action-row,
.button-group,
.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.property-card-head {
    justify-content: space-between;
    margin-bottom: 14px;
}

.property-card h2 {
    margin: 0;
    font-size: 1.22rem;
    font-weight: 800;
}

.property-card p {
    margin: 6px 0 16px;
    color: var(--muted);
}

.property-card dl,
.details-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.property-card dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.property-card dl div {
    border: 1px solid #edf1f6;
    border-radius: 7px;
    padding: 10px;
}

.property-card dt,
.details-list dt {
    font-size: 0.82rem;
    font-weight: 700;
}

.property-card dd,
.details-list dd {
    margin: 4px 0 0;
    font-weight: 800;
}

.action-row {
    margin-top: 16px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef3f8;
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 800;
}

.status-forsale {
    background: #e8f6ef;
    color: #1f6f4a;
}

.status-rented,
.status-sold {
    background: #e8eff8;
    color: #175a7a;
}

.status-reserved {
    background: #fff4df;
    color: var(--warning);
}

.status-forrent {
    background: #f0eafa;
    color: #7040a0;
}

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

.form-grid-wide {
    grid-column: 1 / -1;
}

.form-textarea {
    min-height: 120px;
}

.form-floating > label {
    right: 0;
    left: auto;
}

.form-actions {
    justify-content: flex-start;
    margin-top: 18px;
}

.danger-panel {
    border-color: #f2c5bf;
}

.empty-state {
    margin-top: 16px;
    padding: 28px;
    text-align: center;
}

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

    .split-grid,
    .filter-bar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .app-shell {
        padding: 16px;
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .metric-grid,
    .property-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .button-group,
    .form-actions {
        flex-wrap: wrap;
    }
}
