/* Verse CRM — macOS-style admin, tinted with the Verse palette */
:root {
  --bg: #F5F5F7;
  --side: rgba(236, 236, 238, .82);
  --card: #FFFFFF;
  --text: #1D1D1F;
  --text-2: #6E6E73;
  --text-3: #8E8E93;
  --sep: rgba(0, 0, 0, .08);
  --fill: rgba(120, 120, 128, .12);
  --fill-2: rgba(120, 120, 128, .08);
  --tint: #2D5A44;            /* Verse Garden */
  --tint-soft: #E3EDE6;
  --blue: #C7DAEE;            /* Verse Powder Blue */
  --bar: #2D5A44;
  --bar-soft: #B9CFC2;
  --cherry: #C23B34;
  --r: 14px;
  --f: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter Tight', 'Helvetica Neue', Arial, sans-serif;
  --f-display: 'Instrument Serif', Georgia, serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 400 14px/1.45 var(--f); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--tint); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(45, 90, 68, .45); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* icon */
.vicon { position: relative; width: 34px; height: 34px; border-radius: 50%; background: var(--blue); display: grid; place-items: center; flex: none; }
.vicon > span { font-family: var(--f-display); font-style: italic; font-size: 18px; line-height: 1; transform: translate(1px, 1px); color: #161616; }
.vicon svg { position: absolute; inset: -3px; width: calc(100% + 6px); height: calc(100% + 6px); overflow: visible; }
.vicon.big { width: 72px; height: 72px; }
.vicon.big > span { font-size: 38px; }

/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, #DCE8F4, var(--bg)); }
.login-card { width: min(360px, 100%); display: grid; justify-items: center; gap: 12px; text-align: center; background: rgba(255, 255, 255, .8); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 22px; padding: 36px 28px 28px; box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 20px 60px rgba(0, 0, 0, .12); }
.login-card h1 { font: 600 22px/1.2 var(--f); margin: 8px 0 0; }
.login-card .sub { margin: 0 0 8px; color: var(--text-2); }
.login-card input { width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--sep); background: #fff; font-size: 15px; }
.login-card input:focus { outline: none; border-color: var(--tint); box-shadow: 0 0 0 4px rgba(45, 90, 68, .15); }
.login-err { color: var(--cherry); min-height: 1.2em; margin: 0; font-size: 13px; }
.btn-primary { width: 100%; padding: 11px 16px; border: 0; border-radius: 10px; background: var(--tint); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; }
.btn-primary:hover { background: #24493A; }

/* layout */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100%; }
.side { position: sticky; top: 0; height: 100vh; background: var(--side); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-right: 1px solid var(--sep); display: flex; flex-direction: column; padding: 18px 12px 14px; gap: 18px; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.side-brand b { font-family: var(--f-display); font-weight: 400; font-size: 24px; line-height: 1; display: block; }
.side-brand span:not(.vicon *) { font-size: 11px; font-weight: 600; letter-spacing: .12em; color: var(--text-2); }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text); font-weight: 500; text-decoration: none; }
.side-nav a:hover { background: var(--fill-2); }
.side-nav a.on { background: var(--tint); color: #fff; }
.side-nav svg { width: 18px; height: 18px; fill: var(--tint); flex: none; }
.side-nav a.on svg { fill: #fff; }
.badge { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--cherry); color: #fff; font-size: 12px; font-weight: 600; text-align: center; }
.soon { margin-left: auto; font-size: 11px; color: var(--text-3); }
.side-nav a.on .soon { color: rgba(255, 255, 255, .75); }
.side-foot { margin-top: auto; display: grid; gap: 2px; }
.side-link { display: block; text-align: left; padding: 7px 10px; border-radius: 8px; background: none; border: 0; color: var(--text-2); cursor: pointer; }
.side-link:hover { background: var(--fill-2); text-decoration: none; color: var(--text); }

.main { padding: 26px clamp(18px, 3vw, 40px) 60px; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.top h1 { font: 700 30px/1.1 var(--f); letter-spacing: -.02em; margin: 0; }
.top-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.live { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #34C759; box-shadow: 0 0 0 0 rgba(52, 199, 89, .5); animation: pulse 2s infinite; }
.live.off i { background: var(--text-3); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(52, 199, 89, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); } }

/* segmented control */
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text); }
.seg button[aria-checked="true"] { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); font-weight: 600; }
.seg.small button { padding: 4px 10px; }

