/* ============================================================================
   v2.css — styles for the 2.0 tabs ONLY (Map, Properties) and the deal modal.

   CRITICAL RULE FOR EDITING THIS FILE:
   Every selector here MUST be scoped under #tab-map, #tab-properties, #v2mask
   or a .v2- prefix. This sheet loads AFTER v1's style.css, so an unscoped
   `table`, `body`, `.btn` or `*` rule would silently reskin the entire rest of
   the game. The 2.0 look is being introduced one screen at a time, not by
   dropping a whole-page stylesheet on top of a working UI.
   ========================================================================== */

#tab-map, #tab-properties {
  --v2-panel:#fff;  --v2-ink:#12283d;  --v2-muted:#6b8398;
  --v2-line:#d8e2ec; --v2-accent:#2f6fb0;
  --v2-good:#18794e; --v2-warn:#b8860b; --v2-bad:#c2410c; --v2-lot:#c8892b;
  color: var(--v2-ink);
  font: 14px/1.45 system-ui, 'Segoe UI', Roboto, sans-serif;
  background: #eef2f7;
  border-radius: 8px;
}


/* ---------- the map colour control -----------------------------------------
   A VIEW CONTROL, deliberately unlike navigation: it sits on the map's
   empty top-left corner (countryside, no markers), inside a light card,
   as a compact segmented switch with a plain label. Navigation is text in a
   dark bar; this is a small light instrument on the map. Never the same look. */
#tab-map .map-ctl {
  position:absolute; top:10px; left:10px; z-index:20;
  background:rgba(255,255,255,.94); color:#12283d;
  border:1px solid #cfdbe6; border-radius:8px; padding:7px 9px 8px;
  box-shadow:0 2px 10px rgba(20,40,60,.18); font-size:11px; max-width:290px;
}
#tab-map .map-ctl-t { font-weight:700; color:#5b7690; text-transform:uppercase; letter-spacing:.06em; font-size:10px; margin-bottom:5px; }
#tab-map .seg { display:inline-flex; border:1px solid #b9cadb; border-radius:6px; overflow:hidden; }
#tab-map .seg button {
  font:600 11px system-ui; padding:3px 8px; border:0; border-left:1px solid #b9cadb;
  background:#fff; color:#3d5f7a; cursor:pointer;
}
#tab-map .seg button:first-child { border-left:0; }
#tab-map .seg button:hover { background:#eef4fa; }
#tab-map .seg button.on { background:#3d5f7a; color:#fff; }
#tab-map .map-legend { margin-top:6px; color:#3d5f7a; line-height:1.5; }

/* ---------- the map itself ------------------------------------------------ */
#tab-map .mapwrap { display:flex; justify-content:center; padding:14px; }
#tab-map #map {
  position:relative; width:100%; max-width:1120px; border-radius:10px;
  overflow:hidden; box-shadow:0 6px 26px rgba(20,40,60,.18); background:#a8c8e4;
}
#tab-map #map > img { width:100%; display:block; }
#tab-map #markers { position:absolute; inset:0; }

#tab-map .mk {
  position:absolute; transform:translate(-50%,-100%); cursor:pointer;
  transform-origin:bottom center; transition:transform .1s;
  filter:drop-shadow(0 2px 2px rgba(10,30,50,.4));
}
#tab-map .mk:hover { transform:translate(-50%,-100%) scale(1.3); z-index:15; }
#tab-map .mk.mine {
  filter:drop-shadow(0 0 3px rgba(31,157,85,.9)) drop-shadow(0 2px 2px rgba(10,30,50,.4));
}
#tab-map .mk svg { display:block; overflow:visible; }

#tab-map .lot {
  position:absolute; transform:translate(-50%,-50%); width:20px; height:20px;
  border-radius:5px; border:2px dashed #b9822e; background:rgba(240,190,90,.45);
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  color:#7a4d10; font-weight:900; font-size:13px; transition:transform .1s;
}
#tab-map .lot:hover { transform:translate(-50%,-50%) scale(1.35); z-index:15; }

#tab-map #card { position:absolute; z-index:30; display:none; pointer-events:none; }
#tab-map .cardbox {
  width:242px; background:#0e2233; color:#eaf2f9; border:1px solid #24435c;
  border-radius:11px; padding:11px 12px; box-shadow:0 10px 30px rgba(8,20,34,.5); font-size:12px;
}
#tab-map .chead { display:flex; gap:10px; align-items:center; }
#tab-map .chead .tx { flex:1; min-width:0; }
#tab-map .cardbox .nm { font-weight:800; font-size:13px; }
#tab-map .cardbox .tt { font-weight:700; color:#bcd3e6; font-size:11px; }
#tab-map .thumb { width:56px; height:56px; border-radius:6px; object-fit:cover; flex:none; background:#152f45; }
#tab-map .cardbox .grid { display:grid; grid-template-columns:auto auto; gap:2px 10px; margin-top:8px; }
#tab-map .cardbox .k { color:#8fb0c9; }
#tab-map .cardbox .v { text-align:right; font-weight:600; }
#tab-map .cardact { margin-top:8px; color:#fff; text-align:center; border-radius:6px; padding:4px; font-weight:700; }
#tab-map .divl { height:1px; background:#24435c; margin:8px 0; }
#tab-map .hint { max-width:1120px; margin:0 auto; padding:0 16px 18px; color:#4a6a83; font-size:12px; }

