/* =====================================================================
   Vesta Plain HOA – design system
   Colors come from the association seal: forest green ring, sun yellow,
   red roofs. Status colors are reserved for dues and complaints.
   ===================================================================== */
:root {
    --ink: #17241c;
    --ink-2: #3a4a40;
    --muted: #64736a;
    --paper: #f2f4f0;
    --surface: #ffffff;
    --surface-2: #f8faf7;
    --line: #dde3dc;
    --line-2: #c9d2c8;
    --pine: #13301f;
    --pine-2: #1c4129;
    --brand: #2b6a39;
    --brand-600: #22562e;
    --brand-50: #e9f2ea;
    --sun: #e8b621;
    --roof: #b8382b;

    --paid: #23794a;   --paid-bg: #e3f2e8;
    --due: #a86c00;    --due-bg: #fcf0d4;
    --overdue: #b7342a; --overdue-bg: #fbe6e3;
    --nobill: #4a5f8f; --nobill-bg: #e7ebf5;
    --vacant: #7d8780; --vacant-bg: #eceeeb;
    --info: #22648a;   --info-bg: #e1eef6;

    --radius-lg: 14px;
    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 2px rgba(23, 36, 28, .06), 0 4px 14px rgba(23, 36, 28, .05);
    --shadow-lg: 0 18px 48px rgba(19, 48, 31, .22);
    --font: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --display: 'Archivo', 'Segoe UI', system-ui, sans-serif;
    --sidebar-w: 256px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--paper); }
img { max-width: 100%; }
a { color: var(--brand); }
h1, h2, h3, h4 { font-family: var(--display); font-stretch: 106%; line-height: 1.2; margin: 0 0 .4em; color: var(--ink); letter-spacing: -.01em; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 .8em; }
small, .small { font-size: .86rem; }
.muted { color: var(--muted); }
.num, td.num { font-family: var(--display); font-variant-numeric: tabular-nums; font-stretch: 100%; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--sun); color: var(--ink); padding: 8px 14px; z-index: 3000; border-radius: 6px; font-weight: 700; }
.skip-link:focus { left: 8px; }

