/* AdsLyve CRM — brand: magenta → purple → blue accents on white, dark navy headings. System fonts only (works offline). */
:root {
  --navy: #151A47; --navy7: #232A63; --magenta: #D4208E; --violet: #7B2FF2; --azure: #2563EB;
  --ink: #2A2F45; --muted: #676C86; --line: #E4E6EF; --canvas: #F6F7FB; --surface: #fff; --heading: #151A47; --wordmark: #111;
  --good: #0F8A5F; --warn: #A86A12; --bad: #C53030;
  --brand: linear-gradient(100deg, #D4208E 0%, #7B2FF2 55%, #2563EB 100%);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --t-call: var(--violet); --t-email: var(--azure); --t-whatsapp: var(--good); --t-meeting: var(--magenta); --t-proposal: var(--navy);
  --t-status_change: #C9CCDA; --t-assignment: #C9CCDA; --t-import: #C9CCDA; --t-follow_up: var(--violet);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--canvas); color: var(--ink); font: 14px/1.5 var(--font); font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-family: var(--font-display); color: var(--heading); margin: 0; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.contents { display: contents; border: 0; padding: 0; margin: 0; }
.muted { color: var(--muted); } .sm { font-size: 12.5px; } .strong { color: var(--heading); font-weight: 600; }
.bad { color: var(--bad); } .warn { color: var(--warn); } .good { color: var(--good); }
.nowrap { white-space: nowrap; } .r { text-align: right; } .mt { margin-top: 6px; } .mb { margin-bottom: 18px; } .pad { padding: 10px 16px; }
.trunc { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .row.tight { gap: 5px; } .row.between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.link, a.link { color: var(--violet); text-decoration: none; } .link:hover { text-decoration: underline; }
.lk { color: var(--heading); font-weight: 600; text-decoration: none; } .lk:hover { color: var(--violet); text-decoration: underline; }
.h1 { font-size: 24px; margin-top: 2px; } .h2 { font-size: 18px; margin-bottom: 10px; } .h3 { font-size: 14px; margin: 14px 0 4px; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--surface); }
.center-text { text-align: center; } .centered { justify-content: center; }

/* layout */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }

.app > aside { background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; padding: 18px 12px; overflow-y: auto; }
.logo { width: 150px; display: block; margin: 0 8px 18px; } .logo.big { width: 200px; margin: 0 auto 24px; }

.app > aside nav a { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 6px; text-decoration: none; margin-bottom: 2px; }

.app > aside nav a:hover { background: var(--canvas); }

.app > aside nav a[aria-current="page"] { background: var(--canvas); font-weight: 600; color: var(--heading); }

.app > aside nav a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: var(--brand); }
.pill { font-size: 11px; font-weight: 600; color: var(--bad); background: #C5303014; padding: 0 6px; border-radius: 4px; white-space: nowrap; }
.main-col { min-width: 0; }
.top { position: sticky; top: 0; z-index: 5; display: flex; gap: 12px; align-items: center; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 28px; }
.top .grow { flex: 1; } .top input { width: 100%; max-width: 540px; border: 1px solid var(--line); background: var(--canvas); border-radius: 6px; padding: 7px 12px; color: var(--ink); font: inherit; }
.count { margin-left: 6px; background: var(--magenta); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; font-weight: 600; }
.who { font-size: 12.5px; line-height: 1.25; text-align: right; } .who b { color: var(--heading); display: block; } .who span { color: var(--muted); }
main { padding: 24px 28px 64px; }
.ph { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 20px; }
.ph h1 { font-size: 26px; font-weight: 600; } .ph p { margin: 4px 0 0; color: var(--muted); max-width: 720px; }
.narrow { max-width: 460px; } .narrow-wide { max-width: 900px; }

/* panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.panel > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 11px 16px; }
.panel > header h2 { font-size: 15px; font-weight: 600; } .b, .panel.b { padding: 14px 16px; }
.grid { display: grid; gap: 18px; } .g4 { grid-template-columns: repeat(4, 1fr); } .g2 { grid-template-columns: 1fr 1fr; } .g31 { grid-template-columns: minmax(0, 1fr) 380px; }
dl { margin: 0; }
.stat { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.stat:last-child { border: 0; } .stat dt a { text-decoration: none; } .stat dt a:hover { color: var(--violet); text-decoration: underline; }
.stat dd { margin: 0; font: 600 17px var(--font-display); color: var(--heading); white-space: nowrap; } .stat dd.bad { color: var(--bad); } .stat dd.warn { color: var(--warn); }
.funnel { list-style: none; margin: 0; padding: 0; } .funnel li { display: grid; grid-template-columns: 170px 1fr 90px; gap: 12px; align-items: center; margin: 5px 0; }
.bar { height: 20px; background: var(--canvas); border-radius: 3px; } .bar span { display: block; height: 20px; border-radius: 3px; background: var(--brand); }
.facts { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px 16px; margin-top: 14px; } .facts dt { font-size: 12px; color: var(--muted); } .facts dd { margin: 0; font-weight: 600; color: var(--heading); }

/* controls */
.btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; padding: 7px 13px; font-weight: 500; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--canvas); } .btn.p { background: var(--navy); border-color: var(--navy); color: #fff; } .btn.p:hover { background: var(--navy7); }
.btn.sm { padding: 4px 10px; font-size: 13px; } .btn.ghost { border-color: transparent; background: none; color: var(--muted); } .btn.danger { color: var(--bad); border-color: #C5303040; }
.btn.full { width: 100%; justify-content: center; } .btn:disabled { opacity: .55; cursor: not-allowed; }
.inp { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; background: var(--surface); color: var(--ink); font: inherit; min-width: 0; }
.inp:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 3px #7B2FF222; } .inp.auto { width: auto; } .w8 { width: 8.5rem; } .w20 { max-width: 20rem; }
textarea.inp { resize: vertical; }
.field { display: flex; flex-direction: column; gap: 4px; } .lbl { font-size: 13px; font-weight: 500; } .hint { font-size: 12.5px; color: var(--muted); margin: 4px 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; align-items: end; } .span2 { grid-column: span 2; }
.g3c { grid-template-columns: repeat(3, 1fr); } .g4c { grid-template-columns: 2fr 1fr 1fr auto; } .g5c { grid-template-columns: 1fr 1.3fr 150px 180px auto; }
.inline-lbl { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.msg { font-size: 13px; margin: 8px 0 0; } .msg.good { color: var(--good); } .msg.bad { color: var(--bad); } .msg.warn { color: var(--warn); background: #A86A1212; border-radius: 6px; margin: 10px 16px 0; padding: 8px 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; border-right: 1px solid var(--line); background: none; padding: 6px 12px; color: var(--ink); } .seg button:last-child { border: 0; } .seg .on { background: var(--navy); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; align-items: center; }
.chips button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 6px; padding: 4px 11px; } .chips .on { background: var(--navy); border-color: var(--navy); color: #fff; }
.badge { display: inline-block; white-space: nowrap; border: 1px solid var(--line); background: var(--canvas); border-radius: 4px; padding: 1px 6px; font-size: 11.5px; font-weight: 500; color: var(--ink); }
.badge.good { color: var(--good); border-color: #0F8A5F44; background: #0F8A5F14; } .badge.warn { color: var(--warn); border-color: #A86A1244; background: #A86A1214; }
.badge.bad { color: var(--bad); border-color: #C5303044; background: #C5303014; } .badge.brand { color: var(--violet); border-color: #7B2FF244; background: #7B2FF214; }
.badge.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 8px; padding: 36px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--heading); font-family: var(--font-display); margin-bottom: 4px; }

/* tables */
.tw { overflow-x: auto; } .tw.scroll { max-height: 480px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; white-space: nowrap; background: #F6F7FBcc; color: var(--muted); font-size: 12px; font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
th.r { text-align: right; } td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; } tr:last-child td { border-bottom: 0; }
tr.sel td { background: #7B2FF20d; } tr.group td { background: var(--canvas); font-weight: 600; color: var(--heading); } .w1 { width: 1%; } .minw { min-width: 180px; }
.filters { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 12px; margin-bottom: 14px; }
.bulk { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--canvas); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; color: var(--muted); font-size: 13px; }

/* lead page */
.task { padding: 12px 16px; border-bottom: 1px solid var(--line); } .task:last-child { border-bottom: 0; } .task.unread { background: #7B2FF20a; }
.complete { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; background: var(--canvas); border: 1px solid var(--line); border-radius: 6px; padding: 12px; margin-top: 10px; width: 100%; }
.tl { list-style: none; margin: 0 0 0 6px; padding: 0 0 0 20px; border-left: 1px solid var(--line); }
.tl li { position: relative; margin-bottom: 16px; }
.tl li::before { content: ""; position: absolute; left: -26px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 4px var(--surface); }
.quote { background: var(--canvas); border-radius: 6px; padding: 8px 12px; margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.plain { list-style: none; margin: 0; padding: 0; } .plain li { padding: 4px 0; } .change { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 8px; }
details summary { cursor: pointer; }

/* follow-up views */
.views { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; }
.mobile-only { display: none; }
.views nav p { font-size: 12px; font-weight: 600; color: var(--muted); margin: 14px 8px 4px; } .views nav div:first-child p { margin-top: 0; }
.views nav a { display: block; padding: 6px 8px; border-radius: 6px; text-decoration: none; font-size: 13.5px; }
.views nav a:hover { background: var(--surface); } .views nav a[aria-current="page"] { background: var(--surface); font-weight: 600; color: var(--heading); box-shadow: inset 3px 0 0 var(--violet); }

/* pipeline */
.kb { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.col { flex: 0 0 248px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding-bottom: 6px; } .col.over { border-color: var(--violet); }
.col header { border-bottom: 1px solid var(--line); padding: 9px 12px; } .col h3 { font-size: 14px; font-weight: 600; }
.card { border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; margin: 8px; background: var(--surface); cursor: grab; } .card:hover { border-color: #7B2FF266; } .card.dragging { opacity: .5; }
.more { display: block; font-size: 12px; color: var(--muted); padding: 2px 12px; }

/* import, backups */
.steps { display: flex; list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); } .steps li { flex: 1; padding: 10px 16px; color: var(--muted); }
.steps .on { color: var(--heading); font-weight: 600; box-shadow: inset 0 -2px 0 var(--violet); } .steps .done { color: var(--ink); }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px dashed var(--line); border-radius: 8px; padding: 48px 20px; text-align: center; cursor: pointer; }
.drop:hover { border-color: #7B2FF288; } .drop b { color: var(--heading); font-family: var(--font-display); } .drop.small { padding: 24px; }
.mini-stats { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; } .mini-stats div { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
.mini-stats dt { font-size: 12px; color: var(--muted); } .mini-stats dd { margin: 0; font: 600 18px var(--font-display); color: var(--heading); }
.progress { height: 8px; max-width: 460px; margin: 6px auto; background: var(--canvas); border-radius: 4px; } .progress span { display: block; height: 8px; border-radius: 4px; background: var(--brand); transition: width .3s; }
.creds { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; margin: 12px 0; } .creds dt { color: var(--muted); } .creds dd { margin: 0; overflow-wrap: anywhere; }
code { background: var(--canvas); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.user-row { display: grid; grid-template-columns: 1fr 1.4fr 130px 170px 130px auto; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.stage-row { display: grid; grid-template-columns: 1.4fr 80px 80px repeat(4, auto) auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
.stage-row.dashed { border-style: dashed; grid-template-columns: 1.4fr 80px 80px auto; } .end { align-self: end; }

/* charts */
.chart { margin: 0; } .chart svg { width: 100%; height: auto; display: block; } .axis { font-size: 10px; fill: var(--muted); }
.legend { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); } .legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* auth + modal */
.auth { width: 100%; max-width: 400px; } .auth-bar { height: 4px; background: var(--brand); border-radius: 8px 8px 0 0; }
.auth-card { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; padding: 24px; background: var(--surface); }
.auth-card h1 { font-size: 20px; margin-bottom: 6px; } .auth-card .stack { margin-top: 14px; }
.modal-bg { position: fixed; inset: 0; z-index: 30; background: #151A4755; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 480px; background: var(--surface); border-radius: 10px; border: 1px solid var(--line); max-height: 90vh; overflow: auto; }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); } .modal header h2 { font-size: 16px; }
.x { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); }

/* responsive */
@media (max-width: 1200px) { .g4 { grid-template-columns: 1fr 1fr; } .g31 { grid-template-columns: minmax(0, 1fr); } .filters { grid-template-columns: repeat(3, 1fr); } .mini-stats { grid-template-columns: repeat(4, 1fr); } .facts { grid-template-columns: repeat(4, 1fr); } .user-row { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .app > aside { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; }
  .logo { width: 110px; margin: 0 4px 8px; } .app > aside nav { display: flex; overflow-x: auto; gap: 2px; } 
.app > aside nav a { white-space: nowrap; }
  .top { padding: 8px 12px; flex-wrap: wrap; } .who { display: none; } main { padding: 16px 12px 56px; }
  .g4, .g2, .g31, .g3c, .g4c, .g5c, .form-grid, .complete, .views, .filters, .user-row { grid-template-columns: minmax(0, 1fr); } .span2 { grid-column: auto; }
  .facts { grid-template-columns: repeat(2, 1fr); } .mini-stats { grid-template-columns: repeat(2, 1fr); } .stage-row, .stage-row.dashed { grid-template-columns: 1fr 1fr; }
  .funnel li { grid-template-columns: 110px 1fr 70px; } .ph h1 { font-size: 22px; } .creds { grid-template-columns: 1fr; }
}
@media (max-width: 760px) { .views > nav { display: none; } .mobile-only { display: block; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
