/* ============================================================
   Repliqo — dashboard design system (app.css)
   Brutalist/indie visual language, aligned with the public
   landing page (public/index.html): paper background, thick
   3px ink borders, hard offset shadows, Space Grotesk.
   All selectors are consumed by index.html / login.html JS —
   values changed, names kept.
   ============================================================ */

:root {
  --paper: #FAF3E3;
  --ink: #111111;
  --yellow: #FFC900;
  --pink: #FF90E8;
  --green: #23A094;
  --orange: #FF4D00;
  --white: #FFFFFF;
  --mint: #B8F3E6;
  --muted: rgba(17, 17, 17, .62);

  --border: 3px solid var(--ink);
  --shadow: 8px 8px 0 var(--ink);
  --shadow-sm: 5px 5px 0 var(--ink);
  --shadow-xs: 3px 3px 0 var(--ink);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-snap: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ============== Top nav (login page) ============== */
nav.top {
  border-bottom: var(--border);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -1px;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.logo-icon { width: 28px; height: 28px; display: block; flex-shrink: 0; }
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a:not(.btn) { font-weight: 700; font-size: 15px; color: var(--ink); }
.nav-links a:not(.btn):hover {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
  text-decoration-color: var(--orange);
}

/* ============== Buttons ============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--yellow);
  color: var(--ink);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  padding: 11px 20px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform .12s, box-shadow .12s;
  text-align: center;
}
.btn:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: var(--shadow-sm) !important; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--paper); box-shadow: var(--shadow-sm); }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.white { background: var(--white); }
.btn.ink { background: var(--ink); color: var(--paper); }
.btn.recording { background: var(--orange); color: #fff; animation: btn-pulse 1.1s ease-in-out infinite; }
@keyframes btn-pulse { 0%, 100% { box-shadow: var(--shadow-sm); } 50% { box-shadow: 0 0 0 5px rgba(255,77,0,.25); } }
.btn.pink { background: var(--pink); }

/* ============== Forms ============== */
label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 16px;
  margin-bottom: 6px;
}
input, textarea, select {
  width: 100%;
  background: var(--white);
  border: var(--border);
  color: var(--ink);
  border-radius: 0;
  padding: 12px 14px;
  font-size: 14.5px;
  font-weight: 500;
  font-family: inherit;
  margin-top: 4px;
  box-shadow: var(--shadow-xs);
  transition: transform .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, textarea:focus, select:focus {
  outline: none;
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--orange);
}
textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
  cursor: pointer;
}

/* ============== Cards ============== */
.card {
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 18px;
  position: relative;
}
.card.mint { background: var(--mint); }
.card.pink { background: var(--pink); }
.card.yellow { background: var(--yellow); }
.card.ink { background: var(--ink); color: var(--paper); }
.card.ink h1, .card.ink h2, .card.ink h3 { color: var(--paper); }
.card-title { font-size: 19px; font-weight: 900; text-transform: uppercase; letter-spacing: -.5px; margin-bottom: 6px; }
.card-sub { font-size: 13.5px; font-weight: 500; margin-bottom: 18px; opacity: .75; }

/* ============== Headings ============== */
h1 {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -1px;
  text-transform: uppercase;
  line-height: 1.08;
  margin-bottom: 6px;
  color: var(--ink);
}
h2 { font-size: 20px; font-weight: 900; text-transform: uppercase; letter-spacing: -.5px; margin-bottom: 4px; }
h3 { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.sub { color: var(--ink); opacity: .7; font-size: 14px; font-weight: 500; margin-bottom: 20px; }

/* ============== Overline / kicker (sticker) ============== */
.kicker {
  display: inline-block;
  background: var(--orange);
  color: var(--white);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 11px;
  border: var(--border);
  box-shadow: var(--shadow-xs);
  transform: rotate(-1.5deg);
  margin-bottom: 12px;
}
.kicker.ink { background: var(--ink); color: var(--paper); }
.kicker.yellow { background: var(--yellow); color: var(--ink); }
.kicker.mint { background: var(--mint); color: var(--ink); }

/* ============== Badges / status pills ============== */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border: 2px solid var(--ink);
  text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--white);
  color: var(--ink);
}
.badge.nouveau, .badge.new { background: var(--white); }
.badge.en_discussion, .badge.talking { background: var(--yellow); }
.badge.a_relancer { background: var(--yellow); }
.badge.converti, .badge.won { background: var(--green); color: var(--white); }
.badge.perdu, .badge.lost { background: var(--orange); color: var(--white); }
.badge.simulator { background: var(--mint); }
.badge.whatsapp { background: var(--mint); }
.badge.email { background: var(--paper); }

