/* client/src/styles.css
   AceLive — CLEAN FULL DROP-IN (single source of truth)

   What this file does:
   - Clean, modern cards + grid
   - iMessage-ish transcript bubbles (Lead=white, Jake=blue)
   - STEP events are tiny pills (CSS-only; true “attach under message” is JSX)
   - Header topbar: AceLive left, nav pills inline, logout far right (matches your DOM)
   - Supports your current classnames: .topbar-left/.topbar-right/.nav-link/.btn-ghost
   - Keeps your table + panels consistent
*/

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body,
#root {
  margin: 0;
  padding: 0;
  min-height: 100%;
  height: auto;
  overflow-y: auto;
}

body {
  --bg: #f7f8fb;
  --card: #ffffff;
  --text: #0b1220;
  --muted: #5b6472;
  --border: #e7e9f0;
  --accent: #2563eb;
  --accent2: #0ea5e9;
  --shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    Helvetica Neue, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

/* ---------- Layout Shell ---------- */
.app-shell {
  min-height: 100vh;
  padding: 40px 22px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.dashboard-root {
  width: 100%;
  max-width: 1600px;
}

/* ---------- Topbar (matches your DOM) ---------- */
/*
  Structure assumed (from your App.jsx):
  <div className="topbar">
    <div className="topbar-left">
      <div className="brand">AceLive</div>
      <nav className="nav">
        <NavLink className="nav-link" .../>
        ...
      </nav>
    </div>
    <div className="topbar-right">
      <span>Syncing…</span>
      <button className="btn btn-sm btn-ghost">Log out</button>
    </div>
  </div>
*/
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 4px 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px; /* space between brand + nav */
  min-width: 0;
}

.topbar-left .brand {
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
}

.topbar-left .nav {
  display: flex;
  align-items: center;
  gap: 8px; /* spacing between pills */
  flex-wrap: wrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

/* Nav pills */
.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 7px 12px;
  font-size: 0.92rem;
  font-weight: 500; /* not bold */
  line-height: 1;
  white-space: nowrap;

  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(37, 99, 235, 0.10);
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

.nav-link:hover {
  background: rgba(10, 132, 255, 0.16);
}

.nav-link.active {
  background: #0a84ff;
  border-color: var(--accent);
  color: #fff;
  font-weight: 600; /* subtle emphasis */
}

/* Allow wrapping only on small screens */
@media (max-width: 760px) {
  .topbar-left {
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .topbar-left .nav {
    flex-wrap: wrap;
    row-gap: 8px;
  }
}

/* ---------- Headings / tiny text ---------- */
h1,
h2,
h3 {
  margin: 0 0 10px;
  line-height: 1.15;
}

.small,
.muted {
  font-size: 0.9rem;
  opacity: 0.75;
}

.label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  opacity: 0.85;
}

/* ---------- Cards / panels ---------- */
.card,
.dashboard-card,
.panel,
.table-card,
.live-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}

/* Generic header row inside cards */
.dash-row,
.panel-header,
.table-header,
.live-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.panel-title,
.table-header-title,
.dash-title-sm {
  font-size: 1rem;
  font-weight: 600;
}

.panel-subtitle,
.table-header-sub,
.dash-pill {
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.58);
  margin-top: 4px;
}

/* Main title (login page / dashboard title if used) */
.dash-title {
  font-size: 1.4rem;
  font-weight: 600;
}

/* ---------- Main Grid ---------- */
.dash-main-grid,
.dashboard-grid,
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
  align-items: start;
}

/* ---------- Controls ---------- */
input,
select,
textarea {
  font: inherit;
}

.input,
.agent-select,
.textarea,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--card);
  color: #000;
  outline: none;
}

.input:focus,
.agent-select:focus,
.textarea:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(10, 132, 255, 0.55);
  outline-offset: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: #000;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  line-height: 1;
  user-select: none;
  transition: transform 0.06s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(0, 0, 0, 0.03);
}

.btn:active {
  transform: translateY(0px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 999px; /* pill-ish small buttons */
}

.btn-primary {
  background: #0a84ff;
  border-color: rgba(10, 132, 255, 0.45);
  color: #fff;
}

.btn-primary:hover {
  background: rgba(10, 132, 255, 0.90);
}

.btn-danger {
  background: rgba(255, 59, 48, 0.10);
  border-color: rgba(255, 59, 48, 0.28);
  color: #ff3b30;
}

.btn-danger:hover {
  background: rgba(255, 59, 48, 0.14);
}

.btn-ghost {
  background: rgba(37, 99, 235, 0.10);
  border: 1px solid var(--border);
  color: var(--accent);
  border-radius: 999px;
}


.btn-link {
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  text-align: left;
  display: inline-block;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-link:hover {
  opacity: 0.9;
}

.btn-link:focus {
  outline: 2px solid rgba(10, 132, 255, 0.35);
  outline-offset: 2px;
  border-radius: 6px;
}

.btn-link:active {
  transform: translateY(1px);
}

/* ---------- Deals page: foldable top panels ---------- */
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.collapsible-card.collapsed {
  padding-bottom: 10px;
}

.collapsible-card.collapsed .deal-form,
.collapsible-card.collapsed .todo-list,
.collapsible-card.collapsed .todo-empty {
  display: none;
}

.collapsed-hint {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.55);
}
.btn-ghost:hover {
  background: rgba(10, 132, 255, 0.16);
}

/* ---------- Prompt preview / snippet ---------- */
.prompt-snippet,
.code-snippet {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: var(--card);
  font-size: 0.85rem;
}

.prompt-snippet .label,
.code-snippet .label {
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.snippet-text {
  font-size: 0.88rem;
}

.prompt-snippet pre,
.code-snippet pre {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- Tables ---------- */
.table-scroll,
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  min-width: 900px; /* keeps columns readable on desktop */
  font-size: 0.85rem;
}

.table th,
.table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.10);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.table thead th {
  font-weight: 800;
  white-space: nowrap;
}

.table tr:last-child td {
  border-bottom: none;
}

/* --- Call Logs table: keep everything inside the card at 100% zoom --- */
.calllogs-table-wrap {
  overflow-x: auto;
}

.calllogs-table {
  table-layout: fixed;
  min-width: 0 !important; /* override .table min-width: 900px */
}

.calllogs-table th,
.calllogs-table td {
  overflow: visible;
  text-overflow: clip;
}

/* Column sizing (overrides inline widths in CallLogs.jsx) */
.calllogs-table th:nth-child(1),
.calllogs-table td:nth-child(1) { width: 165px !important; }
.calllogs-table th:nth-child(2),
.calllogs-table td:nth-child(2) { width: 130px !important; }
.calllogs-table th:nth-child(3),
.calllogs-table td:nth-child(3) { width: 130px !important; }
.calllogs-table th:nth-child(5),
.calllogs-table td:nth-child(5) { width: 190px !important; }
.calllogs-table th:nth-child(6),
.calllogs-table td:nth-child(6) { width: 190px !important; }
.calllogs-table th:nth-child(7),
.calllogs-table td:nth-child(7) { width: 180px !important; }
.calllogs-table th:nth-child(8),
.calllogs-table td:nth-child(8) { width: 120px !important; }

/* Address should be the flexible column */
.calllogs-table th:nth-child(4),
.calllogs-table td:nth-child(4) {
  width: auto !important;
  white-space: nowrap;
}

.table tbody tr:hover {
  background: rgba(0, 0, 0, 0.03);
}

.table .wrap {
  white-space: normal;
  word-break: break-word;
}

.table td .cell-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  white-space: normal;
}

.status-cell {
  white-space: nowrap;
}

/* ---------- Pills / badges ---------- */
.pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--card);
  color: rgba(0, 0, 0, 0.70);
  white-space: nowrap;
}

.badge-good,
.pill.ok {
  background: rgba(52, 199, 89, 0.14);
  border-color: rgba(52, 199, 89, 0.25);
  color: rgba(36, 140, 62, 0.95);
}

.badge-muted,
.pill.muted {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.14);
  color: rgba(0, 0, 0, 0.60);
}

.pill.blue {
  background: rgba(10, 132, 255, 0.12);
  border-color: rgba(10, 132, 255, 0.22);
  color: rgba(10, 132, 255, 0.95);
}

/* Deals pipeline buyer-progress pills */
.pill.pill-grey {
  background: var(--card);
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.55);
}

.pill.pill-yellow {
  /* lighter pastel orange for "No" confirmations */
  background: var(--card);
  border-color: rgba(255, 159, 10, 0.18);
  color: rgba(130, 75, 0, 0.92);
}

.pill.pill-green {
  background: var(--card);
  border-color: rgba(52, 199, 89, 0.32);
  color: rgba(36, 140, 62, 0.95);
}

