/* Team portal — shares tokens with the site (site.css). Dense, calm, built for phones first. */
body.portal { background: var(--mist); font-size: 16px; }
.boot { padding: 40px; text-align: center; color: var(--ink-3); }

/* login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(circle at 85% 10%, rgba(210,42,18,.10) 0 120px, transparent 121px),
  radial-gradient(circle at 85% 10%, transparent 0 168px, rgba(210,42,18,.07) 169px 184px, transparent 185px), var(--mist); }
.auth .card { width: min(420px, 100%); background: #fff; border-radius: var(--r-lg); padding: 32px 28px; border: 1px solid var(--line); display: grid; gap: 16px; }
.auth h1 { font-size: 2rem; line-height: 1.05; }
.auth .brand { margin-bottom: 6px; }

/* shell */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #D7D4E2; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .brand { color: #fff; padding: 4px 8px 18px; }
.side .brand b { font-size: 1.02rem; }
.side .brand img { width: 30px; height: 30px; }
.side .brand span { color: #FF8A73; font-size: 1.02rem; }
.side a { display: flex; align-items: center; gap: 10px; color: #D7D4E2; text-decoration: none; padding: 10px 12px; border-radius: 10px; font-weight: 500; }
.side a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side a[aria-current="page"] { background: #fff; color: var(--ink); }
.side a svg { width: 20px; height: 20px; flex: none; }
.side .me { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding: 14px 8px 0; font-size: .92rem; }
.side .me b { display: block; color: #fff; }
.side .me button { margin-top: 10px; background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px; padding: 6px 12px; font: 500 .9rem var(--body); cursor: pointer; }
.main { padding: 24px 28px 40px; min-width: 0; }
.topbar { display: none; }
.tabbar { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--ink); color: #fff; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); position: sticky; top: 0; z-index: 20; }
  .topbar .brand { color: #fff; } .topbar .brand b { font-size: 1rem; } .topbar .brand span { color: #FF8A73; font-size: 1rem; } .topbar .brand img { width: 28px; height: 28px; }
  .topbar small { color: #C9C5D6; }
  .main { padding: 16px 14px 96px; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 10px; color: var(--ink-3); text-decoration: none; font-size: .78rem; font-weight: 600; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--red); }
}

/* page head */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.ph h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); line-height: 1.05; }
.ph p { margin: 6px 0 0; color: var(--ink-3); }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: #fff; border-radius: var(--r-md); padding: 16px 18px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); display: grid; gap: 4px; }
a.tile:hover { border-color: var(--ink); }
.tile span { color: var(--ink-3); font-size: .92rem; }
.tile b { font: 700 1.9rem/1.05 var(--display); font-stretch: 118%; font-variant-numeric: tabular-nums; }
.tile.hot { background: var(--red); border-color: var(--red); color: #fff; }
.tile.hot span { color: #FFE3DD; }
.tile.gold { background: var(--marigold-tint); border-color: #F3DA9B; }

.cardx { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin-bottom: 16px; min-width: 0; }
.cardx h2 { font-size: 1.25rem; margin-bottom: 14px; font-stretch: 104%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .grid3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }

/* bars */
.bars { display: grid; gap: 8px; }
.bars .r { display: grid; grid-template-columns: 120px 1fr 44px; gap: 10px; align-items: center; font-size: .95rem; }
.bars .t { height: 12px; background: var(--mist); border-radius: 6px; overflow: hidden; }
.bars .t i { display: block; height: 100%; background: var(--ink); border-radius: 6px; }
.bars .r.red .t i { background: var(--red); }
.bars .r.gold .t i { background: var(--marigold); }
.bars .n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* toolbar + list */
.views { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.views a { padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .95rem; }
.views a[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 180px 200px; gap: 10px; margin-bottom: 14px; }
@media (max-width: 760px) { .toolbar { grid-template-columns: 1fr 1fr; } .toolbar .search { grid-column: 1 / -1; } }
.toolbar .input { min-height: 44px; padding: 9px 12px; }
table.leads { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
table.leads th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: .88rem; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #FAFBFC; }
table.leads td { padding: 12px; border-bottom: 1px solid var(--mist); vertical-align: middle; }
table.leads tr:last-child td { border-bottom: 0; }
table.leads tbody tr { cursor: pointer; }
table.leads tbody tr:hover { background: #FBF7F6; }
table.leads .nm b { display: block; }
table.leads .nm small { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lcards { display: none; }
@media (max-width: 860px) {
  table.leads { display: none; }
  .lcards { display: grid; gap: 10px; }
}
.lcard:hover { color: var(--ink); border-color: var(--ink); }
.lcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: grid; gap: 6px; text-decoration: none; color: var(--ink); }
.lcard .l1 { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.lcard .l1 b { font-size: 1.05rem; }
.lcard .l2 { color: var(--ink-2); font-size: .95rem; }
.lcard .l3 { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.empty { background: #fff; border: 1px dashed #C9D0D8; border-radius: var(--r-md); padding: 28px; text-align: center; color: var(--ink-2); }
.pager { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 14px; }

/* status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .84rem; font-weight: 600; white-space: nowrap; background: var(--mist); color: var(--ink-2); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.New { background: #E8EEF6; color: #2B4C7E; }
.pill.Contacted { background: #EFEAF8; color: #5A3E91; }
.pill.Qualified { background: var(--red-tint); color: var(--red-deep); }
.pill.Login, .pill.Sanctioned { background: var(--marigold-tint); color: #7A5200; }
.pill.Disbursed { background: #E3F3EA; color: var(--ok); }
.pill.Rejected, .pill.Junk, .pill.Not-interested { background: #F1F1F3; color: #7B7787; }
.pill.Nurture { background: #EEF1F4; color: var(--ink-3); }
.score { font: 700 .95rem var(--display); font-stretch: 112%; }
.score.hi { color: var(--ok); } .score.mid { color: #7A5200; } .score.lo { color: var(--ink-3); }
.due { color: var(--warn); font-weight: 600; }

/* lead detail */
.lhead { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 16px; }
.lhead h1 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); line-height: 1.05; }
.lhead .meta { color: var(--ink-3); margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn { min-height: 44px; padding: 0 16px; }
.btn-sm { min-height: 38px !important; padding: 0 14px !important; font-size: .95rem !important; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 18px; }
.kv div span { display: block; color: var(--ink-3); font-size: .86rem; }
.kv div b { font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .input { min-height: 44px; padding: 9px 12px; }
label.f.small { font-size: .9rem; }
.lenders { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.lenders li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--mist); border-radius: 10px; }
.lenders small { color: var(--ink-3); }
.docs label { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--mist); align-items: flex-start; }
.docs input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--red); }
.notes { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.notes li { background: var(--mist); border-radius: 10px; padding: 10px 12px; }
.notes small, .timeline small { color: var(--ink-3); }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; font-size: .92rem; }
.timeline li { padding: 8px 0 8px 18px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--ink-3); }
.money { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.money div { background: var(--marigold-tint); border-radius: 10px; padding: 10px 12px; }
.money span { display: block; font-size: .85rem; color: var(--ink-2); }
.money b { font: 700 1.2rem var(--display); font-stretch: 112%; }
.notice { background: var(--marigold-tint); border-radius: 10px; padding: 12px 14px; color: var(--ink); }
.secret { font: 700 1.4rem var(--display); font-stretch: 112%; letter-spacing: .04em; background: var(--mist); padding: 10px 14px; border-radius: 10px; display: inline-block; user-select: all; }
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2); text-decoration: none; font-weight: 600; margin-bottom: 10px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--warn); }
@media (max-width: 860px) { #toast { bottom: 84px; } }