/* ============== Tables ============== */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 12px; border-bottom: 2px solid var(--ink); font-size: 14px; vertical-align: middle; }
th {
  color: var(--ink);
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
}
tr.click { cursor: pointer; transition: background .12s; }
tr.click:hover td { background: var(--mint); }

/* ============== Toast ============== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: var(--yellow);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 14px 22px;
  font-weight: 700;
  font-size: 14px;
  z-index: 100;
  opacity: 0;
  transform: translateY(20px) rotate(-1deg);
  transition: opacity .25s, transform .25s var(--ease-snap);
  pointer-events: none;
  max-width: 360px;
}
.toast.show { opacity: 1; transform: translateY(0) rotate(-1deg); }
.toast.err { background: var(--orange); color: var(--white); }
.toast.ok { background: var(--green); color: var(--white); }

/* ============== Empty state ============== */
.empty {
  border: 3px dashed var(--ink);
  padding: 34px 20px;
  text-align: center;
  font-weight: 600;
  background: var(--paper);
  color: var(--ink);
}
.empty .big { font-size: 24px; font-weight: 900; text-transform: uppercase; margin-bottom: 6px; }
.empty .hint { font-size: 13px; opacity: .7; margin-top: 8px; }

/* ============================================================
   Shell — fixed icon rail that expands on hover (overlay, no reflow)
   ============================================================ */
#app { display: block; min-height: 100vh; }

/* ---- Mobile top bar (hidden on desktop) ---- */
.mobile-topbar { display: none; }

/* ---- Sidebar (collapsed rail) ---- */
aside {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 76px;
  background: var(--paper);
  border-right: var(--border);
  padding: 18px 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  z-index: 70;
  display: flex;
  flex-direction: column;
  transition: width .22s var(--ease-snap), box-shadow .22s;
}
aside::-webkit-scrollbar { display: none; }
aside:hover, aside:focus-within { width: 252px; box-shadow: var(--shadow); }

aside .logo { font-size: 20px; margin-bottom: 18px; padding: 0 22px; height: 30px; }
aside .logo-icon { width: 30px; height: 30px; }

/* Labels + meta fade in on expand */
.lbl,
aside .user-meta,
aside #usage-mini {
  opacity: 0;
  transform: translateX(-6px);
  white-space: nowrap;
  transition: opacity .15s, transform .2s var(--ease-out);
}
aside:hover .lbl,
aside:focus-within .lbl,
aside:hover .user-meta,
aside:focus-within .user-meta,
aside:hover #usage-mini,
aside:focus-within #usage-mini { opacity: 1; transform: none; }

.nav-label {
  position: relative;
  height: 15px;
  margin: 16px 0 6px;
  padding: 0 23px;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink);
}
.nav-label::before {
  content: '';
  position: absolute;
  left: 23px; top: 6px;
  width: 22px; height: 3px;
  background: var(--ink);
  transition: opacity .15s;
}
aside:hover .nav-label::before,
aside:focus-within .nav-label::before { opacity: 0; }

nav.side { display: flex; flex-direction: column; gap: 4px; }
nav.side a {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 46px;
  padding: 0 23px;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background .1s;
}
nav.side a .ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  background: var(--white);
  color: var(--ink);
  flex-shrink: 0;
  transition: transform .12s, box-shadow .12s;
}
#nav-leads .ico { background: var(--yellow); }
#nav-activity .ico { background: var(--pink); }
#nav-test .ico { background: var(--mint); }
#nav-settings .ico { background: var(--orange); color: var(--white); }
#nav-channels .ico { background: var(--green); color: var(--white); }
#nav-integrations .ico { background: var(--pink); }
#nav-pricing .ico { background: var(--mint); }
nav.side a:hover .ico { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
nav.side a.on { background: var(--yellow); font-weight: 800; }
nav.side a.on .ico { background: var(--ink); color: var(--paper); }

.upgrade-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 46px;
  margin: 10px 20px 0;
  padding: 0 12px;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-xs);
  font-weight: 800;
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.upgrade-cta:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.upgrade-cta [data-icon] { flex-shrink: 0; margin-left: 3px; }