/* ---------- Live badge ---------- */
.live-badge {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(37, 99, 235, 0.15);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.7);
  animation: livePulse 1.4s ease-in-out infinite;
}

@keyframes livePulse {
  0% {
    opacity: 0.35;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-1px);
  }
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
}

/* ---------- Live transcript container ---------- */
.live-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.live-body {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  height: 520px;
  overflow: auto;
  background: var(--card);
}

/* ---------- Transcript bubbles (NEW: .msg...) ---------- */
.msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  max-width: 88%;
}

.msg.lead {
  align-self: flex-start;
}

.msg.jake,
.msg.ai {
  align-self: flex-end;
}

.msg-meta {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.55);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.msg-who {
  font-weight: 700;
  color: rgba(0, 0, 0, 0.70);
}

.msg-latency {
  font-weight: 600;
}

/* If you're rendering stepEvent inside meta */
.msg-step {
  font-weight: 700;
  opacity: 0.9;
}

/* Bubble body */
.msg-text {
  padding: 10px 12px;
  border-radius: 18px;
  white-space: pre-wrap;
  word-break: break-word;

  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

/* Lead = white */
.msg.lead .msg-text {
  background: var(--card);
  color: #000;
}

/* Jake/AI = blue */
.msg.jake .msg-text,
.msg.ai .msg-text {
  background: #0a84ff;
  color: #fff;
  border-color: rgba(10, 132, 255, 0.25);
}

/* ---------- STEP events rendered as system lines (CSS-only shrink) ---------- */
.msg.system {
  max-width: 100%;
  align-self: center;
  margin: 6px 0 10px;
}

.msg.system .msg-meta {
  display: none;
}

.msg.system .msg-text {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;

  background: rgba(0, 0, 0, 0.04);
  border: 1px dashed rgba(0, 0, 0, 0.22);
  color: rgba(0, 0, 0, 0.70);
  box-shadow: none;
}

/* ---------- Legacy transcript classes (kept just in case) ---------- */
.live-line {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  max-width: 88%;
}

.live-line.lead {
  align-self: flex-start;
}

.live-line.jake,
.live-line.ai {
  align-self: flex-end;
}

.live-line.system {
  max-width: 100%;
  align-self: center;
}

.live-role,
.live-meta {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.55);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.live-text {
  padding: 10px 12px;
  border-radius: 18px;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.live-line.lead .live-text {
  background: var(--card);
  color: #000;
}

.live-line.jake .live-text,
.live-line.ai .live-text {
  background: #0a84ff;
  color: #fff;
  border-color: rgba(10, 132, 255, 0.25);
}

.live-line.system .live-text {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px dashed rgba(0, 0, 0, 0.22);
  color: rgba(0, 0, 0, 0.70);
  box-shadow: none;
}

/* ---------- Call logs summary cell ---------- */
.call-summary-cell {
  max-width: 480px;
  white-space: normal;
  word-wrap: break-word;
  font-size: 0.85rem;
}

/* "Show more / Show less" inline button */
.link-button {
  border: none;
  background: none;
  padding: 0 0 0 6px;
  margin: 0;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.link-button:hover {
  text-decoration-thickness: 2px;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  z-index: 4000;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal,
.modal-card {
  z-index: 4001;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 20px;
  width: min(900px, 100% - 32px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: 0.9rem;
  color: rgba(0, 0, 0, 0.60);
  margin-bottom: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* --- Presence / Active users --- */
.presence-dot {
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  display: inline-block;
  margin-right: 8px;
  background: #2ecc71;
  box-shadow: 0 0 0 rgba(46, 204, 113, 0.55);
  animation: presencePulse 1.4s infinite;
}

@keyframes presencePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
  }
}

.presence-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 8px;
}

.presence-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.error-text {
  margin-top: 10px;
  font-size: 0.9rem;
  color: rgba(255, 59, 48, 0.95);
}

.center-card {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .table {
    min-width: 780px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    padding: 26px 14px;
  }

  .dash-main-grid,
  .dashboard-grid,
  .dash-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .live-body {
    height: 420px;
  }

  .table {
    min-width: 720px;
  }
}

@media (max-width: 520px) {
  .card,
  .dashboard-card,
  .panel,
  .table-card,
  .live-card {
    padding: 14px;
    border-radius: 16px;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .table {
    min-width: 640px;
  }
}

.msg-steps {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stepline {
  font-size: 12px;
  line-height: 1.2;
  opacity: 0.85;
}

.stepline.started {
  color: rgba(255, 255, 255, 0.85); /* for blue bubbles */
}

.msg.lead .stepline.started {
  color: rgba(0, 0, 0, 0.55); /* for white bubbles */
}

.stepline.confirmed {
  font-weight: 600;
  opacity: 0.95;
}

/* ---------- Deals ---------- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.deal-form {
  display: grid;
  grid-template-columns: 1.6fr 1fr 0.7fr 0.7fr 1fr auto;
  gap: 10px;
  align-items: center;
}

@media (max-width: 980px) {
  .deal-form {
    grid-template-columns: 1fr 1fr;
  }
}

.deal-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.deal-status-btn {
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.04);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.deal-status-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.deal-status-btn.active {
  background: rgba(10, 132, 255, 0.14);
  border-color: rgba(10, 132, 255, 0.35);
  color: var(--accent);
  font-weight: 600;
}

.deal-status-btn.good.active {
  background: rgba(46, 204, 113, 0.14);
  border-color: rgba(46, 204, 113, 0.35);
  color: rgba(0, 0, 0, 0.85);
}

.deal-status-btn.bad.active {
  background: rgba(255, 59, 48, 0.14);
  border-color: rgba(255, 59, 48, 0.35);
  color: rgba(0, 0, 0, 0.85);
}

.deal-status-btn.warn.active {
  background: rgba(255, 149, 0, 0.16);
  border-color: rgba(255, 149, 0, 0.35);
  color: rgba(0, 0, 0, 0.85);
}

.deal-status-btn.info.active {
  background: rgba(175, 82, 222, 0.14);
  border-color: rgba(175, 82, 222, 0.35);
  color: rgba(0, 0, 0, 0.85);
}

/* Offers UI */
.offers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 170px;
}

.offer-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.03);
  border-radius: 12px;
  font-size: 12px;
}

.offer-del {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  opacity: 0.55;
}

.offer-del:hover {
  opacity: 0.9;
}

.offer-add {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* --------------------
   Deals: Next actions box
--------------------- */

.deal-top-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.todo-card {
  width: 340px;
  max-width: 340px;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todo-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px;
}

.todo-item.high {
  border-color: rgba(255, 80, 80, 0.35);
}

.todo-item.medium {
  border-color: rgba(255, 200, 80, 0.35);
}

.todo-msg {
  font-weight: 700;
  font-size: 13px;
}

.todo-reason {
  margin-top: 2px;
  font-size: 12px;
  opacity: 0.75;
}

.todo-empty {
  font-size: 13px;
  opacity: 0.75;
  padding: 4px 2px;
}

@media (max-width: 900px) {
  .deal-top-row {
    flex-direction: column;
  }
  .todo-card {
    width: 100%;
    max-width: 100%;
  }
}

.input.input-sm {
  padding: 7px 10px;
  font-size: 12px;
}

.countdown {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.04);
  font-size: 12px;
}

.countdown.over {
  background: rgba(255, 59, 48, 0.12);
  border-color: rgba(255, 59, 48, 0.22);
}

.attachments {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attachment-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}

.attachment-link:hover {
  text-decoration: underline;
}



/* Deals: floating minimal controls */
.deal-float-wrap {
  position: relative;
  margin-top: 10px;
}

.deal-float-bar {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  margin: 6px 0 10px;
}

.pill-btn {
  background: rgba(10, 132, 255, 0.08);
  border: 1px solid rgba(10, 132, 255, 0.18);
  color: var(--accent);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease;
}

.pill-btn:hover {
  background: rgba(10, 132, 255, 0.12);
}

.pill-btn:active {
  transform: translateY(1px);
}

.pill-btn.active {
  background: rgba(10, 132, 255, 0.16);
  border-color: rgba(10, 132, 255, 0.28);
}

.pill-btn:focus {
  outline: 2px solid rgba(10, 132, 255, 0.35);
  outline-offset: 2px;
}

/* Deal tags / acreage pills */
.tag-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:600;
  cursor:pointer;
  background:rgba(0,0,0,0.04);
  border:1px solid rgba(0,0,0,0.10);
}
.tag-pill:hover{ background:rgba(0,0,0,0.06); }
.tag-pill.on{
  background:rgba(10,132,255,0.12);
  border-color:rgba(10,132,255,0.28);
  color:#0a84ff;
}
.tag-pill.off{ color:#333; }
.tag-wrap{ display:flex; flex-wrap:wrap; gap:8px; }

/* Popover card that floats over the table without pushing layout */

/* ---------- Add Deal full-screen modal ---------- */
.deal-modal-overlay{
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(12, 18, 28, 0.35);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 16px;
}

.deal-modal-shell{
  width: min(1100px, 100%);
  height: 100%;
  display: flex;
}

.deal-modal-card{
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
}

.deal-modal-body{
  flex: 1;
  overflow: auto;
  padding: 14px;
}

/* Make the modal header sticky inside the modal */
.deal-modal-card .card-title{
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.deal-popover {
  /* Add Deal popover should behave like a centered modal */
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 90px;
  z-index: 50;
  width: min(720px, calc(100vw - 40px));
}

.pop-card {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}


/* Activity history */
.activity-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow: auto;
  padding-right: 4px;
}

.activity-row {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 10px 12px;
}


/* ---------- Segmented buttons (Activity Today/Yesterday/All) ---------- */
.segbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: rgba(0, 0, 0, 0.02);
}

.segbtn {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.65);
  cursor: pointer;
}

