:root {
  --navy: #002d50;
  --navy-dark: #001d33;
  --emerald: #00cf91;
  --emerald-dark: #00a574;
  --ink: #0b1f2e;
  --mute: #5b7186;
  --line: #e4ebf1;
  --bg: #f6f9fb;
  --white: #fff;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 45, 80, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
a { text-decoration: none; }

/* Nav */
.nav { background: var(--white); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: baseline; gap: 8px; }
.logo-center { justify-content: center; margin-bottom: 12px; }
.logo-word { font-weight: 800; font-size: 22px; letter-spacing: -0.5px; color: var(--navy); }
.logo-by { font-size: 12px; color: var(--mute); }
.logo-hex {
  width: 18px; height: 20px; align-self: center;
  background: var(--emerald);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

/* Buttons */
.btn { display: inline-block; padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 14px; cursor: pointer; transition: .15s; }
.btn-solid { background: var(--emerald); color: var(--navy-dark); }
.btn-solid:hover { background: var(--emerald-dark); color: #fff; }
.btn-line { border: 1px solid rgba(255,255,255,.5); color: #fff; }
.btn-line:hover { background: rgba(255,255,255,.12); }
.btn-ghost { color: var(--navy); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--navy); }
.full { width: 100%; text-align: center; }

/* Hero */
.hero {
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(0,207,145,.35), transparent 60%),
    linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 55%, #013a2e 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0; opacity: .12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'%3E%3Cpath fill='none' stroke='%2300cf91' stroke-width='1.5' d='M28 1L54 16v32L28 63 2 48V16z'/%3E%3C/svg%3E");
  background-size: 56px 64px;
}
.hero-inner { position: relative; padding: 84px 24px 92px; }
.badge {
  display: inline-block; background: rgba(0,207,145,.16); color: var(--emerald);
  border: 1px solid rgba(0,207,145,.4); padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase;
}
.hero h1 { font-size: 64px; margin: 18px 0 6px; letter-spacing: -2px; font-weight: 800; }
.tagline { font-size: 22px; color: var(--emerald); font-weight: 600; margin: 0 0 14px; }
.sub { font-size: 16px; max-width: 560px; color: rgba(255,255,255,.82); margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin: -44px auto 8px; position: relative; z-index: 2; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat { padding: 20px; text-align: center; }
.stat-num { font-size: 30px; font-weight: 800; color: var(--navy); letter-spacing: -1px; }
.stat-label { font-size: 12px; color: var(--mute); margin-top: 4px; text-transform: uppercase; letter-spacing: .4px; }
.stat.accent { background: var(--navy); border-color: var(--navy); }
.stat.accent .stat-num { color: var(--emerald); }
.stat.accent .stat-label { color: rgba(255,255,255,.7); }

/* Table */
.section-title { margin: 40px 0 14px; font-size: 18px; color: var(--navy); }
.table-card { padding: 6px 6px; margin-bottom: 60px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--mute); padding: 14px 16px; border-bottom: 1px solid var(--line); }
td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
tr:last-child td { border-bottom: none; }
.strong { font-weight: 700; color: var(--navy); }
.muted { color: var(--mute); }
.center { text-align: center; }
.pill { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .3px; }
.pill-commercial { background: rgba(0,45,80,.08); color: var(--navy); }
.pill-residential { background: rgba(0,207,145,.16); color: var(--emerald-dark); }
.pill-mixed { background: #fff3d6; color: #9a6b00; }

/* Footer */
.foot { border-top: 1px solid var(--line); background: var(--white); padding: 22px 0; font-size: 13px; color: var(--mute); }
.foot strong { color: var(--navy); }

/* Auth */
.centered { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--navy), var(--emerald-dark)); }
.auth-card { padding: 36px; width: 360px; text-align: center; }

/* App shell */
.app { background: var(--bg); min-height: 100vh; }
.topbar { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.app-main { padding: 28px 24px 64px; }
.app-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 22px; }
.app-head h1 { font-size: 26px; margin: 0; color: var(--navy); letter-spacing: -0.5px; }
.back { display: inline-block; color: var(--mute); font-size: 13px; margin-bottom: 14px; }
.back:hover { color: var(--navy); }
.app-stats { grid-template-columns: repeat(4, 1fr); margin: 0 0 28px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.complex-card { padding: 18px 20px; display: block; transition: .15s; }
.complex-card:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(0, 45, 80, .12); }
.cc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cc-stats { display: flex; justify-content: space-between; font-size: 13px; color: var(--mute); margin-bottom: 12px; }
.bar { height: 7px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--emerald); }
.pill-master { background: rgba(0, 45, 80, .1); color: var(--navy); }
.pill-manager { background: rgba(0, 207, 145, .16); color: var(--emerald-dark); }
.pill-viewer { background: #eef2f6; color: var(--mute); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.dot-occupied { background: var(--emerald); }
.dot-vacant { background: #c7d2dd; }
.row-vacant td { color: var(--mute); }
.alert { background: #fde8e8; color: #a12020; border: 1px solid #f5c2c2; padding: 10px 12px; border-radius: 9px; font-size: 13px; margin: 4px 0 4px; text-align: left; }
.auth-card label { display: block; text-align: left; font-size: 13px; font-weight: 600; color: var(--navy); margin: 12px 0 0; }
.auth-card input { width: 100%; padding: 11px 12px; margin-top: 5px; border: 1px solid var(--line); border-radius: 9px; font-size: 15px; }
.auth-card input:focus { outline: none; border-color: var(--emerald); }
.auth-card button { margin-top: 18px; border: none; }
.small { font-size: 12px; margin-top: 14px; }

.topnav { display: flex; gap: 20px; margin-left: 6px; flex: 1; }
.topnav a { color: var(--mute); font-size: 14px; font-weight: 600; }
.topnav a:hover { color: var(--navy); }
.link { color: var(--emerald-dark); font-weight: 600; font-size: 13px; }
.link:hover { text-decoration: underline; }
.owe { color: #c0392b; }
.ok { color: var(--emerald-dark); }
.over { color: #9a6b00; }
.rate { font-weight: 700; color: var(--navy); }
.ledger-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 8px; }
.pay-card { padding: 22px; }
.pay-card h3 { margin: 0 0 10px; color: var(--navy); }
.pay-card label { display: block; text-align: left; font-size: 13px; font-weight: 600; color: var(--navy); margin: 12px 0 0; }
.pay-card select { width: 100%; padding: 11px 12px; margin-top: 5px; border: 1px solid var(--line); border-radius: 9px; font-size: 15px; background: #fff; }
.money-input { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 9px; margin-top: 5px; overflow: hidden; }
.money-input span { padding: 0 12px; color: var(--mute); background: var(--bg); display: flex; align-items: center; }
.money-input input { border: none; padding: 12px; font-size: 16px; width: 100%; }
.money-input input:focus { outline: none; }
.pay-card button { margin-top: 16px; border: none; }
.balance-card { padding: 22px; display: flex; flex-direction: column; justify-content: center; }
.balance-card.owing { background: linear-gradient(135deg, #fff, #fff5f5); }
.balance-num { font-size: 38px; font-weight: 800; color: var(--navy); letter-spacing: -1px; margin: 4px 0; }
.balance-card.owing .balance-num { color: #c0392b; }
.total-row td { border-top: 2px solid var(--line); background: var(--bg); }
.narrow { max-width: 520px; }
.receipt { padding: 28px; }
.receipt-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed var(--line); padding-bottom: 14px; }
.receipt-no { font-weight: 700; color: var(--mute); }
.receipt-amt { font-size: 42px; font-weight: 800; color: var(--navy); text-align: center; margin: 18px 0 2px; letter-spacing: -1px; }
.receipt-tbl { width: 100%; margin: 16px 0; border-collapse: collapse; }
.receipt-tbl td { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.receipt-tbl td:first-child { color: var(--mute); }
.receipt-tbl td:last-child { text-align: right; font-weight: 600; }
.receipt-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.auth-title { color: var(--navy); margin: 6px 0; }
.bar-fill { display: block; height: 100%; background: var(--emerald); width: 0; }
.stmt-btn { margin-top: 14px; align-self: flex-start; }

@media (max-width: 840px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .app-stats { grid-template-columns: repeat(2, 1fr); }
  .ledger-grid { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .hero h1 { font-size: 46px; }
}

/* ---- Theme toggle ---- */
.nav-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  background: transparent; border: 1px solid var(--line); border-radius: 8px;
  width: 34px; height: 34px; cursor: pointer; font-size: 15px; line-height: 1;
  color: var(--ink); display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { border-color: var(--emerald); }

/* ---- Dark mode ---- (brand navy+emerald stay; neutrals invert) */
[data-theme="dark"] {
  --bg: #0b1620;
  --white: #14242f;
  --ink: #e7eef4;
  --mute: #8da3b3;
  --line: #213441;
}
[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
[data-theme="dark"] .logo-word,
[data-theme="dark"] .stat-num,
[data-theme="dark"] .section-title,
[data-theme="dark"] .app-head h1,
[data-theme="dark"] .strong,
[data-theme="dark"] td.strong,
[data-theme="dark"] .rate,
[data-theme="dark"] .balance-num,
[data-theme="dark"] .receipt-amt,
[data-theme="dark"] .auth-title,
[data-theme="dark"] .foot strong,
[data-theme="dark"] .pay-card h3 { color: var(--ink); }
[data-theme="dark"] a.link, [data-theme="dark"] td.strong a { color: var(--emerald); }
[data-theme="dark"] .btn-ghost { color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .btn-ghost:hover { border-color: var(--emerald); }
[data-theme="dark"] input, [data-theme="dark"] select { background: var(--bg); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .money-input { border-color: var(--line); }
[data-theme="dark"] .money-input span { background: var(--bg); color: var(--mute); }
[data-theme="dark"] .pill-master { color: #9fd0ea; background: rgba(120, 180, 210, .16); }
[data-theme="dark"] .pill-commercial { color: #cfe0ee; background: rgba(120, 150, 180, .18); }
[data-theme="dark"] .balance-card.owing { background: linear-gradient(135deg, var(--white), #2a1414); }
[data-theme="dark"] .total-row td { background: rgba(255, 255, 255, .04); }
[data-theme="dark"] .owe { color: #ff7a6b; }
[data-theme="dark"] .receipt-head { border-color: var(--line); }
[data-theme="dark"] .dot-vacant { background: #3a4f5e; }
[data-theme="dark"] .pay-card label,
[data-theme="dark"] .auth-card label,
[data-theme="dark"] .complex-pick legend,
[data-theme="dark"] .check { color: var(--ink); }

/* ---- Team admin ---- */
.team-form { max-width: 460px; margin-bottom: 8px; }
.pay-card label > input { width: 100%; padding: 11px 12px; margin-top: 5px; border: 1px solid var(--line); border-radius: 9px; font-size: 15px; background: var(--white); color: var(--ink); box-sizing: border-box; }
.pay-card label > input:focus { outline: none; border-color: var(--emerald); }
.complex-pick { border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; margin: 14px 0 0; }
.complex-pick legend { font-size: 12px; color: var(--mute); padding: 0 6px; }
.check { display: block !important; font-weight: 500 !important; color: var(--ink); margin: 6px 0 !important; font-size: 14px; }
.check input { width: auto; margin-right: 8px; }
.row-actions { display: flex; gap: 14px; }
.inline-form { display: inline; }
.inline-form .link { background: none; border: none; cursor: pointer; padding: 0; font-family: inherit; }
.alert-ok { background: rgba(0, 207, 145, .12); color: var(--emerald-dark); border: 1px solid rgba(0, 207, 145, .4); padding: 11px 13px; border-radius: 9px; font-size: 13px; margin-bottom: 16px; }
[data-theme="dark"] .alert-ok { color: #6fe0bd; }
.pw { background: var(--bg); padding: 2px 8px; border-radius: 6px; font-weight: 700; font-family: ui-monospace, monospace; }

/* ---- Landing feature cards (no operator data) ---- */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: -44px auto 48px; position: relative; z-index: 2; }
.feature { padding: 24px; }
.feature-ico { font-size: 24px; margin-bottom: 8px; }
.feature h3 { margin: 0 0 6px; color: var(--navy); font-size: 17px; }
.feature p { margin: 0; color: var(--mute); font-size: 14px; line-height: 1.55; }
[data-theme="dark"] .feature h3 { color: var(--ink); }

/* smooth anchor scroll + centered section titles */
html { scroll-behavior: smooth; }
.section-title.center { text-align: center; display: block; }

/* problem → fix band */
.band { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 60px 24px; }
.band-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.band h2 { font-size: 30px; color: var(--navy); letter-spacing: -1px; margin: 0 0 14px; }
[data-theme="dark"] .band h2 { color: var(--ink); }
.band > .wrap > p, .band-inner > p { font-size: 17px; color: var(--mute); margin: 0 auto 26px; max-width: 600px; }
.quote { background: var(--bg); border-left: 3px solid var(--emerald); border-radius: 10px; padding: 18px 22px; font-size: 15px; color: var(--ink); text-align: left; max-width: 640px; margin: 0 auto; line-height: 1.6; }
.quote strong { color: var(--navy); }
[data-theme="dark"] .quote strong { color: var(--emerald); }

/* how it works */
.how { padding: 60px 24px 20px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 26px; }
.step { text-align: center; padding: 0 10px; }
.step-n { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--emerald); color: var(--navy-dark); font-weight: 800; font-size: 17px; margin-bottom: 14px; }
.step h3 { color: var(--navy); font-size: 17px; margin: 0 0 6px; }
[data-theme="dark"] .step h3 { color: var(--ink); }
.step p { color: var(--mute); font-size: 14px; margin: 0; line-height: 1.55; }

/* built-for chips */
.built { padding: 40px 24px 64px; text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.chip { background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; font-size: 14px; font-weight: 600; color: var(--navy); }
[data-theme="dark"] .chip { color: var(--ink); }

/* closing CTA */
.cta-band { background: linear-gradient(135deg, var(--navy) 0%, #013a2e 100%); padding: 60px 24px; }
.cta-inner { text-align: center; }
.cta-band h2 { color: #fff; font-size: 30px; letter-spacing: -1px; margin: 0 0 22px; }

@media (max-width: 840px) {
  .features { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 30px; }
  .band h2, .cta-band h2 { font-size: 25px; }
}

/* ---- Portfolio admin ---- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.manage-bar { display: flex; gap: 10px; margin-bottom: 14px; }
.add-unit { margin-bottom: 22px; }
.add-unit h3 { margin: 0 0 12px; color: var(--navy); }
[data-theme="dark"] .add-unit h3 { color: var(--ink); }
.unit-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.unit-form input, .unit-form select { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; background: var(--white); color: var(--ink); }
.unit-form .money-input { margin-top: 0; }
.unit-form input[name="code"] { flex: 1; min-width: 130px; }
.unit-form button { border: none; }
.newprop { margin-left: auto; }
.csv { font-size: 12px; margin-left: 8px; font-weight: 700; }
.link.danger { color: #c0392b; }
[data-theme="dark"] .link.danger { color: #ff7a6b; }
.narrow-wide { max-width: 640px; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-size: 15px; text-decoration: none; }
.iconbtn:hover { border-color: var(--emerald); }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-logo-lg { height: 54px; margin: 0 auto 6px; }
[data-theme="dark"] .brand-logo { background: #eef3f7; padding: 4px 9px; border-radius: 8px; }
@media (max-width: 840px) {
  .topbar-in { flex-wrap: wrap; }
  .topnav { display: flex; order: 3; width: 100%; overflow-x: auto; gap: 16px; padding-bottom: 6px; }
}
