:root {
  --bg: #0f1f1a;
  --bg2: #163028;
  --panel: #1c3a30;
  --line: #2f5648;
  --text: #e8f2ec;
  --muted: #9bb5a8;
  --accent: #d4a54a;
  --accent2: #3d9b74;
  --danger: #e07a6a;
  --radius: 10px;
  --font: "Segoe UI", "Helvetica Neue", sans-serif;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --paper: #f4efe6;
  --ink: #1c1a17;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.tiny { font-size: .78rem; }
.wrap { width: min(1100px, calc(100% - 2rem)); margin: 0 auto; }
.narrow { width: min(640px, calc(100% - 2rem)); }
.narrow-lg { width: min(760px, calc(100% - 2rem)); }
.eyebrow {
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .72rem;
  color: var(--accent);
  margin: 0 0 .4rem;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0 0 .5rem; }
.lede { font-size: 1.15rem; max-width: 38rem; color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); padding: .55rem 1rem;
  font: inherit; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #1a1205; border-color: #b8862f; font-weight: 650; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.flash {
  background: #214639; border: 1px solid var(--line); padding: .75rem 1rem;
  border-radius: var(--radius); margin: 0 0 1rem;
}
.error-flash, .field-error { color: #ffd2ca; }
.field-error { margin: 0; }
.stack { display: grid; gap: .85rem; }
.stack label, .panel label { display: grid; gap: .3rem; font-size: .9rem; }
input, textarea, select {
  width: 100%; padding: .55rem .7rem; border-radius: 8px;
  border: 1px solid var(--line); background: #12261f; color: var(--text);
  font: inherit;
}
.check { display: flex !important; align-items: center; gap: .5rem; grid-template-columns: none; }
.check input { width: auto; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.panel {
  background: rgba(15, 31, 26, .55);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
}
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .65rem .4rem; border-bottom: 1px solid var(--line); }
.row-actions { display: flex; gap: .75rem; }
.page-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: 1rem; }
.stat-grid, .card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.stat {
  display: block; padding: 1.1rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel); color: inherit;
}
.stat:hover { text-decoration: none; border-color: var(--accent); }
.stat strong { display: block; font-size: 1.8rem; font-family: var(--serif); }
.chip-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: .25rem .7rem;
  color: var(--text);
}
.chip.is-on { background: var(--accent); color: #1a1205; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.ticks { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; display: grid; gap: .35rem; }
.addon-list { display: grid; gap: 1rem; }
.stack-row {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(140px, 220px);
  gap: .75rem;
  align-items: end;
  margin-bottom: .85rem;
}
.price-panel { margin-top: .4rem; padding-top: .85rem; border-top: 1px solid var(--line); }
.unit-plan-head, .unit-plan-row {
  display: grid;
  grid-template-columns: 110px 90px 120px 120px 80px;
  gap: .55rem;
  align-items: center;
}
.unit-plan-head {
  font-size: .75rem;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: .4rem 0 .35rem;
}
.unit-plan-row { margin-bottom: .45rem; }
.site-copyright { font-size: .78rem; color: var(--muted); padding: 1.25rem 0; text-align: center; }
.confidential { border-color: var(--accent); }
.risk-badge {
  display: inline-block; border-radius: 999px; padding: .2rem .65rem;
  font-size: .78rem; font-weight: 650; letter-spacing: .02em;
}
.risk-low { background: #214639; color: #9ee6c0; }
.risk-moderate { background: #3f3a1d; color: #e6d48a; }
.risk-elevated { background: #4a2e18; color: #f0b27a; }
.risk-high { background: #4a1f1c; color: #ffd2ca; }
.risk-factors { margin: .4rem 0 0; padding-left: 1.1rem; }
.risk-factors li { margin: .3rem 0; }

/* Public */
body.public {
  background:
    radial-gradient(1200px 600px at 10% -10%, #214639 0%, transparent 55%),
    linear-gradient(160deg, var(--bg), #0b1612 70%);
}
.pub-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--line);
  background: rgba(10, 22, 18, .88); position: sticky; top: 0; z-index: 5;
}
.pub-brand { display: flex; gap: .75rem; align-items: center; color: inherit; }
.pub-brand:hover { text-decoration: none; }
.pub-brand span { display: grid; }
.pub-nav { display: flex; gap: 1.1rem; }
.pub-nav .is-on { color: var(--accent); }
.hero { padding: 4.5rem 0 3rem; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); max-width: 14ch; }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.5rem; }
.section { padding: 2.5rem 0 3.5rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1.2rem; }
.unit-card {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: rgba(15, 31, 26, .6);
}
.unit-card-media { display: block; height: 160px; background: #12261f; }
.unit-card-media img { width: 100%; height: 160px; object-fit: cover; }
.unit-card-placeholder {
  height: 160px; display: grid; place-items: center; color: var(--muted);
  letter-spacing: .08em; text-transform: uppercase; font-size: .8rem;
}
.unit-card-body { padding: .9rem 1rem 1.1rem; }
.unit-card h3 { font-size: 1.15rem; }
.rent { font-size: 1.15rem; margin: .3rem 0; }
.rent.lg { font-size: 1.6rem; }
.filter-bar { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; margin-bottom: 1.5rem; }
.filter-bar label { min-width: 160px; }
.listing-photo { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); margin: 1rem 0; }
.listing-detail .btn { margin-top: 1rem; }
.pub-foot { border-top: 1px solid var(--line); padding: 2rem 0 0; }
.pub-foot-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.pub-foot-grid a { display: block; margin: .25rem 0; }

.brand-mark {
  width: 40px; height: 40px; border-radius: 8px;
  display: block; object-fit: cover;
  background: #0b1612;
  box-shadow: 0 0 0 1px rgba(212, 165, 74, .28);
  flex: 0 0 auto;
}
.brand-mark.sm { width: 32px; height: 32px; }
.brand-mark.lg { width: 88px; height: 88px; margin: 0 auto 1rem; border-radius: 12px; }
.brand-lockup {
  display: block;
  width: min(340px, 100%);
  height: auto;
  margin: 0 auto 1rem;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(212, 165, 74, .28);
}

.login-body { display: grid; place-items: center; padding: 2rem; }
.login-card {
  width: min(440px, 100%); text-align: center;
  background: rgba(15, 31, 26, .7); border: 1px solid var(--line);
  border-radius: 14px; padding: 1.6rem 1.5rem 2rem;
}
.login-card form { text-align: left; margin: 1.4rem 0 1rem; }

/* Hub / staff — same family as PayfastLodging */
body.staff {
  background:
    radial-gradient(1200px 600px at 10% -10%, #214639 0%, transparent 55%),
    linear-gradient(160deg, var(--bg), #0b1612 70%);
}
.app-frame { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  background: rgba(10, 22, 18, .94);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: .9rem .75rem 1rem;
}
.sidebar-brand-home { display: flex; gap: .7rem; align-items: center; color: inherit; }
.sidebar-brand-home:hover { text-decoration: none; }
.sidebar-brand-text strong { display: block; }
.platform-version { font-size: .68rem; margin-top: .15rem; }
.sidebar-user { padding: .85rem .35rem; border-bottom: 1px solid var(--line); margin-bottom: .5rem; }
.sidebar-user-label { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.side-nav { flex: 1; overflow: auto; padding: .3rem 0; }
.nav-group { margin-bottom: .8rem; }
.nav-group-label {
  font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); padding: .2rem .45rem .35rem;
}
.side-link {
  display: flex; align-items: center; gap: .55rem;
  padding: .42rem .5rem; border-radius: 8px; color: var(--text);
}
.side-link:hover { text-decoration: none; background: #214639; }
.side-link.is-active { background: #2a5344; color: var(--accent); }
.nav-glyph {
  width: 22px; text-align: center; color: var(--accent); font-size: .8rem;
}
.sidebar-end { border-top: 1px solid var(--line); padding-top: .5rem; }
.logout { margin: 0; }
.side-logout { width: 100%; background: none; border: 0; font: inherit; cursor: pointer; }
.app-main { min-width: 0; }
.mobile-topbar { display: none; }
.shell { padding: 1.4rem 1.6rem 2.5rem; max-width: 1100px; }

.legal-sheet {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid #d5cbb8;
  border-radius: 4px;
  padding: 1.4rem 1.5rem 1.6rem;
  max-width: 800px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.legal-sheet h1, .legal-sheet h2 { color: var(--ink); font-family: var(--serif); }
.legal-sheet h1 { font-size: 1.45rem; margin-bottom: .25rem; }
.legal-sheet h2 { font-size: 1rem; margin: 1.1rem 0 .4rem; border-bottom: 1px solid #c9bda8; padding-bottom: .2rem; }
.legal-sheet p, .legal-sheet li { font-size: .86rem; line-height: 1.45; margin: .35rem 0; }
.legal-kicker { letter-spacing: .12em; text-transform: uppercase; font-size: .68rem; margin: 0 0 .35rem; color: #6a5b3a; }
.legal-sub, .legal-note { font-size: .78rem; color: #4a4338; }
.legal-strong { font-weight: 650; margin-top: .7rem !important; }
.legal-line { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .35rem .45rem; }
.legal-sheet .fill {
  display: inline-block; border-bottom: 1px solid #1c1a17; min-height: 1.05em; min-width: 7rem; flex: 1;
}
.legal-sheet .fill.xs { min-width: 2.4rem; flex: 0 0 2.6rem; text-align: center; font-weight: 650; }
.legal-sheet .fill.sm { min-width: 5rem; flex: 0 0 6rem; }
.legal-sheet .fill.lg { min-width: 10rem; }
.legal-sheet .fill.xl { min-width: 14rem; }
.legal-sheet .box {
  display: inline-block; width: .85rem; height: .85rem; border: 1px solid #1c1a17;
  vertical-align: -1px; margin: 0 .2rem 0 .35rem;
}
.legal-table { width: 100%; border-collapse: collapse; margin: .4rem 0 .7rem; font-size: .82rem; }
.legal-table th, .legal-table td { border: 1px solid #1c1a17; padding: .45rem .4rem; height: 1.7rem; }
.legal-table th { text-align: left; background: #efe6d4; }
.legal-ol { padding-left: 1.15rem; }
.legal-ol li { margin: .45rem 0; }
.legal-sign { margin: .85rem 0; }
.legal-doc-foot { margin-top: 1.4rem; padding-top: .6rem; border-top: 1px solid #c9bda8; font-size: .72rem; color: #4a4338; }

@media print {
  .sidebar, .mobile-topbar, .no-print, .site-copyright, .flash, .error-flash { display: none !important; }
  .app-frame { display: block; background: #fff; }
  .app-main, .shell { padding: 0; max-width: none; }
  body.staff, .app-main, .shell { background: #fff; color: #000; }
  .legal-sheet {
    border: 0; border-radius: 0; padding: 0; max-width: none;
    box-shadow: none; background: #fff;
  }
  .legal-sheet .fill { border-bottom-color: #000; }
  a[href]::after { content: none !important; }
  @page { margin: .6in; }
}

@media (max-width: 900px) {
  .unit-plan-head { display: none; }
  .unit-plan-row { grid-template-columns: 1fr 1fr; }
  .app-frame { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .side-nav { display: flex; flex-wrap: wrap; gap: .2rem; }
  .nav-group { margin: 0; }
  .nav-group-label { display: none; }
  .mobile-topbar { display: none; }
  .pub-foot-grid { grid-template-columns: 1fr; }
}