.segbtn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.segbtn.active {
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.85);
}

.verifiedToggle{
  display:inline-block;
  font-size:9px;
  line-height:1.15;
  padding:2px 5px;
  border-radius:7px;
  color:rgba(0,0,0,0.35);
  border:1px solid rgba(0,0,0,0.10);
  cursor:pointer;
  user-select:none;
}
.verifiedToggle.on{
  color:#0a84ff;
  border-color:rgba(10,132,255,0.55);
  box-shadow:0 0 0 2px rgba(10,132,255,0.10);
  font-weight:600;
}

/* Deal tags / acreage pills */
.tag-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:600;
  cursor:pointer;
  background:rgba(0,0,0,0.04);
  border:1px solid rgba(0,0,0,0.10);
}
.tag-pill:hover{ background:rgba(0,0,0,0.06); }
.tag-pill.on{
  background:rgba(10, 132, 255, 0.14);
  border-color:rgba(10, 132, 255, 0.28);
  color:#0a84ff;
}
.tag-pill.danger.on{
  background:rgba(255, 59, 48, 0.10);
  border-color:rgba(255, 59, 48, 0.22);
  color:#b42318;
}


/* ---------- Smart targeting pills ---------- */
.smart-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  border:1px solid rgba(0,0,0,.12);
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
}
.smart-pill--critical{
  background:rgba(255,0,0,.10);
  border-color:rgba(255,0,0,.25);
  color:#b00020;
}
.smart-pill--warn{
  background:rgba(255,165,0,.12);
  border-color:rgba(255,165,0,.25);
  color:#7a4a00;
}
.smart-pill--info{
  background:rgba(0,0,0,.06);
  border-color:rgba(0,0,0,.12);
  color:rgba(0,0,0,.75);
}

@keyframes smartPulse {
  0% { box-shadow: 0 0 0 0 rgba(255,0,0,.35); }
  70% { box-shadow: 0 0 0 10px rgba(255,0,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,0,0,0); }
}
.smart-pill--pulse{
  animation: smartPulse 1.2s infinite;
}

/* =========================
   Enterprise polish + Dashboard v2
   ========================= */

.topbar {
  position: relative;
  z-index: 220;
  overflow: visible;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.nav-link {
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border: 1px solid var(--border);
  color: var(--text);
}
.nav-link.active {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--card));
  color: var(--accent);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.select {
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 0 12px;
  font-size: 13px;
  color: var(--text);
}

.nav-more {
  position: relative;
  z-index: 260;
}
.nav-more-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 9999;
}
.app-shell,
.dashboard-root,
.page,
.topbar-left,
.topbar-right {
  overflow: visible;
}
.nav-more-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 10px;
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.nav-more-item:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--card));
}

/* Dashboard layout */
.dash-layout {
  display: grid;
  grid-template-columns: 1.65fr 0.95fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 980px) {
  .dash-layout {
    grid-template-columns: 1fr;
  }
}

