:root {
  --ink: #0E0C0D; --ink-2: #171315; --ivory: #F7F3EE; --paper: #FBF9F6; --champagne: #EDE4D9; --sand: #D9CDBF;
  --text: #1A1517; --text-2: #3F363A; --muted: #5B5054; --on-dark: #E9DFD3; --on-dark-2: #CFC4BA;
  --gold: #C9A45C; --gold-light: #E3C78F; --gold-dark: #85662A; --wine: #6B2236; --ok: #2F6B4F; --warn: #9A5B12;
  --line: #DCD0C2; --line-dark: #2E272A;
  --display: 'Bodoni Moda', Didot, 'Bodoni 72', 'Times New Roman', serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ivory); color: var(--text); font-family: var(--body); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* ---------- top bar ---------- */
.bar { background: var(--ink); color: var(--ivory); }
.bar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.brand img { height: 40px; width: auto; display: block; }
.brand-sub { padding-left: 16px; border-left: 1px solid #3A3135; font-size: 11px; font-weight: 700; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); }
.bar-tools { display: flex; align-items: center; gap: 18px; }
.lang { display: flex; gap: 2px; }
.lang button { min-width: 36px; height: 36px; border: 0; background: none; color: var(--on-dark-2); font-size: 11px; font-weight: 700; letter-spacing: .14em; cursor: pointer; }
.lang button[aria-pressed="true"] { color: var(--gold-light); text-decoration: underline; text-underline-offset: 6px; }
.link-btn { border: 0; background: none; padding: 8px 0; color: var(--on-dark); font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }
.link-btn:hover { color: var(--gold-light); }

/* ---------- type ---------- */
.eyebrow { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--gold-dark); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; }
.h1 { margin-top: 12px; font-size: clamp(34px, 4vw, 52px); line-height: 1.08; }
.h2 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.15; }
.lead { margin: 12px 0 0; max-width: 640px; color: var(--text-2); font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 22px; border: 1px solid transparent; background: var(--ink); color: var(--ivory); font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.btn:hover { background: var(--wine); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-light); }
.btn-line { background: transparent; color: var(--text); border-color: var(--text); }
.btn-line:hover { background: var(--ink); color: var(--ivory); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 11px; }
.btn[disabled] { opacity: .5; cursor: default; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--text-2); }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); background: #fff; border-radius: 0; }
.field textarea { min-height: 90px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 16px; }
.form-actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.msg { margin: 14px 0 0; padding: 12px 14px; font-size: 14px; border-left: 3px solid var(--gold); background: var(--paper); }
.msg.err { border-color: var(--wine); color: var(--wine); }
.msg.ok { border-color: var(--ok); color: var(--ok); }

/* ---------- login ---------- */
.login { min-height: calc(100vh - 76px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login-art { display: none; } }
.login-art { position: relative; background: var(--ink) url('img/portal-cover.jpg') center 18% / cover no-repeat; }
.login-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14,12,13,.15), rgba(14,12,13,.55)); }
.login-art blockquote { position: absolute; z-index: 1; left: clamp(24px, 4vw, 56px); right: clamp(24px, 4vw, 56px); bottom: clamp(28px, 5vw, 64px); margin: 0; font-family: var(--display); font-style: italic; font-size: clamp(24px, 2.4vw, 34px); line-height: 1.3; color: var(--ivory); }
.login-box { align-self: center; width: 100%; max-width: 460px; margin: 0 auto; padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 40px); }
.login-box form { margin-top: 28px; display: flex; flex-direction: column; gap: 16px; }
.login-box .btn { width: 100%; }

