@font-face {
    font-family: "Cash Creek Mono";
    src: url("/fonts/liberation-mono-latin-regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Cash Creek Mono";
    src: url("/fonts/liberation-mono-latin-bold.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --ink: #171612;
    --ink-soft: #37342e;
    --tan: #b79b75;
    --tan-dark: #8d704b;
    --sand: #e7dccb;
    --cream: #f6f1e8;
    --paper: #fffdf9;
    --line: #ddd2c1;
    --muted: #756f65;
    --success: #355d42;
    --danger: #9b302d;
    --shadow: 0 18px 50px rgba(36, 29, 19, .08);
}

html, body { margin: 0; min-height: 100%; background: var(--cream); color: var(--ink); font-family: "Cash Creek Mono", "Courier New", monospace; }
* { box-sizing: border-box; }
a { color: var(--ink); text-decoration-color: var(--tan); text-underline-offset: .22em; }
a:hover { color: var(--tan-dark); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 3.4vw, 3.6rem); line-height: 1.05; letter-spacing: -.045em; }
h2 { font-size: clamp(1.25rem, 2vw, 1.75rem); letter-spacing: -.025em; }
button, input, textarea, select { font: inherit; }

.portal-shell { min-height: 100vh; display: grid; grid-template-columns: 282px minmax(0, 1fr); }
.portal-sidebar { position: sticky; top: 0; height: 100vh; background: var(--ink); color: white; z-index: 20; }
.portal-main { min-width: 0; display: flex; flex-direction: column; }
.portal-topbar { height: 70px; padding: 0 clamp(1.5rem, 4vw, 4.5rem); background: rgba(255,253,249,.88); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; backdrop-filter: blur(12px); }
.topbar-label { color: var(--muted); text-transform: uppercase; font-size: .72rem; letter-spacing: .15em; }
.topbar-account { display: flex; align-items: center; gap: .7rem; text-decoration: none; font-size: .78rem; }
.portal-content { width: 100%; max-width: 1480px; margin: 0 auto; padding: clamp(2rem, 5vw, 5rem) clamp(1.25rem, 5vw, 5rem); flex: 1; }
.portal-footer { padding: 1.5rem clamp(1.25rem, 5vw, 5rem); border-top: 1px solid var(--line); color: var(--muted); display: flex; justify-content: space-between; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; }

.mobile-brand-row, .nav-toggle { display: none; }
.nav-panel { height: 100%; display: flex; flex-direction: column; }
.brand-lockup { display: block; background: #fff; margin: 22px; padding: 10px; border: 1px solid rgba(255,255,255,.2); }
.brand-lockup img { display: block; width: 100%; height: 148px; object-fit: contain; }
.portal-nav { padding: 14px 18px; }
.nav-section-label { margin: 0 14px 9px; color: #a8a194; font-size: .62rem; text-transform: uppercase; letter-spacing: .16em; }
.nav-section-label.spaced { margin-top: 28px; }
.portal-nav-link { display: flex; align-items: center; gap: 13px; margin: 4px 0; padding: 11px 13px; color: #e9e1d5; border-radius: 3px; text-decoration: none; font-size: .83rem; transition: .18s ease; }
.portal-nav-link:hover { color: white; background: rgba(255,255,255,.07); }
.portal-nav-link.active { color: var(--ink); background: var(--tan); }
.nav-icon { width: 20px; text-align: center; font-size: 1rem; }
.sidebar-footer { margin-top: auto; padding: 20px 22px 25px; border-top: 1px solid rgba(255,255,255,.12); color: #bdb5a8; font-size: .72rem; }
.sidebar-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar-user div { min-width: 0; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user strong { color: white; font-size: .7rem; }
.sidebar-user small { margin-top: 3px; color: #9d9588; }
.logout-button { margin-top: 14px; padding: 0; color: #d5cabc; background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: .7rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto; display: inline-grid; place-items: center; background: var(--tan); color: var(--ink); font-weight: 700; }
.avatar.small { width: 30px; height: 30px; font-size: .72rem; }

.eyebrow { margin-bottom: .75rem; color: var(--tan-dark); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .17em; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; margin-bottom: 2.25rem; }
.page-heading h1 { margin-bottom: .55rem; }
.page-intro, .hero-copy { max-width: 700px; color: var(--muted); line-height: 1.75; }
.text-link { margin-top: 8px; white-space: nowrap; font-size: .76rem; }

.btn { border-radius: 2px; padding: .75rem 1.15rem; border-width: 1px; font-size: .75rem; font-weight: 700; letter-spacing: .035em; }
.btn-lg { padding: .95rem 1.45rem; }
.btn-primary { color: white; background: var(--ink); border-color: var(--ink); }
.btn-primary:hover, .btn-primary:focus { color: var(--ink); background: var(--tan); border-color: var(--tan); }
.btn-outline-dark { color: var(--ink); border-color: var(--ink); }
.btn-outline-dark:hover { color: white; background: var(--ink); }
.btn:focus, .form-control:focus, .form-select:focus { box-shadow: 0 0 0 .2rem rgba(183,155,117,.25); border-color: var(--tan-dark); }

.hero-panel { min-height: 560px; padding: clamp(2rem, 6vw, 6rem); background: var(--sand); border: 1px solid #d0bea4; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; overflow: hidden; position: relative; }
.hero-panel::before { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(23,22,18,.13); pointer-events: none; }
.hero-content { position: relative; z-index: 1; max-width: 680px; }
.hero-content h1 { font-size: clamp(2.7rem, 5.5vw, 5.8rem); }
.hero-copy { margin-bottom: 2rem; font-size: .95rem; }
.hero-mark { display: grid; place-items: center; position: relative; }
.hero-mark img { width: min(100%, 470px); mix-blend-mode: multiply; filter: sepia(.15); }
.compact-hero { min-height: 390px; grid-template-columns: 1fr; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 1.5rem; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.feature-card { min-height: 230px; padding: 2rem; background: var(--paper); }
.feature-card h2 { margin: 1.5rem 0 .7rem; }
.feature-card p { color: var(--muted); font-size: .78rem; line-height: 1.7; }
.feature-number { color: var(--tan-dark); font-size: .64rem; letter-spacing: .15em; text-transform: uppercase; }
.muted-feature { background: #eee5d8; }

.content-card { padding: clamp(1.4rem, 3vw, 2.5rem); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { padding: 1.7rem; background: var(--paper); border: 1px solid var(--line); }
.stat-card span, .stat-card small { display: block; color: var(--muted); }
.stat-card span { font-size: .64rem; text-transform: uppercase; letter-spacing: .13em; }
.stat-card strong { display: block; margin: .6rem 0 .25rem; font-size: 2rem; line-height: 1.1; }
.stat-card .status-word, .stat-card .date-word { font-size: 1.25rem; }
.stat-card small { font-size: .66rem; }
.action-card { display: flex; justify-content: space-between; align-items: center; gap: 2rem; }
.action-card p { color: var(--muted); margin-bottom: 0; font-size: .78rem; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
.section-heading h2 { margin-bottom: 0; }
.section-heading a, .section-heading > span { color: var(--muted); font-size: .7rem; }
.property-preview-grid { display: grid; gap: .65rem; }
.property-preview { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: 1rem; border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: .18s; }
.property-preview:hover { transform: translateX(3px); border-color: var(--tan); color: var(--ink); }
.property-preview strong, .property-preview small { display: block; }
.property-preview small { margin-top: 3px; color: var(--muted); font-size: .66rem; }
.property-icon { width: 35px; height: 35px; display: grid; place-items: center; background: var(--sand); }
.property-icon.large { width: 47px; height: 47px; font-size: 1.3rem; }

.property-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.property-card { padding: 1.6rem; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.property-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.property-card h2 { margin: 1.25rem 0 .35rem; }
.property-card > p { min-height: 2.6rem; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.type-badge, .status-badge { display: inline-block; padding: .35rem .55rem; background: var(--cream); border: 1px solid var(--line); font-size: .58rem; text-transform: uppercase; letter-spacing: .08em; }
.property-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; padding: 1rem 0; margin: 1.2rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.property-card dl div { min-width: 0; }
.property-card dt { color: var(--muted); font-size: .58rem; text-transform: uppercase; }
.property-card dd { margin: .25rem 0 0; font-size: .7rem; }
.card-link { display: flex; justify-content: space-between; font-size: .7rem; font-weight: 700; }

.form-card { max-width: 980px; }
.form-section-heading { margin-bottom: 1.4rem; }
.form-section-heading h2 { margin-bottom: .35rem; }
.form-section-heading p { color: var(--muted); font-size: .68rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.15rem 1.25rem; }
.field-group { min-width: 0; }
.field-group label, .label-row { display: block; margin-bottom: .45rem; font-size: .68rem; font-weight: 700; }
.label-row { display: flex; justify-content: space-between; }
.label-row a { font-weight: 400; }
.field-group small { display: block; margin-top: .4rem; color: var(--muted); font-size: .6rem; }
.full-field { grid-column: 1 / -1; }
.form-control, .form-select { min-height: 47px; border-radius: 1px; border-color: #cfc3b2; background-color: #fff; color: var(--ink); font-size: .76rem; }
textarea.form-control { min-height: auto; }
.form-divider { margin: 2.4rem 0; border-color: var(--line); opacity: 1; }
.form-actions { display: flex; justify-content: flex-end; gap: .7rem; margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.danger-zone { margin-top: 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem; border-color: #dfc0bd; }
.danger-zone h2, .delete-confirmation h2 { margin-bottom: .45rem; }
.danger-zone p:last-child, .delete-confirmation > p { margin-bottom: 0; color: var(--muted); }
.delete-confirmation { max-width: 760px; border-color: #dfc0bd; }
.delete-confirmation form { margin-top: 1.5rem; }
.validation-message, .validation-summary { color: var(--danger); font-size: .64rem; }
.invalid { border-color: var(--danger) !important; }
.valid.modified:not([type=checkbox]) { border-color: var(--success); }
.alert { border-radius: 1px; font-size: .72rem; }
.alert-success { color: #244831; background: #e8f0e8; border-color: #c5d8c8; }
.alert-danger { color: #74211f; background: #f5e5e3; border-color: #dfc0bd; }
.related-section { max-width: 980px; margin-top: 1.25rem; }

.table-card { padding: 0; overflow: hidden; }
.table-tools { padding: 1.25rem 1.5rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-bottom: 1px solid var(--line); }
.search-box { width: min(100%, 420px); display: flex; align-items: center; gap: .6rem; padding: 0 .8rem; border: 1px solid var(--line); background: white; }
.search-box input { width: 100%; height: 41px; border: 0; outline: 0; font-size: .72rem; }
.result-count { color: var(--muted); font-size: .66rem; }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: .8rem 1.2rem; color: var(--muted); background: var(--cream); text-align: left; font-size: .58rem; text-transform: uppercase; letter-spacing: .1em; }
td { padding: 1rem 1.2rem; border-top: 1px solid var(--line); font-size: .7rem; vertical-align: middle; }
td a { text-decoration: none; }
.person-cell { display: flex; align-items: center; gap: .8rem; min-width: 200px; }
.person-cell strong, .person-cell small, .block-small { display: block; }
.person-cell small, .block-small { margin-top: .25rem; color: var(--muted); font-size: .59rem; }
.status-active { color: #28523a; background: #e4efe6; border-color: #bfd3c3; }
.status-inactive { color: #716c64; background: #efede8; }
.status-lead { color: #705024; background: #f2e6d1; border-color: #ddc49d; }
.action-cell { text-align: right; }
.table-action { white-space: nowrap; font-weight: 700; }

.auth-shell { min-height: min(650px, calc(100vh - 190px)); display: grid; grid-template-columns: 1fr 1fr; background: var(--sand); border: 1px solid #d0bea4; }
.auth-brand { display: grid; align-content: center; justify-items: center; padding: 3rem; border-right: 1px solid #d0bea4; text-align: center; }
.auth-brand img { width: min(100%, 390px); mix-blend-mode: multiply; }
.auth-brand p { max-width: 350px; color: var(--muted); font-size: .72rem; }
.auth-card { align-self: center; width: min(100% - 3rem, 460px); margin: 3rem auto; padding: clamp(1.5rem, 4vw, 3.5rem); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-card h1 { font-size: clamp(2rem, 3.4vw, 3.2rem); }
.auth-intro, .auth-card > p { color: var(--muted); font-size: .72rem; line-height: 1.6; }
.auth-help { margin: 1.5rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); text-align: center; }

.loading-state, .empty-state, .empty-inline { padding: 3rem; color: var(--muted); background: var(--paper); border: 1px solid var(--line); text-align: center; }
.empty-state { padding: clamp(3rem, 8vw, 7rem) 2rem; }
.empty-inline { padding: 2rem; font-size: .72rem; }

#blazor-error-ui { display: none; position: fixed; right: 1rem; bottom: 1rem; z-index: 1000; padding: 1rem 1.2rem; background: #fff3cd; border: 1px solid #d6b862; box-shadow: var(--shadow); font-size: .72rem; }
#blazor-error-ui .dismiss { margin-left: 1rem; cursor: pointer; }
.blazor-error-boundary { padding: 1rem; color: white; background: var(--danger); }
h1:focus { outline: none; }

@media (max-width: 900px) {
    .portal-shell { display: block; }
    .portal-sidebar { position: sticky; height: auto; }
    .mobile-brand-row { height: 65px; padding: 0 1rem; display: flex; justify-content: space-between; align-items: center; }
    .mobile-brand { color: white; text-decoration: none; text-transform: uppercase; letter-spacing: .12em; }
    .mobile-brand span, .mobile-brand small { display: block; }
    .mobile-brand span { font-size: .8rem; }
    .mobile-brand small { color: var(--tan); font-size: .5rem; }
    .menu-button { width: 30px; display: grid; gap: 5px; cursor: pointer; }
    .menu-button span { height: 1px; background: white; }
    .nav-panel { display: none; position: absolute; top: 65px; left: 0; right: 0; height: calc(100vh - 65px); background: var(--ink); overflow-y: auto; }
    .nav-toggle:checked + .nav-panel { display: flex; }
    .brand-lockup { display: none; }
    .portal-topbar { display: none; }
    .portal-content { padding-top: 2.25rem; }
    .hero-panel { min-height: auto; grid-template-columns: 1fr; }
    .hero-mark { margin-top: 2rem; }
    .feature-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
}

@media (max-width: 620px) {
    .page-heading, .action-card { display: block; }
    .page-heading .btn, .page-heading .text-link, .action-card .btn { display: inline-block; margin-top: 1rem; }
    .form-grid { grid-template-columns: 1fr; }
    .full-field { grid-column: auto; }
    .form-actions { justify-content: stretch; }
    .form-actions .btn { flex: 1; }
    .table-tools { align-items: stretch; flex-direction: column; }
    .search-box { width: 100%; }
    .portal-footer { display: block; }
    .portal-footer span { display: block; margin-bottom: .4rem; }
    .hero-panel { padding: 2.3rem 1.5rem; }
    .hero-panel::before { inset: 8px; }
}
