/* Rankd Marketing Tracker — dashboard app (shares brand.css tokens) */

.dash { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

/* ---------- sidebar ---------- */
.side {
  position: sticky; top: 0; height: 100vh; background: var(--paper);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 22px 16px;
}
.side .brand { padding: 4px 8px 22px; }
.side nav { display: flex; flex-direction: column; gap: 3px; }
.side nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm);
  font-weight: 600; font-size: 14.5px; color: var(--ink-2); cursor: pointer;
}
.side nav a svg { width: 19px; height: 19px; color: var(--ink-3); flex-shrink: 0; stroke-linecap: round; stroke-linejoin: round; }
.side nav a:hover { background: var(--bg-2); color: var(--ink); }
.side nav a.on { background: var(--violet-100); color: var(--violet-700); }
.side nav a.on svg { color: var(--violet); }
.side .spacer { flex: 1; }
.side .acct { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 10px; }
.side .acct .biz { font-weight: 700; font-size: 14px; }
.side .acct .plan { display: flex; align-items: center; gap: 7px; margin-top: 6px; font-size: 12px; color: var(--ink-3); }

/* ---------- main ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(250,248,255,.86); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); padding: 16px 28px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.topbar h1 { font-size: 23px; }
.topbar .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.topbar .tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.content { padding: 26px 28px 60px; }

/* period picker */
.period { display: inline-flex; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 3px; box-shadow: var(--shadow-sm); }
.period button { border: 0; background: none; font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: .03em; padding: 7px 12px; border-radius: var(--r-pill); color: var(--ink-3); }
.period button:hover { color: var(--ink); }
.period button.on { background: var(--violet); color: #fff; }

.sync-btn { display: inline-flex; align-items: center; gap: 8px; }
.sync-meta { font-size: 12px; color: var(--ink-3); }

/* ---------- kpis ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.kpi::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background: var(--accent, var(--violet)); }
.kpi .label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kpi .value { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -.02em; margin-top: 7px; line-height: 1; }
.kpi .value.long { font-size: 25px; } .kpi .value.vlong { font-size: 21px; }
.kpi .delta { font-size: 12.5px; font-weight: 700; margin-top: 8px; color: var(--ink-3); }
.kpi .delta.up { color: var(--green-700); } .kpi .delta.down { color: var(--coral); }
.kpi.a-green::before { background: var(--green); } .kpi.a-violet::before { background: var(--violet); }
.kpi.a-sky::before { background: var(--sky); } .kpi.a-amber::before { background: var(--amber); }
.kpi.a-coral::before { background: var(--coral); }

/* ---------- blocks ---------- */
.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
.grid-2.even { grid-template-columns: 1fr 1fr; }
.block { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 20px 22px; margin-bottom: 20px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.block-head h2 { font-size: 16.5px; font-weight: 800; }
.block-head .hint { font-size: 12px; color: var(--ink-3); }

/* hbars */
.hbar { display: grid; grid-template-columns: 150px 1fr auto auto; align-items: center; gap: 12px; padding: 7px 0; }
.hbar .l { font-weight: 600; font-size: 13.5px; }
.hbar .l small { display: block; color: var(--ink-3); font-weight: 500; font-size: 11.5px; }
.hbar .track { background: var(--bg-2); border-radius: var(--r-pill); height: 12px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: var(--r-pill); background: var(--violet); transition: width .5s cubic-bezier(.2,.7,.2,1); }
.hbar .v { font-family: var(--mono); font-weight: 700; font-size: 13.5px; text-align: right; }
.hbar .s { font-size: 11.5px; color: var(--ink-3); text-align: right; min-width: 56px; }

/* charts */
.chart svg { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--mono); font-size: 9.5px; fill: var(--ink-3); }
.donut-v { font-family: var(--display); font-weight: 800; font-size: 19px; fill: var(--ink); }
.donut-l { font-family: var(--mono); font-size: 8px; fill: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: right; font-family: var(--mono); }
.tbl .chtag { display: inline-flex; align-items: center; gap: 6px; }

/* expense entry */
.exp-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; align-items: end; }
.exp-form .field { margin: 0; }
.exp-month { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.exp-saved { color: var(--green-700); font-weight: 700; font-size: 13px; }
.exp-intro { font-size: 14.5px; color: var(--ink-2); line-height: 1.55; margin-bottom: 16px; max-width: 660px; }
.exp-month { background: var(--violet-050); border: 1px solid var(--violet-100); border-radius: var(--r-sm); padding: 12px 14px; }
.exp-month .label { font-weight: 700; color: var(--ink); }
.exp-hist-row { cursor: pointer; }
.exp-hist-row:hover { background: var(--violet-050); }
.exp-hist-row td:first-child { font-weight: 700; color: var(--violet-700); }
.exp-edit-hint { font-size: 11px; color: var(--ink-4); }

/* empty / loading states */
.center-state { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 40px; }
.center-state .card { max-width: 460px; padding: 36px 32px; }
.center-state h2 { font-size: 22px; margin-bottom: 10px; }
.center-state p { color: var(--ink-2); margin-bottom: 20px; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.kv { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-3); }
.kv .v { font-weight: 700; }

/* ---------- best practices ---------- */
.tips-intro { background: var(--violet-050); border: 1px solid var(--violet-100); border-radius: var(--r-lg); padding: 18px 22px; margin-bottom: 20px; font-size: 15px; color: var(--ink-2); }
.tips-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; margin-bottom: 20px; }
.tip-ic { width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; color: #fff; margin-right: 10px; vertical-align: middle; }
.tip-ic svg { width: 16px; height: 16px; stroke-linecap: round; stroke-linejoin: round; }
.block-head h2 .tip-ic { margin-bottom: 0; }
.tiplist { list-style: none; display: grid; gap: 13px; }
.tiplist li { display: flex; gap: 11px; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.tiplist li svg { width: 18px; height: 18px; color: var(--green); flex: none; margin-top: 2px; stroke-linecap: round; stroke-linejoin: round; }
.tiplist li b { color: var(--ink); }
@media (max-width: 1000px) { .tips-2 { grid-template-columns: 1fr; } }

/* ---------- demo banner ---------- */
.demo-bar { position: sticky; top: 0; z-index: 80; display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(90deg, var(--violet-700), var(--violet) 60%, #9333ea); color: #fff; padding: 10px 18px; font-weight: 600; font-size: 14px; }
.demo-bar b { font-weight: 800; }
.demo-bar .btn { padding: 8px 16px; font-size: 14px; }
.demo-bar .btn-white { background: #fff; color: var(--violet-700); }
.demo-bar .btn-white:hover { transform: translateY(-1px); }
.demo-bar a.demo-link { color: #fff; text-decoration: underline; font-weight: 700; }
@media (max-width: 700px) { .demo-bar { font-size: 12.5px; } }

/* ---------- smaller, centered charts ---------- */
.chart { display: flex; justify-content: center; }
.chart svg { width: 100%; height: auto; max-height: 220px; }
#ovDonut.chart svg, #revDonut.chart svg { max-height: 200px; }

/* ---------- help tooltips on panels ---------- */
.help { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--violet-100); color: var(--violet-700); font-size: 10px; font-weight: 800; margin-left: 7px; cursor: help; position: relative; vertical-align: middle; }
.help::after { content: attr(data-tip); position: absolute; left: 50%; bottom: 150%; transform: translateX(-50%) translateY(4px); width: 250px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 500; line-height: 1.45; letter-spacing: 0; text-transform: none; padding: 9px 11px; border-radius: 9px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease; z-index: 60; }
.help:hover::after, .help:focus::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.kpi .help { margin-left: 5px; }

/* ---------- technician leaderboard ---------- */
.lb { display: grid; gap: 10px; }
.lb-row { display: grid; grid-template-columns: 34px 40px 1fr auto auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
.lb-row.top { border-color: var(--violet-300); background: var(--violet-050); }
.lb-rank { font-family: var(--display); font-weight: 800; font-size: 16px; color: var(--ink-3); text-align: center; }
.lb-row.top .lb-rank { color: var(--violet); }
.lb-av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--violet-100); display: grid; place-items: center; font-weight: 800; color: var(--violet-700); font-size: 14px; overflow: hidden; }
.lb-av img { width: 100%; height: 100%; object-fit: cover; }
.lb-name { font-weight: 700; font-size: 15px; } .lb-name small { display: block; color: var(--ink-3); font-weight: 500; font-size: 12px; }
.lb-rev { font-family: var(--mono); font-weight: 700; font-size: 15px; text-align: right; }
.lb-jobs { font-size: 12.5px; color: var(--ink-3); text-align: right; min-width: 90px; }
.lb-medal { font-size: 18px; }

/* ---------- leaderboard range control + tech detail ---------- */
.lb-ctl { display: inline-flex; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 3px; box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.lb-range-btn { border: 0; background: none; font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: .03em; padding: 8px 14px; border-radius: var(--r-pill); color: var(--ink-3); cursor: pointer; }
.lb-range-btn:hover { color: var(--ink); }
.lb-range-btn.on { background: var(--violet); color: #fff; }
.modal-card.wide { max-width: 660px; max-height: 88vh; overflow-y: auto; }
.dtl-h { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.wk-bars { display: flex; align-items: flex-end; gap: 10px; height: 110px; }
.wk-bars .wk { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.wk-bars .wk-bar { width: 70%; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--violet-300), var(--violet)); min-height: 3px; }
.wk-bars .wk-l { font-family: var(--mono); font-size: 9px; color: var(--ink-3); }

.lb-custom { display: flex; gap: 16px; flex-wrap: wrap; margin: -6px 0 16px; }
.lb-custom label { font-size: 12.5px; font-weight: 600; color: var(--ink-3); display: inline-flex; align-items: center; gap: 7px; }
.lb-custom input[type=date] { font: inherit; font-size: 13px; padding: 6px 9px; border: 1px solid var(--line-2); border-radius: var(--r-sm); color: var(--ink); background: var(--paper); }
.tbl th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.tbl th.sortable:hover { color: var(--violet); }

/* ---------- support ---------- */
.support-grid { align-items: start; }
.support-lede { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; margin: 0 0 16px; }
.support-form { display: grid; gap: 13px; }
.support-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.support-form .field { display: grid; gap: 5px; }
.support-form textarea.input { resize: vertical; font-family: inherit; line-height: 1.5; }
.support-result { min-height: 0; }
.sp-err { background: var(--amber-100); color: var(--amber-700); border-radius: var(--r-sm); padding: 10px 13px; font-size: 13px; font-weight: 600; }
.support-done { text-align: center; padding: 26px 10px; }
.support-done .big { width: 46px; height: 46px; border-radius: 50%; background: var(--green-100, #e6f7ee); color: var(--green-600, #16a34a); font-size: 24px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.support-done h3 { margin: 0 0 4px; }
.support-done p { color: var(--ink-2); font-size: 13.5px; margin: 0; }
.support-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.support-list li { display: grid; gap: 2px; font-size: 13px; }
.support-list li b { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.support-list li span { color: var(--ink-2); line-height: 1.5; }

/* ---------- call intel ---------- */
.intel-list { display: grid; gap: 10px; }
.intel-call { border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px; }
.intel-call .top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.intel-call .who { font-weight: 700; font-size: 14px; }
.intel-call .sum { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.stars { color: var(--amber); letter-spacing: 1px; font-size: 13px; }
.stars.sm { font-size: 11px; }
.stars .off { color: var(--line-2); }

.ci-note { background: var(--sky-100, #e6f1fe); color: var(--sky-700, #0369a1); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 13px; font-size: 12.5px; line-height: 1.5; margin-bottom: 18px; }
.ci-note a { color: inherit; font-weight: 700; }

/* AI transcript scan */
.ai-cta { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: linear-gradient(100deg, var(--violet-50, #f3effe), #fff); border: 1px solid var(--violet-200, #ddd0fb); border-radius: var(--r); padding: 18px 20px; margin-bottom: 18px; }
.ai-cta-txt { max-width: 620px; }
.ai-cta-txt h3 { margin: 0 0 6px; font-size: 17px; display: flex; align-items: center; gap: 9px; }
.ai-cta-txt p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.ai-cta-act { text-align: center; flex: none; }
.ai-quota { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.ai-bar { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; background: var(--violet-50, #f3effe); border: 1px solid var(--violet-200, #ddd0fb); border-radius: var(--r-sm); padding: 11px 15px; margin-bottom: 18px; font-size: 13.5px; }
.ai-bar .muted { color: var(--ink-3); font-size: 12.5px; }
.sent { font-size: 10.5px; font-weight: 700; text-transform: capitalize; padding: 2px 8px; border-radius: 999px; }
.sent.positive { background: var(--green-100, #e6f7ee); color: var(--green-700, #15803d); }
.sent.neutral { background: var(--line); color: var(--ink-3); }
.sent.negative { background: var(--coral-100, #fee2e6); color: #be123c; }
.coach-row { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.coach-row:last-child { border-bottom: 0; }
.coach-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; font-size: 13px; }
.coach-top .rc-date { margin-left: auto; }
#aiReps { display: grid; gap: 12px; }

/* CSR reps + coaching layout */
.intel-coach { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .intel-coach { grid-template-columns: 1fr; } }
.rep-note { background: var(--violet-50, #f3effe); color: var(--violet-700, #5b2bc9); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 13px; font-size: 12.5px; margin-bottom: 14px; }
#ciReps { display: grid; gap: 12px; }
.rep { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.rep-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--paper-2, #faf9fe); border-bottom: 1px solid var(--line); }
.rep-av { width: 34px; height: 34px; border-radius: 50%; background: var(--violet); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; flex: none; }
.rep-id { display: flex; flex-direction: column; min-width: 0; }
.rep-name { font-weight: 800; font-size: 14.5px; }
.rep-meta { font-size: 11.5px; color: var(--ink-3); font-family: var(--mono); }
.rep-rate { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.rep-rate b { font-size: 15px; }
.rep-calls { padding: 6px 14px 12px; display: grid; gap: 9px; }
.rc { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.rc:last-child { border-bottom: 0; }
.rc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.rc-cust { font-weight: 700; font-size: 13px; }
.rc-date { margin-left: auto; font-size: 10.5px; color: var(--ink-3); font-family: var(--mono); }
.rc-detail { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.rc-none { font-size: 12.5px; color: var(--ink-3); padding: 4px 0; }
.listen { font-size: 11px; font-weight: 700; color: var(--violet); text-decoration: none; white-space: nowrap; margin-left: 6px; }
.listen:hover { text-decoration: underline; }
.method .method-body { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.method .method-body p { margin: 0 0 10px; }
.method .method-body ul { margin: 0 0 10px; padding-left: 18px; display: grid; gap: 6px; }
.method .method-note { background: var(--amber-100); color: var(--amber-700); border-radius: var(--r-sm); padding: 9px 12px; font-size: 12px; font-weight: 600; margin: 0; }
.disclaimer { background: var(--amber-100); color: var(--amber-700); border-radius: var(--r-sm); padding: 11px 14px; font-size: 13px; font-weight: 600; margin-bottom: 18px; display: flex; gap: 9px; align-items: flex-start; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(29,24,48,.5); z-index: 1000; display: grid; place-items: center; padding: 20px; }
.modal-card { background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 440px; padding: 28px; }
.modal-card h2 { font-size: 22px; margin-bottom: 6px; }
.modal-card p { color: var(--ink-2); font-size: 14.5px; margin-bottom: 18px; }
.modal-card .cancel-link { display: block; text-align: center; margin-top: 18px; font-size: 12.5px; color: var(--ink-4); }
.modal-card .cancel-link:hover { color: var(--coral); text-decoration: underline; }
.modal-x { float: right; background: none; border: 0; font-size: 22px; color: var(--ink-3); line-height: 1; margin: -8px -6px 0 0; }

/* ---------- product tour ---------- */
.tour-backdrop { position: fixed; inset: 0; background: rgba(29,24,48,.5); z-index: 900; }
.tour-pop { position: fixed; z-index: 901; max-width: 320px; background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 18px 20px; }
.tour-pop h3 { font-size: 17px; margin-bottom: 6px; }
.tour-pop p { font-size: 14px; color: var(--ink-2); margin-bottom: 14px; }
.tour-pop .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tour-pop .dots { display: flex; gap: 5px; }
.tour-pop .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); display: inline-block; }
.tour-pop .dots i.on { background: var(--violet); }
.tour-spot { position: fixed; z-index: 902; border-radius: 12px; box-shadow: 0 0 0 3px var(--violet), 0 0 0 8px rgba(124,58,237,.3); pointer-events: none; transition: all .25s ease; }

@media (max-width: 1000px) { .grid-2, .grid-2.even, .settings-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .dash { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side .spacer, .side .acct { display: none; }
}