/* ---------- layout ---------- */
.page { padding-top: clamp(28px, 5vw, 56px); padding-bottom: 72px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.crumbs { margin: 0 0 6px; font-size: 13px; }
.crumbs a { color: var(--gold-dark); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.kpis { margin-top: 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.kpi { padding: 20px 22px; background: #fff; }
.kpi-l { font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.kpi-v { margin-top: 6px; font-family: var(--display); font-size: clamp(26px, 2.6vw, 34px); line-height: 1.1; }
.kpi-v.net { color: var(--wine); }
.cards { margin-top: 28px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; gap: 8px; padding: 26px 24px; background: #fff; border: 1px solid var(--line); border-top: 2px solid var(--gold); text-decoration: none; transition: box-shadow .25s, transform .25s; }
a.card:hover { box-shadow: 0 14px 34px rgba(14,12,13,.08); transform: translateY(-2px); }
.card-t { font-family: var(--display); font-size: 22px; line-height: 1.25; }
.card-meta { font-size: 13px; color: var(--muted); }
.pill { align-self: flex-start; padding: 4px 10px; font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; background: var(--champagne); color: var(--gold-dark); }
.pill.ok { background: #E3EFE7; color: var(--ok); }
.pill.warn { background: #F5E7D3; color: var(--warn); }
.pill.wine { background: #F1DFE3; color: var(--wine); }
.card-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }

/* ---------- tabs ---------- */
.tabs { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 0 26px; border-bottom: 1px solid var(--line); }
.tabs button { position: relative; min-height: 48px; padding: 0; border: 0; background: none; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--gold); }
.panel { padding-top: 26px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); background: var(--paper); white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--paper); }
.neg { color: var(--wine); }
.empty { padding: 28px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); }

/* ---------- documents & media ---------- */
.docs { display: grid; gap: 10px; }
.doc { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); flex-wrap: wrap; min-width: 0; }
.doc-t { font-weight: 600; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.gallery figure { margin: 0; background: #fff; border: 1px solid var(--line); }
.gallery img, .gallery video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--sand); }
.gallery figcaption { padding: 10px 12px; font-size: 13px; color: var(--muted); }

/* ---------- statement (screen + print) ---------- */
.statement { max-width: 820px; margin: 0 auto; padding: clamp(24px, 4vw, 48px); background: #fff; border: 1px solid var(--line); }
.st-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 2px solid var(--gold); }
.st-head img { height: 46px; }
.st-title { text-align: right; }
.st-title h2 { font-size: 28px; }
.st-meta { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 28px; font-size: 14px; }
.st-meta b { display: block; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.st-table { margin-top: 26px; }
.st-total td { font-weight: 700; border-top: 2px solid var(--text); }
.st-net td { font-family: var(--display); font-size: 20px; color: var(--wine); }
.st-foot { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.print-bar { max-width: 820px; margin: 0 auto 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media print {
  .bar, .print-bar, .no-print, .tabs { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; }
  .statement { border: 0; padding: 0; max-width: none; }
}

/* ---------- admin ---------- */
.admin-nav { margin: 28px 0 8px; display: flex; flex-wrap: wrap; gap: 0 26px; border-bottom: 1px solid var(--line); }
.admin-nav a { display: inline-flex; align-items: center; min-height: 46px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; }
.admin-nav a:hover { color: var(--text); }
.admin-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--gold); }
@media (max-width: 720px) { .admin-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .admin-nav a { flex: none; } }
.box { margin-top: 24px; padding: 24px; background: #fff; border: 1px solid var(--line); }
.box h3 { font-size: 22px; margin-bottom: 14px; }
.grid-rent td, .grid-rent th { padding: 8px 10px; text-align: center; }
.grid-rent { table-layout: fixed; min-width: 900px; }
.grid-rent td:first-child, .grid-rent th:first-child { text-align: left; width: 25%; }
.grid-rent td:first-child a { font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line); }
.cell { width: 100%; min-width: 0; min-height: 40px; padding: 4px 6px; white-space: nowrap; border: 1px solid var(--line); background: #fff; font-size: 12px; cursor: pointer; }
.cell.paid { background: #E3EFE7; border-color: #BCD8C6; color: var(--ok); font-weight: 700; }
.cell.unpaid { background: #F1DFE3; border-color: #E2BCC6; color: var(--wine); font-weight: 700; }
.cell.pub::after { content: " ●"; color: var(--gold-dark); }
.legend { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 12px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; padding: 12px 18px; background: var(--ink); color: var(--ivory); font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.demo-banner { background: var(--gold); color: var(--ink); text-align: center; padding: 6px 12px; font-size: 12px; font-weight: 700; letter-spacing: .1em; }
.foot { padding: 28px 0 40px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

.prop-meta { margin-top: 10px; line-height: 1.7; }
.doc > span:first-child, .doc-t { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 16px 14px; }
  .kpi-v { font-size: 22px; }
  .kpi-l { font-size: 10px; letter-spacing: .16em; }
  .brand-sub { font-size: 10px; letter-spacing: .22em; }
}
.bar-row { padding-top: 10px; padding-bottom: 10px; }

.prop-det { margin-top: 10px; border: 1px solid var(--line); background: #fff; }
.prop-det > summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 14px 18px; cursor: pointer; font-weight: 600; list-style: none; }
.prop-det > summary::-webkit-details-marker { display: none; }
.prop-det > summary::after { content: "+"; color: var(--gold-dark); font-weight: 700; }
.prop-det[open] > summary::after { content: "–"; }
.prop-det > .box { margin: 0; border: 0; border-top: 1px solid var(--line); }
@media (max-width: 720px) { .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; } .tabs::-webkit-scrollbar { display: none; } .tabs button { flex: none; } }