.sidebar-spacer { flex: 1; }

.side-foot { margin: 16px 20px 0; padding: 14px 0 18px; border-top: 3px solid var(--ink); flex-shrink: 0; }

.usage-bar {
  height: 8px;
  border: 2px solid var(--ink);
  background: var(--white);
  overflow: hidden;
  margin: 0 0 8px;
}
.usage-bar-fill { height: 100%; background: var(--yellow); }

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  margin-bottom: 2px;
}
.usage-mini { font-size: 11px; font-weight: 600; color: var(--muted); padding: 0 0 8px; }
.usage-mini a { color: var(--orange); text-decoration: underline; text-decoration-thickness: 2px; }
.user-avatar {
  width: 32px; height: 32px;
  background: var(--pink);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  font-size: 13px;
  flex-shrink: 0;
}
.user-meta { font-size: 12px; font-weight: 600; line-height: 1.3; min-width: 0; }
.user-meta .nm { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta .em { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-link {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 0 2px;
  white-space: nowrap;
}
.logout-link:hover { color: var(--orange); }

/* ---- Off-canvas drawer + backdrop (mobile) ---- */
.sidebar-backdrop { display: none; }

@media (max-width: 860px) {
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 14px;
    background: var(--paper);
    border-bottom: var(--border);
    position: sticky;
    top: 0;
    z-index: 60;
  }
  .mobile-topbar .logo { font-size: 18px; margin: 0; padding: 0; height: auto; }
  .hamburger {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: var(--yellow);
    border: 2px solid var(--ink);
    box-shadow: var(--shadow-xs);
    cursor: pointer;
    flex-shrink: 0;
  }
  .hamburger span { display: block; width: 18px; height: 3px; background: var(--ink); position: relative; }
  .hamburger span::before, .hamburger span::after { content: ''; position: absolute; left: 0; width: 18px; height: 3px; background: var(--ink); }
  .hamburger span::before { top: -6px; }
  .hamburger span::after { top: 6px; }

  aside {
    width: 260px;
    transform: translateX(-100%);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    z-index: 90;
  }
  aside.open { transform: translateX(0); }
  aside:hover, aside:focus-within { width: 260px; }
  aside .logo, .nav-label, nav.side a, .upgrade-cta, .side-foot { padding-left: 0; padding-right: 0; }
  nav.side a { padding: 0 6px; }
  .nav-label { padding: 0 6px; }
  .nav-label::before { display: none; }
  .upgrade-cta { margin-left: 0; margin-right: 0; }
  .side-foot { margin-left: 0; margin-right: 0; }
  /* Drawer is always expanded → labels always visible */
  .lbl, aside .user-meta, aside #usage-mini { opacity: 1; transform: none; }

  .sidebar-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, .35);
    z-index: 80;
  }
}

/* ============== Main ============== */
main { margin-left: 76px; padding: 28px 36px; }
@media (max-width: 860px) { main { margin-left: 0; padding: 20px 18px; } }

.panel { display: none; }
.panel.on { display: block; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 3px solid var(--ink);
}
.page-head h1 { font-size: 28px; margin-bottom: 2px; }
.page-head .sub { margin-bottom: 0; }

.back-link { display: inline-block; margin-bottom: 4px; font-weight: 700; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.back-link:hover { color: var(--orange); text-decoration: underline; text-decoration-thickness: 2px; }

/* ============== Chat (test panel + lead detail) ============== */
.msgs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 6px 4px;
  margin-bottom: 12px;
}
.msg {
  max-width: 75%;
  padding: 11px 14px;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-xs);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.msg.user { background: var(--white); align-self: flex-start; }