.demo-banner { margin: -4px 0 20px; padding: 10px 14px; border-radius: 10px; background: #FFF6DB; color: #5C4A0C; font-size: 13px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { background: var(--card); border-radius: var(--r); padding: 14px 16px; box-shadow: 0 0 0 .5px var(--sep); display: grid; gap: 4px; }
.kpi span { color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.kpi b { font: 600 26px/1.1 var(--f); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.kpi small.up { color: #1E7F43; }
.kpi small.down { color: var(--cherry); }
@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* cards */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.card { background: var(--card); border-radius: var(--r); padding: 16px 18px 18px; box-shadow: 0 0 0 .5px var(--sep); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
@media (max-width: 1100px) { .span-4, .span-6, .span-8 { grid-column: span 6; } .span-8 { grid-column: span 12; } }
@media (max-width: 760px) { .span-4, .span-6, .span-8 { grid-column: span 12; } }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.card-h h2 { font: 600 15px/1.3 var(--f); margin: 0; }
.card-h.sub-h { margin-top: 18px; }
.card-note { color: var(--text-3); font-size: 12.5px; }
.more { font-size: 13px; font-weight: 500; }

/* bar lists */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; font-size: 13px; }
.bars .name { display: flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .flag { font-size: 16px; line-height: 1; }
.bars .val { font-variant-numeric: tabular-nums; color: var(--text-2); }
.bars .val b { color: var(--text); font-weight: 600; }
.bars .track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--fill-2); overflow: hidden; }
.bars .track i { display: block; height: 100%; border-radius: 3px; background: var(--bar); }
.empty { color: var(--text-3); font-size: 13px; padding: 8px 0; }

/* charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-l { stroke: var(--sep); stroke-width: 1; }
.chart .axis { fill: var(--text-3); font-size: 11px; font-family: var(--f); }
.chart .bar { fill: var(--bar); }
.chart .bar.soft { fill: var(--bar-soft); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart g:hover .bar { fill: #1F3F30; }
.chart .lead-dot { fill: var(--cherry); }
.chart .lead-lbl { fill: var(--text-2); font-size: 11px; font-family: var(--f); }
.tip { position: fixed; z-index: 100; pointer-events: none; background: rgba(29, 29, 31, .92); color: #fff; padding: 7px 10px; border-radius: 8px; font-size: 12px; line-height: 1.4; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); white-space: nowrap; }
.tip b { font-weight: 600; }

/* funnel */
.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.funnel li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 13px; }
.funnel .track { grid-column: 1 / -1; height: 22px; border-radius: 5px; background: var(--fill-2); overflow: hidden; }
.funnel .track i { display: block; height: 100%; border-radius: 5px; background: var(--bar); }
.funnel li:nth-child(2) .track i { background: #4E7A63; }
.funnel li:nth-child(3) .track i { background: #7C9F8B; }
.funnel li:nth-child(4) .track i { background: var(--cherry); }
.funnel .val { font-variant-numeric: tabular-nums; color: var(--text-2); }
.funnel .val b { color: var(--text); }

/* activity */
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }
.acts h3 { font: 600 12.5px/1.3 var(--f); color: var(--text-2); margin: 0 0 8px; }
.levels { display: flex; height: 26px; border-radius: 6px; overflow: hidden; gap: 2px; }
.levels span { display: grid; place-items: center; font-size: 11.5px; font-weight: 600; min-width: 28px; }
.levels .A2 { background: var(--blue); }
.levels .B1 { background: #EDE3D3; }
.levels .B2 { background: var(--tint); color: #fff; }
@media (max-width: 560px) { .acts { grid-template-columns: 1fr; } }

/* tables */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--text-2); padding: 10px 14px; border-bottom: 1px solid var(--sep); white-space: nowrap; background: #FAFAFB; position: sticky; top: 0; }
.tbl td { padding: 9px 14px; border-bottom: 1px solid var(--sep); vertical-align: middle; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #FAFAFB; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .muted { color: var(--text-3); }
.card .tbl th { background: transparent; }
.card:not(.flush) .tbl th:first-child, .card:not(.flush) .tbl td:first-child { padding-left: 0; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--fill); font-size: 12px; font-weight: 500; }
.pill.new-v { background: var(--tint-soft); color: var(--tint); }
.mini-bar { display: inline-block; width: 80px; height: 6px; border-radius: 3px; background: var(--fill-2); vertical-align: middle; margin-right: 8px; overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--bar); border-radius: 3px; }

/* status chips (always with text) */
.st { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st.new { background: #FDE8E7; color: #A2302A; }
.st.contacted { background: #FFF3D6; color: #8A5A00; }
.st.trial { background: #E4EEF8; color: #2F5F8F; }
.st.client { background: var(--tint-soft); color: var(--tint); }
.st.lost { background: var(--fill); color: var(--text-2); }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.select select { appearance: none; -webkit-appearance: none; padding: 6px 30px 6px 12px; border-radius: 8px; border: 0; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236E6E73' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 11px center; box-shadow: 0 0 0 .5px var(--sep), 0 1px 2px rgba(0, 0, 0, .05); font-size: 13px; cursor: pointer; }

/* leads: mail layout */
.mail { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 12px; align-items: start; }
.mail-list { list-style: none; margin: 0; padding: 6px; background: var(--card); border-radius: var(--r); box-shadow: 0 0 0 .5px var(--sep); max-height: calc(100vh - 180px); overflow: auto; display: grid; gap: 2px; }
.mail-list button { all: unset; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; width: 100%; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.mail-list button:hover { background: var(--fill-2); }
.mail-list button[aria-current="true"] { background: var(--tint); color: #fff; }
.mail-list button[aria-current="true"] .muted, .mail-list button[aria-current="true"] time { color: rgba(255, 255, 255, .78); }
.mail-list b { font-weight: 600; }
.mail-list time { font-size: 12px; color: var(--text-3); }
.mail-list .muted { color: var(--text-2); font-size: 12.5px; grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-list .dot-new { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--cherry); margin-right: 6px; vertical-align: 1px; }
.mail-detail { padding: 22px 24px; display: grid; gap: 18px; }
.mail-detail h2 { font: 700 24px/1.2 var(--f); margin: 0; letter-spacing: -.01em; }
.mail-detail .meta { color: var(--text-2); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 .5px var(--sep); }
.facts div { padding: 10px 14px; border-right: 1px solid var(--sep); border-bottom: 1px solid var(--sep); display: grid; gap: 2px; }
.facts span { font-size: 12px; color: var(--text-2); }
.facts b { font-weight: 600; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; border: 0; background: var(--fill); color: var(--text); font-weight: 500; cursor: pointer; text-decoration: none; }
.btn:hover { background: rgba(120, 120, 128, .2); text-decoration: none; }
.btn.tint { background: var(--tint); color: #fff; }
.btn.tint:hover { background: #24493A; }
.note { width: 100%; min-height: 96px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--sep); background: #FCFCFD; resize: vertical; line-height: 1.45; }
.note:focus { outline: none; border-color: var(--tint); box-shadow: 0 0 0 4px rgba(45, 90, 68, .12); }
.msg { background: var(--fill-2); border-radius: 12px; padding: 12px 14px; }
.saved { font-size: 12px; color: var(--text-3); min-height: 1.2em; }
@media (max-width: 900px) { .mail { grid-template-columns: minmax(0, 1fr); } .mail-list { max-height: 320px; } .facts { grid-template-columns: 1fr 1fr; } }

.prose { max-width: 720px; display: grid; gap: 12px; }
.prose h2 { font: 600 20px/1.3 var(--f); margin: 0; }
.prose p { margin: 0; }
.checklist { margin: 0; padding-left: 18px; display: grid; gap: 6px; }

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; padding: 8px 10px; gap: 10px; overflow-x: auto; }
  .side-brand div, .side-foot { display: none; }
  .side-nav { display: flex; gap: 4px; }
  .side-nav a { white-space: nowrap; padding: 6px 10px; }
  .side-nav svg { display: none; }
  .main { padding-top: 18px; }
}
.levels span { min-width: 58px; white-space: nowrap; padding: 0 6px; }
#recent-leads td { white-space: normal; }
.login-card .sub span { white-space: nowrap; }
#visits td:nth-child(4) { white-space: normal; min-width: 160px; }
.side-credit { font-size: 11px; color: var(--text-3); padding: 6px 10px 0; }