/* ---------- sidebar ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--pine); color: #d8e4da; display: flex; flex-direction: column; z-index: 1100;
    background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 22px 22px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; text-decoration: none; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #000; box-shadow: 0 0 0 2px rgba(232,182,33,.55); }
.brand strong { display: block; font-family: var(--display); font-stretch: 110%; font-size: 1.02rem; letter-spacing: -.01em; }
.brand small { display: block; color: #9fb7a6; font-size: .82rem; }
.nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav a, .nav-logout { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; color: #c9d8cd; text-decoration: none; font-weight: 600; font-size: .97rem; position: relative; }
.nav a i, .nav-logout i { width: 20px; text-align: center; color: #8fae98; font-size: .98rem; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.is-active { background: rgba(232,182,33,.13); color: #fff; }
.nav a.is-active i { color: var(--sun); }
.nav a.is-active::before { content: ''; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--sun); }
.sidebar-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.nav-logout:hover { background: rgba(184,56,43,.18); color: #fff; }
.sidebar-scrim { display: none; }

/* ---------- shell ---------- */
.shell { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 900; display: flex; align-items: center; gap: 16px; padding: 14px 32px; background: rgba(242,244,240,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 1.45rem; font-weight: 750; margin: 0; }
.topbar-title p { margin: 2px 0 0; color: var(--muted); font-size: .93rem; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.today { color: var(--muted); font-size: .9rem; display: flex; gap: 7px; align-items: center; white-space: nowrap; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; text-decoration: none; position: relative; flex: none; font-size: .95rem; }
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); }
.bell .dot { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--roof); color: #fff; font-size: .7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--paper); }
.me { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 3px 10px 3px 3px; border-radius: 30px; border: 1px solid var(--line); background: var(--surface); }
.me img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--brand-50); }
.me strong { display: block; font-size: .9rem; line-height: 1.15; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me small { display: block; color: var(--muted); font-size: .77rem; line-height: 1.2; }
.menu-btn { display: none; }
.content { padding: 26px 32px 40px; flex: 1; width: 100%; max-width: 1360px; }
.footer { padding: 18px 32px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .lead { margin: 0; color: var(--ink-2); max-width: 70ch; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); margin-bottom: 22px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 1.06rem; display: flex; align-items: center; gap: 10px; }
.card-head h2 i { color: var(--brand); font-size: .95rem; }
.card-head .sub { color: var(--muted); font-size: .88rem; margin: 2px 0 0; }
.card-body { padding: 20px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.grid { display: grid; gap: 22px; align-items: start; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.grid-side { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }
.grid > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 22px; }

/* ---------- KPI figures ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.kpi-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.kpi-label i { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand); font-size: .85rem; }
.kpi-value { font-family: var(--display); font-stretch: 104%; font-weight: 750; font-size: 1.75rem; margin-top: 8px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; overflow-wrap: anywhere; }
.kpi-note { color: var(--muted); font-size: .86rem; margin-top: 4px; }
.kpi.is-paid .kpi-label i { background: var(--paid-bg); color: var(--paid); }
.kpi.is-due .kpi-label i { background: var(--due-bg); color: var(--due); }
.kpi.is-overdue .kpi-label i { background: var(--overdue-bg); color: var(--overdue); }
.kpi.is-info .kpi-label i { background: var(--info-bg); color: var(--info); }
.kpi.is-overdue .kpi-value { color: var(--overdue); }

/* the one bold element: this month's dues standing as a house strip */
.standing { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 28px; align-items: center; padding: 22px 24px; border-radius: var(--radius-lg); color: #fff; margin-bottom: 22px;
    background: var(--pine-2); background-image: radial-gradient(circle at 100% 0, rgba(232,182,33,.25), transparent 45%); box-shadow: var(--shadow); }
.standing h2 { color: #fff; font-size: 1.5rem; font-stretch: 112%; margin: 0 0 4px; }
.standing p { color: #cfe0d3; margin: 0; }
.standing .amount { font-family: var(--display); font-stretch: 108%; font-size: 2.3rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; text-align: right; }
.standing .amount small { display: block; font-family: var(--font); font-size: .85rem; font-weight: 600; color: #cfe0d3; letter-spacing: 0; margin-top: 6px; }
.standing.is-paid { background-color: #1d5a35; }
.standing.is-overdue { background-color: #6e231b; background-image: radial-gradient(circle at 100% 0, rgba(255,170,150,.25), transparent 45%); }
.collection-bar { grid-column: 1 / -1; height: 12px; border-radius: 8px; background: rgba(255,255,255,.14); display: flex; overflow: hidden; }
.collection-bar span { display: block; height: 100%; }
.collection-legend { grid-column: 1 / -1; display: flex; gap: 18px; flex-wrap: wrap; color: #d6e5da; font-size: .9rem; }
.collection-legend b { color: #fff; font-family: var(--display); }
.swatch { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent; font: 600 .95rem/1.2 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-secondary { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(23,36,28,.06); }
.btn-danger { background: var(--surface); color: var(--overdue); border-color: #ebc1bb; }
.btn-danger:hover { background: var(--overdue-bg); }
.btn-pay { background: var(--paid); color: #fff; }
.btn-pay:hover { background: #1b623b; }
.btn-sm { padding: 6px 11px; font-size: .86rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label, .label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 5px; color: var(--ink-2); }
.field .hint { color: var(--muted); font-size: .84rem; margin-top: 4px; }
.input, input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=month], input[type=search], input[type=tel], select, textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font: inherit; font-size: .97rem; color: var(--ink); background: #fff; }
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43,106,57,.16); }
input[type=file] { font-size: .9rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.toolbar .grow { flex: 1; }
.toolbar input[type=search], .toolbar select { width: auto; min-width: 180px; }
.search { position: relative; }
.search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; }
.search input { padding-left: 34px; min-width: 240px; }
.month-picker { display: inline-flex; align-items: center; gap: 6px; }
.month-picker input { width: 168px; font-weight: 600; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 16px; overflow-x: auto; }
.tabs a { padding: 12px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { color: var(--ink); border-color: var(--brand); }
.tabs .count { background: var(--paper); border-radius: 10px; padding: 0 7px; font-size: .78rem; color: var(--ink-2); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .86rem; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: #fafcf9; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .right, .table td.num { text-align: right; }
.table th.right { text-align: right; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line-2); }
.person { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.person img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--brand-50); flex: none; }
.person strong { display: block; line-height: 1.2; }
.person small { color: var(--muted); }
.clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: .83rem; font-weight: 700; white-space: nowrap; }
.badge i { font-size: .74rem; }
.badge-paid { background: var(--paid-bg); color: var(--paid); }
.badge-due { background: var(--due-bg); color: var(--due); }
.badge-overdue { background: var(--overdue-bg); color: var(--overdue); }
.badge-nobill { background: var(--nobill-bg); color: var(--nobill); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--vacant-bg); color: var(--vacant); }
.badge-role { background: #f6eccf; color: #7a5b00; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); font-size: .82rem; color: var(--ink-2); }

/* ---------- alerts & notes ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; font-weight: 600; }
.alert i { margin-top: 3px; }
.alert-success { background: var(--paid-bg); color: #1a5c38; border-color: #bfdfca; }
.alert-error { background: var(--overdue-bg); color: #8e2a22; border-color: #efc3bd; }
.alert-info { background: var(--info-bg); color: #1b5072; border-color: #bcd8ea; }
.note { padding: 14px 16px; background: #fbf6e3; border: 1px solid #efe0a8; border-radius: var(--radius); color: #5d4a0c; white-space: pre-line; }
.note strong { display: block; margin-bottom: 4px; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty i { font-size: 2rem; color: var(--line-2); display: block; margin-bottom: 10px; }
.empty strong { display: block; color: var(--ink-2); font-size: 1.02rem; margin-bottom: 4px; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.list li:last-child { border-bottom: 0; }
.list .ico { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--brand-50); color: var(--brand); font-size: .9rem; }
.list .ico.is-paid { background: var(--paid-bg); color: var(--paid); }
.list .ico.is-due { background: var(--due-bg); color: var(--due); }
.list .ico.is-info { background: var(--info-bg); color: var(--info); }
.list .grow { flex: 1; min-width: 0; }
.list .meta { color: var(--muted); font-size: .85rem; }
.list li.unread { background: #fbfdf9; }
.list li.unread .grow strong::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--roof); margin-left: 8px; vertical-align: 2px; }

.dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 14px; margin: 0; }
.dl dt { color: var(--muted); font-weight: 600; font-size: .92rem; }
.dl dd { margin: 0; font-weight: 600; }

.reply { margin-top: 10px; padding: 10px 14px; border-left: 3px solid var(--brand); background: var(--brand-50); border-radius: 0 8px 8px 0; }
.reply b { display: block; font-size: .85rem; color: var(--brand-600); }

.progress { height: 8px; border-radius: 6px; background: var(--paper); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--paid); border-radius: 6px; }

/* month strip (resident 12-month history) */
.months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.months .m { border-radius: 8px; padding: 8px 4px; text-align: center; font-size: .78rem; font-weight: 700; background: var(--vacant-bg); color: var(--vacant); }
.months .m span { display: block; font-size: .72rem; font-weight: 600; opacity: .85; }
.months .m.paid { background: var(--paid-bg); color: var(--paid); }
.months .m.pending { background: var(--due-bg); color: var(--due); }
.months .m.overdue { background: var(--overdue-bg); color: var(--overdue); }

/* bar chart (reports) */
.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; align-items: end; height: 220px; padding: 10px 4px 0; border-bottom: 1px solid var(--line-2); }
.bar { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.bar .billed { background: #dfe6de; border-radius: 6px 6px 0 0; position: relative; min-height: 2px; }
.bar .collected { position: absolute; left: 22%; right: 22%; bottom: 0; background: var(--brand); border-radius: 5px 5px 0 0; }
.bar.is-current .collected { background: var(--sun); }
.bar-labels { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; margin-top: 6px; text-align: center; font-size: .78rem; color: var(--muted); }

/* ---------- modal ---------- */
dialog.modal { border: 0; padding: 0; border-radius: var(--radius-lg); width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--ink); }
dialog.modal::backdrop { background: rgba(14, 30, 20, .5); backdrop-filter: blur(2px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.1rem; }
.modal-body { padding: 18px 20px; max-height: 70vh; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); }
.summary-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.summary-box .row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.summary-box .row.total { border-top: 1px dashed var(--line-2); margin-top: 6px; padding-top: 8px; font-weight: 700; }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-art { position: relative; background: var(--pine); color: #fff; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.auth-art svg.plan { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .95; }
.auth-art .photo { position: absolute; inset: 0; background-size: cover; background-position: 56% 55%; }
.auth-art .photo::after { content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(19,48,31,.78) 0%, rgba(19,48,31,.25) 28%, rgba(19,48,31,.30) 55%, rgba(19,48,31,.94) 100%); }
.auth-art .photo-credit { position: absolute; right: 14px; bottom: 10px; z-index: 1; font-size: .72rem; color: rgba(255,255,255,.7); }
.auth-art .top, .auth-art .bottom { position: relative; z-index: 1; }
.auth-art .top { display: flex; align-items: center; gap: 14px; }
.auth-art .top img { width: 58px; height: 58px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(232,182,33,.6); }
.auth-art .top strong { font-family: var(--display); font-stretch: 112%; font-size: 1.2rem; display: block; }
.auth-art .top small { color: #b9cfbf; }
.auth-art h2 { color: #fff; font-size: clamp(1.8rem, 3.2vw, 2.6rem); font-stretch: 115%; font-weight: 800; max-width: 15ch; margin-bottom: 12px; }
.auth-art .bottom p { color: #cfe0d3; max-width: 44ch; font-size: 1.05rem; }
.auth-art .legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .9rem; color: #d6e5da; margin-top: 14px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form .box { width: 100%; max-width: 420px; }
.auth-form h1 { font-size: 1.9rem; font-stretch: 110%; font-weight: 800; }
.auth-form .sub { color: var(--muted); margin-bottom: 24px; }
.auth-form .btn-primary { width: 100%; padding: 12px; font-size: 1rem; }
.auth-form .alt { margin-top: 18px; text-align: center; color: var(--muted); }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px 8px; }

/* ---------- receipt ---------- */
.receipt { max-width: 640px; margin: 30px auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.receipt-head { display: flex; gap: 16px; align-items: center; padding: 24px 28px; border-bottom: 2px solid var(--pine); }
.receipt-head img { width: 64px; height: 64px; border-radius: 50%; }
.receipt-head h1 { font-size: 1.3rem; margin: 0; font-stretch: 110%; }
.receipt-head p { margin: 0; color: var(--muted); font-size: .9rem; }
.receipt-head .or { margin-left: auto; text-align: right; }
.receipt-head .or b { display: block; font-family: var(--display); font-size: 1.3rem; color: var(--roof); }
.receipt-body { padding: 24px 28px; }
.receipt .total { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 0 0; margin-top: 16px; border-top: 1px dashed var(--line-2); font-weight: 700; }
.receipt .total b { font-family: var(--display); font-size: 1.8rem; }
.receipt .sig { display: flex; justify-content: space-between; gap: 30px; margin-top: 44px; }
.receipt .sig div { flex: 1; border-top: 1px solid var(--ink-2); padding-top: 6px; text-align: center; font-size: .85rem; color: var(--muted); }
.receipt-actions { text-align: center; margin: 0 0 30px; display: flex; justify-content: center; gap: 10px; }
.stamp { display: inline-block; border: 2px solid var(--paid); color: var(--paid); padding: 2px 10px; border-radius: 6px; font-family: var(--display); font-weight: 800; transform: rotate(-4deg); }

/* ---------- map pages ---------- */
.map-card { overflow: hidden; }
.map-box { height: calc(100vh - 260px); min-height: 460px; background: #d9e3d4; }
.map-box.small { height: 560px; min-height: 0; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); font-size: .88rem; color: var(--ink-2); }
.legend .swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0,0,0,.15); }
.leaflet-container { font-family: var(--font); background: #d9e3d4; }
.table td.nowrap { white-space: nowrap; }
.block-tag { background: rgba(19,48,31,.85); color: #fff; font: 700 11px/1 var(--display); padding: 3px 7px; border-radius: 5px; white-space: nowrap; transform: translate(-50%, -50%); display: inline-block; pointer-events: none; }
.maptype { background: #fff; border-radius: 9px; box-shadow: 0 2px 8px rgba(0,0,0,.2); display: flex; overflow: hidden; }
.maptype button { border: 0; background: #fff; padding: 8px 12px; font: 600 13px var(--font); cursor: pointer; color: var(--ink-2); }
.maptype button.on { background: var(--pine); color: #fff; }
.sv-btn { width: 40px; height: 40px; border-radius: 9px; border: 0; background: #fff; color: #d48a00; box-shadow: 0 2px 8px rgba(0,0,0,.2); cursor: pointer; font-size: 18px; }
.sv-btn.on { background: #d48a00; color: #fff; }
.cursor-cross, .cursor-cross .leaflet-interactive { cursor: crosshair !important; }
.photo-pin { display: flex; flex-direction: column; align-items: center; }
.photo-card { width: 72px; background: #fff; border-radius: 8px; box-shadow: 0 3px 10px rgba(0,0,0,.3); overflow: hidden; border: 2px solid #fff; position: relative; }
.photo-card img { width: 100%; height: 48px; object-fit: cover; display: block; }
.photo-card .status-bar { height: 5px; }
.photo-card .photo-label { font: 700 10px/1.2 var(--font); text-align: center; padding: 2px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-marker.selected .photo-card { border-color: var(--sun); }
.pin-tip { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid #fff; }
.me-pin { background: var(--roof); color: #fff; font: 700 12px/1 var(--display); padding: 6px 10px; border-radius: 8px; white-space: nowrap; box-shadow: 0 3px 10px rgba(0,0,0,.3); transform: translate(-50%, -140%); display: inline-block; position: relative; }
.me-pin::after { content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--roof); border-bottom: 0; }
.vx { background: #fff; border: 2px solid #d48a00; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.4); cursor: grab; }
.vx-mid { background: #e8b621; border: 2px solid #fff; border-radius: 50%; opacity: .9; cursor: copy; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.vx-first { background: #2b6a39; border-color: #fff; }
.align-handle { background: #2563eb; color: #fff; border-radius: 50%; display: flex !important; align-items: center; justify-content: center; font: 700 11px var(--font); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.align-handle.move { background: #f59e0b; font-size: 18px; }

.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 0; }
.map-side { border-left: 1px solid var(--line); display: flex; flex-direction: column; max-height: calc(100vh - 200px); min-height: 460px; }
.map-side .side-scroll { overflow-y: auto; flex: 1; }
.map-side .side-head { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.map-side .side-body { padding: 16px 18px; }
.lot-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lot-title h3 { font-size: 1.2rem; margin: 0; }
.hist { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; margin: 8px 0 14px; }
.hist div { border-radius: 7px; padding: 6px 2px; text-align: center; font-size: .72rem; font-weight: 700; background: var(--vacant-bg); color: var(--vacant); }
.hist div.paid { background: var(--paid-bg); color: var(--paid); }
.hist div.pending { background: var(--due-bg); color: var(--due); }
.hist div.overdue { background: var(--overdue-bg); color: var(--overdue); }
.map-tools { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); align-items: center; }
.map-tools .btn.is-on { background: var(--pine); color: #fff; border-color: var(--pine); }
.map-tools .sep { width: 1px; height: 26px; background: var(--line-2); margin: 0 4px; }
.status-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.status-strip button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px 5px 9px; font: 600 .86rem var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); }
.status-strip button b { font-family: var(--display); color: var(--ink); }
.status-strip button.is-off { opacity: .45; }
.banner > span { flex: 1 1 300px; }
.banner { padding: 10px 16px; background: #fbf6e3; border-bottom: 1px solid #efe0a8; color: #5d4a0c; font-size: .92rem; display: none; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner.show { display: flex; }
.sv-panel { border-bottom: 1px solid var(--line); background: #0f1f15; color: #fff; }
.sv-panel[hidden] { display: none; }
.sv-head { display: flex; align-items: center; gap: 16px; padding: 12px 16px; flex-wrap: wrap; }
.sv-where { flex: 1 1 220px; min-width: 0; }
.sv-block { display: block; font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 1.5rem; line-height: 1.1; color: var(--sun); }
.sv-near { display: block; color: #c9d8cd; font-size: .9rem; }
.sv-sides { display: flex; gap: 8px; flex-wrap: wrap; }
.sv-sides div { background: rgba(255,255,255,.08); border-radius: 9px; padding: 6px 12px; min-width: 120px; }
.sv-sides div.is-front { background: rgba(232,182,33,.2); box-shadow: inset 0 0 0 1px rgba(232,182,33,.6); }
.sv-sides small { display: block; color: #a9c0b0; font-size: .75rem; font-weight: 600; }
.sv-sides b { font-family: var(--display); font-size: .98rem; white-space: nowrap; }
.sv-head .icon-btn { background: rgba(255,255,255,.1); border-color: transparent; color: #fff; }
.sv-body { position: relative; height: 440px; background: #1d2b22; }
.sv-body iframe { width: 100%; height: 100%; border: 0; display: block; }
.sv-controls { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 6px; background: rgba(15,31,21,.85); padding: 6px; border-radius: 12px; }
.sv-controls button { border: 0; background: rgba(255,255,255,.1); color: #fff; border-radius: 8px; padding: 8px 12px; font: 600 .85rem var(--font); cursor: pointer; display: inline-flex; gap: 7px; align-items: center; }
.sv-controls button:hover { background: var(--sun); color: var(--ink); }
.sv-foot { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 8px 16px; font-size: .84rem; color: #b9cfbf; flex-wrap: wrap; }
.sv-foot a { color: var(--sun); font-weight: 600; }
.leaflet-tooltip.sv-tip { background: #e8b621; border: 0; color: #17241c; font-weight: 800; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.leaflet-tooltip.sv-tip::before { border-top-color: #e8b621; }
@media (max-width: 640px) { .sv-body { height: 300px; } .sv-controls span { display: none; } .sv-sides div { min-width: 0; flex: 1; } }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--pine); color: #fff; padding: 11px 18px; border-radius: 10px; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 4000; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-main, .grid-side { grid-template-columns: minmax(0, 1fr); }
    .today { display: none; }
}
@media (max-width: 980px) {
    .sidebar { transform: translateX(-100%); transition: transform .25s; }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1050; }
    .shell { margin-left: 0; }
    .menu-btn { display: inline-flex; }
    .topbar { padding: 12px 16px; }
    .content { padding: 18px 16px 32px; }
    .footer { padding: 16px; }
    .me span { display: none; }
    .me { padding: 2px; }
    .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .map-layout { grid-template-columns: minmax(0, 1fr); }
    .map-side { border-left: 0; border-top: 1px solid var(--line); max-height: none; min-height: 0; }
    .map-box { height: 62vh; }
    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth-art { min-height: 260px; padding: 28px; }
    .auth-art h2 { font-size: 1.6rem; }
    .auth-art svg.plan { opacity: .28; }
    .auth-art .photo::after { background: linear-gradient(180deg, rgba(19,48,31,.7), rgba(19,48,31,.85)); }
    .auth-art .bottom p, .auth-art .legend, .auth-art .top small { display: none; }
    .map-tools .search { flex: 1 1 100% !important; max-width: none !important; }
}
@media (max-width: 640px) {
    .kpis { grid-template-columns: minmax(0, 1fr); }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .topbar-title h1 { font-size: 1.15rem; }
    .topbar-title p { display: none; }
    .standing { grid-template-columns: minmax(0, 1fr); }
    .standing .amount { text-align: left; }
    .months { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .toolbar input[type=search], .toolbar select, .search input { min-width: 0; width: 100%; }
    .toolbar > * { flex: 1 1 100%; }
    .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .dl dd { margin-bottom: 8px; }
    .bars, .bar-labels { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- print ---------- */
@media print {
    body { background: #fff; font-size: 12px; }
    .sidebar, .topbar, .footer, .no-print, .page-actions, .toolbar, .tabs, .btn, .menu-btn, .receipt-actions { display: none !important; }
    .shell { margin: 0; }
    .content { padding: 0; max-width: none; }
    .card, .kpi, .receipt { box-shadow: none; break-inside: avoid; }
    .print-only { display: block !important; }
    .standing { color: #000; background: #fff !important; border: 1px solid #999; }
    .standing h2, .standing .amount, .standing p, .collection-legend, .collection-legend b { color: #000 !important; }
    a { color: inherit; text-decoration: none; }
}
.print-only { display: none; }
.bk-num { color: #13301f; font: 700 10px/14px var(--font); text-align: center; text-shadow: 0 0 2px #fff, 0 0 2px #fff; pointer-events: none; }
.lot-num { color: #10261a; font: 700 11px/16px var(--font); text-align: center; white-space: nowrap; pointer-events: none; text-shadow: 0 0 3px rgba(255,255,255,.95), 0 0 2px #fff; }
.leaflet-container.is-plan { background: #c9d8b9; }
.reg-done { text-align: left; }
.reg-icon { display: inline-flex; width: 56px; height: 56px; border-radius: 50%; align-items: center; justify-content: center; background: var(--info-bg); color: #1b5072; font-size: 24px; margin-bottom: 14px; }
.reg-done .alert { margin: 16px 0; }
.reg-done .btn { margin-top: 18px; }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--sun, #e8b621); color: #13301f; font: 700 11px/20px var(--font); text-align: center; }
.badge-pending { background: var(--info-bg); color: #1b5072; }
.badge-locked { background: var(--overdue-bg); color: #8e2a22; }
.pending-card { border-color: #bcd8ea; box-shadow: 0 0 0 3px var(--info-bg); margin-bottom: 18px; }
.pending-card h2 .badge { margin-left: 6px; vertical-align: middle; }

/* ---------- DataTables, matched to the system look ---------- */
.dt-container { font-size: inherit; }
.dt-container .dt-layout-row { margin: 0; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dt-container .dt-layout-row.dt-layout-table { padding: 0; display: block; overflow-x: auto; }
.dt-container .dt-layout-cell { padding: 0 !important; }
.dt-container .dt-layout-row:first-child { border-bottom: 1px solid var(--line, #e3e7df); }
.dt-container .dt-layout-row:last-child { border-top: 1px solid var(--line, #e3e7df); }
.dt-container .dt-length, .dt-container .dt-info { color: var(--muted, #5d6b60); font-size: 13px; }
.dt-container .dt-length select { margin: 0 6px; padding: 5px 26px 5px 8px; border-radius: 8px; border: 1px solid var(--line, #d6dcd2); background-color: #fff; font: inherit; width: auto; min-height: 0; }
.dt-container .dt-search input { margin: 0; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line, #d6dcd2); font: inherit; font-size: 14px; min-width: 220px; min-height: 0; }
.dt-container .dt-search input:focus, .dt-container .dt-length select:focus { outline: 3px solid var(--sun); outline-offset: 1px; }
.dt-container .dt-paging .dt-paging-button { border-radius: 8px !important; border: 1px solid transparent !important; padding: 4px 11px !important; margin-left: 3px !important; color: var(--ink, #1d2a20) !important; background: none !important; font-weight: 600; min-width: 34px; }
.dt-container .dt-paging .dt-paging-button:hover:not(.disabled) { background: var(--paid-bg, #e3f1e7) !important; border-color: transparent !important; color: var(--pine, #13301f) !important; }
.dt-container .dt-paging .dt-paging-button.current, .dt-container .dt-paging .dt-paging-button.current:hover { background: var(--brand, #2b6a39) !important; color: #fff !important; border-color: var(--brand, #2b6a39) !important; }
.dt-container .dt-paging .dt-paging-button.disabled { opacity: .35; }
table.dataTable { border-collapse: collapse !important; width: 100% !important; }
table.dataTable > thead > tr > th, table.dataTable > thead > tr > td { border-bottom: 1px solid var(--line, #e3e7df) !important; }
table.dataTable > tbody > tr > td { border-top: 1px solid var(--line, #eef1ec); }
table.dataTable.no-footer { border-bottom: 0 !important; }
table.dataTable > tbody > tr.selected > *, table.dataTable.hover > tbody > tr:hover > *, table.dataTable.display > tbody > tr:hover > * { box-shadow: none !important; }
table.dataTable thead > tr > th.dt-orderable-asc, table.dataTable thead > tr > th.dt-orderable-desc { cursor: pointer; }
table.dataTable thead > tr > th.dt-orderable-asc:hover, table.dataTable thead > tr > th.dt-orderable-desc:hover { outline: none !important; color: var(--brand, #2b6a39); }
table.dataTable th.dt-type-numeric, table.dataTable td.dt-type-numeric, table.dataTable th.dt-type-date, table.dataTable td.dt-type-date { text-align: inherit; }
table.dataTable td.num, table.dataTable th.right, table.dataTable td.right { text-align: right; }
table.dataTable td.dt-empty { padding: 0; }
/* short lists stay plain: no page size, filter, counter or page buttons until there is more than one page of rows */
.dt-container.dt-short .dt-layout-row:not(.dt-layout-table) { display: none; }
.dt-container.dt-onepage .dt-paging { visibility: hidden; }
@media print { .dt-container .dt-layout-row:not(.dt-layout-table) { display: none !important; } }
@media (max-width: 640px) { .dt-container .dt-search input { min-width: 0; width: 100%; } .dt-container .dt-layout-row { padding: 10px 12px; } }
div.dt-container.dt-empty-footer tbody > tr:last-child > *, div.dt-container.dt-empty-footer .dt-scroll-body { border-bottom: 0 !important; }
/* slimmer sort arrows so wide tables keep their action buttons in view */
table.dataTable thead > tr > th.dt-orderable-asc, table.dataTable thead > tr > th.dt-orderable-desc,
table.dataTable thead > tr > th.dt-ordering-asc, table.dataTable thead > tr > th.dt-ordering-desc { padding-right: 18px !important; }
table.dataTable thead > tr > th span.dt-column-order { right: 4px !important; width: 10px !important; opacity: .55; }
table.dataTable thead > tr > th.right span.dt-column-order { display: none; }
table.dataTable > thead > tr > th, table.dataTable > tbody > tr > td { padding-left: 10px; padding-right: 10px; }
/* status switch (Unpaid / Paid / All) */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #fff; }
.seg a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14px; border-right: 1px solid var(--line); white-space: nowrap; }
.seg a:last-child { border-right: 0; }
.seg a b { background: var(--paper, #f3f5f1); border-radius: 9px; padding: 0 7px; font-size: 12px; }
.seg a:hover { background: var(--brand-50); }
.seg a.is-on { background: var(--brand); color: #fff; }
.seg a.is-on b { background: rgba(255,255,255,.22); color: #fff; }
/* several dues selected */
.bulk-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--brand-50); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 3; }
.bulk-bar[hidden] { display: none; }
th.chk, td.chk { width: 34px; padding-right: 0 !important; }
td.chk input, th.chk input { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; }
table.dataTable .person small { display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.kpi-link { text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
a.kpi-link:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(19,48,31,.12); }