.msg.assistant { background: var(--yellow); color: var(--ink); align-self: flex-end; }
.msg.system { background: var(--paper); align-self: center; font-style: italic; font-size: 12.5px; box-shadow: none; border: 2px dashed var(--ink); color: var(--muted); }
.row { display: flex; gap: 8px; align-items: flex-end; }
.row textarea { min-height: 46px; flex: 1; }

.hint { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-top: 8px; }

/* ============== Lead row / channel tags ============== */
.channel-tag {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 2px 8px;
  border: 2px solid var(--ink);
  display: inline-block;
  background: var(--white);
  color: var(--ink);
}
.channel-tag.simulator { background: var(--paper); }
.channel-tag.whatsapp { background: var(--mint); }
.channel-tag.email { background: var(--yellow); }
.channel-tag.telegram { background: var(--pink); }

/* ============== Stat row ============== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr) !important; } }
.stat {
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
}
.stat .label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.stat .num { font-size: 28px; font-weight: 900; line-height: 1.15; margin-top: 4px; color: var(--ink); }
.stat .num.yellow { color: var(--orange); }

/* ============== Dashboard (home) ============== */
.dash-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
@media (max-width: 1000px) { .dash-kpis { grid-template-columns: repeat(2, 1fr); } }
.dash-kpi {
  background: var(--white); border: var(--border); box-shadow: var(--shadow-sm);
  padding: 18px 20px; position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.dash-kpi:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow); }
