:root {
    --primary: #1f6f5b;
    --ink: #17211d;
    --muted: #65736d;
    --line: #dbe3df;
    --surface: #ffffff;
    --soft: #f5f8f6;
    --danger: #b42318;
    --success: #067647;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--soft);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--primary); }
input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.8rem 0.9rem;
    font: inherit;
    background: #fff;
}
label { display: grid; gap: 0.4rem; font-weight: 700; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; }
pre { white-space: pre-wrap; word-break: break-word; margin: 0; }
.public-page, .login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: linear-gradient(145deg, #183a2f, #d7e5de);
}
.lead-card, .login-panel {
    width: min(100%, 560px);
    background: rgba(255, 255, 255, 0.97);
    border-radius: 8px;
    padding: clamp(1.25rem, 4vw, 2rem);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}
.lead-card.compact { text-align: center; }
.lead-card h1, .login-panel h1 { margin: 0 0 0.5rem; font-size: clamp(1.6rem, 6vw, 2.3rem); line-height: 1.08; }
.lead-card p, .login-panel p { color: var(--muted); margin: 0 0 1.4rem; }
.public-brand { color: var(--primary); font-weight: 800; margin-bottom: 1rem; }
.form-stack { display: grid; gap: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.full { grid-column: 1 / -1; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.check-row { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 500; }
.check-row input { width: auto; margin-top: 0.25rem; }
.honeypot { position: absolute; left: -9999px; height: 1px; width: 1px; }
.primary-button, .secondary-button, .danger-button {
    border: 0;
    border-radius: 6px;
    padding: 0.85rem 1rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.primary-button { background: var(--primary); color: #fff; }
.secondary-button { background: #e8efeb; color: var(--ink); }
.danger-button { background: #fee4e2; color: var(--danger); }
.small { padding: 0.65rem 0.8rem; font-size: 0.92rem; }
.link-button { border: 0; background: transparent; color: #d7e8e1; cursor: pointer; padding: 0; }
.field-error { color: var(--danger); font-size: 0.88rem; font-weight: 600; }
.alert { padding: 0.9rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.alert.success { background: #dcfae6; color: var(--success); }
.alert.danger { background: #fee4e2; color: var(--danger); }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.admin-sidebar { background: #10231c; color: #fff; padding: 1.25rem; display: flex; flex-direction: column; gap: 1.25rem; }
.admin-sidebar nav { display: grid; gap: 0.3rem; }
.admin-sidebar a { color: #d7e8e1; text-decoration: none; padding: 0.75rem; border-radius: 6px; }
.admin-sidebar a.active, .admin-sidebar a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.brand { display: flex; gap: 0.75rem; align-items: center; }
.brand img { width: 36px; height: 36px; object-fit: contain; }
.admin-main { padding: clamp(1rem, 3vw, 2rem); overflow-x: auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.page-heading h1 { margin: 0; }
.actions { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.panel h2 { margin-top: 0; font-size: 1.1rem; }
.metrics-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.metrics-grid div { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; }
.metrics-grid span { display: block; font-size: 2rem; font-weight: 900; }
.metrics-grid strong { color: var(--muted); font-size: 0.9rem; }
.property-detail { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 1rem; }
.print-layout { border: 1px dashed var(--line); padding: 1rem; text-align: center; margin-bottom: 1rem; }
.print-layout img { width: min(100%, 320px); height: auto; }
.detail-list { display: grid; grid-template-columns: 150px 1fr; gap: 0.7rem 1rem; }
.detail-list dt { font-weight: 800; color: var(--muted); }
.detail-list dd { margin: 0; word-break: break-word; }
.table-wrap { overflow-x: auto; }
.status { border-radius: 999px; padding: 0.25rem 0.55rem; font-size: 0.82rem; font-weight: 800; }
.status.success { background: #dcfae6; color: var(--success); }
.status.failed { background: #fee4e2; color: var(--danger); }
.status.pending { background: #fef0c7; color: #93370d; }
.filters { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto auto auto; gap: 0.7rem; margin-bottom: 1rem; }
@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; }
    .metrics-grid, .property-detail, .filters { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .two-col, .form-grid { grid-template-columns: 1fr; }
    .page-heading { align-items: stretch; flex-direction: column; }
    th, td { padding: 0.65rem; }
}
@media print {
    .admin-sidebar, .actions, .page-heading, .panel:not(:first-child) { display: none; }
    .admin-shell { display: block; }
    .panel { border: 0; }
    .print-layout { border: 0; }
}
