/* RealDev Workspace — navy & gold */
:root {
  --navy: #0f1b2d; --navy2: #16263f; --navy3: #22375a;
  --gold: #d4af37; --gold2: #f3d77a; --gold-d: #b8901f;
  --bg: #f3f5fa; --card: #fff; --line: #e4e8f0; --line2: #eef1f6;
  --ink: #18212f; --ink2: #4a5568; --muted: #8590a2;
  --blue: #2563eb; --green: #059669; --red: #dc2626; --amber: #d97706; --violet: #7c3aed; --teal: #0d9488;
  --r: 16px; --r-s: 10px;
  --sh: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --sh-l: 0 12px 40px rgba(15, 27, 45, .18);
  --side: 248px; --top: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.45 "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.noscroll { overflow: hidden; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
p { margin: .35em 0; }
small { font-size: 12px; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.ic.big { width: 40px; height: 40px; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: #fff; outline: none; transition: border .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, .2); }
textarea { resize: vertical; }
input[type=checkbox] { width: auto; accent-color: var(--navy); }
input[type=range] { padding: 0; border: 0; accent-color: var(--gold-d); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; }
.row { display: flex; align-items: center; }
.gap { gap: 12px; } .gap-s { gap: 6px; } .wrap { flex-wrap: wrap; }
.pad { padding: 12px 16px; }
.nowrap { white-space: nowrap; }
.ok-t { color: var(--green); font-weight: 600; } .bad-t { color: var(--red); font-weight: 600; } .warn-t { color: var(--amber); font-weight: 600; }
.danger-t { color: var(--red) !important; }

/* ---------- layout ---------- */
.app { min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: radial-gradient(120% 60% at 0% 0%, #1d3254 0%, var(--navy) 55%); color: #c9d3e3; display: flex; flex-direction: column; z-index: 40; transition: transform .25s ease; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 18px; color: #fff; font-weight: 800; font-size: 21px; letter-spacing: -.02em; text-decoration: none !important; }
.brand img { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.brand span { color: var(--gold); }
.brand small { display: block; font-size: 11px; font-weight: 500; color: #8fa0bb; letter-spacing: .04em; text-transform: uppercase; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0; border-radius: 11px; color: #b8c4d8; font-weight: 500; text-decoration: none; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.on { background: linear-gradient(90deg, rgba(212, 175, 55, .22), rgba(212, 175, 55, .06)); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav a.on .ic { color: var(--gold); }
.side-foot { display: flex; align-items: center; gap: 8px; padding: 14px 16px calc(14px + var(--safe-b)); border-top: 1px solid rgba(255, 255, 255, .08); }
.side-foot > div { flex: 1; min-width: 0; }
.side-foot .row { min-width: 0; }
.su-txt { min-width: 0; overflow: hidden; }
.su-txt b { color: #fff; display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-txt small { color: #8fa0bb; }
.side-out { color: #8fa0bb; padding: 8px; border-radius: 9px; }
.side-out:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.main-wrap { margin-left: var(--side); min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 28px; background: rgba(243, 245, 250, .85); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line2); }
.top h1 { font-size: 20px; font-weight: 750; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { display: flex; align-items: center; gap: 8px; }
.main { padding: 24px 28px 60px; max-width: 1360px; }
.scrim { display: none; }
.tabbar { display: none; }
.only-m { display: none !important; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 11px; border: 1px solid transparent; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: transform .08s, box-shadow .15s, background .15s; line-height: 1.2; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--navy); color: #fff; box-shadow: 0 4px 12px rgba(15, 27, 45, .25); }
.btn.primary:hover { background: var(--navy3); }
.btn.gold { background: linear-gradient(135deg, var(--gold2), var(--gold) 55%, var(--gold-d)); color: var(--navy); box-shadow: 0 6px 18px rgba(212, 175, 55, .4); }
.btn.glass { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .22); }
.btn.glass:hover { background: rgba(255, 255, 255, .2); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: #cfd6e2; background: #fafbfd; }
.btn.danger { background: var(--red); color: #fff; box-shadow: 0 4px 12px rgba(220, 38, 38, .25); }
.btn.ms { background: #fff; color: #1f2937; border-color: #d1d5db; padding: 13px 22px; font-size: 16px; width: 100%; box-shadow: 0 2px 6px rgba(0, 0, 0, .06); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.big { padding: 15px 26px; font-size: 17px; border-radius: 14px; }
.btn.block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; border: 0; background: transparent; cursor: pointer; color: var(--ink2); position: relative; }
.icon-btn:hover { background: rgba(15, 27, 45, .06); }
.bell .count { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }
.clock-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink2); font-weight: 600; font-size: 13px; text-decoration: none !important; }
.clock-pill.on { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; display: inline-block; box-shadow: 0 0 0 0 rgba(16, 185, 129, .6); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .55); } 70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
.live { display: inline-flex; align-items: center; gap: 7px; color: #047857; font-weight: 700; font-size: 13px; background: #ecfdf5; padding: 4px 10px; border-radius: 999px; }
.off { display: inline-flex; color: var(--ink2); font-weight: 600; font-size: 13px; background: #f1f4f9; padding: 4px 10px; border-radius: 999px; }
.live.big, .off.big { font-size: 15px; padding: 6px 14px; }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); padding: 18px 20px; margin-bottom: 16px; border: 1px solid rgba(228, 232, 240, .7); }
.card.flush { padding: 0; overflow: hidden; }
.card.inset { background: #f8fafc; box-shadow: none; border: 1px solid var(--line2); }
.card h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card h3 .ic { color: var(--gold-d); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-head h3 { margin: 0; }
.card-head.pad { padding: 16px 20px 8px; }
h3.sec { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 26px 2px 12px; font-weight: 700; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.cols > .col.wide { grid-column: span 1; }
.cols:has(> .col.wide) { grid-template-columns: 1.6fr 1fr; }
.col > .card:last-child { margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.span2 { grid-column: 1 / -1; }
.err-card { display: flex; gap: 14px; align-items: flex-start; color: var(--red); }
.loading { display: flex; justify-content: center; padding: 60px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); background: #fff; border-radius: var(--r); border: 1px dashed var(--line); }
.empty .ic.big { color: #c8d0dc; }
.empty h4 { color: var(--ink); margin: 10px 0 4px; font-size: 17px; }
.empty .btn { margin-top: 14px; }

/* ---------- hero / KPIs ---------- */
.hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 26px 28px; border-radius: 22px; margin-bottom: 18px; color: #fff;
  background: radial-gradient(90% 140% at 100% 0%, rgba(212, 175, 55, .35) 0%, rgba(212, 175, 55, 0) 55%), linear-gradient(135deg, #0f1b2d 0%, #1b2f4f 60%, #22375a 100%); box-shadow: var(--sh-l); }
.hero::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; border: 40px solid rgba(255, 255, 255, .04); }
.hero h2 { font-size: 26px; font-weight: 800; }
.hero p { color: #b9c6dc; margin-top: 4px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-clock { display: flex; align-items: center; gap: 18px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); padding: 14px 16px; border-radius: 18px; position: relative; z-index: 1; }
.hc-state { display: flex; flex-direction: column; gap: 6px; }
.hc-state b { font-size: 17px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }
.kpis.three { grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; }
.kpi { display: flex; align-items: center; gap: 14px; padding: 16px; background: #fff; border-radius: var(--r); box-shadow: var(--sh); color: var(--ink); text-decoration: none !important; border: 1px solid rgba(228, 232, 240, .7); transition: transform .12s, box-shadow .12s; }
a.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16, 24, 40, .1); }
.kpi-ic { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.kpi-n { font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.kpi-n.sm { font-size: 18px; }
.kpi-l { font-size: 13px; color: var(--ink2); margin-top: 4px; }
.tone-red .kpi-ic { background: #fee2e2; color: var(--red); } .tone-red .kpi-n { color: var(--red); }
.tone-green .kpi-ic { background: #d1fae5; color: var(--green); }
.tone-amber .kpi-ic { background: #fef3c7; color: var(--amber); }
.tone-blue .kpi-ic { background: #dbeafe; color: var(--blue); }
.tone-violet .kpi-ic { background: #ede9fe; color: var(--violet); }
.tone-slate .kpi-ic { background: #eef1f6; color: var(--muted); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0 18px; }
.qbtn { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; background: #fff; border-radius: var(--r); border: 1px solid var(--line); box-shadow: var(--sh); cursor: pointer; font-weight: 600; color: var(--ink); font-size: 13px; text-decoration: none !important; }
.qbtn .ic { width: 24px; height: 24px; color: var(--gold-d); }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.mini-stats > div { background: #f7f9fc; border-radius: 12px; padding: 12px; }
.mini-stats b { display: block; font-size: 19px; font-weight: 800; }
.mini-stats small { color: var(--muted); }

/* ---------- members ---------- */
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.member { margin: 0; }
.mc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.mc-head small { display: block; color: var(--muted); }
.mc-line { margin-bottom: 6px; }
.mc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.mc-stats > div { background: #f7f9fc; border-radius: 11px; padding: 9px 10px; }
.mc-stats b { display: block; font-size: 15px; }
.mc-stats small { color: var(--muted); }
.mc-links { display: flex; gap: 16px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line2); font-weight: 600; font-size: 13px; }
.map { width: 100%; border: 0; border-radius: 12px; margin: 8px 0; background: #e8edf3; display: block; }

/* ---------- avatar / pills / tags ---------- */
.av { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 13px; flex: none; letter-spacing: .02em; box-shadow: 0 0 0 2px #fff; }
.av-sm { width: 26px; height: 26px; font-size: 11px; }
.av-xs { width: 22px; height: 22px; font-size: 10px; }
.av-lg { width: 46px; height: 46px; font-size: 16px; }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; background: #eef1f6; color: var(--ink2); }
.st-todo { background: #eef1f6; color: #475569; }
.st-in_progress { background: #dbeafe; color: #1d4ed8; }
.st-waiting { background: #fef3c7; color: #b45309; }
.st-done { background: #d1fae5; color: #047857; }
.st-cancelled { background: #f3f4f6; color: #9ca3af; text-decoration: line-through; }
.ps-prospect, .ls-new { background: #eef1f6; color: #475569; }
.ps-listing_prep, .ls-contacted { background: #e0f2fe; color: #0369a1; }
.ps-listed, .ls-qualified { background: #dbeafe; color: #1d4ed8; }
.ps-under_offer, .ls-viewing { background: #ede9fe; color: #6d28d9; }
.ls-offer { background: #fef3c7; color: #b45309; }
.ps-sold, .ps-rented, .ls-won { background: #d1fae5; color: #047857; }
.ps-renovation { background: #ffedd5; color: #c2410c; }
.ps-off_market, .ls-lost { background: #f3f4f6; color: #6b7280; }
.es-pending { background: #fef3c7; color: #b45309; } .es-approved { background: #dbeafe; color: #1d4ed8; } .es-paid { background: #d1fae5; color: #047857; } .es-rejected { background: #fee2e2; color: #b91c1c; } .es-withdrawn { background: #f3f4f6; color: #6b7280; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 7px; font-size: 12px; font-weight: 600; background: #f1f4f9; color: var(--ink2); white-space: nowrap; }
.tag .ic { width: 13px; height: 13px; }
.tag-ok { background: #d1fae5; color: #047857; } .tag-warn { background: #fef3c7; color: #b45309; } .tag-bad { background: #fee2e2; color: #b91c1c; } .tag-muted { background: #f1f4f9; color: var(--muted); }
.prio { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 6px; }
.prio-low { background: #cbd5e1; } .prio-normal { background: #60a5fa; } .prio-high { background: #f59e0b; } .prio-urgent { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .2); }
.due { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink2); white-space: nowrap; }
.due .ic { width: 14px; height: 14px; }
.due.over { color: var(--red); } .due.today { color: var(--amber); } .due.ok { color: var(--green); } .due.late-done { color: var(--amber); }
.where { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.where-link { color: var(--ink2); display: inline-flex; gap: 4px; align-items: center; }
.where .ic { width: 14px; height: 14px; }
.meta-bit { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- task rows ---------- */
.tlist { display: flex; flex-direction: column; }
.trow { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line2); color: var(--ink); text-decoration: none !important; align-items: flex-start; transition: background .12s; }
.trow:last-child { border-bottom: 0; }
.trow:hover { background: #fafbfe; }
.trow.is-over { background: linear-gradient(90deg, rgba(254, 226, 226, .55), transparent 40%); }
.trow.is-done .trow-title { color: var(--muted); text-decoration: line-through; }
.trow-main { flex: 1; min-width: 0; }
.trow-title { font-weight: 650; }
.trow-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.trow-meta .ic { width: 13px; height: 13px; margin-right: 2px; }
.trow-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: #cbd5e1; margin: 0 5px; }
.trow-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.bar { height: 5px; background: #eef1f6; border-radius: 9px; margin-top: 8px; overflow: hidden; max-width: 320px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-d)); border-radius: 9px; }
.card .tlist .trow { padding-left: 4px; padding-right: 4px; }
.card.flush .tlist .trow, .tlist.card .trow { padding: 13px 16px; }
.lrow { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line2); color: var(--ink); text-decoration: none !important; }
.lrow b { flex: 1; }

/* ---------- toolbar / filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar select, .toolbar input { width: auto; padding: 8px 10px; }
.toolbar .search { min-width: 220px; flex: 1; max-width: 340px; padding-left: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238590a2' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 12px center; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button, .seg a { border: 0; background: transparent; padding: 6px 11px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink2); display: inline-flex; align-items: center; text-decoration: none !important; }
.seg .on { background: var(--navy); color: #fff; }
.fld { display: block; margin-bottom: 12px; }
.fld > span { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink2); margin-bottom: 5px; }
.fld.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.fld.inline > span { margin: 0; white-space: nowrap; }
.pipeline { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.pchip { border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; background: #fff; }
.pchip b { margin-left: 4px; opacity: .7; }
.pchip.on { box-shadow: 0 0 0 2px var(--navy); }

/* ---------- board ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.bcol { background: #e9edf4; border-radius: var(--r); padding: 10px; min-height: 200px; }
.bcol-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 10px; }
.bcard { display: block; background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 8px; box-shadow: var(--sh); color: var(--ink); text-decoration: none !important; border-left: 3px solid transparent; }
.bcard.is-over { border-left-color: var(--red); }
.bcard b { display: inline; font-weight: 650; margin-left: 6px; }
.bcard .prio { display: inline-block; margin: 0; }
.bcard-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }

/* ---------- task detail ---------- */
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; font-weight: 600; color: var(--ink2); }
.task-head .th-top { display: flex; align-items: flex-start; gap: 12px; }
.task-head h2 { font-size: 22px; flex: 1; font-weight: 800; }
.th-top .prio { margin-top: 9px; }
.th-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.status-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.st-btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 650; font-size: 13px; cursor: pointer; color: var(--ink2); }
.st-btn.on.st-todo { background: #475569; color: #fff; border-color: #475569; }
.st-btn.on.st-in_progress { background: var(--blue); color: #fff; border-color: var(--blue); }
.st-btn.on.st-waiting { background: var(--amber); color: #fff; border-color: var(--amber); }
.st-btn.on.st-done { background: var(--green); color: #fff; border-color: var(--green); }
.st-btn.on.st-cancelled { background: #9ca3af; color: #fff; border-color: #9ca3af; text-decoration: none; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 12px 0; }
.facts > div { background: #f7f9fc; border-radius: 11px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.facts small { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .05em; }
.prog { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.prog small { color: var(--muted); font-weight: 600; }
.prog input { flex: 1; max-width: 360px; }
.desc { background: #fbfaf5; border: 1px solid #f1ead0; border-radius: 12px; padding: 12px 14px; margin-top: 12px; white-space: normal; }
.owner { margin-top: 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.composer textarea { margin-bottom: 10px; }
.timeline { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.tl { display: flex; gap: 12px; }
.tl-body { flex: 1; min-width: 0; background: #f8fafc; border-radius: 4px 14px 14px 14px; padding: 10px 14px; border: 1px solid var(--line2); }
.tl-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tl-head small { color: var(--muted); }
.tl-text { margin-top: 4px; white-space: normal; word-wrap: break-word; }
.tl-status { margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.tl.sys { align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding-left: 8px; }
.tl.sys .ic { width: 14px; height: 14px; color: var(--gold-d); }
.tl.sys span { flex: 1; }
.checklist { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.ck { display: flex; align-items: flex-start; gap: 10px; padding: 8px 6px; border-radius: 9px; cursor: pointer; }
.ck:hover { background: #f7f9fc; }
.ck input { margin-top: 3px; width: 18px; height: 18px; }
.ck span { flex: 1; }
.ck small { display: block; color: var(--muted); }
.ck.done span { color: var(--muted); text-decoration: line-through; }
.ck .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }
#ckForm input { flex: 1; }

/* ---------- thumbs / gallery ---------- */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumb { width: 84px; height: 84px; border-radius: 11px; overflow: hidden; border: 0; padding: 0; cursor: zoom-in; background: #e8edf3; display: inline-flex; align-items: center; justify-content: center; flex-direction: column; color: var(--ink2); font-size: 11px; font-weight: 700; }
.thumbs.big .thumb { width: 120px; height: 120px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.gitem { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--sh); }
.thumb.g { width: 100%; height: 170px; border-radius: 0; }
.gcap { padding: 10px 12px; font-size: 13px; }
.gtxt { margin-top: 4px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.gtags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.lb { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.lb-img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; background: #0b1220; }
.lb-info { display: flex; flex-direction: column; gap: 10px; }
.picker-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.picker-btns label { cursor: pointer; }
.picker-prev { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.pv { position: relative; width: 74px; height: 74px; }
.pv img, .pv-pdf { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.pv-pdf { background: #fee2e2; color: #b91c1c; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.pv button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: var(--ink); color: #fff; cursor: pointer; font-size: 13px; line-height: 1; }

/* ---------- clock ---------- */
.clock-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: center; padding: 24px; border-top: 4px solid #cbd5e1; }
.clock-hero.on { border-top-color: #10b981; background: linear-gradient(180deg, #f0fdf7, #fff 50%); }
.ch-time { font-size: 46px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 0; }
.ch-r { display: flex; flex-direction: column; gap: 10px; }
.shift { padding: 14px 18px; }
.shift.is-open { border-left: 4px solid #10b981; }
.shift-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.shift-date { font-weight: 700; }
.hours { font-weight: 800; font-size: 17px; }
.stamps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stamp { background: #f7f9fc; border-radius: 12px; padding: 10px 12px; }
.stamp small { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .05em; display: block; }
.stamp > b { font-size: 18px; }
.stamp.empty b { color: var(--muted); font-size: 14px; }
.edits { margin-top: 10px; font-size: 12.5px; color: var(--amber); }
.hchart { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding: 10px 0 0; }
.hbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.hbar i { width: 100%; max-width: 32px; background: linear-gradient(180deg, #3b82f6, #1d4ed8); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.hbar i.warn { background: linear-gradient(180deg, #fbbf24, #d97706); }
.hbar small { font-size: 10px; color: var(--muted); text-align: center; margin-top: 4px; line-height: 1.15; }
.hbar b { position: absolute; top: -2px; font-size: 10px; color: var(--ink2); }

/* ---------- properties ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.pcard { background: #fff; border-radius: var(--r); overflow: hidden; box-shadow: var(--sh); color: var(--ink); text-decoration: none !important; transition: transform .12s, box-shadow .12s; border: 1px solid rgba(228, 232, 240, .7); }
.pcard:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(16, 24, 40, .12); }
.pcover { height: 150px; background: linear-gradient(135deg, #1b2f4f, #0f1b2d); display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, .3); position: relative; }
.pcover img { width: 100%; height: 100%; object-fit: cover; }
.pcover .pill { position: absolute; top: 10px; left: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.pbody { padding: 12px 14px 14px; }
.pprice { font-weight: 800; font-size: 17px; margin-top: 6px; color: var(--navy); }
.pmeta { font-size: 12.5px; color: var(--ink2); }
.pcounts { display: flex; gap: 4px; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.pcounts .ic { width: 14px; height: 14px; margin-left: 6px; }
.pcounts .ic:first-child { margin-left: 0; }

/* ---------- reports / expenses ---------- */
.report.reviewed { opacity: .92; }
.rstats { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink2); margin-bottom: 10px; }
.rstats span { display: inline-flex; align-items: center; gap: 5px; }
.rstats .ic { width: 14px; height: 14px; color: var(--gold-d); }
.rsec { margin: 10px 0; }
.rsec small { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 11px; }
.rsec.warn p { color: #92400e; }
.comments { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.cmt { display: flex; gap: 8px; background: #fbfaf5; border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.rcom { margin-top: 12px; }
.rcom input { flex: 1; }
.amount { font-weight: 800; font-size: 17px; }
.exp-body { display: flex; gap: 14px; align-items: flex-start; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.actions.left { justify-content: flex-start; }
.contact-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

/* ---------- callouts ---------- */
.callout { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; margin-bottom: 14px; color: var(--ink); text-decoration: none !important; }
.callout > .ic { width: 24px; height: 24px; flex: none; }
.callout > div { flex: 1; }
.callout p { margin: 2px 0 0; color: var(--ink2); font-size: 14px; }
.callout.info { background: #eff6ff; border: 1px solid #bfdbfe; } .callout.info > .ic { color: var(--blue); }
.callout.warn { background: #fffbeb; border: 1px solid #fde68a; } .callout.warn > .ic { color: var(--amber); }
.callout.ok { background: #ecfdf5; border: 1px solid #a7f3d0; } .callout.ok > .ic { color: var(--green); }

/* ---------- feed ---------- */
.feed { display: flex; flex-direction: column; max-height: 720px; overflow-y: auto; }
.feed-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line2); font-size: 14px; }
.feed-item:last-child { border: 0; }
.feed-ic { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; background: #eef1f6; color: var(--ink2); }
.feed-ic .ic { width: 16px; height: 16px; }
.k-clock { background: #d1fae5; color: var(--green); } .k-task { background: #dbeafe; color: var(--blue); } .k-update { background: #e0e7ff; color: #4338ca; }
.k-photo { background: #fce7f3; color: #be185d; } .k-report { background: #ede9fe; color: var(--violet); } .k-expense { background: #fef3c7; color: var(--amber); }
.k-lead { background: #ccfbf1; color: var(--teal); } .k-property { background: #fef9c3; color: #a16207; } .k-login { background: #f1f5f9; color: #475569; }
.feed-body { flex: 1; min-width: 0; }
.feed-body a { color: var(--ink); }
.feed-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 12px 14px; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl.hover tbody tr { cursor: pointer; }
.tbl.hover tbody tr:hover { background: #fafbfe; }

/* ---------- settings ---------- */
.toggle { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line2); cursor: pointer; }
.toggle:last-child { border: 0; }
.toggle input { display: none; }
.toggle small { display: block; color: var(--muted); }
.sw { width: 44px; height: 26px; border-radius: 99px; background: #cbd5e1; position: relative; flex: none; transition: background .2s; margin-top: 2px; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.toggle input:checked + .sw { background: var(--green); }
.toggle input:checked + .sw::after { transform: translateX(18px); }
.site-row, .member-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line2); }
.site-row b { min-width: 90px; }
.site-row span { flex: 1; }
.member-row.off { opacity: .55; }
.member-row select { width: auto; padding: 6px 8px; }
.member-row small { color: var(--muted); display: block; }
.inline-name { border: 1px solid transparent; padding: 2px 6px; margin-left: -6px; font-weight: 650; background: transparent; }
.inline-name:hover, .inline-name:focus { border-color: var(--line); background: #fff; }
#teamForm, #siteForm { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }

/* ---------- modal / toast / notif / busy ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(15, 27, 45, .5); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); animation: pop .18s ease-out; }
.modal.wide { max-width: 780px; }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 10px; }
.modal-head h3 { font-size: 18px; font-weight: 750; }
.modal-body { padding: 4px 20px 20px; overflow-y: auto; }
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--sh-l); font-weight: 600; font-size: 14px; opacity: 0; transform: translateY(10px); transition: all .25s; max-width: 92vw; }
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--red); } .toast.warn { background: var(--amber); }
.notif-panel { position: fixed; top: calc(var(--top) - 4px); right: 20px; width: 380px; max-width: calc(100vw - 24px); max-height: 70vh; background: #fff; border-radius: 16px; box-shadow: var(--sh-l); z-index: 60; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); }
.np-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line2); }
.np-list { overflow-y: auto; }
.np-item { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line2); color: var(--ink); font-size: 14px; text-decoration: none !important; }
.np-item.unread { background: #fffbeb; box-shadow: inset 3px 0 0 var(--gold); }
.np-item small { color: var(--muted); }
.np-item:hover { background: #f8fafc; }
#busy { position: fixed; inset: 0; z-index: 300; background: rgba(15, 27, 45, .45); display: flex; align-items: center; justify-content: center; }
.busy-card { background: #fff; border-radius: 18px; padding: 24px 30px; display: flex; flex-direction: column; align-items: center; gap: 14px; font-weight: 650; box-shadow: var(--sh-l); }
.spin { width: 16px; height: 16px; border: 2px solid rgba(0, 0, 0, .12); border-top-color: currentColor; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
.spin.big { width: 32px; height: 32px; border-width: 3px; color: var(--gold-d); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- login ---------- */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy); padding: 20px; }
.login-bg { position: fixed; inset: 0; background: radial-gradient(60% 50% at 80% 10%, rgba(212, 175, 55, .35), transparent 60%), radial-gradient(50% 50% at 10% 90%, rgba(37, 99, 235, .25), transparent 60%), linear-gradient(160deg, #0b1424, #13233c); }
.login-card { position: relative; background: rgba(255, 255, 255, .97); border-radius: 26px; padding: 40px 34px 30px; width: 100%; max-width: 400px; text-align: center; box-shadow: 0 40px 100px rgba(0, 0, 0, .45); }
.login-logo { width: 74px; height: 74px; border-radius: 20px; box-shadow: 0 10px 30px rgba(15, 27, 45, .35); }
.login-card h1 { font-size: 34px; font-weight: 850; letter-spacing: -.03em; margin-top: 14px; }
.login-card h1 span { color: var(--gold-d); }
.login-sub { color: var(--ink2); margin-bottom: 24px; }
.login-msg { border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; text-align: left; }
.login-msg.bad { background: #fee2e2; color: #991b1b; } .login-msg.ok { background: #d1fae5; color: #065f46; }
.login-foot { color: var(--muted); font-size: 12.5px; margin-top: 18px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cols, .cols:has(> .col.wide) { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  :root { --top: 56px; }
  .side { transform: translateX(-102%); box-shadow: var(--sh-l); }
  .side.open { transform: none; }
  .scrim.on { display: block; position: fixed; inset: 0; background: rgba(15, 27, 45, .45); z-index: 35; }
  .main-wrap { margin-left: 0; }
  .only-m { display: inline-flex !important; }
  .top { padding: 0 10px 0 6px; }
  .top h1 { font-size: 18px; }
  .main { padding: 14px 12px calc(90px + var(--safe-b)); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none !important; padding: 4px 0; border-radius: 10px; }
  .tabbar a .ic { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--navy); }
  .tabbar a.on .ic { color: var(--gold-d); }
  .clock-pill span { display: none; }
  .clock-pill.on span { display: inline; }
  .hero { padding: 20px; border-radius: 18px; }
  .hero h2 { font-size: 21px; }
  .hero-clock { width: 100%; justify-content: space-between; }
  .kpi { padding: 12px; gap: 10px; }
  .kpi-ic { width: 36px; height: 36px; }
  .kpi-n { font-size: 22px; }
  .quick { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .qbtn { padding: 12px 4px; font-size: 11.5px; }
  .members { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .stamps { grid-template-columns: 1fr; }
  .clock-hero { grid-template-columns: 1fr; }
  .lb { grid-template-columns: 1fr; }
  .toolbar .search { max-width: none; min-width: 100%; }
  .toolbar select { flex: 1; min-width: 40%; }
  .trow { padding: 12px; }
  .trow-side { max-width: 42%; }
  .board { grid-template-columns: repeat(4, 80vw); }
  .modal-wrap { padding: 0; align-items: flex-end; }
  .modal, .modal.wide { max-width: none; border-radius: 20px 20px 0 0; max-height: 92vh; }
  .modal-body { padding-bottom: calc(20px + var(--safe-b)); }
  .notif-panel { right: 8px; left: 8px; width: auto; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .thumb.g { height: 140px; }
  .ch-time { font-size: 38px; }
  .card { padding: 16px; }
}
