/* WarmDispatch — demo dashboard */
body { background: var(--surface-3); }
.dash-wrap { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .dash-wrap { padding: 0 14px; } }

.dash-intro { background: #fff; border-bottom: 1px solid var(--line); padding: 26px 0 24px; }
.dash-intro-row { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.demo-badge { font-size: .73rem; }

.dash-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 22px; padding-top: 22px; padding-bottom: 26px; align-items: start; }
@media (max-width: 900px) { .dash-shell { grid-template-columns: minmax(0,1fr); gap: 14px; } }

.dash-side { position: sticky; top: 84px; }
@media (max-width: 900px) { .dash-side { position: static; min-width: 0; max-width: 100%; } }
.dash-nav { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 8px; }
.dnav {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  background: none; border: 0; border-radius: var(--radius-sm); padding: 10px 12px;
  font-family: var(--font); font-size: .91rem; font-weight: 500; color: var(--ink-2); white-space: nowrap;
}
.dnav svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.dnav:hover { background: var(--surface-3); color: var(--ink); }
.dnav.active { background: var(--blue-100); color: var(--blue-700); font-weight: 600; }
.dnav-count {
  margin-left: auto; font-size: .72rem; font-weight: 700; background: var(--surface-3); color: var(--ink-2);
  border-radius: 999px; padding: 2px 7px; min-width: 22px; text-align: center;
}
.dnav-count.alert { background: var(--amber-100); color: #9A5A05; }
.dnav.active .dnav-count { background: #fff; color: var(--blue-700); }
@media (max-width: 900px) {
  .dash-nav { flex-direction: row; overflow-x: auto; gap: 4px; padding: 6px; scrollbar-width: thin;
    -webkit-overflow-scrolling: touch; mask-image: linear-gradient(to right, #000 92%, transparent); }
  .dnav { width: auto; padding: 9px 12px; }
  .dnav span:not(.dnav-count) { font-size: .87rem; }
  .dnav-count { margin-left: 4px; }
}
.dash-oncall { margin-top: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; }
@media (max-width: 900px) { .dash-oncall { display: none; } }

.dash-main { min-width: 0; }
.dash-main:focus { outline: none; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.panel + .panel, .stack > * + * { margin-top: 18px; }
.panel-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.panel-head h2, .panel-head h3 { font-size: .98rem; margin: 0; font-weight: 600; }
.panel-head .spacer { margin-left: auto; }
.panel-body { padding: 18px; }
.panel-body.tight { padding: 0; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 14px; }
@media (max-width: 1160px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 700px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; }
.kpi-l { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 600; line-height: 1.3; min-height: 2.1em; }
.kpi-v { font-family: var(--font-num); font-weight: 900; font-size: 1.9rem; letter-spacing: -.04em; color: var(--navy-800); margin: 8px 0 4px; line-height: 1; }
.kpi-d { font-size: .76rem; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.kpi-d.up { color: var(--green); }
.kpi-d.down { color: var(--red); }
.kpi-d.flat { color: var(--ink-3); }

.chart-box { height: 264px; position: relative; }
@media (max-width: 600px) { .chart-box { height: 230px; } }

/* activity feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: .88rem; }
.feed li:last-child { border-bottom: 0; }
.feed li:hover { background: var(--surface-2); }
.feed-ico { flex: none; width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; }
.feed-ico svg { width: 14px; height: 14px; }
.fi-blue { background: var(--blue-100); color: var(--blue-700); }
.fi-green { background: var(--green-100); color: var(--green); }
.fi-amber { background: var(--amber-100); color: #9A5A05; }
.fi-red { background: var(--red-100); color: var(--red); }
.fi-gray { background: var(--surface-3); color: var(--ink-2); }
.feed-t { font-size: .76rem; color: var(--ink-3); margin-left: auto; white-space: nowrap; padding-left: 10px; }

/* pipeline */
.pipe { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; }
.pipe-stage {
  flex: 1 0 90px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 10px;
  background: var(--surface-2); cursor: pointer; text-align: left; font-family: var(--font);
}
.pipe-stage:hover { border-color: var(--line-strong); background: #fff; }
.pipe-stage.on { border-color: var(--blue); background: #F5FAFF; box-shadow: inset 0 0 0 1px var(--blue); }
.pipe-n { font-family: var(--font-num); font-weight: 900; font-size: 1.22rem; color: var(--navy-800); line-height: 1; }
.pipe-l { font-size: .67rem; color: var(--ink-3); margin-top: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

/* filters */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .input { width: auto; min-width: 150px; padding: 8px 12px; font-size: .87rem; }
.filters .input[type=search] { min-width: 210px; }
@media (max-width: 600px) { .filters { width: 100%; } .filters .input { flex: 1 1 140px; min-width: 0; } }

/* data table */
table.dt { width: 100%; border-collapse: collapse; font-size: .85rem; min-width: 720px; table-layout: auto; }
table.dt th, table.dt td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
table.dt th:first-child, table.dt td:first-child { padding-left: 16px; }
table.dt th:last-child, table.dt td:last-child { padding-right: 16px; }
table.dt td:nth-child(2), table.dt td:nth-child(5) { white-space: normal; min-width: 120px; }
table.dt thead th { font-size: .71rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); background: var(--surface-2); font-weight: 600; position: sticky; top: 0; z-index: 1; }
table.dt tbody tr { cursor: pointer; }
table.dt tbody tr:hover { background: #F6FAFF; }
table.dt tbody tr.sel { background: var(--blue-100); }
table.dt tbody tr:last-child td { border-bottom: 0; }
.td-name { font-weight: 600; color: var(--ink); }
.td-sub { font-size: .76rem; color: var(--ink-3); font-weight: 400; }
.scroll-x { overflow-x: auto; }
.rows-note { padding: 10px 18px; font-size: .78rem; color: var(--ink-3); border-top: 1px solid var(--line); background: var(--surface-2); }

.empty { padding: 46px 24px; text-align: center; color: var(--ink-3); }
.empty svg { width: 30px; height: 30px; margin-bottom: 10px; opacity: .5; }
.empty h3 { font-size: 1rem; color: var(--ink-2); margin-bottom: 4px; }
.empty p { font-size: .87rem; margin: 0 auto; max-width: 40ch; }

/* lead detail drawer */
.drawer-back { position: fixed; inset: 0; background: rgba(15,33,53,.42); z-index: 90; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-back.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(470px, 100%); background: #fff; z-index: 95;
  box-shadow: var(--shadow-lg); transform: translateX(102%); visibility: hidden;
  transition: transform .26s cubic-bezier(.2,.7,.3,1), visibility .26s;
  display: flex; flex-direction: column;
}
.drawer.on { transform: none; visibility: visible; }
.drawer-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.drawer-body { overflow-y: auto; padding: 18px 20px 30px; flex: 1; }
.x-btn { background: none; border: 1px solid var(--line); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; color: var(--ink-2); display: flex; align-items: center; justify-content: center; flex: none; }
.x-btn:hover { background: var(--surface-3); color: var(--ink); }
.dl { display: grid; grid-template-columns: 116px minmax(0,1fr); gap: 9px 14px; font-size: .87rem; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; color: var(--ink); word-break: break-word; }
.sub-h { font-size: .73rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); font-weight: 600; margin: 24px 0 10px; }

/* conversations */
.conv-shell { display: grid; grid-template-columns: 268px minmax(0,1fr); min-height: 560px; }
@media (max-width: 820px) { .conv-shell { grid-template-columns: 1fr; min-height: 0; } }
.conv-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 620px; }
@media (max-width: 820px) { .conv-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 260px; } }
.conv-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 12px 14px; cursor: pointer; font-family: var(--font); }
.conv-item:hover { background: var(--surface-2); }
.conv-item.on { background: var(--blue-100); box-shadow: inset 3px 0 0 var(--blue); }
.conv-top { display: flex; gap: 8px; align-items: baseline; }
.conv-name { font-weight: 600; font-size: .89rem; color: var(--ink); }
.conv-time { margin-left: auto; font-size: .71rem; color: var(--ink-3); white-space: nowrap; }
.conv-prev { font-size: .79rem; color: var(--ink-3); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); flex: none; }
.thread-pane { display: flex; flex-direction: column; min-width: 0; }
.thread-head { padding: 13px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--surface-2); }
.thread-msgs { padding: 18px; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; max-height: 400px; background: var(--surface-3); flex: 1; }
.composer { border-top: 1px solid var(--line); padding: 14px 18px 16px; background: #fff; }
.ai-draft { border: 1px dashed var(--blue); background: #F7FBFF; border-radius: var(--radius); padding: 13px 14px; }
.ai-tag { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--blue-700); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.ai-draft-text { font-size: .88rem; color: var(--ink); margin-bottom: 12px; }
.composer-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sent-flag { font-size: .82rem; color: var(--green); font-weight: 600; display: flex; align-items: center; gap: 7px; }

/* booking */
.appt { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.appt:last-child { border-bottom: 0; }
.appt:hover { background: var(--surface-2); }
.appt-when { flex: none; width: 96px; }
.appt-day { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 600; }
.appt-time { font-family: var(--font-num); font-weight: 700; font-size: .95rem; color: var(--navy-800); }
.appt-main { flex: 1; min-width: 0; }
.appt-title { font-weight: 600; font-size: .92rem; }
.appt-sub { font-size: .8rem; color: var(--ink-3); }
.day-sep { padding: 9px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }

/* automations */
.auto-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; padding: 16px 18px; }
.auto-head { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.auto-head h3 { font-size: .95rem; margin: 0; }
.auto-when { font-size: .78rem; color: var(--ink-3); margin-bottom: 10px; }
.tmpl {
  width: 100%; font-family: var(--font); font-size: .86rem; line-height: 1.55; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 11px 13px; background: var(--surface-2);
  resize: vertical; min-height: 92px;
}
.tmpl:focus { outline: none; background: #fff; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30,111,217,.13); }
.tmpl-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 9px; }
.char-n { font-size: .75rem; color: var(--ink-3); margin-left: auto; }
.saved-flag { font-size: .78rem; color: var(--green); font-weight: 600; }
.toggle { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .8rem; color: var(--ink-2); font-weight: 500; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.track { width: 36px; height: 20px; border-radius: 999px; background: var(--line-strong); transition: background .18s; position: relative; flex: none; }
.track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: var(--shadow-xs); }
.toggle input:checked + .track { background: var(--green); }
.toggle input:checked + .track::after { transform: translateX(16px); }
.toggle input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(30,111,217,.3); }

/* settings */
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; align-items: start; }
@media (max-width: 860px) { .set-grid { grid-template-columns: 1fr; } }
.zip-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.zip { border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 11px; font-size: .82rem; font-family: var(--font-num); font-weight: 700; color: var(--ink-2); background: var(--surface-2); }
.hours-row { display: flex; justify-content: space-between; font-size: .87rem; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hours-row:last-child { border-bottom: 0; }
.member { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }
.int-row2 { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.int-row2:last-child { border-bottom: 0; }
.int-name { font-weight: 600; font-size: .9rem; }
.int-desc { font-size: .78rem; color: var(--ink-3); }
.mono-note { font-family: var(--font-num); font-size: .8rem; color: var(--ink-3); }
#drawerContent { display: flex; flex-direction: column; height: 100%; min-height: 0; }

/* ---------- dashboard walkthrough onboarding ---------- */
.dash-walkthrough { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 14px; margin-bottom: 18px; border: 1px solid #CBDFFA; border-left: 3px solid var(--blue); border-radius: var(--radius); background: #F8FBFF; color: var(--ink-2); font-size: .84rem; }
.dash-walkthrough strong { color: var(--ink); margin-right: 8px; }
.dash-walkthrough-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.walkthrough-dismiss { appearance: none; border: 0; background: transparent; color: var(--ink-3); font: 500 .78rem var(--font); cursor: pointer; padding: 7px 3px; }
.walkthrough-dismiss:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 620px) { .dash-walkthrough { align-items: flex-start; flex-direction: column; } .dash-walkthrough strong, .dash-walkthrough span { display: block; } .dash-walkthrough span { margin-top: 3px; } }
.dash-walkthrough[hidden] { display: none !important; }
