:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e1e5ee;
  --ink: #121a2b;
  --muted: #5e6880;
  --navy: #213a6b;
  --navy-soft: #dfe5f0;
  --gold: #b8913a;
  --green: #3f9a4f;
  --green-bg: #e5f5e8;
  --orange: #d3792b;
  --orange-bg: #fcefe0;
  --teal: #3d8fb2;
  --teal-bg: #e1f3f9;
  --red: #c2412d;
  --red-bg: #fde9e5;
  --radius: 14px;
  font-family: Inter, "Noto Sans Telugu", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-size: 15px; line-height: 1.4; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
.te { font-family: "Noto Sans Telugu", Inter, sans-serif; }
.num { font-variant-numeric: tabular-nums; }

.view { max-width: 1100px; margin: 0 auto; padding: 22px 16px 110px; }
.loading, .empty { color: var(--muted); text-align: center; padding: 40px 0; }
.error-box { background: var(--red-bg); color: var(--red); border-radius: var(--radius); padding: 16px; margin-top: 20px; }

/* ---------- header ---------- */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.logo { height: 34px; display: block; margin-bottom: 8px; }
.venture { color: var(--gold); font-weight: 800; letter-spacing: .14em; font-size: 17px; }
.sync { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.sync svg { width: 13px; height: 13px; }
.icon-btn { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.page-title { display: flex; align-items: baseline; gap: 10px; }
.page-title h1 { font-size: 30px; margin: 0; font-weight: 800; letter-spacing: -.02em; }
.page-title .count { color: var(--muted); font-size: 15px; }
.subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; }

svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- cards ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .label { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.stat .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.stat.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.stat.navy .label, .stat.navy .sub { color: rgba(255,255,255,.8); }
.stat.green .value { color: var(--green); } .stat.green .sub { color: color-mix(in srgb, var(--green) 70%, white); }
.stat.orange .value { color: var(--orange); } .stat.orange .sub { color: color-mix(in srgb, var(--orange) 70%, white); }
.stat.teal .value { color: var(--teal); } .stat.teal .sub { color: color-mix(in srgb, var(--teal) 70%, white); }
button.stat { text-align: left; cursor: pointer; width: 100%; }

.section { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 26px 0 10px; }

/* chips */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 9px; padding: 7px 13px; font-size: 14.5px; font-weight: 500; cursor: pointer; color: var(--muted); }
.chip.on { background: var(--navy-soft); border-color: var(--navy); color: var(--navy); font-weight: 700; }

/* badges */
.badge { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
.badge.Available { background: var(--green-bg); color: var(--green); }
.badge.Reserved { background: var(--orange-bg); color: var(--orange); }
.badge.Sold-Out { background: var(--teal-bg); color: var(--teal); }
.badge.Pending { background: var(--orange-bg); color: var(--orange); text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.badge.expired { background: var(--red-bg); color: var(--red); }
.tag { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border: 1px solid #c9d0de; background: var(--navy-soft); color: var(--navy); border-radius: 6px; font-size: 13px; font-weight: 700; }

/* search */
.search { position: relative; margin-bottom: 12px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--muted); }
.search input { width: 100%; font: inherit; font-size: 16px; padding: 13px 14px 13px 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); }
.search input:focus { outline: 2px solid color-mix(in srgb, var(--navy) 40%, transparent); }

/* plot cards */
.plot-list { display: grid; gap: 12px; }
.plot { display: block; width: 100%; text-align: left; cursor: pointer; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 14px; }
.plot:hover { border-color: #c4ccdb; }
.plot-head { display: flex; justify-content: space-between; align-items: flex-start; }
.plot .k { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.plot .no { font-size: 32px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; line-height: 1.1; }
.plot-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.plot-facts .k { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; }
.plot-facts b { font-size: 15.5px; }
.plot .chev { text-align: right; color: var(--muted); margin-top: 4px; }
.plot .chev svg { width: 18px; height: 18px; }
.bar { height: 5px; border-radius: 99px; background: var(--navy-soft); overflow: hidden; margin-top: 12px; }
.bar span { display: block; height: 100%; background: var(--navy); }

/* expenses */
.total-card { display: flex; align-items: center; gap: 14px; cursor: pointer; width: 100%; text-align: left; }
.total-card .label { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.total-card .value { font-size: 22px; font-weight: 800; flex: 1; }
.total-card .hint { color: var(--muted); font-size: 12.5px; }
.selected-bar { background: var(--navy-soft); margin: 0 -16px 12px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; }
.selected-bar .label { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); font-weight: 700; }
.selected-bar .value { font-size: 22px; font-weight: 800; color: var(--navy); }
.selected-bar .exact { font-size: 13px; color: var(--muted); margin-left: 6px; font-weight: 500; }
.clear { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; cursor: pointer; display: grid; place-items: center; }
.clear svg { width: 14px; height: 14px; stroke-width: 2.5; }
.select-all { display: flex; align-items: center; gap: 12px; width: 100%; cursor: pointer; font-weight: 700; color: var(--navy); margin-bottom: 12px; }
.select-all .muted { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 13.5px; }
.box { width: 24px; height: 24px; border-radius: 6px; border: 2px solid #b9c2d3; display: grid; place-items: center; flex: none; background: var(--card); }
.box svg { width: 15px; height: 15px; stroke-width: 3; color: #fff; display: none; }
.on > .box, .box.on { background: var(--navy); border-color: var(--navy); }
.on > .box svg, .box.on svg { display: block; }
.exp-list { display: grid; gap: 10px; }
.exp { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; background: var(--card); border: 1px solid var(--line); border-left: 4px solid #c4ccdb; border-radius: var(--radius); padding: 14px 16px; }
.exp.on { background: #e8ebf2; border-color: #a9b4c9; border-left-color: var(--navy); }
.exp .n { min-width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--green-bg); color: var(--green); flex: none; }
.exp .n.pending { background: var(--orange-bg); color: var(--orange); }
.exp .name { flex: 1; font-size: 16px; font-weight: 500; }
.exp .name small { display: block; color: var(--muted); font-size: 12.5px; font-family: Inter, sans-serif; }
.exp .amt { font-weight: 800; font-size: 17px; white-space: nowrap; }

/* recent */
.recent { display: grid; gap: 12px; }

/* bottom sheet (plot details) */
.sheet-scrim { position: fixed; inset: 0; background: rgba(15, 22, 40, .4); z-index: 30; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; background: var(--bg); border-radius: 20px 20px 0 0;
  z-index: 31; transform: translateY(100%); transition: transform .25s ease; max-width: 640px; margin: 0 auto; padding: 10px 18px 34px; }
.sheet.open { transform: none; }
.grab { width: 44px; height: 5px; border-radius: 99px; background: #c7cedb; margin: 4px auto 14px; }
.sheet .rows { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 12px; }
.sheet .row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.sheet .row:first-child { border-top: 0; }
.sheet .row span { color: var(--muted); }
.sheet .row b { text-align: right; }
.sheet .row.total b { font-size: 17px; }

/* bottom tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--bg); border-top: 1px solid var(--line); padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); }
.tabbar a { display: grid; justify-items: center; gap: 3px; padding: 8px 0 6px; text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 500; border-radius: 10px; border: 1.5px solid transparent; }
.tabbar svg { width: 28px; height: 28px; stroke-width: 1.5; }
.tabbar a.active { color: var(--navy); font-weight: 600; border-color: #3b6fd4; border-bottom: 0; border-radius: 10px 10px 0 0; }

/* wider screens */
@media (min-width: 760px) {
  .view { padding-top: 32px; }
  .dash-stats { grid-template-columns: repeat(4, 1fr); }
  .pay-stats { grid-template-columns: repeat(3, 1fr); }
  .plot-list, .recent { grid-template-columns: repeat(2, 1fr); }
  .exp-list { grid-template-columns: repeat(2, 1fr); }
  .selected-bar { margin: 0 0 12px; border-radius: var(--radius); }
  .tabbar { max-width: 560px; margin: 0 auto 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 6px 24px rgba(20, 30, 60, .08); }
  .tabbar a.active { border-radius: 10px; border-bottom: 1.5px solid #3b6fd4; background: var(--navy-soft); }
}
@media (min-width: 1040px) {
  .plot-list, .recent { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- editing ---------- */
.top-actions { display: flex; gap: 10px; align-items: center; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.form .full { grid-column: 1 / -1; }
.form label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.form input, .form select, .form textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid color-mix(in srgb, var(--navy) 40%, transparent); }
.form h3 { grid-column: 1 / -1; margin: 8px 0 -4px; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.preview { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--navy-soft); border-radius: 12px; padding: 12px; }
.preview div { font-size: 12px; color: var(--navy); font-weight: 600; }
.preview b { display: block; font-size: 15px; color: var(--ink); }
.btn { font: inherit; font-weight: 700; border-radius: 12px; padding: 13px 16px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .6; }
.actions { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.actions .grow { margin-right: auto; }
.form-error { grid-column: 1 / -1; color: var(--red); font-size: 14px; min-height: 0; margin: 0; }
.mini { width: 36px; height: 36px; border-radius: 9px; border: 0; background: #dde3ee; color: var(--navy); display: grid; place-items: center; cursor: pointer; flex: none; }
.mini svg { width: 17px; height: 17px; }
.mini.del { color: var(--teal); background: #dbeaf2; }
.live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 2px; box-shadow: 0 0 0 3px var(--green-bg); }
.live.off { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px;
  border-radius: 10px; font-weight: 600; z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; }
.flash { animation: flash 1.2s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px #f2b544; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- sign in ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px, 100%); display: grid; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px 24px; }
.login-card .venture { text-align: center; font-size: 20px; }
.login-card label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.login-card input { font: inherit; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; color: var(--ink); background: var(--card); }
.hist { font-size: 13.5px; padding: 10px 16px; border-top: 1px solid var(--line); }
.hist:first-child { border-top: 0; }
.hist .who { color: var(--muted); font-size: 12.5px; }
.team-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.team-row:first-child { border-top: 0; }
.team-row .grow { flex: 1; }
.team-row select { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: var(--card); color: var(--ink); }

/* sign-in: company logo as a very light background */
.login { position: fixed; inset: 0; overflow-y: auto; background: #fbfcfe; isolation: isolate; z-index: 40; }
.login::before { content: ""; position: fixed; inset: 6vh 6vw; z-index: -1;
  background: url("/nvb-logo.png") center / contain no-repeat; opacity: .10; }
.login-card { background: rgba(255, 255, 255, .86); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  box-shadow: 0 10px 40px rgba(20, 30, 60, .08); }
.login-card .logo { height: 64px; margin: 0 auto 2px; }
@media (max-width: 700px) {
  .login { align-content: end; padding-bottom: 14vh; }
  .login::before { inset: 7vh 6vw auto; height: 38vh; opacity: .14; }
}

.venture-btn { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; text-align: left; display: grid; gap: 1px; }
.venture-btn .venture { text-transform: uppercase; }
.venture-sub { color: var(--ink); font-weight: 600; font-size: 15px; }
.venture-btn .venture { white-space: nowrap; letter-spacing: .1em; }
@media (max-width: 500px) { .hide-phone { display: none !important; } }

/* ---------- site plan ---------- */
.seg { display: inline-grid; grid-auto-flow: column; background: var(--navy-soft); border-radius: 11px; padding: 3px; margin-bottom: 12px; }
.seg button { border: 0; background: none; padding: 8px 22px; border-radius: 9px; font-weight: 600; color: var(--navy); cursor: pointer; }
.seg button.on { background: var(--card); box-shadow: 0 1px 3px rgba(20, 30, 60, .15); }
.plan-wrap { position: relative; height: calc(100vh - 290px); height: calc(100dvh - 290px); min-height: 380px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
#plan-svg { width: 100%; height: 100%; display: block; cursor: grab; }
#plan-svg:active { cursor: grabbing; }
.hot { fill-opacity: .32; stroke-width: 2; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill-opacity .15s; }
.hot:hover { fill-opacity: .5; }
.hot.Available { fill: #3f9a4f; stroke: #2f7d3d; }
.hot.Reserved { fill: #e58a2e; stroke: #c26a12; }
.hot.Sold-Out { fill: #3d8fb2; stroke: #2a6f8f; }
.hot.Mixed { fill: #b07cc6; stroke: #8a55a3; }
.hot.none { fill: #9aa3b5; stroke: #7a8396; fill-opacity: .2; }
.plan-tools { position: absolute; right: 10px; top: 10px; display: grid; gap: 8px; }
.plan-tools button { width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255,255,255,.95);
  font-size: 22px; font-weight: 600; color: var(--navy); cursor: pointer; box-shadow: 0 2px 8px rgba(20,30,60,.12); }
.plan-legend { position: absolute; left: 10px; bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.plan-legend span { background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.plan-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.plan-legend i.Available { background: #3f9a4f; } .plan-legend i.Reserved { background: #e58a2e; } .plan-legend i.Sold-Out { background: #3d8fb2; }
.plan-hint { color: var(--muted); font-size: 12.5px; text-align: center; margin: 8px 0 0; }