.dash-kpi .dk-icon { position: absolute; top: 16px; right: 16px; opacity: .3; }
.dash-kpi .label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); padding-right: 24px; }
.dash-kpi .num { font-size: 38px; font-weight: 900; line-height: 1.1; margin-top: 6px; color: var(--ink); letter-spacing: -1px; }
.dash-kpi .sub { font-size: 12px; font-weight: 700; opacity: .6; margin-top: 6px; }
.dash-kpi .sub.up { color: var(--green); opacity: 1; }
.dash-kpi .bar { height: 9px; background: var(--paper); border: 2px solid var(--ink); margin-top: 12px; overflow: hidden; }
.dash-kpi .bar .fill { height: 100%; background: var(--ink); transition: width .6s cubic-bezier(.2,.9,.25,1); }
.dash-kpi .bar .fill.warn { background: var(--yellow); }
.dash-kpi .bar .fill.danger { background: #fff; }

/* Tuiles colorées façon Stripe/Dodo : chaque métrique a sa propre teinte pour créer une
   hiérarchie visuelle immédiate au lieu de 4 cartes blanches identiques. */
.dash-kpi.accent-yellow { background: var(--yellow); }
.dash-kpi.accent-mint { background: var(--mint); }
.dash-kpi.accent-orange { background: var(--orange); color: #fff; }
.dash-kpi.accent-orange .num { color: #fff; }
.dash-kpi.accent-orange .label, .dash-kpi.accent-orange .sub { color: rgba(255,255,255,.85); }
.dash-kpi.accent-orange .dk-icon { color: #fff; opacity: .55; }
.dash-kpi.accent-orange .bar { background: rgba(255,255,255,.3); border-color: #fff; }
.dash-kpi.accent-ink { background: var(--ink); color: var(--paper); }
.dash-kpi.accent-ink .num { color: var(--paper); }
.dash-kpi.accent-ink .label, .dash-kpi.accent-ink .sub { color: rgba(250,243,227,.7); }
.dash-kpi.accent-ink .dk-icon { color: var(--paper); opacity: .45; }

.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-grid .card { position: relative; min-height: 200px; }
.dash-grid .card h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 16px; }

.sparkline { display: flex; align-items: flex-end; gap: 5px; height: 120px; }
.sparkline .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; }
.sparkline .bar-col .b { width: 100%; background: var(--yellow); border: 2px solid var(--ink); min-height: 3px; transition: height .3s; cursor: default; }
.sparkline .bar-col .b:hover { background: var(--orange); }
.sparkline .bar-col .d { font-size: 9px; font-weight: 700; opacity: .5; }

.funnel { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.funnel-row { display: flex; align-items: center; gap: 10px; }
.funnel-row .fl { width: 88px; flex-shrink: 0; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; }
.funnel-row .ft { flex: 1; height: 20px; background: var(--paper); border: 2px solid var(--ink); overflow: hidden; }
.funnel-row .ft .fv { height: 100%; transition: width .4s ease; }
.funnel-row .fn { width: 28px; flex-shrink: 0; text-align: right; font-weight: 800; font-size: 13px; }

/* État vide : au lieu d'un graphe/funnel à plat (tout à zéro, l'air mort), un message
   avec CTA superposé — plus honnête qu'une fausse démo, moins triste qu'un flatline. */
.dash-empty-overlay {
  position: absolute; inset: 0; background: var(--white); z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px; padding: 20px;
}
.dash-empty-overlay .big { font-size: 15px; font-weight: 800; }
.dash-empty-overlay .hint { font-size: 12.5px; opacity: .7; font-weight: 600; }
.dash-empty-overlay a { text-decoration: underline; cursor: pointer; text-underline-offset: 2px; }

/* ============== Usage banner ============== */
.usage-banner {
  border: var(--border);
  box-shadow: var(--shadow-xs);
  font-weight: 700;
  font-size: 13.5px;
}

/* ============== Kanban board ============== */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: start; }
.col {
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  min-height: 120px;
}
.col-head {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px;
  border-bottom: 3px solid var(--ink);
  font-weight: 800; font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink);
}
.col-head .dotc { width: 12px; height: 12px; border: 2px solid var(--ink); flex-shrink: 0; background: var(--white); }
.col-head .cnt { margin-left: auto; background: var(--white); border: 2px solid var(--ink); color: var(--ink); font-size: 11.5px; font-weight: 800; min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.col.new .dotc { background: var(--white); }
.col.disc .dotc { background: var(--pink); }
.col.fup .dotc { background: var(--yellow); }
.col.won .dotc { background: var(--green); }
.col.lost .dotc { background: var(--orange); }
.col-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; flex: 1; }
.col-body.dragover { background: var(--mint); outline: 3px dashed var(--orange); outline-offset: -4px; }
.kcard {
  background: var(--white);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-xs);
  padding: 10px 11px;
  cursor: grab;
  transition: transform .12s, box-shadow .12s;
}
.kcard:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .4; box-shadow: var(--shadow); }
.kcard .knm { font-weight: 800; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.kcard .kaddr { font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard .kneed { font-size: 12px; font-weight: 500; margin-top: 6px; color: var(--ink); }
.kcard .klast {
  font-size: 11.5px; margin-top: 7px; padding: 6px 8px;
  border-left: 3px solid var(--ink); background: var(--paper);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kcard .klast .who { font-weight: 800; text-transform: uppercase; letter-spacing: .4px; font-size: 9.5px; color: var(--muted); display: block; margin-bottom: 1px; }
.kcard .kfoot { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.kcard .kfoot .channel-tag { font-size: 10px; padding: 1px 6px; }
.kcard .kfoot .fup { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.col-empty { font-size: 12px; font-weight: 500; color: var(--muted); text-align: center; padding: 16px 8px; }

.view-toggle { display: inline-flex; border: var(--border); box-shadow: var(--shadow-xs); overflow: hidden; }
.view-toggle button { border: none; background: var(--white); font-family: inherit; font-weight: 700; font-size: 12.5px; padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.view-toggle button + button { border-left: 3px solid var(--ink); }
.view-toggle button.on { background: var(--yellow); font-weight: 800; }

/* ============== Follow-ups activity ============== */
.fup-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.fup-pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 2px solid var(--ink); background: var(--white); box-shadow: var(--shadow-xs);
  padding: 7px 13px; font-size: 12.5px; font-weight: 600; color: var(--ink);
}
.fup-pill b { font-size: 14px; font-weight: 900; color: var(--ink); }
.fup-pill .dotc { width: 10px; height: 10px; border: 2px solid var(--ink); flex-shrink: 0; }
.fup-pill.pend .dotc { background: var(--yellow); }
.fup-pill.sent .dotc { background: var(--green); }
.fup-pill.fail .dotc { background: var(--orange); }
.fup-pill.canc .dotc { background: var(--white); }
.fup-status { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; padding: 2px 8px; border: 2px solid var(--ink); display: inline-block; }
.fup-status.pending { background: var(--yellow); color: var(--ink); }
.fup-status.sent { background: var(--green); color: var(--white); }
.fup-status.failed { background: var(--orange); color: var(--white); }
.fup-status.cancelled { background: var(--paper); color: var(--muted); }
.fup-err { font-size: 11.5px; color: var(--orange); margin-top: 3px; font-weight: 600; }

/* ============== Tip / helper box (channel setup hints) ============== */
.tip-box {
  margin-top: 14px;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  background: var(--mint);
  box-shadow: var(--shadow-xs);
}

/* ============== Onboarding helper card ============== */
.onb-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  background: var(--white);
  box-shadow: var(--shadow-xs);
  margin-bottom: 8px;
}
.onb-step .num {
  width: 28px; height: 28px;
  background: var(--yellow);
  color: var(--ink);
  border: 2px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  font-size: 13px;
  flex-shrink: 0;
}
.onb-step .body { font-size: 13.5px; font-weight: 500; }
.onb-step .body strong { display: block; font-weight: 800; margin-bottom: 2px; }

/* ============== Voice call teaser ============== */
.voice-card {
  background: var(--ink);
  color: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 18px 22px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.voice-card h3 { color: var(--paper); font-size: 14.5px; }
.voice-card p { font-size: 13.5px; opacity: .8; margin-top: 6px; }
.voice-card .badge { position: absolute; top: 16px; right: 16px; background: var(--yellow); color: var(--ink); }

/* ============== Modal ============== */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: rgba(17, 17, 17, .45);
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.on { display: flex; }
.modal-box {
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 26px 28px;
  max-width: 440px;
  width: 100%;
}
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.modal-actions .btn { flex: 1 1 auto; }

/* ============== Channel / integration blocks ============== */
.chan-block { display: flex; gap: 14px; align-items: flex-start; }
.chan-block .grow { flex: 1; min-width: 0; }
.icon-chip { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 2px solid var(--ink); box-shadow: var(--shadow-xs); background: var(--white); color: var(--ink); flex-shrink: 0; }
.icon-chip.tg { background: #229ED9; color: #fff; }
.icon-chip.wa { background: #25D366; color: #fff; }
.icon-chip.ml { background: #EA4335; color: #fff; }
.icon-chip.mcp { background: var(--pink); color: var(--ink); }
.icon-chip.wg { background: var(--ink); color: var(--paper); }
.icon-chip.ms { background: #0084FF; color: #fff; }
.icon-chip.ig { background: #E4405F; color: #fff; }
.icon-chip.dc { background: #5865F2; color: #fff; }
.icon-chip.sm { background: #F22F46; color: #fff; }
.icon-chip img { width: 24px; height: 24px; display: block; }

.conn-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; padding: 3px 9px; border: 2px solid var(--ink); background: var(--white); color: var(--muted); }
.conn-status.on { background: var(--green); color: var(--white); }
.conn-status.off { background: var(--paper); color: var(--muted); }

.steps-mini { counter-reset: s; margin: 10px 0; }
.steps-mini li { list-style: none; display: flex; gap: 10px; padding: 6px 0; font-size: 13px; font-weight: 500; color: var(--ink); }
.steps-mini li::before {
  counter-increment: s; content: counter(s);
  flex-shrink: 0; width: 22px; height: 22px;
  background: var(--yellow); color: var(--ink);
  border: 2px solid var(--ink); font-weight: 900; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}

.copy-field { display: flex; gap: 8px; align-items: stretch; margin-top: 4px; }
.copy-field input { margin-top: 0; font-family: ui-monospace, monospace; font-size: 12px; }
.copy-field button { flex-shrink: 0; }

.mcp-item { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 2px solid var(--ink); background: var(--white); box-shadow: var(--shadow-xs); margin-bottom: 8px; }
.mcp-item .grow { flex: 1; min-width: 0; }
.mcp-item .tools { font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn { border: 2px solid var(--ink); background: var(--white); box-shadow: var(--shadow-xs); width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); transition: transform .12s, box-shadow .12s, background .12s; }
.icon-btn:hover { background: var(--orange); color: var(--white); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }

.typing-bubble { display: inline-flex !important; gap: 5px; align-items: center; padding: 12px 14px !important; }
.typing-bubble .tdot { width: 6px; height: 6px; background: var(--ink); border-radius: 50%; animation: tdot 1s infinite; }
.typing-bubble .tdot:nth-child(2) { animation-delay: .18s; }
.typing-bubble .tdot:nth-child(3) { animation-delay: .36s; }
@keyframes tdot { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ---- toggle switch ---- */
.tgl { position: relative; width: 46px; height: 26px; border: 2px solid var(--ink); background: var(--white); cursor: pointer; flex-shrink: 0; transition: background .18s; }
.tgl .knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: var(--ink); transition: left .18s; }
.tgl.on { background: var(--green); }
.tgl.on .knob { left: 22px; background: var(--white); }
.tgl-row { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 14px; padding-top: 12px; border-top: 2px solid var(--ink); font-size: 13px; font-weight: 600; }
.tgl-row .lab { color: var(--muted); font-size: 12px; }

/* ---- held (generated-but-not-yet-sent) reply in the test panel ---- */
.msg.held { opacity: .8; border-style: dashed; }
.hold-note { align-self: flex-end; max-width: 75%; font-size: 11.5px; font-weight: 600; color: var(--muted); margin: -2px 2px 2px; display: flex; align-items: center; gap: 8px; }
.hold-note .bar { flex: 1; height: 6px; border: 2px solid var(--ink); background: var(--white); position: relative; overflow: hidden; min-width: 50px; }
.hold-note .bar i { position: absolute; inset: 0; background: var(--orange); transform-origin: left; transform: scaleX(0); }
.hold-note.sent { opacity: .6; }

/* ============== Reveal animation (used on login pitch) ============== */
.rv { opacity: 0; transform: translateY(20px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); transition-delay: calc(var(--i, 0) * .08s); }
.rv.in { opacity: 1; transform: translateY(0); }
.rv-stamp { opacity: 0; transform: rotate(-1.5deg) scale(1.8); transition: all .45s var(--ease-snap); }
.rv-stamp.in { opacity: 1; transform: rotate(-1.5deg) scale(1); }

/* ============== Integrations: one-click connector gallery ============== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.app-card {
  background: var(--white);
  border: var(--border);
  box-shadow: var(--shadow-xs);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .15s, box-shadow .15s;
}
.app-card:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow); }
.app-card .app-avatar {
  width: 40px; height: 40px;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 15px; color: #fff;
  flex-shrink: 0;
}
.app-card .app-avatar img, .app-card .app-avatar svg { width: 20px; height: 20px; display: block; }
.app-card .app-name { font-weight: 800; font-size: 14.5px; }
.app-card .app-blurb { font-size: 12.5px; color: var(--muted); line-height: 1.4; flex: 1; }
.app-card .app-docs-link { font-size: 11.5px; font-weight: 800; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; width: fit-content; }
.app-card .app-docs-link:hover { color: var(--orange); }
.app-card .app-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.app-card .app-foot .btn { flex: 1; }
.app-card.connected { border-color: var(--ink); background: var(--mint); }
.app-card .app-connected-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; color: var(--green); }
.app-card.error { box-shadow: 5px 5px 0 var(--orange); }
.app-card .app-error-tag { font-size: 11.5px; font-weight: 800; color: var(--orange); }

/* ---- Email wizard (overlay simple setup) ---- */
.ew-body { padding: 24px; overflow-y: auto; }
.ew-title { font-size: 20px; font-weight: 900; text-transform: uppercase; letter-spacing: -.5px; margin: 0 0 16px; }
.ew-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.ew-card { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--white); border: var(--border);
  box-shadow: var(--shadow-xs); font-family: inherit; font-weight: 800; font-size: 15px; cursor: pointer;
  transition: transform .12s var(--ease-snap), box-shadow .12s; }
.ew-card:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-sm); background: var(--yellow); }
.ew-tile { width: 38px; height: 38px; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 17px; flex-shrink: 0; }
.ew-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 9px; font-size: 14px; font-weight: 600; line-height: 1.45; }
@media (max-width: 560px) { .ew-grid { grid-template-columns: 1fr; } }

/* ============== Reduced motion ============== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .rv, .rv-stamp { opacity: 1 !important; transform: none !important; }
}