/* ---------- properties tab ------------------------------------------------ */
#tab-properties .v2wrap { padding:16px 18px; }
#tab-properties h2.sec {
  font-size:15px; letter-spacing:.04em; text-transform:uppercase; color:#44637d;
  margin:24px 0 10px; display:flex; align-items:center; gap:10px;
}
#tab-properties h2.sec:first-child { margin-top:0; }
#tab-properties h2.sec .cnt { background:#dbe6f0; color:#3d5f7a; border-radius:20px; padding:1px 9px; font-size:12px; }

#tab-properties .kpis { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
#tab-properties .kpi {
  background:var(--v2-panel); border:1px solid var(--v2-line); border-radius:10px;
  padding:9px 13px; min-width:132px; box-shadow:0 1px 2px rgba(20,45,70,.05);
}
#tab-properties .kpi .k { font-size:11px; color:var(--v2-muted); text-transform:uppercase; letter-spacing:.04em; }
#tab-properties .kpi .v { font-size:19px; font-weight:800; margin-top:1px; }
#tab-properties .kpi.click { cursor:pointer; }
#tab-properties .kpi.click:hover { border-color:var(--v2-accent); background:#f3f8fd; }
#tab-properties .kpi.on { border-color:var(--v2-accent); background:#e8f1fa; box-shadow:0 0 0 2px rgba(47,111,176,.18); }
#tab-properties .kpi.warn .v { color:var(--v2-bad); }

#tab-properties .grpbar { margin-bottom:8px; font-size:12px; color:var(--v2-muted); }
#tab-properties #filterNote { margin-left:12px; color:var(--v2-bad); font-weight:600; }
#tab-properties .toggle {
  font:600 11px system-ui; color:var(--v2-accent); background:none; border:none;
  cursor:pointer; padding:2px 6px; border-radius:4px;
}
#tab-properties .toggle:hover { background:#e3edf7; }
#tab-properties .toggle.on { background:var(--v2-accent); color:#fff; }

#tab-properties table {
  width:100%; border-collapse:collapse; background:var(--v2-panel);
  border:1px solid var(--v2-line); border-radius:10px; overflow:hidden;
}
#tab-properties th {
  font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--v2-muted);
  text-align:right; padding:9px 10px; background:#f4f8fb; border-bottom:1px solid var(--v2-line);
  white-space:nowrap; cursor:pointer; user-select:none;
}
#tab-properties th.l { text-align:left; }
#tab-properties th:hover { color:var(--v2-accent); }
#tab-properties th .arrow { opacity:.5; font-size:9px; }
#tab-properties td {
  padding:8px 10px; border-bottom:1px solid #eef3f8; text-align:right;
  vertical-align:middle; white-space:nowrap; color:var(--v2-ink);
}
#tab-properties td.l { text-align:left; }
#tab-properties tr.grp td { background:#eaf1f7; font-weight:700; font-size:12px; color:#3d5f7a; }
#tab-properties tr.row { cursor:pointer; }
#tab-properties tr.row:hover { background:#f6fafd; }
#tab-properties tr.listed {
  background:repeating-linear-gradient(45deg,#fffaf0,#fffaf0 8px,#fff5e2 8px,#fff5e2 16px);
}
#tab-properties .collapsed tbody.body { display:none; }

#tab-properties .nm { display:flex; align-items:center; gap:9px; }
#tab-properties .nm img { width:40px; height:40px; border-radius:6px; object-fit:cover; flex:none; background:#dde7f0; }
#tab-properties .nm .t1 { font-weight:700; }
#tab-properties .nm .t2 { font-size:11px; color:var(--v2-muted); }
#tab-properties .badge { display:inline-block; font-size:10px; font-weight:700; padding:1px 7px; border-radius:20px; }
#tab-properties .b-active { background:#e6f4ec; color:var(--v2-good); }
#tab-properties .b-listed { background:#fdf0d5; color:#8a5a00; }
#tab-properties .b-reno   { background:#e7edfb; color:#2c4f9e; }
#tab-properties .b-lease  { background:#eaf3fb; color:var(--v2-accent); }
#tab-properties .b-lot    { background:#fdefd8; color:#8a5a00; }
#tab-properties .dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:5px; vertical-align:-1px; }
#tab-properties .bar { display:inline-block; width:52px; height:6px; border-radius:4px; background:#e4ebf2; overflow:hidden; vertical-align:0; margin-left:6px; }
#tab-properties .bar i { display:block; height:100%; }
#tab-properties .sml { font-size:11px; color:var(--v2-muted); }