.live-ops-card {
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.live-ops-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.live-ops-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
@media (max-width: 980px) {
  .live-ops-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.live-slot {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
.live-slot.empty {
  opacity: 0.62;
  border-style: dashed;
}
.live-slot-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.live-slot-ident { min-width: 0; flex: 1 1 auto; }
.live-slot-title {
  font-weight: 800;
  font-size: 22px;
  line-height: 1.1;
  color: var(--text);
}
.live-slot-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.35;
}
.clamp-2{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.live-slot-waiting{
  font-size:13px;
  color:var(--muted);
  padding:10px 12px;
  border-radius:12px;
  border:1px dashed var(--border);
  background: color-mix(in srgb, var(--bg) 60%, var(--card));
}
.calllogs-table td:nth-child(5),
.calllogs-table td:nth-child(6),
.calllogs-table td:nth-child(7) {
  white-space: nowrap;
}
.calllogs-table td:nth-child(6),
.calllogs-table td:nth-child(7) {
  min-width: 180px;
}
.live-slot-numbers{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
}
.live-slot-numbers > div,
.live-slot-meta-row{
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:0;
}
.live-slot-meta {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--card) 88%, var(--bg));
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
.live-slot-meta.compact{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
}
.live-slot-meta-row.full{ grid-column:1 / -1; }
.meta-key{ font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.meta-value{ color:var(--text); font-weight:600; word-break:break-word; }
.meta-value.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size:12px; }
.live-slot-meta b { color: var(--text); font-weight: 700; }
.transcript-mini {
  background: color-mix(in srgb, var(--bg) 60%, var(--card));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  min-height: 90px;
  max-height: 260px;
  overflow: auto;
}
.tline{
  display:grid;
  grid-template-columns:64px 1fr;
  gap:8px;
  align-items:start;
  padding:6px 4px;
  border-bottom:1px solid color-mix(in srgb, var(--border) 80%, transparent);
}
.tline:last-child{ border-bottom:0; }
.tline-speaker{ font-size:11px; font-weight:800; color:var(--muted); letter-spacing:.04em; }
.tline-text{ font-size:13px; line-height:1.4; color:var(--text); white-space:pre-wrap; word-break:break-word; }
.tline-ai .tline-speaker{ color:var(--accent); }
.tline-human .tline-speaker{ color:#21a366; }
.tline-sys .tline-speaker{ color:#8a94a6; }
.tline-fn .tline-speaker{ color:#c084fc; }
.kpi-card, .activity-card {
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.table {
  min-width: 980px;
}
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi-grid.compact{ grid-template-columns:repeat(4, minmax(0, 1fr)); gap:8px; }
.kpi-box { border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 10px 12px; background: rgba(255,255,255,0.03); }
.kpi-box.compact{ padding:10px; border-radius:10px; }
.kpi-label { font-size: 12px; opacity: 0.8; }
.kpi-value { margin-top: 6px; font-size: 22px; font-weight: 700; letter-spacing: 0.2px; }
.kpi-num{ font-size:26px; line-height:1; font-weight:800; color:var(--text); margin-bottom:6px; }
.page-title-row{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}
.page-actions{display:flex; gap:8px; align-items:center;}
.dash-monitor{
  display:grid;
  grid-template-rows:auto auto;
  gap:12px;
}
.dash-monitor-top .live-slots-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:12px;
}
.dash-monitor-bottom{
  display:grid;
  grid-template-columns:minmax(340px, 420px) minmax(0, 1fr);
  gap:12px;
  align-items:start;
}
.kpi-compact-card{ align-self:start; }
@media (max-width: 1280px){
  .dash-monitor-top .live-slots-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .dash-monitor-bottom{ grid-template-columns:1fr; }
}
@media (max-width: 720px){
  .live-slot-title{ font-size:18px; }
  .live-slot-numbers,
  .live-slot-meta.compact,
  .kpi-grid.compact{ grid-template-columns:1fr; }
}
.pill-live{
  background: rgba(40, 199, 111, 0.12);
  border: 1px solid rgba(40, 199, 111, 0.25);
}
.card-title-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.activity-feed{
  max-height: 360px;
  overflow:auto;
  padding-top:6px;
}

.activity-row{
  display:flex;
  gap:10px;
  padding:6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.activity-ts{
  width: 90px;
  flex: 0 0 90px;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.activity-msg{
  flex:1;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}


/* Deals page redesign (pill slider + full-page feel) */
.deals-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12;margin:0 0 10px 0;}
.deals-segment{display:inline-flex;gap:0;background:rgba(0,0,0,0.04);border:1px solid rgba(0,0,0,0.08);border-radius:999px;padding:4px;}
.seg-btn{border:0;background:transparent;padding:6px 12px;border-radius:999px;font-weight:700;font-size:13px;cursor:pointer;}
.seg-btn.active{background:#2d4cff;color:white;box-shadow:0 6px 18px rgba(45,76,255,0.18);}

/* Remove extra top gap on Deals page */
.page-header{margin:0 0 8px 0;}


/* Deals top controls */
.deals-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin: 6px 0 10px;
}
.deals-topbar .segbar{
  margin: 0;
}
.deals-topbar .btn.pill{
  width: 40px;
  height: 34px;
}


/* Deals layout toggle + glanceable rows */
.deals-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.deals-layout-toggle{
  display:flex;
  align-items:center;
  gap:6px;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 999px;
  padding: 4px;
}

.layout-btn{
  border: 0;
  background: transparent;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  opacity: 0.75;
}

.layout-btn.active{
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,0.05);
  opacity: 1;
}

.deal-row-click{
  cursor: pointer;
}
.deal-row-click:hover{
  background: rgba(0,0,0,0.02);
}

.deal-cell-main .deal-address{
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
}
.deal-cell-main .deal-sub{
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.7;
}

/* Card view */
.deals-cards{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.deal-card{
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  padding: 12px 12px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
  cursor:pointer;
}

.deal-card:hover{
  border-color: rgba(0,0,0,0.14);
}

.deal-card-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
}

.deal-address{
  font-size: 16px;
  font-weight: 800;
  line-height: 1.15;
}

.deal-sub{
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.7;
}

.deal-metrics{
  margin-top: 10px;
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.metric{
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.015);
}

.metric-label{
  font-size: 11px;
  opacity: 0.65;
  margin-bottom: 4px;
  font-weight: 600;
}

.metric-value{
  font-size: 14px;
  font-weight: 800;
}

.metric-last .metric-value{
  font-size: 12px;
  font-weight: 800;
}

.deal-status-select{
  min-width: 140px;
}

@media (max-width: 1100px){
  .deal-metrics{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px){
  .deal-metrics{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deal-status-select{ min-width: 120px; }
}


/* Sticky Deals sub-header (slider + view toggle + + button) */
.deals-toolbar{
  position: sticky;
  top: 64px; /* sits under the main nav pills */
  z-index: 50;
  background: rgba(248, 250, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 0;
  margin: 0 0 12px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* keep controls compact so they don't feel "in the way" */
.deals-toolbar .seg-btn{ padding: 6px 10px; font-size: 13px; }
.deals-toolbar .layout-btn{ padding: 6px 10px; font-size: 13px; }
.deals-toolbar .btn.pill{
  width: 40px !important;
  height: 34px !important;
  border-radius: 999px;
}

/* When the page is narrow, allow wrapping cleanly */
@media (max-width: 860px){
  .deals-toolbar{ flex-wrap: wrap; gap: 10px; top: 56px; }
}


/* Deals refresh: thinner sticky subbar + right aligned layout toggle */
.deals-toolbar.compact{
  position: sticky;
  top: 64px;
  z-index: 50;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  background: rgba(248,250,255,0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 0;
  margin: 0 0 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.deals-toolbar-left,.deals-toolbar-right{display:flex;align-items:center;gap:8px;}
.deals-toolbar.compact .deals-segment,.deals-toolbar.compact .deals-layout-toggle{padding:3px;background:rgba(0,0,0,0.03);}
.deals-toolbar.compact .seg-btn,.deals-toolbar.compact .layout-btn{padding:5px 10px;font-size:12px;line-height:1.1;}
.deals-add-btn{width:34px !important;height:32px !important;padding:0 !important;font-size:20px !important;line-height:20px !important;}

/* Board card view inspired by rental dashboard */
.deals-cards.board{display:grid;grid-template-columns:repeat(auto-fill,minmax(305px,1fr));gap:16px;}
.deal-board-card{background:#fff;border:1px solid rgba(17,24,39,0.08);border-radius:18px;padding:16px 16px 14px;box-shadow:0 10px 30px rgba(15,23,42,0.05);cursor:pointer;transition:transform .15s ease, box-shadow .15s ease,border-color .15s ease;position:relative;overflow:hidden;}
.deal-board-card:hover{transform:translateY(-2px);box-shadow:0 14px 32px rgba(15,23,42,0.08);border-color:rgba(17,24,39,0.14);}
.deal-board-card::after{content:"";position:absolute;left:0;right:0;bottom:0;height:4px;background:#cbd5e1;}
.deal-board-card.status-marketing::after{background:#22c55e;}
.deal-board-card.status-assigned::after{background:#3b82f6;}
.deal-board-card.status-dead::after{background:#f87171;}
.deal-board-card.status-new::after{background:#94a3b8;}
.deal-board-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px;}
.deal-board-stage{display:flex;flex-direction:column;gap:6px;}
.deal-stage-pill{display:inline-flex;align-items:center;border-radius:999px;padding:5px 10px;font-size:12px;font-weight:700;background:#eef2ff;color:#334155;width:max-content;}
.deal-stage-pill.stage-marketing{background:#ecfdf5;color:#15803d;}
.deal-stage-pill.stage-assigned{background:#eff6ff;color:#1d4ed8;}
.deal-stage-pill.stage-dead{background:#fef2f2;color:#dc2626;}
.deal-stage-meta{font-size:12px;color:#6b7280;font-weight:600;}
.deal-board-arrow{border:0;background:#111827;color:#fff;width:38px;height:38px;border-radius:999px;font-size:26px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;}
.deal-board-address{font-size:30px;line-height:1.02;font-weight:800;letter-spacing:-0.03em;color:#111827;margin-bottom:6px;}
.deal-board-sub{font-size:15px;color:#6b7280;font-weight:600;margin-bottom:14px;}
.deal-board-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:14px;}
.board-metric{display:flex;flex-direction:column;gap:6px;padding:10px 12px;border:1px solid rgba(15,23,42,0.08);border-radius:14px;background:#fafafa;}
.board-metric span{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:#9ca3af;font-weight:700;}
.board-metric strong{font-size:clamp(13px,1.05vw,16px);line-height:1.05;color:#111827;display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums;letter-spacing:-0.02em;}
.deal-board-track{padding:8px 0 14px;}
.deal-board-track-line{display:flex;align-items:center;gap:10px;}
.track-dot{width:10px;height:10px;border-radius:999px;border:3px solid #111827;background:#fff;flex:0 0 auto;}
.track-dot.end{border-color:#94a3b8;}
.track-dot.done{background:#111827;}
.track-bar{height:6px;background:#dcfce7;flex:1;border-radius:999px;position:relative;overflow:hidden;border:1px solid rgba(34,197,94,0.14);}
.track-bar::after{content:"";position:absolute;inset:0;background:repeating-linear-gradient(90deg,rgba(255,255,255,0) 0,rgba(255,255,255,0) 18px,rgba(255,255,255,0.78) 18px,rgba(255,255,255,0.78) 20px);pointer-events:none;opacity:.9;mix-blend-mode:screen;}
.track-bar-fill{position:absolute;left:0;top:0;bottom:0;border-radius:999px;background:#22c55e;transition:width .25s ease;}
.track-bar.marketing{background:#dcfce7;border-color:rgba(34,197,94,0.16);}
.track-bar.marketing .track-bar-fill{background:#22c55e;}
.track-bar.assigned{background:#dbeafe;border-color:rgba(59,130,246,0.18);}
.track-bar.assigned .track-bar-fill{background:#3b82f6;}
.deal-board-track-labels{display:flex;justify-content:space-between;font-size:12px;color:#6b7280;margin-top:8px;font-weight:600;}
.deal-board-footer{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;margin-top:2px;}
.deal-board-person{display:flex;align-items:center;gap:10px;min-width:0;}
.deal-board-avatar{width:32px;height:32px;border-radius:999px;background:#dbeafe;color:#1d4ed8;font-weight:700;display:flex;align-items:center;justify-content:center;flex:0 0 auto;}
.deal-board-person-title{font-size:15px;font-weight:700;color:#111827;}
.deal-board-person-sub{font-size:12px;color:#6b7280;}
.deal-board-right{display:flex;flex-direction:column;align-items:flex-end;gap:8px;min-width:126px;}
.deal-board-offer{font-size:16px;font-weight:800;color:#111827;}
.deal-status-select.compact{min-width:126px;height:36px;padding-top:0;padding-bottom:0;font-size:13px;}

@media (max-width: 860px){
  .deals-toolbar.compact{top:56px;flex-wrap:wrap;}
  .deals-toolbar-right{margin-left:auto;}
}
@media (max-width: 640px){
  .deal-board-address{font-size:24px;}
  .deal-board-metrics{grid-template-columns:1fr;}
  .deal-board-footer{flex-direction:column;align-items:stretch;}
  .deal-board-right{align-items:stretch;min-width:0;}
}

/* ACQ ops polish */
.acq-toolbar-btn {
  border: 1px solid #d9e1f2;
  background: #fff;
  color: #22314a;
  font-weight: 800;
}
.acq-toolbar-btn:hover {
  border-color: #b9c8ef;
  background: #f7faff;
}
.acq-toolbar-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.acq-kpi-card {
  border: 1px solid #e8ecf6;
  border-radius: 16px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.acq-kpi-card:hover {
  transform: translateY(-1px);
  border-color: #c6d4f7;
  box-shadow: 0 8px 24px rgba(31, 72, 170, 0.06);
}
.acq-kpi-card.active {
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  border-color: #b9c8ef;
  box-shadow: 0 10px 24px rgba(41, 82, 204, 0.08);
}


.deals-view-switch{display:inline-flex;align-items:center;gap:4px;padding:4px;background:rgba(17,24,39,0.05);border:1px solid rgba(15,23,42,0.08);border-radius:999px;box-shadow:inset 0 1px 0 rgba(255,255,255,0.65);}
.deals-view-pill{appearance:none;border:0;background:transparent;color:#111827;font-weight:800;font-size:13px;line-height:1;padding:10px 16px;border-radius:999px;cursor:pointer;transition:background .15s ease,color .15s ease, box-shadow .15s ease, transform .15s ease;white-space:nowrap;}
.deals-view-pill:hover{background:rgba(59,130,246,0.08);}
.deals-view-pill.active{background:#335cff;color:#fff;box-shadow:0 8px 18px rgba(51,92,255,.24);}
.deals-sticky-subbar{position:sticky;top:66px;z-index:30;display:flex;align-items:center;justify-content:space-between;gap:10px;background:rgba(248,250,255,.92);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);padding:8px 0;border-bottom:1px solid rgba(15,23,42,.06);}
.deals-view-left,.deals-view-right{display:flex;align-items:center;gap:8px;min-width:0;}
.data-export-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:14px;}
.data-export-card{background:#fff;border:1px solid #e8ecf6;border-radius:18px;padding:18px;box-shadow:0 10px 24px rgba(15,23,42,0.05);}
.data-export-kicker{font-size:11px;font-weight:800;letter-spacing:.08em;color:#7b8798;text-transform:uppercase;}
.data-export-title{font-size:22px;font-weight:900;line-height:1.05;margin-top:8px;color:#111827;}
.data-export-count{font-size:34px;font-weight:900;line-height:1;margin:12px 0 10px;color:#111827;}
@media (max-width: 860px){.deals-sticky-subbar{top:56px;flex-wrap:wrap;}.deals-view-right{width:100%;justify-content:flex-start;}}

/* ---------- Deal detail revamp ---------- */
.deal-detail-page {
  color: var(--text);
}

.deal-detail-page .dashboard-card,
.deal-detail-page .prompt-snippet {
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
}

.deal-detail-top-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.18fr) minmax(260px, 0.92fr) minmax(250px, 0.78fr);
  gap: 12px;
  align-items: start;
}

.deal-hero-card {
  padding: 16px;
}

.deal-hero-head {
  align-items: flex-start;
}

.deal-hero-address {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.deal-hero-specs {
  text-align: right;
  margin-right: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.2;
}

.deal-metrics-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.deal-metric-card {
  padding: 12px 14px;
  border-radius: 14px;
}

.deal-metric-card .label {
  margin-bottom: 8px;
}

.deal-metric-card .snippet-text {
  font-size: 1.15rem;
  line-height: 1.15;
  font-weight: 800;
}

.deal-detail-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.86fr);
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}

.deal-buyers-card {
  min-width: 0;
}

.deal-buyers-card .table {
  table-layout: fixed;
  width: 100%;
}

.deal-buyers-card .table th,
.deal-buyers-card .table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-workspace-card {
  min-height: 100%;
}

.deal-detail-bottom-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(240px, 0.92fr) minmax(320px, 1.18fr) minmax(280px, 1.04fr);
  grid-template-areas:
    "closing chat attachments"
    "history chat attachments";
  gap: 12px;
  width: 100%;
  align-items: stretch;
}

.deal-closing-card { grid-area: closing; }
.deal-history-card { grid-area: history; }
.deal-team-chat-card { grid-area: chat; }
.deal-attachments-card { grid-area: attachments; }

.deal-team-chat-card,
.deal-attachments-card,
.deal-history-card,
.deal-closing-card {
  min-height: 100%;
}

.deal-detail-page a {
  color: var(--text);
}

.deal-detail-page .muted,
.deal-detail-page .dash-pill,
.deal-detail-page .label,
.deal-detail-page .sub {
  color: var(--muted);
}

.deal-detail-page .table th,
.deal-detail-page .table td,
.deal-detail-page .snippet-text,
.deal-detail-page .dash-title-sm,
.deal-detail-page .panel-title,
.deal-detail-page .pill,
.deal-detail-page .btn,
.deal-detail-page .btn-link {
  color: inherit;
}

:root[data-theme="night"] .deal-detail-page,
:root[data-theme="night"] .deal-detail-page * {
  border-color: var(--border);
}

:root[data-theme="night"] .deal-detail-page .table th,
:root[data-theme="night"] .deal-detail-page .table td,
:root[data-theme="night"] .deal-detail-page .prompt-snippet,
:root[data-theme="night"] .deal-detail-page .dashboard-card,
:root[data-theme="night"] .deal-detail-page .snippet-text,
:root[data-theme="night"] .deal-detail-page .dash-title-sm,
:root[data-theme="night"] .deal-detail-page .label,
:root[data-theme="night"] .deal-detail-page .muted,
:root[data-theme="night"] .deal-detail-page input,
:root[data-theme="night"] .deal-detail-page textarea,
:root[data-theme="night"] .deal-detail-page select,
:root[data-theme="night"] .deal-detail-page button,
:root[data-theme="night"] .deal-detail-page a {
  color: var(--text);
}

:root[data-theme="night"] .deal-detail-page .muted,
:root[data-theme="night"] .deal-detail-page .label,
:root[data-theme="night"] .deal-detail-page .dash-pill,
:root[data-theme="night"] .deal-detail-page .sub,
:root[data-theme="night"] .deal-detail-page [style*="opacity: 0.7"],
:root[data-theme="night"] .deal-detail-page [style*="opacity: 0.75"] {
  color: var(--muted);
}

@media (max-width: 1180px) {
  .deal-detail-top-grid,
  .deal-detail-main-grid,
  .deal-detail-bottom-grid {
    grid-template-columns: 1fr;
  }

  .deal-detail-bottom-grid {
    grid-template-areas:
      "closing"
      "chat"
      "attachments"
      "history";
  }
}

.kpi-topbar-card{padding:10px 14px;border-radius:14px;display:flex;align-items:center;gap:14px;flex-wrap:wrap;}
.kpi-topbar-title{font-weight:800;font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;}
.kpi-topbar{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:8px;flex:1 1 auto;}
.kpi-stat{padding:8px 10px;border:1px solid var(--border);border-radius:12px;background:color-mix(in srgb, var(--card) 88%, var(--bg));display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;}
.kpi-stat-label{font-size:11px;color:var(--muted);white-space:nowrap;}
.kpi-stat-value{font-size:18px;font-weight:800;color:var(--text);white-space:nowrap;}
.live-slot{min-height:340px;padding:16px;gap:12px;}
.live-slots-grid{grid-auto-rows:minmax(340px,auto);}
.live-slot-top{align-items:flex-start;}
.live-slot-title{font-size:20px;line-height:1.15;}
.live-slot-sub{font-size:14px;line-height:1.35;max-width:100%;}
.live-slot-headbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
.head-chip{padding:8px 10px;border:1px solid var(--border);border-radius:12px;background:color-mix(in srgb, var(--card) 88%, var(--bg));display:flex;flex-direction:column;gap:3px;min-width:0;}
.transcript-mini{padding:10px;min-height:150px;max-height:240px;}
.tline{grid-template-columns:52px 1fr;gap:10px;padding:7px 2px;}
.tline-speaker{font-size:10px;line-height:1.2;}
.tline-text{font-size:14px;line-height:1.45;}
.dash-monitor{grid-template-rows:auto auto auto;}
.dash-monitor-bottom.full-width{grid-template-columns:minmax(0,1fr);}
.activity-card{min-height:320px;}
@media (max-width: 1280px){.kpi-topbar{grid-template-columns:repeat(4,minmax(0,1fr));}.dash-monitor-top .live-slots-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width: 860px){.kpi-topbar{grid-template-columns:repeat(2,minmax(0,1fr));}.live-slot-headbar{grid-template-columns:1fr;}}


/* round5 refinements */
.deal-hero-specs{font-size:13px;line-height:1.35;display:flex;flex-direction:column;align-items:flex-end;gap:6px;}
.deal-hero-specs-inline{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;}
.deal-hero-spec-chip{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;background:color-mix(in srgb, var(--card) 84%, var(--bg));border:1px solid var(--border);font-weight:700;color:var(--text);white-space:nowrap;}
.deal-hero-spec-chip-label{opacity:.72;font-weight:700;}
.deal-hero-spec-chip-value{font-weight:800;}
.deal-hero-specs-line.secondary{font-weight:600;color:var(--muted);}
.live-slot{min-height:250px;padding:12px;gap:10px;}
.live-slots-grid{grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:minmax(250px,auto);gap:10px;}
.live-slot-title{font-size:16px;line-height:1.15;}
.live-slot-sub{font-size:12px;line-height:1.3;}
.live-slot-headbar{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;}
.head-chip{padding:7px 8px;gap:2px;}
.head-chip .meta-key{font-size:10px;}
.head-chip .meta-value{font-size:12px;font-weight:700;}
.transcript-mini{padding:8px;min-height:90px;max-height:140px;}
.tline{padding:5px 0;}
.tline-text{font-size:12px;line-height:1.35;}
.tline-speaker{font-size:9px;}
@media (max-width: 1280px){.live-slots-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width: 860px){.live-slots-grid{grid-template-columns:1fr;}.live-slot-headbar{grid-template-columns:repeat(2,minmax(0,1fr));}}

/* round7 compact live slots */
.live-slot-headbar.inline-compact{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:6px;}
.live-slot-headbar.inline-compact .head-chip{padding:4px 7px;border-radius:10px;min-width:auto;flex:0 0 auto;gap:1px;}
.live-slot-headbar.inline-compact .meta-key{font-size:9px;letter-spacing:.04em;}
.live-slot-headbar.inline-compact .meta-value{font-size:11px;font-weight:700;line-height:1.2;}
.live-slot-waiting{font-size:12px;color:var(--muted);padding:8px 2px;}
.live-slot.empty .live-slot-waiting{min-height:40px;}


/* round9 dashboard polish */
.live-slot{min-height:320px;padding:14px 14px 12px;gap:10px;}
.live-slots-grid{grid-auto-rows:minmax(320px,auto);}
.live-slot-headbar.inline-compact{gap:4px;margin-bottom:8px;}
.live-slot-headbar.inline-compact .head-chip{padding:3px 6px;border-radius:8px;}
.live-slot-headbar.inline-compact .meta-key{font-size:8px;}
.live-slot-headbar.inline-compact .meta-value{font-size:10px;font-weight:700;}
.transcript-mini{max-height:180px;overflow:auto;scroll-behavior:smooth;}
.activity-card{min-height:unset;}
.activity-feed{max-height:180px;overflow:auto;padding-top:4px;}
.activity-row{padding:4px 0;font-size:11px;}
.activity-ts{width:72px;flex-basis:72px;}
.campaign-complete-card{padding:16px 18px;border-radius:16px;display:flex;flex-direction:column;gap:6px;}
.campaign-complete-title{font-size:20px;font-weight:800;color:var(--text);}
.campaign-complete-sub{font-size:14px;color:var(--muted);}


/* March 10 demo patch */
.deal-modal-overlay{z-index:12050;padding:28px 18px;align-items:center;}
.deal-modal-shell{width:min(760px,100%);height:auto;max-height:88vh;}
.deal-modal-card{max-height:88vh;box-shadow:0 24px 60px rgba(15,23,42,.22);}
.deal-modal-body{padding:12px 14px 14px;}
.deal-modal-card .card-title{padding:12px 14px;z-index:3;display:flex;align-items:center;justify-content:space-between;gap:10px;}
.activity-row{display:flex;gap:10px;align-items:flex-start;}


/* mar13 additive demo polish */
.live-slot{
  min-height: 390px;
}
.live-slots-grid{
  grid-auto-rows: minmax(390px, auto);
}
.transcript-mini{
  min-height: 190px;
  max-height: 290px;
  overflow: auto;
  scroll-behavior: smooth;
}
.live-slot .btn.btn-xs{
  font-size: 10px;
  padding: 4px 8px;
  min-height: 24px;
}


/* hotfix: ensure Add Deal modal always overlays sticky headers/nav */
.deal-modal-overlay{position:fixed!important;inset:0!important;z-index:13050!important;}
.deal-modal-shell,.deal-modal-card{position:relative;z-index:13051;}


/* mar14 deals UI patch */
.deals-add-btn{
  width:34px !important;
  min-width:34px !important;
  height:34px !important;
  padding:0 !important;
  border-radius:999px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  line-height:1 !important;
  font-size:20px !important;
  margin-left:0 !important;
  align-self:center !important;
}
.deal-modal-inline-label{font-size:12px; margin-bottom:6px;}
.deal-modal-input-sm{max-width:100%;}
.deal-majors-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.deal-hero-spec-wrap{display:flex;gap:8px;align-items:flex-start;justify-content:space-between;flex-wrap:nowrap;}
.deal-hero-specs-inline{display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
.deal-edit-inline-btn{align-self:flex-start; margin-top:0 !important;}
.deal-enrich-row{margin-top:6px;display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
.deal-enrich-link{border:none;background:transparent;padding:0;color:#6b7280;font-size:12px;font-weight:500;cursor:pointer;}
.deal-enrich-link:disabled{opacity:.6;cursor:default;}
@media (max-width: 800px){.deal-majors-row{grid-template-columns:1fr;}.deal-hero-spec-wrap{flex-wrap:wrap;}}

@keyframes pulseDot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: .75; }
  100% { transform: scale(1); opacity: 1; }
}


@keyframes hjPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(18, 183, 106, 0.45); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(18, 183, 106, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(18, 183, 106, 0); }
}

/* ---------- Premium auth experience ---------- */
.auth-shell {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.18), transparent 26%),
    linear-gradient(180deg, #06131f 0%, #091625 36%, #eef2f8 36%, #f5f7fb 100%);
  background-size: 120% 120%;
  animation: authBgShift 18s ease-in-out infinite;
}

.auth-stage {
  position: relative;
  min-height: 100vh;
  padding: 72px 24px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-stage-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.45;
  pointer-events: none;
}
.auth-stage-glow-a {
  width: 320px;
  height: 320px;
  top: 80px;
  left: 10%;
  background: rgba(37, 99, 235, 0.28);
}
.auth-stage-glow-b {
  width: 260px;
  height: 260px;
  bottom: 80px;
  right: 10%;
  background: rgba(14, 165, 233, 0.18);
}

.auth-hero-card {
  position: relative;
  width: min(1240px, 100%);
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 28px;
  align-items: stretch;
}

.auth-hero-copy,
.auth-card-premium {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 28px 90px rgba(3, 9, 20, 0.22);
}

.auth-hero-copy {
  padding: 44px;
  color: #f8fbff;
  background:
    linear-gradient(145deg, rgba(12, 26, 44, 0.96), rgba(9, 20, 34, 0.92)),
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.28), transparent 34%);
  border: 1px solid rgba(255,255,255,0.08);
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.09);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(226, 238, 255, 0.92);
}

.auth-hero-copy h1 {
  margin-top: 18px;
  font-size: clamp(2.25rem, 4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.auth-hero-copy p {
  max-width: 560px;
  margin-top: 18px;
  color: rgba(226, 235, 247, 0.84);
  font-size: 1.05rem;
}

.auth-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.auth-feature-pill {
  padding: 11px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
  color: #f8fbff;
  font-weight: 800;
  font-size: 0.92rem;
  animation: authPillIn 540ms cubic-bezier(.2,.9,.2,1) both;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}
.auth-feature-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(96,165,250,0.18), 0 18px 30px rgba(14,165,233,0.14);
  border-color: rgba(147, 197, 253, 0.34);
  background: rgba(255,255,255,0.11);
}

.auth-card-premium {
  padding: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(247,250,255,0.84));
  border: 1px solid rgba(223, 230, 244, 0.92);
  backdrop-filter: blur(22px);
  box-shadow: 0 30px 100px rgba(8, 15, 28, 0.18), inset 0 1px 0 rgba(255,255,255,0.45);
}

.auth-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.auth-brand {
  font-size: 2rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.auth-subtitle {
  max-width: 520px;
  margin-top: 10px;
  font-size: 0.98rem;
  color: #5d6676;
}

.auth-mode-switch {
  display: inline-flex;
  padding: 6px;
  border-radius: 999px;
  background: #eef2f8;
  border: 1px solid #dde5f2;
  gap: 6px;
  flex-shrink: 0;
}

.auth-mode-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #526072;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition: all 180ms ease;
}

.auth-mode-btn.active {
  background: linear-gradient(135deg, #0f172a, #111f38);
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
}

.auth-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.auth-field-half { grid-column: span 1; }
.auth-field-full,
.auth-actions,
.auth-error,
.auth-results-card { grid-column: 1 / -1; }

.auth-input,
.auth-textarea {
  border-radius: 16px;
  border-color: #dce4f1;
  background: rgba(255,255,255,0.92);
  padding: 14px 16px;
}
.auth-input:focus,
.auth-textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.auth-helptext,
.auth-fineprint {
  color: #667286;
  font-size: 0.9rem;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.auth-cta {
  min-width: 220px;
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 18px 32px rgba(29, 78, 216, 0.26);
}
.auth-cta:hover { transform: translateY(-1px); }

.auth-results-card {
  margin-top: 10px;
  padding: 18px;
  border-radius: 20px;
  background: #f7faff;
  border: 1px solid #d9e6fb;
}
.auth-results-title {
  font-weight: 900;
  font-size: 1rem;
  margin-bottom: 6px;
}
.auth-result-row {
  border: 1px solid #dfe7f5;
  border-radius: 14px;
  padding: 12px;
  background: white;
}
.auth-temp-pass {
  margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
}

.auth-intro {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, rgba(14, 165, 233, 0.18), transparent 28%), linear-gradient(180deg, #07111c, #091422 60%, #091423);
  color: white;
  transition: opacity 560ms ease, visibility 560ms ease, transform 560ms ease;
}
.auth-intro-hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
}
.auth-intro-bg {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 30% 40%, rgba(37, 99, 235, 0.26), transparent 20%),
    radial-gradient(circle at 70% 55%, rgba(14, 165, 233, 0.18), transparent 22%);
  animation: authPulse 9s ease-in-out infinite alternate;
}
.auth-intro-copy {
  position: relative;
  text-align: center;
  max-width: 900px;
  padding: 0 28px;
}
.auth-intro-kicker {
  margin-bottom: 18px;
  font-size: 0.86rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(214, 232, 255, 0.8);
  font-weight: 800;
}
.auth-intro-copy h1 {
  font-size: clamp(2.6rem, 5.3vw, 4.8rem);
  line-height: 0.98;
  margin: 0;
  letter-spacing: -0.04em;
}
.auth-intro-copy p {
  margin: 18px auto 0;
  max-width: 620px;
  font-size: 1.05rem;
  color: rgba(223, 233, 246, 0.82);
}

@keyframes authPulse {
  from { transform: scale(1) translate3d(0,0,0); }
  to { transform: scale(1.06) translate3d(0,-12px,0); }
}


.auth-inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid #dce4f1;
  background: rgba(255,255,255,0.82);
}

.auth-inline-action {
  min-width: 170px;
  border-radius: 14px;
}

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(3, 9, 20, 0.48);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-modal-card {
  width: min(920px, 100%);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(247,250,255,0.9));
  border: 1px solid rgba(223,230,244,0.92);
  box-shadow: 0 40px 120px rgba(8, 15, 28, 0.28);
  padding: 24px;
}

.auth-modal-top,
.auth-modal-actions,
.auth-modal-actions-right {
  display: flex;
  align-items: center;
}
.auth-modal-top {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.auth-modal-title {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.auth-modal-close {
  appearance: none;
  border: 0;
  background: #eef2f8;
  color: #304055;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  font-size: 1.2rem;
  cursor: pointer;
}
.auth-modal-list {
  display: grid;
  gap: 12px;
}
.auth-team-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr auto;
  gap: 12px;
  align-items: center;
}
.auth-team-email {
  min-width: 0;
}
.auth-team-remove {
  appearance: none;
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #eef2f8;
  color: #44556d;
  font-size: 1.1rem;
  cursor: pointer;
}
.auth-team-add {
  border-radius: 14px;
}
.auth-modal-actions {
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}
.auth-modal-actions-right {
  gap: 12px;
}

.auth-provision-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 10, 18, 0.66);
  backdrop-filter: blur(14px);
}
.auth-provision-card {
  width: min(620px, 100%);
  border-radius: 30px;
  padding: 30px;
  color: #f8fbff;
  background: linear-gradient(145deg, rgba(12, 26, 44, 0.96), rgba(9, 20, 34, 0.92));
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 40px 120px rgba(0,0,0,0.35);
}
.auth-provision-kicker {
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(214, 232, 255, 0.8);
  font-weight: 800;
}
.auth-provision-card h2 {
  margin: 12px 0 20px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}
.auth-provision-steps {
  display: grid;
  gap: 14px;
}
.auth-provision-step {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(222,233,246,0.6);
  font-weight: 700;
  transition: color 180ms ease, transform 180ms ease;
}
.auth-provision-step.active {
  color: #fff;
  transform: translateX(2px);
}
.auth-provision-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
}
.auth-provision-step.active .auth-provision-dot {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  box-shadow: 0 0 0 6px rgba(56,189,248,0.12);
}

@keyframes authPillIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes authBgShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@media (max-width: 1080px) {
  .auth-hero-card {
    grid-template-columns: 1fr;
  }
  .auth-hero-copy { order: 2; }
  .auth-card-premium { order: 1; }
}

@media (max-width: 760px) {
  .auth-stage {
    padding: 28px 14px 22px;
  }
  .auth-hero-copy,
  .auth-card-premium {
    padding: 22px;
    border-radius: 22px;
  }
  .auth-card-top {
    flex-direction: column;
  }
  .auth-form-grid {
    grid-template-columns: 1fr;
  }
  .auth-field-half { grid-column: span 1; }
  .auth-mode-switch {
    width: 100%;
    justify-content: space-between;
  }
  .auth-mode-btn {
    flex: 1;
  }
}


.auth-stage-provisioning {
  pointer-events: none;
}

.auth-hero-card {
  transition: opacity 420ms ease, transform 520ms cubic-bezier(.2,.9,.2,1), filter 420ms ease;
}

.auth-hero-card-hidden {
  opacity: 0;
  transform: translateY(22px) scale(0.985);
  filter: blur(8px);
}

.auth-provision-backdrop-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.38;
  pointer-events: none;
}
.auth-provision-backdrop-glow-a {
  width: 340px;
  height: 340px;
  top: 12%;
  left: 18%;
  background: rgba(37, 99, 235, 0.32);
  animation: authProvisionFloatA 7.5s ease-in-out infinite alternate;
}
.auth-provision-backdrop-glow-b {
  width: 280px;
  height: 280px;
  right: 14%;
  bottom: 14%;
  background: rgba(56, 189, 248, 0.24);
  animation: authProvisionFloatB 8.5s ease-in-out infinite alternate;
}

.auth-provision-card {
  position: relative;
  overflow: hidden;
}
.auth-provision-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(59,130,246,0.18), transparent 34%), radial-gradient(circle at bottom left, rgba(34,211,238,0.14), transparent 32%);
  pointer-events: none;
}
.auth-provision-copy,
.auth-provision-progress-shell,
.auth-provision-progress-label,
.auth-provision-orbit,
.auth-provision-steps,
.auth-provision-kicker,
.auth-provision-card h2 {
  position: relative;
  z-index: 1;
}
.auth-provision-copy {
  margin: 0 0 18px;
  color: rgba(223, 233, 246, 0.78);
  max-width: 520px;
}
.auth-provision-orbit {
  position: relative;
  height: 168px;
  margin: 8px 0 18px;
}
.auth-provision-orbit-ring {
  position: absolute;
  inset: 50% auto auto 50%;
  border-radius: 999px;
  border: 1px solid rgba(147, 197, 253, 0.18);
  transform: translate(-50%, -50%);
}
.auth-provision-orbit-ring-a {
  width: 164px;
  height: 164px;
  animation: authProvisionSpin 10s linear infinite;
}
.auth-provision-orbit-ring-b {
  width: 112px;
  height: 112px;
  border-color: rgba(103, 232, 249, 0.2);
  animation: authProvisionSpinReverse 7s linear infinite;
}
.auth-provision-core {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 82px;
  height: 82px;
  transform: translate(-50%, -50%);
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(14,165,233,0.95), rgba(37,99,235,0.92));
  box-shadow: 0 24px 60px rgba(37,99,235,0.32), inset 0 1px 0 rgba(255,255,255,0.28);
  display: grid;
  place-items: center;
  animation: authProvisionCorePulse 2.2s ease-in-out infinite;
}
.auth-provision-core-text {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #f8fbff;
}
.auth-provision-spark {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7dd3fc, #60a5fa);
  box-shadow: 0 0 0 8px rgba(125,211,252,0.08);
}
.auth-provision-spark-a {
  top: 28px;
  left: calc(50% + 58px);
  animation: authProvisionSparkA 3.6s ease-in-out infinite;
}
.auth-provision-spark-b {
  top: 100px;
  left: calc(50% - 82px);
  animation: authProvisionSparkB 4.1s ease-in-out infinite;
}
.auth-provision-spark-c {
  top: 126px;
  left: calc(50% + 70px);
  animation: authProvisionSparkC 3.2s ease-in-out infinite;
}
.auth-provision-progress-shell {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.auth-provision-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #3b82f6 55%, #60a5fa);
  box-shadow: 0 0 22px rgba(59,130,246,0.35);
  transition: width 380ms ease;
}
.auth-provision-progress-label {
  margin-top: 10px;
  margin-bottom: 18px;
  font-size: 0.92rem;
  color: rgba(223, 233, 246, 0.74);
}
.auth-provision-step.done {
  color: rgba(232, 245, 255, 0.9);
}
.auth-provision-step.done .auth-provision-dot,
.auth-provision-step.active .auth-provision-dot {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
}
.auth-provision-step.done .auth-provision-dot {
  box-shadow: 0 0 0 6px rgba(56,189,248,0.09);
}

@keyframes authProvisionSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes authProvisionSpinReverse {
  from { transform: translate(-50%, -50%) rotate(360deg); }
  to { transform: translate(-50%, -50%) rotate(0deg); }
}
@keyframes authProvisionCorePulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.04); }
}
@keyframes authProvisionSparkA {
  0%, 100% { transform: translate3d(0,0,0) scale(0.85); opacity: 0.75; }
  50% { transform: translate3d(10px,-12px,0) scale(1.18); opacity: 1; }
}
@keyframes authProvisionSparkB {
  0%, 100% { transform: translate3d(0,0,0) scale(0.9); opacity: 0.72; }
  50% { transform: translate3d(-12px,8px,0) scale(1.12); opacity: 1; }
}
@keyframes authProvisionSparkC {
  0%, 100% { transform: translate3d(0,0,0) scale(0.8); opacity: 0.7; }
  50% { transform: translate3d(8px,10px,0) scale(1.1); opacity: 1; }
}
@keyframes authProvisionFloatA {
  from { transform: translate3d(0,0,0); }
  to { transform: translate3d(18px,-14px,0); }
}
@keyframes authProvisionFloatB {
  from { transform: translate3d(0,0,0); }
  to { transform: translate3d(-16px,12px,0); }
}

/* ===== Premium onboarding ===== */
.onboarding-shell {
  position: relative;
  min-height: calc(100vh - 84px);
  padding: 24px;
  overflow: hidden;
}

.onboarding-bg {
  position: absolute;
  inset: auto;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.5;
  pointer-events: none;
}

.onboarding-bg-a {
  width: 340px;
  height: 340px;
  top: 10px;
  right: -80px;
  background: rgba(73, 123, 255, 0.2);
}

.onboarding-bg-b {
  width: 320px;
  height: 320px;
  bottom: -80px;
  left: -70px;
  background: rgba(67, 221, 178, 0.18);
}

.onboarding-topbar,
.onboarding-stage-card {
  position: relative;
  z-index: 1;
}

.onboarding-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.onboarding-kicker,
.onboarding-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(16, 24, 40, 0.08);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.onboarding-topbar h1 {
  margin: 12px 0 8px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.02;
}

.onboarding-topbar p,
.onboarding-section-head p,
.onboarding-choice-copy,
.onboarding-setup-copy,
.onboarding-provider-copy,
.onboarding-summary-copy,
.onboarding-ready-copy,
.onboarding-activate-copy,
.onboarding-inline-note {
  color: rgba(15, 23, 42, 0.72);
}

.onboarding-progress-card,
.onboarding-stage-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px);
}

.onboarding-progress-card {
  padding: 18px;
}

.onboarding-progress-label,
.onboarding-summary-label,
.onboarding-choice-subtitle,
.onboarding-provider-subtitle,
.onboarding-stage-meta {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(15, 23, 42, 0.56);
}

.onboarding-progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
  margin: 10px 0 8px;
}

.onboarding-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f46e5 0%, #06b6d4 55%, #10b981 100%);
  transition: width 260ms ease;
}

.onboarding-progress-meta {
  font-size: 13px;
  font-weight: 700;
}

.onboarding-stage-card {
  padding: 26px;
}

.onboarding-section-head h2,
.onboarding-ready-top h2 {
  margin: 12px 0 8px;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.05;
}

.onboarding-card-grid,
.onboarding-summary-grid,
.onboarding-ready-grid,
.onboarding-setup-grid {
  display: grid;
  gap: 16px;
}

.intent-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}

.channel-grid,
.onboarding-summary-grid,
.onboarding-ready-grid,
.onboarding-setup-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}

.onboarding-choice-card,
.onboarding-setup-card,
.onboarding-summary-card,
.onboarding-ready-item,
.onboarding-provider-card {
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.9);
}

.onboarding-choice-card,
.onboarding-provider-card {
  width: 100%;
  text-align: left;
  padding: 20px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.onboarding-choice-card:hover,
.onboarding-provider-card:hover,
.onboarding-choice-card.active,
.onboarding-provider-card.active {
  transform: translateY(-2px);
  border-color: rgba(79, 70, 229, 0.34);
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.12);
}

.onboarding-choice-top,
.onboarding-provider-top,
.onboarding-ready-top,
.onboarding-activate-box,
.onboarding-footer-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.onboarding-choice-title,
.onboarding-provider-title,
.onboarding-ready-title,
.onboarding-activate-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

.onboarding-choice-subtitle,
.onboarding-provider-subtitle {
  margin-top: 6px;
}

.onboarding-badge,
.onboarding-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.12);
  color: #4338ca;
  font-size: 12px;
  font-weight: 800;
}

.onboarding-bullet-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.onboarding-bullet-list span::before {
  content: '•';
  margin-right: 8px;
  color: #4f46e5;
}

.onboarding-inline-note {
  margin-top: 16px;
  font-size: 13px;
}

.onboarding-setup-card,
.onboarding-summary-card,
.onboarding-ready-item {
  padding: 20px;
}

.onboarding-input {
  margin-top: 14px;
}

.onboarding-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 14px;
}

.onboarding-provider-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.onboarding-summary-value {
  margin-top: 10px;
  font-size: 22px;
  line-height: 1.05;
  font-weight: 800;
  color: #0f172a;
}

.onboarding-activate-box {
  margin-top: 20px;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(16, 185, 129, 0.08) 100%);
  border: 1px solid rgba(79, 70, 229, 0.14);
}

.onboarding-activate-btn,
.onboarding-ready-btn {
  white-space: nowrap;
}

.onboarding-footer-actions {
  margin-top: 22px;
  align-items: center;
}

.onboarding-ready-grid {
  margin-top: 20px;
}

.onboarding-ready-item {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (max-width: 980px) {
  .onboarding-topbar,
  .intent-grid,
  .channel-grid,
  .onboarding-summary-grid,
  .onboarding-ready-grid,
  .onboarding-setup-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .onboarding-activate-box,
  .onboarding-ready-top,
  .onboarding-footer-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
/* Experimental theme (toggle via Theme selector) */
:root[data-theme="exp"] body {
  --bg: #f4f7ff;
  --card: #ffffff;
  --text: #0b1220;
  --muted: #556072;
  --border: #dde2ef;
  --accent: #2b59ff;
  --accent2: #00b3ff;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.10);
}

:root[data-theme="exp"] .topbar {
  background: rgba(255, 255, 255, 0.70);
}

:root[data-theme="exp"] .btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
}

:root[data-theme="exp"] .badge {
  background: rgba(43, 89, 255, 0.10);
  border-color: rgba(43, 89, 255, 0.20);
  color: var(--accent);
}

:root[data-theme="exp"] .card,
:root[data-theme="exp"] .live-slot {
  box-shadow: var(--shadow);
}
/* Night theme (toggle via Theme selector) */
:root[data-theme="night"] body {
  --bg: #0b1020;
  --card: #0f172a;
  --text: #e5e7eb;
  --muted: #9aa4b2;
  --border: #22304a;
  --accent: #60a5fa;
  --accent2: #22d3ee;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

:root[data-theme="night"] .topbar {
  background: rgba(15, 23, 42, 0.70);
  border-bottom-color: var(--border);
}

:root[data-theme="night"] .nav-link {
  background: rgba(15, 23, 42, 0.70);
}

:root[data-theme="night"] .nav-link.active {
  background: rgba(96, 165, 250, 0.12);
}

:root[data-theme="night"] .table th,
:root[data-theme="night"] .table td {
  border-bottom-color: var(--border);
}

:root[data-theme="night"] .muted { color: var(--muted); }

:root[data-theme="night"] input,
:root[data-theme="night"] textarea,
:root[data-theme="night"] select {
  background: rgba(15, 23, 42, 0.80);
  color: var(--text);
  border-color: var(--border);
}

:root[data-theme="night"] .btn {
  background: rgba(15, 23, 42, 0.70);
  border-color: var(--border);
  color: var(--text);
}

:root[data-theme="night"] .btn.primary {
  background: linear-gradient(135deg, rgba(96,165,250,0.95), rgba(34,211,238,0.95));
  border-color: transparent;
}
