/*
 * PlainSight — simple clean light theme. Deliberately minimal; design investment deferred.
 */

:root {
    --ink: #1f2a24;
    --muted: #5b6b62;
    --accent: #2f6f4f;
    --accent-dark: #245740;
    --bg: #f7f8f6;
    --card: #ffffff;
    --line: #dde4df;
    --error-bg: #fdeceb;
    --error-ink: #8a2620;
    --ok-bg: #e8f4ec;
    --ok-ink: #1f5c38;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.25rem 2rem;
}

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

h1 {
    font-size: 1.9rem;
    margin: 0.5rem 0;
}

h2 {
    font-size: 1.15rem;
    margin: 0 0 0.75rem;
}

h3 {
    font-size: 1rem;
    margin: 0 0 0.4rem;
}

/* ── Nav ── */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--accent-dark);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.nav-links a {
    color: var(--ink);
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--accent);
}

.inline-form {
    display: inline;
}

.nav-logout {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.55rem 1.1rem;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    background: var(--accent-dark);
    color: #fff;
}

.btn-lg {
    padding: 0.7rem 1.5rem;
    font-size: 1.05rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-secondary {
    background: var(--card);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-secondary:hover {
    background: var(--ok-bg);
    color: var(--accent-dark);
}

.btn-danger {
    background: var(--card);
    color: var(--error-ink);
    border: 1px solid var(--error-ink);
}

.btn-danger:hover {
    background: var(--error-bg);
    color: var(--error-ink);
}

/* ── Cards / layout ── */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.card-accent {
    border-color: var(--accent);
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.page-actions {
    display: flex;
    gap: 0.5rem;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 720px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}

/* ── Hero / landing ── */
.hero {
    padding: 2rem 0;
}

.hero-sub {
    max-width: 46rem;
    color: var(--muted);
    font-size: 1.05rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.disclaimer {
    color: var(--muted);
    font-size: 0.85rem;
    max-width: 46rem;
}

/* ── Auth pages ── */
.auth {
    max-width: 26rem;
    margin: 2rem auto;
}

.auth-sub {
    color: var(--muted);
    margin-top: 0;
}

.auth-alt {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 0.9rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.form-control {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}

.form-control:focus {
    outline: 2px solid var(--accent);
    outline-offset: 0;
    border-color: var(--accent);
}

fieldset.form-group {
    border: none;
    padding: 0;
    margin: 0 0 0.9rem;
}

fieldset.form-group legend {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    padding: 0;
}

.radio-option {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.35rem 0;
    cursor: pointer;
}

.form-hint {
    color: var(--muted);
    font-weight: 400;
    font-size: 0.85rem;
}

.upload-form {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.upload-form .form-control {
    width: auto;
    flex: 1 1 12rem;
}

/* ── Alerts ── */
.alert {
    border-radius: 6px;
    padding: 0.6rem 0.9rem;
    margin-bottom: 0.9rem;
    font-size: 0.92rem;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-ink);
}

.alert-ok {
    background: var(--ok-bg);
    color: var(--ok-ink);
}

/* ── Transactions list ── */
.txn-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.txn-address {
    font-weight: 600;
    font-size: 1.05rem;
    text-decoration: none;
}

.txn-meta {
    color: var(--muted);
    font-size: 0.85rem;
}

.badge {
    border-radius: 999px;
    padding: 0.15rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-ok {
    background: var(--ok-bg);
    color: var(--ok-ink);
}

.badge-muted {
    background: var(--line);
    color: var(--muted);
}

/* ── Tables ── */
table {
    border-collapse: collapse;
    width: 100%;
}

.facts-table th {
    text-align: left;
    padding: 0.35rem 0.75rem 0.35rem 0;
    white-space: nowrap;
    vertical-align: top;
    color: var(--muted);
    font-size: 0.9rem;
}

.facts-table td {
    padding: 0.35rem 0;
}

.timeline-table td,
.docs-table td,
.docs-table th {
    padding: 0.4rem 0.75rem 0.4rem 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.timeline-date {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}

.timeline-source {
    color: var(--muted);
    font-size: 0.8rem;
}

/* ── Footer ── */
.footer {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 1.5rem 0 0;
    margin-top: 2rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
}

/* ── Property management ── */
.empty-state {
    color: var(--muted);
    padding: 2rem 0;
}

.form-row {
    display: flex;
    gap: 0.9rem;
}

.form-row .form-group {
    flex: 1;
}

.cover-photo {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 0.6rem;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.photo-tile img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    margin-bottom: 0.35rem;
}

.btn-sm {
    padding: 0.25rem 0.6rem;
    font-size: 0.82rem;
}

.chip-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    margin: 0 0 0.9rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--ok-bg);
    border-radius: 999px;
    padding: 0.25rem 0.4rem 0.25rem 0.75rem;
    font-size: 0.9rem;
}

.chip-remove {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.3rem;
    color: var(--muted);
}

.chip-remove:hover {
    color: var(--error-ink);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.table th,
.table td {
    text-align: left;
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--line);
}

/* ── Chat ── */
.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
    max-height: 24rem;
    overflow-y: auto;
}

.chat-message {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    max-width: 85%;
}

.chat-mine {
    align-self: flex-end;
    background: var(--ok-bg);
}

.chat-meta {
    display: flex;
    gap: 0.6rem;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.15rem;
}

.chat-body {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* ── Reports ── */
.stat {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0.2rem 0 0;
    font-variant-numeric: tabular-nums;
}

.badge-late {
    background: var(--error-bg);
    color: var(--error-ink);
}

.current-year {
    font-weight: 700;
    text-decoration: none;
}


/* ── Long-form prose (blog posts) ─────────────────────────────────────────── */

.prose {
    max-width: 720px;
}

.prose h1 {
    line-height: 1.25;
}

.prose h2, .prose h3 {
    margin-top: 1.75rem;
    line-height: 1.3;
}

.prose p, .prose li {
    font-size: 1.02rem;
}

.prose ul, .prose ol {
    padding-left: 1.4rem;
}

.prose blockquote {
    margin: 1rem 0;
    padding: 0.25rem 1rem;
    border-left: 3px solid var(--accent);
    color: var(--muted);
}

.prose code {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-size: 0.92em;
}

.prose pre {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.9rem 1rem;
    overflow-x: auto;
}

.prose pre code {
    border: 0;
    padding: 0;
}

.prose table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

.prose th, .prose td {
    border: 1px solid var(--line);
    padding: 0.45rem 0.6rem;
    text-align: left;
}

.prose img {
    max-width: 100%;
}

.prose hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 1.5rem 0;
}

/* Active state for the blog pillar filter pills. */
.chip-active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
/* ── Lease agreement terms & document ── */
.terms-group {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 0.9rem 1rem 0.4rem;
    margin: 0 0 1rem;
}
.terms-group legend {
    font-weight: 600;
    padding: 0 0.4rem;
}
.terms-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}
.addendum {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 0.9rem;
    margin-top: 0.9rem;
}
.addendum h4 {
    margin: 0 0 0.5rem;
}
.agreement {
    max-width: 52rem;
    margin: 0 auto;
    line-height: 1.55;
    font-size: 0.95rem;
}
.agreement-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
}
.agreement-receipt {
    border: 1px solid currentColor;
    padding: 0.8rem 1rem;
    margin-bottom: 1.4rem;
}
.agreement-receipt h2,
.agreement-addendums h2 {
    font-size: 1.05rem;
    text-align: center;
    margin: 0 0 0.6rem;
}
.agreement-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
}
.agreement-table th,
.agreement-table td {
    padding: 0.3rem 0.4rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    text-align: left;
}
.agreement-table .num {
    text-align: right;
    white-space: nowrap;
}
.agreement-total th {
    border-top: 2px solid currentColor;
}
.agreement-clauses {
    padding-left: 1.4rem;
}
.agreement-clauses > li {
    margin-bottom: 0.8rem;
}
.agreement-parties div {
    margin: 0.3rem 0;
}
.agreement-addendum {
    margin: 1rem 0;
}
.agreement-addendum h3 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
}
.agreement-initials {
    text-align: right;
    font-size: 0.85rem;
}
.agreement-signatures {
    margin-top: 1.6rem;
    border-top: 1px solid currentColor;
    padding-top: 1rem;
}
.agreement-signatures h3 {
    font-size: 0.95rem;
    margin: 1rem 0 0.4rem;
}
.agreement-signer {
    margin-bottom: 0.9rem;
}
.agreement-sigline {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid currentColor;
    padding-bottom: 0.2rem;
    margin-bottom: 0.2rem;
}
@media print {
    .nav, .footer, .no-print { display: none !important; }
    .agreement { box-shadow: none; border: 0; max-width: none; }
}
