/* Marketing panel: base.css is the control panel's stylesheet (same tokens and components);
   this file adds only what the sales pages need. */
.logo.mk { background: linear-gradient(135deg, #0ea5a4 0%, #2f7cf6 60%, #6a4dff 100%); box-shadow: 0 6px 18px rgba(47, 124, 246, .32); }
.me .avatar { background: var(--accent); color: var(--on-accent); }
.nav-soon { flex: none !important; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; padding: 1px 7px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.nav-item.on .nav-soon { background: transparent; color: var(--accent); border-color: var(--accent-soft); }

.toolbar select { width: auto; min-width: 170px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; user-select: none; }
.toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

/* KPI tiles */
.kpi { gap: 6px; }
.kpi-head .delta { margin-left: auto; }
.kpi .kpi-value { font-size: 26px; }
.warn-note { flex-direction: row; align-items: center; gap: 10px; color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta .icon { width: 13px; height: 13px; }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); } .delta.flat { color: var(--muted); }

/* revenue chart */
.chart-wrap { position: relative; min-height: 240px; }
.bars { display: block; }
.bars .grid { stroke: var(--grid); stroke-width: 1; }
.bars .axis { stroke: var(--line-2); stroke-width: 1; }
.bars .tick { fill: var(--muted); font-size: 11px; font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.bars .bar { fill: var(--c1); transition: opacity .12s; }
.bars .bar.on { opacity: .78; }
.bars .hit { fill: transparent; cursor: default; outline: none; }
.tip-row i.c1 { background: var(--c1); }

/* product table */
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.prod { display: flex; flex-direction: column; margin-bottom: 2px; }
.rev { display: flex; flex-direction: column; align-items: flex-end; }
.share { height: 4px; margin-top: 6px; border-radius: 2px; background: var(--grid); overflow: hidden; min-width: 90px; }
.share i { display: block; height: 100%; border-radius: 2px; background: var(--c1); }

/* products without sales */
.other-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.other { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 11px; background: var(--panel-2); border: 1px solid var(--line); }
.other-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.other p { margin: 4px 0 0; }

/* product details */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.fact { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.fact strong { font-variant-numeric: tabular-nums; }

/* roadmap pages */
.roadmap { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.roadmap li { display: flex; gap: 12px; align-items: flex-start; }
.roadmap li > .icon { color: var(--accent); margin-top: 2px; }

/* CRM */
.kpi.clickable { cursor: pointer; transition: border-color .15s; }
.kpi.clickable:hover { border-color: var(--line-2); }
.ai-banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 16px; border-radius: var(--r); border: 1px dashed var(--line-2); background: var(--panel-2); }
.ai-banner > div { flex: 1; min-width: 0; }
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.stage-chip { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text-2); font-weight: 600; cursor: pointer; text-align: left; }
.stage-chip span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-chip strong { font-variant-numeric: tabular-nums; color: var(--text); }
.stage-chip:hover { background: var(--hover); }
.stage-chip.on { border-color: var(--accent); background: var(--accent-soft); }
.stage-chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.stage-chip .dot.info { background: var(--info); } .stage-chip .dot.accent { background: var(--accent); } .stage-chip .dot.warn { background: var(--warn); }
.stage-chip .dot.ok { background: var(--ok); } .stage-chip .dot.bad { background: var(--bad); }
.toolbar input[type="search"] { flex: 1 1 240px; width: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12px; color: var(--text-2); white-space: nowrap; }
.score { display: flex; align-items: center; gap: 8px; min-width: 90px; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }
.score span { width: 24px; text-align: right; }
.score-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--grid); overflow: hidden; min-width: 50px; }
.score-bar i { display: block; height: 100%; border-radius: 3px; }
.score-bar i.hi { background: var(--ok); } .score-bar i.mid { background: var(--c1); } .score-bar i.lo { background: var(--muted); }
.tbl tr.dim td { opacity: .55; }
.due { color: var(--bad); font-weight: 600; }
.contact-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.contact-head .score { min-width: 140px; }
.flags { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.note-box { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.note-box textarea { flex: 1; height: auto; padding: 8px 12px; resize: vertical; }
textarea { height: auto; padding: 8px 12px; resize: vertical; }
.timeline ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.t-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; flex: none; background: var(--panel-2); color: var(--muted); }
.t-ic .icon { width: 15px; height: 15px; }
.t-purchase .t-ic { background: var(--ok-soft); color: var(--ok); }
.t-inquiry .t-ic, .t-email_in .t-ic { background: var(--info-soft); color: var(--info); }
.t-note .t-ic, .t-task .t-ic { background: var(--accent-soft); color: var(--accent); }
.t-optout .t-ic { background: var(--bad-soft); color: var(--bad); }
.t-main { flex: 1; min-width: 0; }
.t-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.t-body { margin-top: 3px; color: var(--text-2); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.modal.wide { max-width: 760px; }
/* inbox */
.mail-list { display: flex; flex-direction: column; margin: -6px -8px; }
.mail-row { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 12px 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; border-radius: 8px; color: var(--text); }
.mail-row:hover { background: var(--hover); }
.mail-row:last-child { border-bottom: 0; }
.mail-row.unread .mail-subj { font-weight: 700; }
.mail-row.unread { box-shadow: inset 3px 0 0 var(--accent); }
.mail-top { display: flex; justify-content: space-between; gap: 10px; }
.mail-subj { font-size: 14px; }
.mail-prev { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.bubbles { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.bubble { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); max-width: 92%; }
.bubble.out { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.bubble-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.bubble-head strong { overflow-wrap: anywhere; }
.bubble-subj { font-weight: 600; margin: 4px 0; }
.bubble-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; color: var(--text-2); max-height: 360px; overflow: auto; }
.draft { margin: 14px 0; padding: 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--panel); }
.draft-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.draft-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--accent); }
.draft-tag .icon { width: 16px; height: 16px; }
.draft-sum { margin: 4px 0; font-size: 13px; }
.draft-body { min-height: 220px; font-family: var(--font-ui); line-height: 1.5; }
.draft-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.draft-prod { display: flex; align-items: center; gap: 8px; }
.draft-prod select { width: auto; min-width: 160px; }
.draft-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sm-select { width: auto; height: 30px; font-size: 13px; padding: 0 8px; }
.compose { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center; margin: 8px 0 12px; }
.compose select { width: auto; }
/* settings */
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.key-line { display: grid; grid-template-columns: minmax(180px, 1.2fr) auto minmax(140px, 1.4fr) 84px auto auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.key-line .form-error { grid-column: 1 / -1; }
.key-line .code { font-family: var(--font-mono); text-align: center; letter-spacing: .2em; }
.profiles { display: flex; flex-direction: column; gap: 8px; }
.profile { border: 1px solid var(--line); border-radius: 11px; padding: 0 14px; background: var(--panel-2); }
.profile[open] { padding-bottom: 12px; }
.profile summary { display: flex; align-items: center; gap: 10px; padding: 12px 0; cursor: pointer; list-style: none; }
.profile summary::-webkit-details-marker { display: none; }
.profile summary strong { min-width: 130px; }
.profile summary .badge { margin-left: auto; }

/* mail preview */
.mail-frame { display: block; width: 100%; height: 68vh; border: 1px solid var(--line); border-radius: 10px; background: #f3f4f6; }
.mail-plain { white-space: pre-wrap; font-family: var(--font-mono); font-size: 12.5px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; max-height: 68vh; overflow: auto; margin: 0; }
.linkish { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 0; border: 0; background: none; color: var(--accent); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.linkish .icon { width: 14px; height: 14px; }
/* campaigns */
.checks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.toggle.sm { height: 28px; padding: 0 9px; font-size: 12px; margin-left: auto; }
.seg-result { margin-top: 10px; padding: 12px 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.seg-result p { margin: 0 0 8px; }
.variants { display: flex; flex-direction: column; gap: 12px; }
.variant { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.variant.off { opacity: .6; }
.variant-label { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 800; }
.swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; border: 1px solid var(--line-2); }
input.color { padding: 2px; height: 38px; cursor: pointer; }
.side-link.on { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 960px) {
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* the menu wraps to a second row instead of running off the screen */
  .sidebar { flex-wrap: wrap; overflow-x: visible; }
  .nav { flex-wrap: wrap; }
  .side-foot .settings-link span { display: inline; }
}

@media (max-width: 640px) {
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compose, .key-line, .form-grid.three { grid-template-columns: 1fr; }
  .bubble { max-width: 100%; }
  .ai-banner { flex-wrap: wrap; }
  .toolbar .seg { overflow-x: auto; max-width: 100%; }
  .toolbar select { width: 100%; }
  .facts { grid-template-columns: 1fr; }
  .rev { align-items: flex-end; }
  .share { display: none; }
}