#tab-properties .act {
  font:600 11px system-ui; padding:4px 9px; border-radius:6px;
  border:1px solid var(--v2-line); background:#fff; color:var(--v2-accent); cursor:pointer;
}
#tab-properties .act:hover { background:var(--v2-accent); color:#fff; border-color:var(--v2-accent); }
#tab-properties .act.buy  { color:var(--v2-good); border-color:#bfe3ce; }
#tab-properties .act.buy:hover { background:var(--v2-good); color:#fff; }
#tab-properties .act.bid  { color:#8a5a00; border-color:#f0dcb4; }
#tab-properties .act.bid:hover { background:var(--v2-lot); color:#fff; }
#tab-properties .act.mute { color:var(--v2-muted); cursor:default; }
#tab-properties .act.mute:hover { background:#fff; color:var(--v2-muted); border-color:var(--v2-line); }

#tab-properties tr.dr td { background:#f7fbfe; padding:0; }
#tab-properties .drawer { display:grid; grid-template-columns:1fr 1.7fr 1fr; gap:18px; padding:14px 16px; }
#tab-properties .drawer h4 { margin:0 0 6px; font-size:11px; letter-spacing:.05em; text-transform:uppercase; color:var(--v2-muted); }
#tab-properties .dl { display:grid; grid-template-columns:auto auto; gap:2px 12px; font-size:12px; }
#tab-properties .dl .k { color:var(--v2-muted); }
#tab-properties .dl .v { text-align:right; font-weight:600; }
#tab-properties .spark { display:flex; align-items:flex-end; gap:3px; height:44px; }
#tab-properties .spark i { flex:1; background:var(--v2-accent); opacity:.75; border-radius:2px 2px 0 0; }
#tab-properties .soon { font-size:11px; color:var(--v2-muted); font-style:italic; }

/* ---------- the deal modal (appended to body, so it owns its own ids) ------ */
#v2mask {
  position:fixed; inset:0; background:rgba(12,30,48,.55); display:none;
  align-items:center; justify-content:center; z-index:9000;
}
#v2modal {
  background:#fff; color:#12283d; border-radius:14px; width:420px; max-width:92vw;
  box-shadow:0 20px 60px rgba(10,30,50,.35); overflow:hidden;
  font:14px/1.45 system-ui,'Segoe UI',Roboto,sans-serif;
  --v2-muted:#6b8398; --v2-line:#d8e2ec; --v2-accent:#2f6fb0;
}
#v2modal .mh { padding:14px 18px; border-bottom:1px solid var(--v2-line); display:flex; gap:12px; align-items:center; }
#v2modal .mh img { width:56px; height:56px; border-radius:8px; object-fit:cover; }
#v2modal .mb { padding:16px 18px; }
#v2modal .mf { padding:12px 18px; background:#f6fafd; display:flex; gap:8px; justify-content:flex-end; }
#v2modal input[type=range] { width:100%; }
#v2modal .big { font-size:24px; font-weight:800; }
#v2modal .sml { font-size:11px; color:var(--v2-muted); }
#v2modal .btn2 {
  font:700 13px system-ui; padding:8px 16px; border-radius:8px;
  border:1px solid var(--v2-line); background:#fff; color:#12283d; cursor:pointer;
}
#v2modal .btn2.p { background:var(--v2-accent); color:#fff; border-color:var(--v2-accent); }

@media (max-width:820px) {
  #tab-properties .drawer { grid-template-columns:1fr; }
}

/* ---------- tenants in the property drawer ---------- */
#tab-properties .tn { padding:5px 0; border-bottom:1px dashed #e1e8ef; white-space:normal; }
#tab-properties .tn:last-of-type { border-bottom:none; }
#tab-properties .tn-n { font-weight:700; font-size:13px; }
#tab-properties .tn-vacant .tn-n { color:var(--v2-bad); }
#tab-properties .tn-res { font-size:13px; white-space:normal; }
#tab-properties .cb { display:inline-block; font-size:10px; font-weight:700; padding:1px 6px; border-radius:10px; margin-left:4px; vertical-align:1px; }
#tab-properties .c-strong { background:#e6f4ec; color:#18794e; }
#tab-properties .c-fine   { background:#eaf3fb; color:#2f6fb0; }
#tab-properties .c-watch  { background:#fdf0d5; color:#8a5a00; }
#tab-properties .c-bad    { background:#fde8e1; color:#c2410c; }
#tab-properties .c-gov    { background:#eef1f4; color:#5d6b79; }
